pub struct ArnMatcher { /* private fields */ }
Expand description
Advanced ARN matching capabilities for policy evaluation
Implementations§
Source§impl ArnMatcher
impl ArnMatcher
Sourcepub fn new<I>(patterns: I) -> Result<Self, ArnError>where
I: IntoIterator<Item = String>,
pub fn new<I>(patterns: I) -> Result<Self, ArnError>where
I: IntoIterator<Item = String>,
Create a new ARN matcher with a set of patterns
§Errors
Returns ArnError
if any of the provided patterns cannot be parsed as valid ARNs.
Sourcepub fn from_pattern(pattern: &str) -> Result<Self, ArnError>
pub fn from_pattern(pattern: &str) -> Result<Self, ArnError>
Create a matcher from a single pattern
§Errors
Returns ArnError
if the pattern cannot be parsed as a valid ARN.
Sourcepub fn matches(&self, arn: &Arn) -> Result<bool, ArnError>
pub fn matches(&self, arn: &Arn) -> Result<bool, ArnError>
Check if any pattern matches the given ARN
§Errors
Returns ArnError
if the ARN cannot be parsed or if pattern matching fails.
Sourcepub fn matches_arn(&self, arn: &Arn) -> bool
pub fn matches_arn(&self, arn: &Arn) -> bool
Check if any pattern matches the given parsed ARN
Sourcepub fn filter_matching<'a>(
&self,
arns: &'a [Arn],
) -> Result<Vec<&'a Arn>, ArnError>
pub fn filter_matching<'a>( &self, arns: &'a [Arn], ) -> Result<Vec<&'a Arn>, ArnError>
Find ARNs from a collection that match any of our patterns
§Errors
Returns ArnError
if any ARN in the collection cannot be parsed.
Sourcepub fn matches_all(&self) -> bool
pub fn matches_all(&self) -> bool
Check if this matcher would match everything (contains “*”)
Sourcepub fn combine(matchers: Vec<ArnMatcher>) -> Self
pub fn combine(matchers: Vec<ArnMatcher>) -> Self
Create a matcher that combines multiple matchers (OR logic)
Trait Implementations§
Source§impl Clone for ArnMatcher
impl Clone for ArnMatcher
Source§fn clone(&self) -> ArnMatcher
fn clone(&self) -> ArnMatcher
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 moreAuto Trait Implementations§
impl Freeze for ArnMatcher
impl RefUnwindSafe for ArnMatcher
impl Send for ArnMatcher
impl Sync for ArnMatcher
impl Unpin for ArnMatcher
impl UnwindSafe for ArnMatcher
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