MCPcopy Create free account
hub / github.com/carsonpo/haystackdb / serialize_length

Function serialize_length

src/structures/mmap_tree/node.rs:265–270  ·  view source on GitHub ↗
(buffer: &mut Vec<u8>, length: u32)

Source from the content-addressed store, hash-verified

263}
264
265fn serialize_length(buffer: &mut Vec<u8>, length: u32) -> &Vec<u8> {
266 buffer.extend_from_slice(&length.to_le_bytes());
267
268 // Return the buffer to allow chaining
269 buffer
270}
271
272fn read_length(data: &[u8]) -> usize {
273 u32::from_le_bytes(data.try_into().unwrap()) as usize

Callers 1

serializeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected