pub struct Negation { /* private fields */ }
Expand description
Negated Glob
s and their associated FilterTarget
s.
Determines an appropriate FilterTarget
for a WalkEntry
based on
Glob
s used as a filter. This can be used with FilterTree
to
effeciently filter WalkEntry
s without reading directory trees from the
file system when not necessary.
Implementations
sourceimpl Negation
impl Negation
sourcepub fn try_from_patterns<'t, P>(
patterns: impl IntoIterator<Item = P>
) -> Result<Self, BuildError<'t>> where
BuildError<'t>: From<P::Error>,
P: TryInto<Glob<'t>>,
pub fn try_from_patterns<'t, P>(
patterns: impl IntoIterator<Item = P>
) -> Result<Self, BuildError<'t>> where
BuildError<'t>: From<P::Error>,
P: TryInto<Glob<'t>>,
Constructs a Negation
from an IntoIterator
with items that can be
converted into Glob
s.
Errors
Returns an error if any of the items cannot be successfully converted
into a Glob
. If the items are Glob
s, then this function is
infallible.
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 IteratorExt::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 a terminal
glob expression, such as secret/**
.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Negation
impl Send for Negation
impl Sync for Negation
impl Unpin for Negation
impl UnwindSafe for Negation
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<I, T> ExtractContext<I, ()> for T
impl<I, T> ExtractContext<I, ()> for T
sourcefn extract_context(self, _original_input: I)
fn extract_context(self, _original_input: I)
Given the context attached to a nom error, and given the original input to the nom parser, extract more the useful context information. Read more
sourceimpl<I> RecreateContext<I> for I
impl<I> RecreateContext<I> for I
sourcefn recreate_context(_original_input: I, tail: I) -> I
fn recreate_context(_original_input: I, tail: I) -> I
Given the original input, as well as the context reported by nom, recreate a context in the original string where the error occurred. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more