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

Method finish

nodedb-codec/src/gorilla.rs:139–146  ·  view source on GitHub ↗

Finish encoding and return compressed bytes. Prepends a 4-byte LE sample count header.

(self)

Source from the content-addressed store, hash-verified

137 ///
138 /// Prepends a 4-byte LE sample count header.
139 pub fn finish(self) -> Vec<u8> {
140 let count_bytes = (self.count as u32).to_le_bytes();
141 let bitstream = self.buf.as_bytes();
142 let mut out = Vec::with_capacity(4 + bitstream.len());
143 out.extend_from_slice(&count_bytes);
144 out.extend_from_slice(bitstream);
145 out
146 }
147
148 pub fn count(&self) -> u64 {
149 self.count

Callers 8

encode_f64Function · 0.45
encode_timestampsFunction · 0.45
empty_encoderFunction · 0.45
single_sample_roundtripFunction · 0.45
varying_values_roundtripFunction · 0.45
compression_ratioFunction · 0.45

Calls 2

as_bytesMethod · 0.45
lenMethod · 0.45

Tested by 6

empty_encoderFunction · 0.36
single_sample_roundtripFunction · 0.36
varying_values_roundtripFunction · 0.36
compression_ratioFunction · 0.36