A better Rust ATProto crate

serde impl for metadata

Orual e806ffd7 a7ab36e4

Changed files
+10 -1
crates
jacquard-common
src
types
jacquard-oauth
+8
crates/jacquard-common/src/types/blob.rs
··· 1 + use crate::types::cid::Cid; 1 2 use crate::{CowStr, IntoStatic, types::cid::CidLink}; 2 3 use serde::{Deserialize, Deserializer, Serialize, Serializer, de::Error}; 3 4 use smol_str::ToSmolStr; ··· 22 23 pub mime_type: MimeType<'b>, 23 24 /// Size of the blob in bytes 24 25 pub size: usize, 26 + } 27 + 28 + impl<'b> Blob<'b> { 29 + /// Create a new Blob reference with the given CID, MIME type, and size. 30 + pub fn cid(&self) -> &Cid<'b> { 31 + &self.r#ref.0 32 + } 25 33 } 26 34 27 35 impl Serialize for Blob<'_> {
+2 -1
crates/jacquard-oauth/src/atproto.rs
··· 76 76 } 77 77 } 78 78 79 - #[derive(Clone, Debug, PartialEq, Eq)] 79 + #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] 80 80 pub struct AtprotoClientMetadata<'m> { 81 81 pub client_id: Url, 82 82 pub client_uri: Option<Url>, 83 83 pub redirect_uris: Vec<Url>, 84 84 pub grant_types: Vec<GrantType>, 85 + #[serde(borrow)] 85 86 pub scopes: Vec<Scope<'m>>, 86 87 pub jwks_uri: Option<Url>, 87 88 }