lib

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

farm.rs (2590B)


      1 #[cfg(not(feature = "std"))]
      2 use alloc::{string::String, vec::Vec};
      3 
      4 #[cfg_attr(feature = "dto-bindgen", derive(dto_bindgen::Dto))]
      5 #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
      6 #[derive(Clone, Debug)]
      7 pub struct RadrootsFarm {
      8     pub d_tag: String,
      9     pub name: String,
     10     pub about: Option<String>,
     11     pub website: Option<String>,
     12     pub picture: Option<String>,
     13     pub banner: Option<String>,
     14     pub location: Option<RadrootsFarmLocation>,
     15     pub tags: Option<Vec<String>>,
     16 }
     17 
     18 #[cfg_attr(feature = "dto-bindgen", derive(dto_bindgen::Dto))]
     19 #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
     20 #[derive(Clone, Debug, Default)]
     21 pub struct RadrootsFarmRef {
     22     pub pubkey: String,
     23     pub d_tag: String,
     24 }
     25 
     26 #[cfg_attr(feature = "dto-bindgen", derive(dto_bindgen::Dto))]
     27 #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
     28 #[derive(Clone, Debug)]
     29 pub struct RadrootsGeoJsonPoint {
     30     #[cfg_attr(feature = "serde", serde(rename = "type"))]
     31     pub r#type: String,
     32     pub coordinates: [f64; 2],
     33 }
     34 
     35 #[cfg_attr(feature = "dto-bindgen", derive(dto_bindgen::Dto))]
     36 #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
     37 #[derive(Clone, Debug)]
     38 pub struct RadrootsGeoJsonPolygon {
     39     #[cfg_attr(feature = "serde", serde(rename = "type"))]
     40     pub r#type: String,
     41     pub coordinates: Vec<Vec<[f64; 2]>>,
     42 }
     43 
     44 #[cfg_attr(feature = "dto-bindgen", derive(dto_bindgen::Dto))]
     45 #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
     46 #[derive(Clone, Debug)]
     47 pub struct RadrootsGcsLocation {
     48     pub lat: f64,
     49     pub lng: f64,
     50     pub geohash: String,
     51     pub point: RadrootsGeoJsonPoint,
     52     pub polygon: RadrootsGeoJsonPolygon,
     53     pub accuracy: Option<f64>,
     54     pub altitude: Option<f64>,
     55     pub tag_0: Option<String>,
     56     pub label: Option<String>,
     57     pub area: Option<f64>,
     58     pub elevation: Option<u32>,
     59     pub soil: Option<String>,
     60     pub climate: Option<String>,
     61     pub gc_id: Option<String>,
     62     pub gc_name: Option<String>,
     63     pub gc_admin1_id: Option<String>,
     64     pub gc_admin1_name: Option<String>,
     65     pub gc_country_id: Option<String>,
     66     pub gc_country_name: Option<String>,
     67 }
     68 
     69 #[cfg_attr(feature = "dto-bindgen", derive(dto_bindgen::Dto))]
     70 #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
     71 #[derive(Clone, Debug)]
     72 pub struct RadrootsFarmLocation {
     73     pub primary: Option<String>,
     74     pub city: Option<String>,
     75     pub region: Option<String>,
     76     pub country: Option<String>,
     77     pub gcs: Option<RadrootsGcsLocation>,
     78 }