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

Function fetch

nodedb-vector/src/rerank/pipeline.rs:208–210  ·  view source on GitHub ↗
(store: &'a HashMap<u32, Vec<f32>>)

Source from the content-addressed store, hash-verified

206 }
207
208 fn fetch<'a>(store: &'a HashMap<u32, Vec<f32>>) -> impl FnMut(u32) -> Option<&'a [f32]> {
209 move |id| store.get(&id).map(|v| v.as_slice())
210 }
211
212 /// Stub codec that encodes as raw LE f32 bytes and computes L2 distance.
213 /// Reports `CodecName::Binary` so tests can request it via `VectorQuantization::Binary`.

Calls 2

getMethod · 0.45
as_sliceMethod · 0.45