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

Method to_bytes

nodedb-vector/src/rerank/codecs/pq.rs:171–178  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

169 }
170
171 fn to_bytes(&self) -> Result<Vec<u8>, RerankError> {
172 let codec = self.codec.as_ref().ok_or_else(|| {
173 RerankError::NotTrained("pq sidecar serialize: codec not trained".to_string())
174 })?;
175 codec
176 .to_bytes()
177 .map_err(|e| RerankError::BadInput(format!("pq to_bytes: {e}")))
178 }
179
180 /// Train PQ codebooks via k-means on a sample of vectors.
181 ///

Callers

nothing calls this directly

Calls 2

to_stringMethod · 0.80
as_refMethod · 0.45

Tested by

no test coverage detected