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: PathBufThe directory the answer is about.
scope: ScopeWhat the scan observes and retains.
Scheduling is supplied separately by Delivery.
content: AnalysisSetThe analyzers whose results the answer may report.
Implementations§
Source§impl Basis
impl Basis
Sourcepub fn held_by(index: &Index) -> Self
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.
Sourcepub fn build(
spec: &RequestSpec<'_>,
axes: &'static AxisNames,
) -> Result<Self, RequestError>
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.