A better Rust ATProto crate
at main 2.2 kB view raw
1// @generated by jacquard-lexicon. DO NOT EDIT. 2// 3// Lexicon: sh.tangled.knot.version 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( 10 serde::Serialize, 11 serde::Deserialize, 12 Debug, 13 Clone, 14 PartialEq, 15 Eq, 16 jacquard_derive::IntoStatic, 17 Default 18)] 19#[serde(rename_all = "camelCase")] 20pub struct VersionOutput<'a> { 21 #[serde(borrow)] 22 pub version: jacquard_common::CowStr<'a>, 23} 24 25#[jacquard_derive::open_union] 26#[derive( 27 serde::Serialize, 28 serde::Deserialize, 29 Debug, 30 Clone, 31 PartialEq, 32 Eq, 33 thiserror::Error, 34 miette::Diagnostic, 35 jacquard_derive::IntoStatic 36)] 37#[serde(tag = "error", content = "message")] 38#[serde(bound(deserialize = "'de: 'a"))] 39pub enum VersionError<'a> {} 40impl std::fmt::Display for VersionError<'_> { 41 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 42 match self { 43 Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), 44 } 45 } 46} 47 48/// XRPC request marker type 49#[derive( 50 Debug, 51 Clone, 52 Copy, 53 PartialEq, 54 Eq, 55 serde::Serialize, 56 serde::Deserialize, 57 jacquard_derive::IntoStatic 58)] 59pub struct Version; 60///Response type for 61///sh.tangled.knot.version 62pub struct VersionResponse; 63impl jacquard_common::xrpc::XrpcResp for VersionResponse { 64 const NSID: &'static str = "sh.tangled.knot.version"; 65 const ENCODING: &'static str = "application/json"; 66 type Output<'de> = VersionOutput<'de>; 67 type Err<'de> = VersionError<'de>; 68} 69 70impl jacquard_common::xrpc::XrpcRequest for Version { 71 const NSID: &'static str = "sh.tangled.knot.version"; 72 const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; 73 type Response = VersionResponse; 74} 75 76///Endpoint type for 77///sh.tangled.knot.version 78pub struct VersionRequest; 79impl jacquard_common::xrpc::XrpcEndpoint for VersionRequest { 80 const PATH: &'static str = "/xrpc/sh.tangled.knot.version"; 81 const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; 82 type Request<'de> = Version; 83 type Response = VersionResponse; 84}