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

Function decode_entry

nodedb-cluster/src/metadata_group/codec.rs:24–28  ·  view source on GitHub ↗

Decode a [`MetadataEntry`] from bytes. Requires a v2 versioned envelope. Rejects bytes without the envelope marker and envelopes with unsupported future version numbers.

(data: &[u8])

Source from the content-addressed store, hash-verified

22/// Requires a v2 versioned envelope. Rejects bytes without the envelope
23/// marker and envelopes with unsupported future version numbers.
24pub fn decode_entry(data: &[u8]) -> Result<MetadataEntry, ClusterError> {
25 decode_versioned(data).map_err(|e| ClusterError::Codec {
26 detail: format!("metadata decode: {e}"),
27 })
28}
29
30#[cfg(test)]
31mod tests {

Callers 3

applyMethod · 0.85
applyMethod · 0.85

Calls 1

decode_versionedFunction · 0.85

Tested by 1