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

Method write_span_section

atomic-core/src/change/format_v3/writer/sections.rs:49–67  ·  view source on GitHub ↗

Write the single hashed span payload required by schema 3.

(&mut self, payload: &[u8])

Source from the content-addressed store, hash-verified

47
48 /// Write the single hashed span payload required by schema 3.
49 pub fn write_span_section(&mut self, payload: &[u8]) -> FormatResult<()> {
50 use super::super::error::SPAN_FORMAT_VERSION;
51 self.ensure_metadata_complete()?;
52 if self.schema_version != SPAN_FORMAT_VERSION || self.wrote_span_section {
53 return Err(FormatError::InvalidHeader {
54 reason: "SPAN requires schema 3 and may appear only once".into(),
55 });
56 }
57 self.transition_to_at_least(WriterState::WritingGraph)?;
58 if self.state != WriterState::WritingGraph {
59 return Err(FormatError::UnexpectedSection {
60 got: "SPAN".into(),
61 expected: "after GRAPH and before SEMANTIC or CONTENT".into(),
62 });
63 }
64 self.write_raw_section(SectionType::Span, payload)?;
65 self.wrote_span_section = true;
66 Ok(())
67 }
68
69 // ── Step 5: Per-File Semantic Sections ─────────────────────────
70

Callers 3

serializeMethod · 0.80

Calls 3

write_raw_sectionMethod · 0.80