MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / serialize

Function serialize

atomic-remote/src/streaming/types.rs:175–181  ·  view source on GitHub ↗
(hash: &[u8; 32], serializer: S)

Source from the content-addressed store, hash-verified

173 use serde::{self, Deserialize, Deserializer, Serializer};
174
175 pub fn serialize<S>(hash: &[u8; 32], serializer: S) -> Result<S::Ok, S::Error>
176 where
177 S: Serializer,
178 {
179 let hex: String = hash.iter().map(|b| format!("{:02x}", b)).collect();
180 serializer.serialize_str(&hex)
181 }
182
183 pub fn deserialize<'de, D>(deserializer: D) -> Result<[u8; 32], D::Error>
184 where

Callers

nothing calls this directly

Calls 1

iterMethod · 0.45

Tested by

no test coverage detected