pub struct EntrySelection {
pub query: Selection,
pub max_size: Option<u64>,
pub exclude_ignored: bool,
pub logical_extensions: Vec<String>,
pub exact_names: Vec<String>,
pub terminal_extensions: Vec<String>,
pub ancestor_names: Vec<String>,
}Expand description
Additive selection for portable opened-root entry projections.
The established Selection remains the shared one-shot query contract. This value
composes it instead of adding fields to that public struct, preserving source
compatibility for existing Rust callers while keeping interactive row predicates in
one pure engine-owned value.
Every axis sees the portable identity. Inside an opened-root read, the name, the
relative path an anchored glob matches, and every ancestor component are the canonical
escaped /-joined spelling a page row carries as portable_path, never the native
path. 100%.txt is 100%25.txt to every predicate, and a directory whose native name
is not UTF-8 is matched by its escaped name, which is the only spelling a caller could
have been shown. A path taken from a page can therefore be passed back into a filter
unchanged. The same rule governs the base Selection and a Report projection’s
selection inside an opened read; one-shot reports and watches keep native names.
Terminal suffixes and ancestor names are validated where they are written, by
Self::admit_terminal_extension and Self::admit_ancestor_name, and again by
Self::validate when a read receives the selection: every spelling that could only
ever match nothing is refused, the same set the MetaBrowser CatalogQuery contract
refuses, so the two providers reject the same values rather than one answering with an
empty page.
Fields§
§query: SelectionExisting fdu query predicates.
max_size: Option<u64>Largest size, inclusive, in the selected metric.
A caller with an exclusive upper bound translates less_than: n to n - 1.
exclude_ignored: boolExclude entries in the fixed ignored partition.
logical_extensions: Vec<String>Logical extensions to admit, including the leading dot.
This is name identity, not the registry’s canonical classification bucket.
exact_names: Vec<String>Exact basenames to admit, compared case-insensitively.
When either this or logical_extensions is nonempty, matching either admits the
name. That represents one identity filter rather than two intersected filters.
terminal_extensions: Vec<String>Lowercase terminal suffixes to admit, including the leading dot.
Unlike a logical extension, only the final dotted component participates. Each
entry is unique, starts with a dot, is lowercase, and is one suffix: .rs, never
rs, .RS, ., .tar.gz, or a value holding a separator.
ancestor_names: Vec<String>Exact ancestor path-component names to admit, as portable components.
Each entry is unique and one whole component: never empty, ., .., or a value
holding / or \.
Implementations§
Source§impl EntrySelection
impl EntrySelection
Sourcepub fn admit_terminal_extension(
&mut self,
value: impl Into<String>,
) -> Result<()>
pub fn admit_terminal_extension( &mut self, value: impl Into<String>, ) -> Result<()>
Add one terminal suffix, refusing a spelling that could only ever match nothing.
§Errors
Error::InvalidValue for a duplicate, an undotted or non-lowercase suffix, a bare
dot, a compound suffix such as .tar.gz, or a value holding a separator.
Sourcepub fn admit_ancestor_name(&mut self, value: impl Into<String>) -> Result<()>
pub fn admit_ancestor_name(&mut self, value: impl Into<String>) -> Result<()>
Add one ancestor name, refusing a value that is not one whole path component.
§Errors
Error::InvalidValue for a duplicate, an empty name, . or .., or a value
holding / or \.
Sourcepub fn validate(&self) -> Result<()>
pub fn validate(&self) -> Result<()>
Check the axes a caller may have written straight into the public fields.
The admitting constructors apply the same rules one value at a time; a read applies this to every selection it receives, so a hand-built value is refused the same way.
§Errors
The refusal MetaBrowser’s CatalogQuery and the Python EntrySelection raise
first, in their order: terminal extensions before ancestor names, and within each
list uniqueness first, then each rule across the whole list. A list wrong in two
ways therefore gets the same message on every surface.
Sourcepub fn is_unfiltered(&self) -> bool
pub fn is_unfiltered(&self) -> bool
Whether this portable entry selection constrains any row.