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

Method new

atomic-core/src/output/repo/writer.rs:176–188  ·  view source on GitHub ↗

Create a new conflict writer. # Arguments `writer` - The underlying writer to wrap `path` - Path to the file being written (for conflict reporting) `position` - The graph position of this file's inode # Example ```rust use atomic_core::output::repo::ConflictWriter; use atomic_core::types::{NodeId, Position, ChangePosition}; let mut buffer = Vec::new(); let pos = Position::new(NodeId::new(1),

(writer: W, path: &str, position: Position<NodeId>)

Source from the content-addressed store, hash-verified

174 /// assert!(writer.conflicts().is_empty());
175 /// ```
176 pub fn new(writer: W, path: &str, position: Position<NodeId>) -> Self {
177 Self {
178 writer,
179 path: path.to_string(),
180 position,
181 conflicts: Vec::new(),
182 line: 1,
183 next_conflict_id: 1,
184 at_line_start: true,
185 bytes_written: 0,
186 content_buffer: Vec::with_capacity(4096),
187 }
188 }
189
190 /// Get the path of the file being written.
191 pub fn path(&self) -> &str {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected