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

Method to_bytes

nodedb-columnar/src/delete_bitmap.rs:102–108  ·  view source on GitHub ↗

Serialize the bitmap to bytes for persistence.

(&self)

Source from the content-addressed store, hash-verified

100
101 /// Serialize the bitmap to bytes for persistence.
102 pub fn to_bytes(&self) -> Result<Vec<u8>, ColumnarError> {
103 let mut buf = Vec::with_capacity(self.inner.serialized_size());
104 self.inner
105 .serialize_into(&mut buf)
106 .map_err(|e| ColumnarError::Serialization(format!("delete bitmap: {e}")))?;
107 Ok(buf)
108 }
109
110 /// Deserialize a bitmap from bytes.
111 pub fn from_bytes(data: &[u8]) -> Result<Self, ColumnarError> {

Callers 2

serialization_roundtripFunction · 0.45
empty_bitmapFunction · 0.45

Calls

no outgoing calls

Tested by 2

serialization_roundtripFunction · 0.36
empty_bitmapFunction · 0.36