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

Function try_encode_int64_dict

nodedb-array/src/codec/coord_delta.rs:75–84  ·  view source on GitHub ↗
(values: &[CoordValue])

Source from the content-addressed store, hash-verified

73const DICT_TAG_MSGPACK: u8 = 2; // per-value zerompk msgpack (string/mixed CoordValue)
74
75fn try_encode_int64_dict(values: &[CoordValue]) -> Option<Vec<i64>> {
76 let mut out = Vec::with_capacity(values.len());
77 for v in values {
78 match v {
79 CoordValue::Int64(n) => out.push(*n),
80 _ => return None,
81 }
82 }
83 Some(out)
84}
85
86/// Encode one axis of a `DimDict` into a byte vector.
87pub fn encode_coord_axis(dict: &DimDict, out: &mut Vec<u8>) -> ArrayResult<()> {

Callers 1

encode_coord_axisFunction · 0.85

Calls 2

lenMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected