MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / to_bytes

Method to_bytes

nodedb/src/data/snapshot.rs:129–134  ·  view source on GitHub ↗

Serialize to bytes for network transfer.

(&self)

Source from the content-addressed store, hash-verified

127
128 /// Serialize to bytes for network transfer.
129 pub fn to_bytes(&self) -> crate::Result<Vec<u8>> {
130 zerompk::to_msgpack_vec(self).map_err(|e| crate::Error::Serialization {
131 format: "msgpack".into(),
132 detail: format!("CoreSnapshot: {e}"),
133 })
134 }
135
136 /// Deserialize from bytes.
137 pub fn from_bytes(data: &[u8]) -> Option<Self> {

Calls

no outgoing calls