pub struct Matcher { /* private fields */ }
Expand description
Matches resource
s.
If no Self::include
s are given, all but the Self::exclude
will be matched.
Simmilaraly, if no exclude
s are given, all but the include
s will be rejected.
Implementations§
source§impl Matcher
impl Matcher
sourcepub fn set_include(self, include: Matches) -> Self
pub fn set_include(self, include: Matches) -> Self
Set the included matches.
See Self
for more info.
sourcepub fn set_exclude(self, exclude: Matches) -> Self
pub fn set_exclude(self, exclude: Matches) -> Self
Set the excluded matches.
See Self
for more info.
sourcepub fn include(self, include: Matches) -> Self
pub fn include(self, include: Matches) -> Self
Additionally includes include
.
If Self::get_include
is Matches::All
, this does nothing.
sourcepub fn exclude(self, exclude: Matches) -> Self
pub fn exclude(self, exclude: Matches) -> Self
Additionally excludes exclude
.
If Self::get_exclude
is Matches::All
, this does nothing.
sourcepub fn get_include(&self) -> &Matches
pub fn get_include(&self) -> &Matches
Get a reference to the include filter.
sourcepub fn get_exclude(&self) -> &Matches
pub fn get_exclude(&self) -> &Matches
Get a reference to the exclude filter.
sourcepub fn matches(&self, resource: &str) -> bool
pub fn matches(&self, resource: &str) -> bool
Test if the resource matches the filter.
Tests if Self::include
matches AND Self::exclude
doesn’t.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Matcher
impl<'de> Deserialize<'de> for Matcher
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Matcher
impl RefUnwindSafe for Matcher
impl Send for Matcher
impl Sync for Matcher
impl Unpin for Matcher
impl UnwindSafe for Matcher
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)