MCPcopy Create free account
hub / github.com/carsonpo/haystackdb / serialize

Method serialize

src/structures/metadata_index.rs:52–61  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

50
51impl TreeSerialization for KVPair {
52 fn serialize(&self) -> Vec<u8> {
53 let mut serialized = Vec::new();
54
55 serialized.extend_from_slice(self.key.len().to_le_bytes().as_ref());
56 serialized.extend_from_slice(self.key.as_bytes());
57 serialized.extend_from_slice(self.value.len().to_le_bytes().as_ref());
58 serialized.extend_from_slice(self.value.as_bytes());
59
60 serialized
61 }
62}
63
64impl TreeDeserialization for KVPair {

Callers

nothing calls this directly

Calls 1

lenMethod · 0.80

Tested by

no test coverage detected