Skip to main content

PredicateClause

Enum PredicateClause 

Source
#[non_exhaustive]
pub enum PredicateClause { Name { pattern: NamePattern, case: CaseSensitivity, negated: bool, }, NameInSet { patterns: Vec<NamePattern>, case: CaseSensitivity, negated: bool, }, IsType { entry_type: EntryType, negated: bool, }, IsReparsePoint { negated: bool, }, ReparseTag { tag: u32, negated: bool, }, AttributesAllSet(u32), AttributesAllClear(u32), LogicalSize { operator: ComparisonOperator, value: u64, }, AllocationSize { operator: ComparisonOperator, value: u64, }, Timestamp { field: TimestampField, operator: ComparisonOperator, value: WindowsFileTimestamp, }, }
Expand description

One condition an entry must satisfy.

Clauses that can be sensibly inverted carry their own negated flag rather than relying on an enclosing Not, which keeps the query flat and keeps the negation adjacent to the thing it negates.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Name

The name matches a pattern.

Fields

§pattern: NamePattern

The pattern to match the entry’s leaf name against.

§case: CaseSensitivity

How the comparison treats case.

§negated: bool

Invert the result.

§

NameInSet

The name matches any pattern in a non-empty set.

Fields

§patterns: Vec<NamePattern>

The alternatives. Must not be empty.

§case: CaseSensitivity

How the comparisons treat case.

§negated: bool

Invert the result, giving set non-membership.

§

IsType

The entry is (or, negated, is not) the given kind.

Fields

§entry_type: EntryType

The kind to test for.

§negated: bool

Invert the result.

§

IsReparsePoint

The entry is (or, negated, is not) a reparse point.

Fields

§negated: bool

Invert the result.

§

ReparseTag

The entry is a reparse point whose tag equals tag.

A non-reparse entry has no tag, so it never satisfies this clause – and, negated, always does.

Fields

§tag: u32

The tag to compare against.

§negated: bool

Invert the result.

§

AttributesAllSet(u32)

Every bit in the mask is set in the entry’s attributes.

The mask must be non-zero.

§

AttributesAllClear(u32)

Every bit in the mask is clear in the entry’s attributes.

The mask must be non-zero.

§

LogicalSize

The entry’s logical size compares to value bytes.

Fields

§operator: ComparisonOperator

How to compare.

§value: u64

The size in bytes to compare against.

§

AllocationSize

The entry’s allocation size compares to value bytes.

Fields

§operator: ComparisonOperator

How to compare.

§value: u64

The size in bytes to compare against.

§

Timestamp

One of the entry’s four times compares to value.

Fields

§field: TimestampField

Which time to read.

§operator: ComparisonOperator

How to compare.

§value: WindowsFileTimestamp

The timestamp to compare against.

Implementations§

Source§

impl PredicateClause

Source

pub fn matches(&self, entry: &DirectoryEntry) -> bool

Whether entry satisfies this clause.

Trait Implementations§

Source§

impl Clone for PredicateClause

Source§

fn clone(&self) -> PredicateClause

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 PredicateClause

Source§

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

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

impl Eq for PredicateClause

Source§

impl PartialEq for PredicateClause

Source§

fn eq(&self, other: &PredicateClause) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for PredicateClause

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, <T as TryFrom<U>>::Error>

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.