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

Function retrieve_span_if_present

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

Source from the content-addressed store, hash-verified

1068}
1069
1070pub(super) fn retrieve_span_if_present<T, C>(
1071 txn: &T,
1072 store: &C,
1073 inode: Inode,
1074 visibility: &GraphVisibilityClosure,
1075) -> Result<Option<Vec<u8>>, RepositoryError>
1076where
1077 T: atomic_core::pristine::span_patch_storage::SpanPatchReadTxn
1078 + atomic_core::pristine::TreeTxnT
1079 + atomic_core::pristine::CapabilityTxnT,
1080 C: atomic_core::change::ChangeStore,
1081{
1082 if !has_visible_span_root(txn, store, inode, visibility)? {
1083 return Ok(None);
1084 }
1085 atomic_core::pristine::span_patch_storage::SpanRenderContext::new(txn, store, visibility)
1086 .and_then(|context| context.render(inode))
1087 .map(Some)
1088 .map_err(|error| RepositoryError::Database(error.to_string()))
1089}
1090
1091/// One span render context shared by every file read through a single
1092/// transaction and visibility closure. `retrieve_span_if_present` builds a

Calls 2

has_visible_span_rootFunction · 0.85
renderMethod · 0.45

Tested by

no test coverage detected