A better Rust ATProto crate
1// @generated by jacquard-lexicon. DO NOT EDIT. 2// 3// Lexicon: buzz.bookhive.book 4// 5// This file was automatically generated from Lexicon schemas. 6// Any manual changes will be overwritten on the next regeneration. 7 8///A book in the user's library 9#[jacquard_derive::lexicon] 10#[derive( 11 serde::Serialize, 12 serde::Deserialize, 13 Debug, 14 Clone, 15 PartialEq, 16 Eq, 17 jacquard_derive::IntoStatic 18)] 19#[serde(rename_all = "camelCase")] 20pub struct Book<'a> { 21 ///The authors of the book (tab separated) 22 #[serde(borrow)] 23 pub authors: jacquard_common::CowStr<'a>, 24 ///Cover image of the book 25 #[serde(skip_serializing_if = "std::option::Option::is_none")] 26 #[serde(borrow)] 27 pub cover: std::option::Option<jacquard_common::types::blob::Blob<'a>>, 28 pub created_at: jacquard_common::types::string::Datetime, 29 ///The date the user finished reading the book 30 #[serde(skip_serializing_if = "std::option::Option::is_none")] 31 pub finished_at: std::option::Option<jacquard_common::types::string::Datetime>, 32 ///The book's hive id, used to correlate user's books with the hive 33 #[serde(borrow)] 34 pub hive_id: jacquard_common::CowStr<'a>, 35 ///The book's review 36 #[serde(skip_serializing_if = "std::option::Option::is_none")] 37 #[serde(borrow)] 38 pub review: std::option::Option<jacquard_common::CowStr<'a>>, 39 ///Number of stars given to the book (1-10) which will be mapped to 1-5 stars 40 #[serde(skip_serializing_if = "std::option::Option::is_none")] 41 pub stars: std::option::Option<i64>, 42 ///The date the user started reading the book 43 #[serde(skip_serializing_if = "std::option::Option::is_none")] 44 pub started_at: std::option::Option<jacquard_common::types::string::Datetime>, 45 #[serde(skip_serializing_if = "std::option::Option::is_none")] 46 #[serde(borrow)] 47 pub status: std::option::Option<jacquard_common::CowStr<'a>>, 48 ///The title of the book 49 #[serde(borrow)] 50 pub title: jacquard_common::CowStr<'a>, 51} 52 53/// Typed wrapper for GetRecord response with this collection's record type. 54#[derive( 55 serde::Serialize, 56 serde::Deserialize, 57 Debug, 58 Clone, 59 PartialEq, 60 Eq, 61 jacquard_derive::IntoStatic 62)] 63#[serde(rename_all = "camelCase")] 64pub struct BookGetRecordOutput<'a> { 65 #[serde(skip_serializing_if = "std::option::Option::is_none")] 66 #[serde(borrow)] 67 pub cid: std::option::Option<jacquard_common::types::string::Cid<'a>>, 68 #[serde(borrow)] 69 pub uri: jacquard_common::types::string::AtUri<'a>, 70 #[serde(borrow)] 71 pub value: Book<'a>, 72} 73 74/// Marker type for deserializing records from this collection. 75pub struct BookRecord; 76impl jacquard_common::xrpc::XrpcResp for BookRecord { 77 const NSID: &'static str = "buzz.bookhive.book"; 78 const ENCODING: &'static str = "application/json"; 79 type Output<'de> = BookGetRecordOutput<'de>; 80 type Err<'de> = jacquard_common::types::collection::RecordError<'de>; 81} 82 83impl jacquard_common::types::collection::Collection for Book<'_> { 84 const NSID: &'static str = "buzz.bookhive.book"; 85 type Record = BookRecord; 86} 87 88impl From<BookGetRecordOutput<'_>> for Book<'_> { 89 fn from(output: BookGetRecordOutput<'_>) -> Self { 90 use jacquard_common::IntoStatic; 91 output.value.into_static() 92 } 93}