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

Function use_vector_codec

nodedb-vector/src/quantize/binary_codec.rs:154–158  ·  view source on GitHub ↗

Verify the trait impl compiles via a generic function.

(c: &C, q: &[f32], v: &[f32])

Source from the content-addressed store, hash-verified

152
153 /// Verify the trait impl compiles via a generic function.
154 fn use_vector_codec<C: VectorCodec>(c: &C, q: &[f32], v: &[f32]) -> f32 {
155 let qv = c.encode(v);
156 let qq = c.prepare_query(q);
157 c.fast_symmetric_distance(&qv, &qv) + c.exact_asymmetric_distance(&qq, &qv)
158 }
159
160 #[test]
161 fn trait_bounds_compile() {

Callers 1

trait_bounds_compileFunction · 0.70

Calls 4

encodeMethod · 0.45
prepare_queryMethod · 0.45

Tested by 1

trait_bounds_compileFunction · 0.56