Skip to main content

IndexHandle

Struct IndexHandle 

Source
pub struct IndexHandle { /* private fields */ }
Expand description

Shareable owner for serving readers while reconciliation applies short writes.

Implementations§

Source§

impl IndexHandle

Source

pub fn new(index: Index) -> Self

Wrap an owned index in the shared single-writer owner.

Source

pub fn apply(&self, observation: &Observation) -> Result<ApplyOutcome>

Arbitrate and apply one observation under the single-writer lock.

Source

pub fn root_path(&self) -> Result<PathBuf>

Absolute filesystem root, copied without retaining the read lock.

Source

pub fn scope(&self) -> Result<ScanScope>

Semantic scan scope represented by the shared index.

Source

pub fn freshness(&self) -> Result<Freshness>

Trust state for the whole index.

Source

pub fn freshness_at(&self, path: &Path) -> Result<Freshness>

Trust state for one subtree.

Source

pub fn clock(&self) -> Result<Clock>

Clock of the most recently committed delta.

Source

pub fn len(&self) -> Result<u64>

Number of live entries, including the root.

Source

pub fn is_empty(&self) -> Result<bool>

Whether the index contains only its root.

Source

pub fn total(&self) -> Result<RollUp>

Owned roll-up totals for the whole tree.

Source

pub fn rollup(&self, path: &Path) -> Result<Option<RollUp>>

Owned roll-up state for a relative directory path.

Source

pub fn attrs(&self, path: &Path) -> Result<Option<Attrs>>

Owned metadata for a relative path.

Source

pub fn kind(&self, path: &Path) -> Result<Option<EntryKind>>

Entry kind for a relative path.

Source

pub fn path_state(&self, path: &Path) -> Result<PathState>

Current visible state for a relative path.

Source

pub fn expectation(&self, path: &Path) -> Result<PathExpectation>

Conditional baseline for a producer operating on a shared index.

Source

pub fn since(&self, clock: Clock) -> Result<Since>

Owned exact commits after clock.

Source

pub fn children(&self, path: &Path) -> Result<Option<Vec<ChildSnapshot>>>

Direct children captured coherently at one read boundary.

On an index that did not observe control state each child’s ChildSnapshot::ignored and ChildSnapshot::partitions are None, the way Index::is_ignored refuses; the names, metadata, and roll-ups still answer.

Source

pub fn snapshot(&self) -> Result<Index>

Capture one coherent owned index image, releasing the lock before callers do serialization, filesystem I/O, conversion, or other potentially blocking work.

Trait Implementations§

Source§

impl Clone for IndexHandle

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for IndexHandle

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.