document.rs (962B)
1 #![forbid(unsafe_code)] 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 DocumentSubject { 14 pub pubkey: String, 15 pub address: Option<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 Document { 26 pub d_tag: String, 27 pub doc_type: String, 28 pub title: String, 29 pub version: String, 30 pub summary: Option<String>, 31 pub effective_at: Option<u32>, 32 pub body_markdown: Option<String>, 33 pub subject: DocumentSubject, 34 pub tags: Option<Vec<String>>, 35 }