Struct scratchstack_arn::ArnPattern
source · [−]pub struct ArnPattern { /* private fields */ }
Expand description
An Amazon Resource Name (ARN) statement in an IAM Aspen policy.
This is used to match Arn objects from a resource statement in the IAM Aspen policy language. For example,
an ArnPattern created from arn:aws*:ec2:us-*-?:123456789012:instance/i-*
would match the following Arn
objects:
arn:aws:ec2:us-east-1:123456789012:instance/i-1234567890abcdef0
arn:aws-us-gov:ec2:us-west-2:123456789012:instance/i-1234567890abcdef0
Patterns are similar to glob statements with a few differences:
- The
*
character matches any number of characters, including none, within a single segment of the ARN. - The
?
character matches any single character within a single segment of the ARN.
ArnPattern objects are immutable.
Implementations
sourceimpl ArnPattern
impl ArnPattern
sourcepub fn new(
partition: &str,
service: &str,
region: &str,
account_id: &str,
resource: &str
) -> Self
pub fn new(
partition: &str,
service: &str,
region: &str,
account_id: &str,
resource: &str
) -> Self
Create a new ARN pattern from the specified components.
partition
- The partition the resource is in.service
- The service the resource belongs to.region
- The region the resource is in.account_id
- The account ID the resource belongs to.resource
- The resource name.
sourcepub fn partition(&self) -> &GlobPattern
pub fn partition(&self) -> &GlobPattern
Retreive the pattern for the partition.
sourcepub fn service(&self) -> &GlobPattern
pub fn service(&self) -> &GlobPattern
Retrieve the pattern for the service.
sourcepub fn region(&self) -> &GlobPattern
pub fn region(&self) -> &GlobPattern
Retrieve the pattern for the region.
sourcepub fn account_id(&self) -> &GlobPattern
pub fn account_id(&self) -> &GlobPattern
Retrieve the pattern for the account ID.
sourcepub fn resource(&self) -> &GlobPattern
pub fn resource(&self) -> &GlobPattern
Retrieve the pattern for the resource.
Trait Implementations
sourceimpl Clone for ArnPattern
impl Clone for ArnPattern
sourcefn clone(&self) -> ArnPattern
fn clone(&self) -> ArnPattern
Returns a copy of the value. Read more
1.0.0 · sourceconst fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for ArnPattern
impl Debug for ArnPattern
sourceimpl Display for ArnPattern
impl Display for ArnPattern
sourceimpl FromStr for ArnPattern
impl FromStr for ArnPattern
sourceimpl Hash for ArnPattern
impl Hash for ArnPattern
sourceimpl PartialEq<ArnPattern> for ArnPattern
impl PartialEq<ArnPattern> for ArnPattern
sourcefn eq(&self, other: &ArnPattern) -> bool
fn eq(&self, other: &ArnPattern) -> bool
impl Eq for ArnPattern
impl StructuralEq for ArnPattern
impl StructuralPartialEq for ArnPattern
Auto Trait Implementations
impl RefUnwindSafe for ArnPattern
impl Send for ArnPattern
impl Sync for ArnPattern
impl Unpin for ArnPattern
impl UnwindSafe for ArnPattern
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more