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

Function retrieve_span_if_present

atomic-repository/src/repository/content.rs:1216–1234  ·  view source on GitHub ↗
(
    txn: &T,
    store: &C,
    inode: Inode,
    visibility: &GraphVisibilityClosure,
)

Source from the content-addressed store, hash-verified

1214}
1215
1216pub(super) fn retrieve_span_if_present<T, C>(
1217 txn: &T,
1218 store: &C,
1219 inode: Inode,
1220 visibility: &GraphVisibilityClosure,
1221) -> Result<Option<Vec<u8>>, RepositoryError>
1222where
1223 T: atomic_core::pristine::span_patch_storage::SpanPatchReadTxn
1224 + atomic_core::pristine::TreeTxnT
1225 + atomic_core::pristine::CapabilityTxnT,
1226 C: atomic_core::change::ChangeStore,
1227{
1228 if !has_visible_span_root(txn, store, inode, visibility)? {
1229 return Ok(None);
1230 }
1231 atomic_core::pristine::span_patch_storage::SpanRenderContext::new(txn, store, visibility)
1232 .and_then(|context| context.render_if_visible(inode))
1233 .map_err(|error| RepositoryError::Database(error.to_string()))
1234}
1235
1236/// One span render context shared by every file read through a single
1237/// transaction and visibility closure. `retrieve_span_if_present` builds a

Calls 2

has_visible_span_rootFunction · 0.85
render_if_visibleMethod · 0.80

Tested by

no test coverage detected