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
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
Sourcepub fn matches(&self, arn: &str) -> Result<bool, ArnError>
pub fn matches(&self, arn: &str) -> Result<bool, ArnError>
Check if any pattern matches the given ARN
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 matching_patterns(&self, arn: &str) -> Result<Vec<&str>, ArnError>
pub fn matching_patterns(&self, arn: &str) -> Result<Vec<&str>, ArnError>
Get all patterns that match the given ARN
Sourcepub fn filter_matching<'a>(
&self,
arns: &'a [String],
) -> Result<Vec<&'a str>, ArnError>
pub fn filter_matching<'a>( &self, arns: &'a [String], ) -> Result<Vec<&'a str>, ArnError>
Find ARNs from a collection that match any of our patterns
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