Write the single hashed span payload required by schema 3.
(&mut self, payload: &[u8])
| 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 |