lib

Core libraries for Radroots
git clone https://radroots.dev/git/lib.git
Log | Files | Refs | README

coop.rs (1383B)


      1 #![forbid(unsafe_code)]
      2 
      3 use crate::farm::change_set::GcsLocation;
      4 
      5 #[cfg(not(feature = "std"))]
      6 use alloc::{string::String, vec::Vec};
      7 
      8 #[cfg_attr(all(test, feature = "std"), derive(dto_bindgen::Dto))]
      9 #[cfg_attr(all(test, feature = "std"), dto(export))]
     10 #[cfg_attr(
     11     any(feature = "serde", test),
     12     derive(serde::Serialize, serde::Deserialize)
     13 )]
     14 #[derive(Clone, Debug)]
     15 pub struct Coop {
     16     pub d_tag: String,
     17     pub name: String,
     18     pub about: Option<String>,
     19     pub website: Option<String>,
     20     pub picture: Option<String>,
     21     pub banner: Option<String>,
     22     pub location: Option<CoopLocation>,
     23     pub tags: Option<Vec<String>>,
     24 }
     25 
     26 #[cfg_attr(all(test, feature = "std"), derive(dto_bindgen::Dto))]
     27 #[cfg_attr(all(test, feature = "std"), dto(export))]
     28 #[cfg_attr(
     29     any(feature = "serde", test),
     30     derive(serde::Serialize, serde::Deserialize)
     31 )]
     32 #[derive(Clone, Debug)]
     33 pub struct CoopRef {
     34     pub pubkey: String,
     35     pub d_tag: String,
     36 }
     37 
     38 #[cfg_attr(all(test, feature = "std"), derive(dto_bindgen::Dto))]
     39 #[cfg_attr(all(test, feature = "std"), dto(export))]
     40 #[cfg_attr(
     41     any(feature = "serde", test),
     42     derive(serde::Serialize, serde::Deserialize)
     43 )]
     44 #[derive(Clone, Debug)]
     45 pub struct CoopLocation {
     46     pub primary: Option<String>,
     47     pub city: Option<String>,
     48     pub region: Option<String>,
     49     pub country: Option<String>,
     50     pub gcs: GcsLocation,
     51 }