pub struct ResourceMatcherRegistry { /* private fields */ }Expand description
Registry for custom resource matchers
Implementations§
Source§impl ResourceMatcherRegistry
impl ResourceMatcherRegistry
Sourcepub fn register(
&mut self,
resource_type: impl Into<String>,
matcher: Box<dyn ResourceMatcher>,
) -> Option<Box<dyn ResourceMatcher>>
pub fn register( &mut self, resource_type: impl Into<String>, matcher: Box<dyn ResourceMatcher>, ) -> Option<Box<dyn ResourceMatcher>>
Registers a new matcher for a resource type
Some(old_matcher) if there was a previous matcher, None if new
Sourcepub fn unregister(
&mut self,
resource_type: &str,
) -> Option<Box<dyn ResourceMatcher>>
pub fn unregister( &mut self, resource_type: &str, ) -> Option<Box<dyn ResourceMatcher>>
Sourcepub fn has_matcher(&self, resource_type: &str) -> bool
pub fn has_matcher(&self, resource_type: &str) -> bool
Checks if there is a matcher registered for a type
Sourcepub fn matches(&self, pattern: &Resource, target: &Resource) -> bool
pub fn matches(&self, pattern: &Resource, target: &Resource) -> bool
Executes matching using the appropriate matcher
If there is no custom matcher, it uses the default Resource::matches() method.
Sourcepub fn list_matchers(&self) -> Vec<String>
pub fn list_matchers(&self) -> Vec<String>
Lists all registered resource types
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ResourceMatcherRegistry
impl !RefUnwindSafe for ResourceMatcherRegistry
impl Send for ResourceMatcherRegistry
impl Sync for ResourceMatcherRegistry
impl Unpin for ResourceMatcherRegistry
impl !UnwindSafe for ResourceMatcherRegistry
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