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

Function sections

atomic-core/examples/semantic_storage.rs:65–82  ·  view source on GitHub ↗
(bytes: &[u8])

Source from the content-addressed store, hash-verified

63}
64
65fn sections(bytes: &[u8]) -> Result<(usize, usize, usize, u32)> {
66 let mut input = bytes;
67 let mut reader = ChangeReader::open(&mut input)?;
68 let version = reader.file_header().version;
69 let mut semantic = 0;
70 let mut content = 0;
71 let mut graph = 0;
72 while let Some(section) = reader.next_section()? {
73 match section.section_type {
74 SectionType::Semantic => semantic += section.compressed_size as usize,
75 SectionType::Content => content += section.compressed_size as usize,
76 SectionType::Graph => graph += section.compressed_size as usize,
77 _ => {}
78 }
79 }
80 reader.verify()?;
81 Ok((semantic, content, graph, version))
82}
83
84fn measure(path: &Path) -> Result<Row> {
85 let original = fs::read(path)?;

Callers 1

measureFunction · 0.85

Calls 4

file_headerMethod · 0.80
next_sectionMethod · 0.80
openFunction · 0.50
verifyMethod · 0.45

Tested by

no test coverage detected