pub struct ResourcePattern { /* private fields */ }Expand description
Represents a pattern that is used by ACLs to match zero or more
Resources.
Corresponds to org.apache.kafka.common.resource.ResourcePattern.
Implementations§
Source§impl ResourcePattern
impl ResourcePattern
Sourcepub const WILDCARD_RESOURCE: &str = "*"
pub const WILDCARD_RESOURCE: &str = "*"
A special literal resource name that corresponds to ‘all resources of a certain type’.
Sourcepub fn new(
resource_type: ResourceType,
name: impl Into<String>,
pattern_type: PatternType,
) -> Result<ResourcePattern, Error>
pub fn new( resource_type: ResourceType, name: impl Into<String>, pattern_type: PatternType, ) -> Result<ResourcePattern, Error>
Create a pattern using the supplied parameters.
§Arguments
resource_type- specific resource typename- resource name, which can be theSelf::WILDCARD_RESOURCEpattern_type- specific resource pattern type, which controls how the pattern will match resource names
§Errors
Returns Error::LocalIllegalArgument if resource_type is
ResourceType::Any, or pattern_type is PatternType::Match or
PatternType::Any (mirrors Java’s IllegalArgumentException).
Sourcepub fn resource_type(&self) -> ResourceType
pub fn resource_type(&self) -> ResourceType
Return the specific resource type this pattern matches.
Sourcepub fn pattern_type(&self) -> PatternType
pub fn pattern_type(&self) -> PatternType
Return the resource pattern type.
Sourcepub fn to_filter(&self) -> ResourcePatternFilter
pub fn to_filter(&self) -> ResourcePatternFilter
Return a filter which matches only this pattern.
Sourcepub fn is_unknown(&self) -> bool
pub fn is_unknown(&self) -> bool
Return true if this pattern has any UNKNOWN components.
Trait Implementations§
Source§impl Clone for ResourcePattern
impl Clone for ResourcePattern
Source§fn clone(&self) -> ResourcePattern
fn clone(&self) -> ResourcePattern
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ResourcePattern
impl Debug for ResourcePattern
Source§impl Display for ResourcePattern
impl Display for ResourcePattern
Source§impl Hash for ResourcePattern
impl Hash for ResourcePattern
Source§impl PartialEq for ResourcePattern
impl PartialEq for ResourcePattern
impl Eq for ResourcePattern
impl StructuralPartialEq for ResourcePattern
Auto Trait Implementations§
impl Freeze for ResourcePattern
impl RefUnwindSafe for ResourcePattern
impl Send for ResourcePattern
impl Sync for ResourcePattern
impl Unpin for ResourcePattern
impl UnsafeUnpin for ResourcePattern
impl UnwindSafe for ResourcePattern
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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more