MCPcopy Create free account
hub / github.com/bajrangCoder/setu / deserialize_bytes_from_base64

Function deserialize_bytes_from_base64

src/entities/response.rs:20–29  ·  view source on GitHub ↗
(deserializer: D)

Source from the content-addressed store, hash-verified

18 }
19}
20
21fn deserialize_bytes_from_base64<'de, D>(deserializer: D) -> Result<Bytes, D::Error>
22where
23 D: Deserializer<'de>,
24{
25 let opt: Option<String> = Option::deserialize(deserializer)?;
26 match opt {
27 Some(s) => STANDARD
28 .decode(&s)
29 .map(Bytes::from)
30 .map_err(serde::de::Error::custom),
31 None => Ok(Bytes::new()),
32 }

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected