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

Function numeric

atomic-core/examples/graph_codec_lab/codec.rs:533–541  ·  view source on GitHub ↗
(c: &mut Borrowed<'_>, previous: &mut [u64], numbers_end: &mut usize)

Source from the content-addressed store, hash-verified

531 replay(c, content, LIMIT)
532}
533fn numeric(c: &mut Borrowed<'_>, previous: &mut [u64], numbers_end: &mut usize) -> Result<u64> {
534 let id = usize::try_from(get(&mut c.control)?)?;
535 ensure!(id < c.numbers.len(), "graph numeric column index");
536 ensure!(id <= *numbers_end, "graph numeric column gap");
537 if id == *numbers_end {
538 *numbers_end += 1;
539 }
540 undelta(&mut c.numbers[id], &mut previous[id])
541}
542fn replay(mut c: Borrowed<'_>, content: Option<&[u8]>, limit: usize) -> Result<Vec<u8>> {
543 if let Some(hash) = c.content_hash {
544 let bytes = content.context("authored content resolver required")?;

Callers 1

replayFunction · 0.70

Calls 2

getFunction · 0.70
undeltaFunction · 0.70

Tested by

no test coverage detected