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