A better Rust ATProto crate
at main 2.0 kB view raw
1// @generated by jacquard-lexicon. DO NOT EDIT. 2// 3// Lexicon: com.atproto.repo.importRepo 4// 5// This file was automatically generated from Lexicon schemas. 6// Any manual changes will be overwritten on the next regeneration. 7 8#[derive( 9 serde::Serialize, 10 serde::Deserialize, 11 Debug, 12 Clone, 13 PartialEq, 14 Eq, 15 bon::Builder, 16 jacquard_derive::IntoStatic 17)] 18#[builder(start_fn = new)] 19#[serde(rename_all = "camelCase")] 20pub struct ImportRepo { 21 pub body: bytes::Bytes, 22} 23 24///Response type for 25///com.atproto.repo.importRepo 26pub struct ImportRepoResponse; 27impl jacquard_common::xrpc::XrpcResp for ImportRepoResponse { 28 const NSID: &'static str = "com.atproto.repo.importRepo"; 29 const ENCODING: &'static str = "application/json"; 30 type Output<'de> = (); 31 type Err<'de> = jacquard_common::xrpc::GenericError<'de>; 32} 33 34impl jacquard_common::xrpc::XrpcRequest for ImportRepo { 35 const NSID: &'static str = "com.atproto.repo.importRepo"; 36 const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( 37 "application/vnd.ipld.car", 38 ); 39 type Response = ImportRepoResponse; 40 fn encode_body(&self) -> Result<Vec<u8>, jacquard_common::xrpc::EncodeError> { 41 Ok(self.body.to_vec()) 42 } 43 fn decode_body<'de>( 44 body: &'de [u8], 45 ) -> Result<Box<Self>, jacquard_common::error::DecodeError> 46 where 47 Self: serde::Deserialize<'de>, 48 { 49 Ok( 50 Box::new(Self { 51 body: bytes::Bytes::copy_from_slice(body), 52 }), 53 ) 54 } 55} 56 57///Endpoint type for 58///com.atproto.repo.importRepo 59pub struct ImportRepoRequest; 60impl jacquard_common::xrpc::XrpcEndpoint for ImportRepoRequest { 61 const PATH: &'static str = "/xrpc/com.atproto.repo.importRepo"; 62 const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( 63 "application/vnd.ipld.car", 64 ); 65 type Request<'de> = ImportRepo; 66 type Response = ImportRepoResponse; 67}