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

Method get_contents_ext

atomic-repository/src/changestore/trait_impl.rs:53–68  ·  view source on GitHub ↗
(
        &self,
        span: GraphNode<Option<Hash>>,
        buf: &mut [u8],
    )

Source from the content-addressed store, hash-verified

51 }
52
53 fn get_contents_ext(
54 &self,
55 span: GraphNode<Option<Hash>>,
56 buf: &mut [u8],
57 ) -> Result<usize, Self::Error> {
58 // Handle None hash (ROOT span)
59 let hash = match span.change {
60 Some(h) => h,
61 None => return Ok(0),
62 };
63
64 let start = span.start.get() as usize;
65 let end = span.end.get() as usize;
66
67 self.copy_content_span(&hash, start, end, buf)
68 }
69
70 fn get_header(&self, hash: &Hash) -> Result<ChangeHeader, Self::Error> {
71 let change = self.load_change(hash)?;

Callers

nothing calls this directly

Calls 2

copy_content_spanMethod · 0.80
getMethod · 0.65

Tested by

no test coverage detected