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

Method render_bounded

atomic-core/src/pristine/span_patch_storage.rs:1281–1290  ·  view source on GitHub ↗

Render at most `max_bytes`, validating the complete span tree even when the visible file is too large to retain.

(&self, inode: Inode, max_bytes: usize)

Source from the content-addressed store, hash-verified

1279 /// Render at most `max_bytes`, validating the complete span tree even when
1280 /// the visible file is too large to retain.
1281 pub fn render_bounded(&self, inode: Inode, max_bytes: usize) -> Result<BoundedSpanContent> {
1282 let (content, oversized) = self.render_internal(inode, None, max_bytes)?;
1283 if oversized {
1284 Ok(BoundedSpanContent::Oversized {
1285 retained_bytes: content.len(),
1286 })
1287 } else {
1288 Ok(BoundedSpanContent::Complete(content))
1289 }
1290 }
1291
1292 fn render_internal(
1293 &self,

Calls 2

render_internalMethod · 0.80
lenMethod · 0.45