A better Rust ATProto crate
at main 2.3 kB view raw
1// @generated by jacquard-lexicon. DO NOT EDIT. 2// 3// Lexicon: place.atwork.endorsementProof 4// 5// This file was automatically generated from Lexicon schemas. 6// Any manual changes will be overwritten on the next regeneration. 7 8/// A cryptographic proof record that validates an endorsement by containing the CID of the endorsement content. 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 bon::Builder 19)] 20#[serde(rename_all = "camelCase")] 21pub struct EndorsementProof<'a> { 22 /// The CID (Content Identifier) of the endorsement content that this proof validates. The endorsement's signatures array references this proof record. 23 #[serde(borrow)] 24 pub cid: jacquard_common::types::string::Cid<'a>, 25} 26 27/// Typed wrapper for GetRecord response with this collection's record type. 28#[derive( 29 serde::Serialize, 30 serde::Deserialize, 31 Debug, 32 Clone, 33 PartialEq, 34 Eq, 35 jacquard_derive::IntoStatic 36)] 37#[serde(rename_all = "camelCase")] 38pub struct EndorsementProofGetRecordOutput<'a> { 39 #[serde(skip_serializing_if = "std::option::Option::is_none")] 40 #[serde(borrow)] 41 pub cid: std::option::Option<jacquard_common::types::string::Cid<'a>>, 42 #[serde(borrow)] 43 pub uri: jacquard_common::types::string::AtUri<'a>, 44 #[serde(borrow)] 45 pub value: EndorsementProof<'a>, 46} 47 48/// Marker type for deserializing records from this collection. 49pub struct EndorsementProofRecord; 50impl jacquard_common::xrpc::XrpcResp for EndorsementProofRecord { 51 const NSID: &'static str = "place.atwork.endorsementProof"; 52 const ENCODING: &'static str = "application/json"; 53 type Output<'de> = EndorsementProofGetRecordOutput<'de>; 54 type Err<'de> = jacquard_common::types::collection::RecordError<'de>; 55} 56 57impl jacquard_common::types::collection::Collection for EndorsementProof<'_> { 58 const NSID: &'static str = "place.atwork.endorsementProof"; 59 type Record = EndorsementProofRecord; 60} 61 62impl From<EndorsementProofGetRecordOutput<'_>> for EndorsementProof<'_> { 63 fn from(output: EndorsementProofGetRecordOutput<'_>) -> Self { 64 use jacquard_common::IntoStatic; 65 output.value.into_static() 66 } 67}