Skip to main content

MetadataViewSession

Struct MetadataViewSession 

Source
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>

Source

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.

Source

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.

Source

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.

Source

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more