MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / slice

Function slice

atomic-core/examples/graph_codec_lab/codec.rs:38–42  ·  view source on GitHub ↗
(input: &mut &'a [u8])

Source from the content-addressed store, hash-verified

36}
37
38fn slice<'a>(input: &mut &'a [u8]) -> Result<&'a [u8]> {
39 let (bytes, rest) = postcard::take_from_bytes(input)?;
40 *input = rest;
41 Ok(bytes)
42}
43fn vector<'a>(input: &mut &'a [u8], limit: usize) -> Result<Vec<&'a [u8]>> {
44 let n = usize::try_from(get(input)?)?;
45 ensure!(n <= limit && n <= input.len(), "graph vector count limit");

Callers 2

vectorFunction · 0.85
parseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected