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) -> &ArnSegmentPattern
pub fn partition(&self) -> &ArnSegmentPattern
Retreive the pattern for the partition.
sourcepub fn service(&self) -> &ArnSegmentPattern
pub fn service(&self) -> &ArnSegmentPattern
Retrieve the pattern for the service.
sourcepub fn region(&self) -> &ArnSegmentPattern
pub fn region(&self) -> &ArnSegmentPattern
Retrieve the pattern for the region.
sourcepub fn account_id(&self) -> &ArnSegmentPattern
pub fn account_id(&self) -> &ArnSegmentPattern
Retrieve the pattern for the account ID.
sourcepub fn resource(&self) -> &ArnSegmentPattern
pub fn resource(&self) -> &ArnSegmentPattern
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 · sourcefn clone_from(&mut self, source: &Self)
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