A better Rust ATProto crate
at lifetimes 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<'de> jacquard_common::xrpc::XrpcRequest<'de> 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( 44 body: &'de [u8], 45 ) -> Result<Box<Self>, jacquard_common::error::DecodeError> { 46 Ok( 47 Box::new(Self { 48 body: bytes::Bytes::copy_from_slice(body), 49 }), 50 ) 51 } 52} 53 54///Endpoint type for 55///com.atproto.repo.importRepo 56pub struct ImportRepoRequest; 57impl jacquard_common::xrpc::XrpcEndpoint for ImportRepoRequest { 58 const PATH: &'static str = "/xrpc/com.atproto.repo.importRepo"; 59 const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( 60 "application/vnd.ipld.car", 61 ); 62 type Request<'de> = ImportRepo; 63 type Response = ImportRepoResponse; 64}