Skip to main content

OpenedIndex

Struct OpenedIndex 

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

A long-lived, synchronously controlled filesystem index.

Clones are cheap references to one authority. Calling Self::close through any clone cancels and joins every worker owned by that authority, and every concurrent caller receives the same stored terminal outcome.

Implementations§

Source§

impl OpenedIndex

Source

pub fn basis() -> Basis

The basis every opened root holds, stated once for every route into one.

No analyzers, because an opened root runs none, and control state always observed, because its ignored and unignored partitions are part of what it serves – OpenOptions has no switch for either, and reads this rather than restating it. The root is empty because no rule in the request model compares roots and an opened read names none: it asks the root it already holds.

Stated rather than read back from the retained index, so a read is refused before any stored state is touched, which is where every other surface refuses one.

Source

pub fn open(plan: &Plan, options: OpenOptions) -> Result<Self>

Open one live root without changing the existing blocking crate::open API.

This constructor validates and binds the root and semantic configuration, starts cold progressive discovery, and captures optional observation before that baseline begins. No cache image or second mutable index is created here.

Source

pub fn close(&self) -> Result<()>

Cancel and join all work owned by this opened root.

The first caller performs shutdown. Concurrent and repeated callers wait for or replay its stored terminal outcome; success is never reported while a worker is still live.

Source

pub fn prioritize(&self, paths: &[PathBuf]) -> Result<()>

Reorder pending discovery toward the supplied relative paths.

This is a bounded best-effort scheduling hint. It does not change scope, facts, lifecycle state, or the index clock, and paths that are already complete simply have no effect.

Source

pub fn read(&self, request: ReadRequest) -> Result<ReadResponse>

Return requested projections from one committed version and state boundary.

§Errors

The whole read fails only when no projection in it can be trusted: the request’s shape is invalid (a bound out of range, too many projections, a path that escapes the root, a continuation another root issued or this one never did), the root is closed, or crate::ReadRequest::expected or a continuation pins a version the index no longer holds. What one projection finds at the pinned version – including a continuation this root issued and has since consumed or evicted – is that projection’s crate::ProjectionRefusal instead, returned in its position while every other projection answers.

The lifecycle lock guards only the phase check. The projection’s coherence comes from the index read boundary, which any number of readers share, so holding the lifecycle lock across it would serialize every read with every other read and with refresh, worker registration, and the start of close. A read that races close cannot leave state behind: the continuation table refuses records once shutdown clears it.

Source

pub fn changes(&self, request: ChangeRequest) -> Result<ChangePoll>

Return exact commits after one version, waiting up to the supplied timeout.

A poll waiting on an idle journal returns as soon as an owned worker panics, with Error::OpenedWorkerPanicked naming the worker – the cause Self::close will report – rather than at its timeout. Commits retained before the panic are still returned first, unless the panic struck inside a commit: that poisons the index, which leaves nothing to read. A poll parked on the journal then reports the panic. A poll already reading when the commit panics can observe the poisoned index before the worker has recorded its panic, and returns Error::IndexLockPoisoned; the panic is recorded moments later, and Self::close names it either way.

Source

pub fn refresh(&self, paths: &[PathBuf]) -> Result<RefreshResult>

Verify a bounded set of relative paths and conditionally commit exact changes.

Inputs are classified as one set: duplicates are removed, descendants covered by an accepted ancestor cost no second walk, and an empty set is a no-op. The returned (after, version] interval is safe as the next journal boundary even when another producer committed concurrently.

Trait Implementations§

Source§

impl Clone for OpenedIndex

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 OpenedIndex

Source§

fn fmt(&self, formatter: &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.