A better Rust ATProto crate
1// @generated by jacquard-lexicon. DO NOT EDIT. 2// 3// Lexicon: tools.ozone.set.deleteSet 4// 5// This file was automatically generated from Lexicon schemas. 6// Any manual changes will be overwritten on the next regeneration. 7 8#[jacquard_derive::lexicon] 9#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] 10#[serde(rename_all = "camelCase")] 11pub struct DeleteSet<'a> { 12 ///Name of the set to delete 13 #[serde(borrow)] 14 pub name: jacquard_common::CowStr<'a>, 15} 16 17impl jacquard_common::IntoStatic for DeleteSet<'_> { 18 type Output = DeleteSet<'static>; 19 fn into_static(self) -> Self::Output { 20 DeleteSet { 21 name: self.name.into_static(), 22 extra_data: self.extra_data.into_static(), 23 } 24 } 25} 26 27#[jacquard_derive::lexicon] 28#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] 29#[serde(rename_all = "camelCase")] 30pub struct DeleteSetOutput<'a> {} 31impl jacquard_common::IntoStatic for DeleteSetOutput<'_> { 32 type Output = DeleteSetOutput<'static>; 33 fn into_static(self) -> Self::Output { 34 DeleteSetOutput { 35 extra_data: self.extra_data.into_static(), 36 } 37 } 38} 39 40#[jacquard_derive::open_union] 41#[derive( 42 serde::Serialize, 43 serde::Deserialize, 44 Debug, 45 Clone, 46 PartialEq, 47 Eq, 48 thiserror::Error, 49 miette::Diagnostic 50)] 51#[serde(tag = "error", content = "message")] 52#[serde(bound(deserialize = "'de: 'a"))] 53pub enum DeleteSetError<'a> { 54 ///set with the given name does not exist 55 #[serde(rename = "SetNotFound")] 56 SetNotFound(std::option::Option<String>), 57} 58 59impl std::fmt::Display for DeleteSetError<'_> { 60 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 61 match self { 62 Self::SetNotFound(msg) => { 63 write!(f, "SetNotFound")?; 64 if let Some(msg) = msg { 65 write!(f, ": {}", msg)?; 66 } 67 Ok(()) 68 } 69 Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), 70 } 71 } 72} 73 74impl jacquard_common::IntoStatic for DeleteSetError<'_> { 75 type Output = DeleteSetError<'static>; 76 fn into_static(self) -> Self::Output { 77 match self { 78 DeleteSetError::SetNotFound(v) => { 79 DeleteSetError::SetNotFound(v.into_static()) 80 } 81 DeleteSetError::Unknown(v) => DeleteSetError::Unknown(v.into_static()), 82 } 83 } 84} 85 86impl jacquard_common::types::xrpc::XrpcRequest for DeleteSet<'_> { 87 const NSID: &'static str = "tools.ozone.set.deleteSet"; 88 const METHOD: jacquard_common::types::xrpc::XrpcMethod = jacquard_common::types::xrpc::XrpcMethod::Procedure( 89 "application/json", 90 ); 91 const OUTPUT_ENCODING: &'static str = "application/json"; 92 type Output<'de> = DeleteSetOutput<'de>; 93 type Err<'de> = DeleteSetError<'de>; 94}