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

Method output_line

atomic-core/src/output/repo/file.rs:1113–1129  ·  view source on GitHub ↗
(
        &mut self,
        node: crate::types::GraphNode<NodeId>,
        get_contents: F,
    )

Source from the content-addressed store, hash-verified

1111
1112impl crate::output::traits::VertexBuffer for BoundedOutput {
1113 fn output_line<E, F>(
1114 &mut self,
1115 node: crate::types::GraphNode<NodeId>,
1116 get_contents: F,
1117 ) -> Result<(), E>
1118 where
1119 E: From<std::io::Error>,
1120 F: FnOnce(&mut [u8]) -> Result<(), E>,
1121 {
1122 // Check an emitted span before Writer allocates its scratch buffer.
1123 // This is a rendered-span check, never a change-payload size estimate.
1124 let sink = self.writer.inner_mut();
1125 if node.len() > sink.max_bytes.saturating_sub(sink.bytes.len()) {
1126 return Err(sink.reject().into());
1127 }
1128 self.writer.output_line(node, get_contents)
1129 }
1130
1131 fn output_conflict_marker(
1132 &mut self,

Callers 1

Calls 3

rejectMethod · 0.80
inner_mutMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected