Struct wax::WalkNegation

source ·
pub struct WalkNegation { /* private fields */ }
Available on crate feature walk only.
Expand description

Negated combinator that efficiently filters WalkEntrys.

Determines an appropriate FilterTarget for a WalkEntry based on the exhaustiveness of its component Patterns. This can be used with FilterTree to efficiently filter WalkEntrys without reading directory trees from the file system when not necessary.

Implementations§

source§

impl WalkNegation

source

pub fn any<'t, I>(patterns: I) -> Result<Self, BuildError>where I: IntoIterator, I::Item: Combine<'t>,

Combines glob expressions into a WalkNegation.

This function accepts an IntoIterator with items that implement Combine, such as Glob and &str.

Errors

Returns an error if any of the inputs fail to build. If the inputs are a compiled Pattern types such as Glob, then this only occurs if the compiled program is too large.

source

pub fn target(&self, entry: &WalkEntry<'_>) -> Option<FilterTarget>

Gets the appropriate FilterTarget for the given WalkEntry.

This function can be used with FileIterator::filter_tree to effeciently filter WalkEntrys without reading directory trees from the file system when not necessary.

Returns FilterTarget::Tree if the WalkEntry matches an exhaustive glob expression, such as secret/**.

Trait Implementations§

source§

impl Clone for WalkNegation

source§

fn clone(&self) -> WalkNegation

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for WalkNegation

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. 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 Twhere 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 Twhere T: Clone,

§

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 Twhere U: Into<T>,

§

type Error = Infallible

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

§

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.