Skip to main content

EntrySelection

Struct EntrySelection 

Source
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: Selection

Existing 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: bool

Exclude 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

Source

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.

Source

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 \.

Source

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.

Source

pub fn is_unfiltered(&self) -> bool

Whether this portable entry selection constrains any row.

Source

pub fn admits(&self, candidate: &Candidate<'_>) -> bool

Whether an entry passes the base query and every opened-row predicate.

Trait Implementations§

Source§

impl Clone for EntrySelection

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 EntrySelection

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for EntrySelection

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl From<Selection> for EntrySelection

Source§

fn from(query: Selection) -> Self

Converts to this type from the input type.

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.