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

Function encode_key

nodedb-array/src/query/elementwise.rs:117–126  ·  view source on GitHub ↗
(c: &[CoordValue])

Source from the content-addressed store, hash-verified

115}
116
117fn encode_key(c: &[CoordValue]) -> Vec<CoordKey> {
118 c.iter()
119 .map(|v| match v {
120 CoordValue::Int64(x) => CoordKey::I(*x),
121 CoordValue::TimestampMs(x) => CoordKey::Ts(*x),
122 CoordValue::Float64(x) => CoordKey::F(x.to_bits()),
123 CoordValue::String(s) => CoordKey::S(s.clone()),
124 })
125 .collect()
126}
127
128fn decode_key(k: &[CoordKey]) -> Vec<CoordValue> {
129 k.iter()

Callers 1

index_rowsFunction · 0.85

Calls 3

collectMethod · 0.80
iterMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected