pub struct MetadataViewSession<'a, 'store, S: ObjectStore + ?Sized> { /* private fields */ }Expand description
One loaded-view session with memoized visibility reads.
This is part of the read surface consumed by loonfs-grep; construction
stays on the loaded view so callers cannot assemble incoherent sessions.
Implementations§
Source§impl<'a, 'store, S: ObjectStore + ?Sized> MetadataViewSession<'a, 'store, S>
impl<'a, 'store, S: ObjectStore + ?Sized> MetadataViewSession<'a, 'store, S>
Sourcepub async fn resolve_visible_path(
&mut self,
absolute_path: &AbsolutePath,
prefetch_leaf_revision: LeafRevisionPrefetch,
) -> Result<ResolvedVisiblePath, CoreError>
pub async fn resolve_visible_path( &mut self, absolute_path: &AbsolutePath, prefetch_leaf_revision: LeafRevisionPrefetch, ) -> Result<ResolvedVisiblePath, CoreError>
Resolves absolute_path with the canonical visibility rules after a
pipelined preload of the walk’s storage lookups.
For each path component, the preload issues the independent probes
(inode, tombstone, child-keyed binding, the previous binding’s
unbind fact) as one concurrent wave alongside the next component’s
bound-child scan — the only lookup the walk truly serializes on —
and seeds the session’s caches with exactly what those lookups would
have fetched. The canonical rules then decide over cache hits, so a
cold resolution costs one round-trip wave per path component instead
of five-plus sequential lookups each.
This is part of the read surface consumed by loonfs-grep.
Sourcepub async fn visible_inode(
&mut self,
inode_id: InodeId,
) -> Result<Option<InodeRecord>, CoreError>
pub async fn visible_inode( &mut self, inode_id: InodeId, ) -> Result<Option<InodeRecord>, CoreError>
Returns the inode when it is visible in this session’s snapshot.
This is part of the read surface consumed by loonfs-grep.
Sourcepub async fn latest_revision_head_of_visible(
&mut self,
inode_id: InodeId,
) -> Result<Option<RevisionRecord>, CoreError>
pub async fn latest_revision_head_of_visible( &mut self, inode_id: InodeId, ) -> Result<Option<RevisionRecord>, CoreError>
Returns the latest revision for an inode already proven visible at
this session’s seq. Unlike [MetadataView::latest_revision_head],
this skips re-deriving the inode’s visibility: the re-check costs a
full child-binds scan and tombstone probe per entry on a wide listing,
and it cannot disagree with the enumeration that admitted the entry
at the same seq.
This is part of the read surface consumed by loonfs-grep.
Sourcepub async fn current_parent_binding_for_child(
&mut self,
child_inode_id: InodeId,
) -> Result<Option<DirentryBindRecord>, CoreError>
pub async fn current_parent_binding_for_child( &mut self, child_inode_id: InodeId, ) -> Result<Option<DirentryBindRecord>, CoreError>
Returns the child’s active parent binding at the visible sequence.
This is part of the read surface consumed by loonfs-grep.
Auto Trait Implementations§
impl<'a, 'store, S> Freeze for MetadataViewSession<'a, 'store, S>where
S: ?Sized,
impl<'a, 'store, S> RefUnwindSafe for MetadataViewSession<'a, 'store, S>where
S: RefUnwindSafe + ?Sized,
impl<'a, 'store, S> Send for MetadataViewSession<'a, 'store, S>where
S: ?Sized,
impl<'a, 'store, S> Sync for MetadataViewSession<'a, 'store, S>where
S: ?Sized,
impl<'a, 'store, S> Unpin for MetadataViewSession<'a, 'store, S>where
S: ?Sized,
impl<'a, 'store, S> UnsafeUnpin for MetadataViewSession<'a, 'store, S>where
S: ?Sized,
impl<'a, 'store, S> UnwindSafe for MetadataViewSession<'a, 'store, S>where
S: RefUnwindSafe + ?Sized,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more