tangled
alpha
login
or
join now
nonbinary.computer
/
jacquard
80
fork
atom
A better Rust ATProto crate
80
fork
atom
overview
issues
9
pulls
pipelines
serde impl for metadata
Orual
4 months ago
e806ffd7
a7ab36e4
1/1
build.yml
success
4min 8s
+10
-1
2 changed files
expand all
collapse all
unified
split
crates
jacquard-common
src
types
blob.rs
jacquard-oauth
src
atproto.rs
+8
crates/jacquard-common/src/types/blob.rs
···
1
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
26
+
}
27
27
+
28
28
+
impl<'b> Blob<'b> {
29
29
+
/// Create a new Blob reference with the given CID, MIME type, and size.
30
30
+
pub fn cid(&self) -> &Cid<'b> {
31
31
+
&self.r#ref.0
32
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
79
-
#[derive(Clone, Debug, PartialEq, Eq)]
79
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
85
+
#[serde(borrow)]
85
86
pub scopes: Vec<Scope<'m>>,
86
87
pub jwks_uri: Option<Url>,
87
88
}