Skip to main content

Basis

Struct Basis 

Source
pub struct Basis {
    pub root: PathBuf,
    pub scope: Scope,
    pub content: AnalysisSet,
}
Expand description

What a retained index or an opened root holds for its lifetime.

Everything here shapes the stored state itself, so a read can only be answered by a holder of the same basis: see Request::validate_read.

Fields§

§root: PathBuf

The directory the answer is about.

§scope: Scope

What the scan observes and retains.

Scheduling is supplied separately by Delivery.

§content: AnalysisSet

The analyzers whose results the answer may report.

Implementations§

Source§

impl Basis

Source

pub fn held_by(index: &Index) -> Self

The basis a retained index holds, as the index itself can still state it.

Scope comes back from ScanScope and the control tier rather than from the ScanConfig that made it: what a read validates against is what the index observed, and the fields a config keeps beyond that – threads, batch size, order – are delivery, which no answer depends on.

The control tier carries both halves of what the scan observed, so both are read from it: whether any rule was read, and the limits the ones that were read were admitted under. An index that observed nothing applied no limits, and the table’s are what a scope that reads no rule would have been taken under; nothing in a basis that observes no control state depends on them.

Source

pub fn build( spec: &RequestSpec<'_>, axes: &'static AxisNames, ) -> Result<Self, RequestError>

The basis a spec names, without the read half it also carries.

What a holder is fixed with for its lifetime: root, scope, and analyzers. A caller that opens an index and then reads it many times parses these once, and each read hands them back to Request::read; building a whole request and discarding its query was the shape that made the basis look like the read’s to overwrite.

§Errors

RequestError for a value no grammar accepts, named as axes spells its axis.

Trait Implementations§

Source§

impl Clone for Basis

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 Basis

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Basis

§

impl RefUnwindSafe for Basis

§

impl Send for Basis

§

impl Sync for Basis

§

impl Unpin for Basis

§

impl UnsafeUnpin for Basis

§

impl UnwindSafe for Basis

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.