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