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

Function has_sidecar

nodedb-query/src/msgpack_scan/sidecar.rs:50–56  ·  view source on GitHub ↗

Check whether `buf` has a valid sidecar index appended.

(buf: &[u8])

Source from the content-addressed store, hash-verified

48
49/// Check whether `buf` has a valid sidecar index appended.
50pub fn has_sidecar(buf: &[u8]) -> bool {
51 if buf.len() < TRAILER_SIZE {
52 return false;
53 }
54 let magic_start = buf.len() - 4;
55 buf[magic_start..] == SIDECAR_MAGIC_LE
56}
57
58/// Return the raw msgpack slice from a buffer that may or may not have a sidecar.
59///

Callers 3

msgpack_bytesFunction · 0.85
sidecar_lookupFunction · 0.85
field_index_from_sidecarFunction · 0.85

Calls 1

lenMethod · 0.45

Tested by

no test coverage detected