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

Method to_bytes

nodedb-codec/src/vector_quant/bbq.rs:122–124  ·  view source on GitHub ↗

Serialize this codec to a self-describing byte buffer.

(&self)

Source from the content-addressed store, hash-verified

120
121 /// Serialize this codec to a self-describing byte buffer.
122 pub fn to_bytes(&self) -> Result<Vec<u8>, CodecError> {
123 codec_envelope::encode(Self::ENVELOPE_MAGIC, Self::ENVELOPE_VERSION, self)
124 }
125
126 /// Deserialize a codec from a byte buffer produced by [`Self::to_bytes`].
127 pub fn from_bytes(buf: &[u8]) -> Result<Self, CodecError> {

Callers 2

Calls 1

encodeFunction · 0.70

Tested by 2