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

Method new

atomic-core/src/change/format_v3/writer/state_machine.rs:190–204  ·  view source on GitHub ↗

Create a new change writer wrapping the given output. The writer starts in the `Created` state. The first call must be [`write_file_header`](Self::write_file_header). # Arguments `writer` - The destination for the serialized change file. `options` - Configuration (compression level, etc.). # Examples ```rust use atomic_core::change::format_v3::{ChangeWriter, WriterOptions}; let mut buf = Vec

(writer: &'w mut W, options: WriterOptions)

Source from the content-addressed store, hash-verified

188 /// let writer = ChangeWriter::new(&mut buf, WriterOptions::default());
189 /// ```
190 pub fn new(writer: &'w mut W, options: WriterOptions) -> Self {
191 Self {
192 writer,
193 state: WriterState::Created,
194 hasher: blake3::Hasher::new(),
195 options,
196 stats: WriterStats::default(),
197 wrote_header_section: false,
198 wrote_deps_section: false,
199 wrote_signature_section: false,
200 schema_version: 0,
201 wrote_span_section: false,
202 last_section_ordering: None,
203 }
204 }
205
206 /// Returns the current writer statistics.
207 ///

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected