pub struct Filter { /* private fields */ }Expand description
A compiled pattern bound to the part of an identifier it describes.
The target travels with the filter so filename, path, folder, and type-name selectors all use
the same Self::matches operation.
Implementations§
Source§impl Filter
impl Filter
Sourcepub const fn new(pattern: Pattern, target: PatternTarget) -> Self
pub const fn new(pattern: Pattern, target: PatternTarget) -> Self
Creates a positive filter.
Sourcepub fn with_exclusions(
self,
exclusions: impl IntoIterator<Item = Filter>,
) -> Self
pub fn with_exclusions( self, exclusions: impl IntoIterator<Item = Filter>, ) -> Self
Returns this filter with hard exclusions evaluated after the parent match.
Sourcepub fn not_matching(self) -> Self
pub fn not_matching(self) -> Self
Returns a filter with the pattern’s meaning inverted.
Sourcepub const fn target(&self) -> PatternTarget
pub const fn target(&self) -> PatternTarget
Returns the candidate part carried by this filter.
Sourcepub fn exclusions(&self) -> &[Filter]
pub fn exclusions(&self) -> &[Filter]
Returns hard exclusions in declaration order.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Filter
impl RefUnwindSafe for Filter
impl Send for Filter
impl Sync for Filter
impl Unpin for Filter
impl UnwindSafe for Filter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more