Struct wax::WalkNegation
source · pub struct WalkNegation { /* private fields */ }
walk
only.Expand description
Negated combinator that efficiently filters WalkEntry
s.
Determines an appropriate FilterTarget
for a WalkEntry
based on the
exhaustiveness of its component Pattern
s. This can be used with
FilterTree
to efficiently filter WalkEntry
s without reading directory trees from the
file system when not necessary.
Implementations§
source§impl WalkNegation
impl WalkNegation
sourcepub fn any<'t, I>(patterns: I) -> Result<Self, BuildError>where
I: IntoIterator,
I::Item: Combine<'t>,
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.
sourcepub fn target(&self, entry: &WalkEntry<'_>) -> Option<FilterTarget>
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
WalkEntry
s 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
impl Clone for WalkNegation
source§fn clone(&self) -> WalkNegation
fn clone(&self) -> WalkNegation
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more