Struct ArnSet

Source
pub struct ArnSet { /* private fields */ }
Expand description

ARN set operations for working with collections of ARNs

Implementations§

Source§

impl ArnSet

Source

pub fn new() -> Self

Create a new ARN set

Source

pub fn from_arns<I>(arns: I) -> Result<Self, ArnError>
where I: IntoIterator<Item = String>,

Create from a collection of ARNs

§Errors

Returns ArnError if any of the provided ARNs are invalid.

Source

pub fn add(&mut self, arn: String) -> Result<(), ArnError>

Add an ARN to the set (validates it first)

§Errors

Returns ArnError if the ARN is invalid.

Source

pub fn contains(&self, arn: &str) -> bool

Check if the set contains an ARN

Source

pub fn filter_by_patterns( &self, patterns: &[String], ) -> Result<Vec<&str>, ArnError>

Get ARNs that match any of the given patterns

§Errors

Returns ArnError if any ARN in the set is invalid.

Source

pub fn filter_by_service(&self, service: &str) -> Result<Vec<&str>, ArnError>

Get all ARNs for a specific service

§Errors

Returns ArnError if any ARN in the set is invalid.

Source

pub fn filter_by_account(&self, account_id: &str) -> Result<Vec<&str>, ArnError>

Get all ARNs for a specific account

§Errors

Returns ArnError if any ARN in the set is invalid.

Source

pub fn len(&self) -> usize

Get the number of ARNs in the set

Source

pub fn is_empty(&self) -> bool

Check if the set is empty

Source

pub fn to_vec(&self) -> Vec<&str>

Get all ARNs as a vector

Trait Implementations§

Source§

impl Default for ArnSet

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Freeze for ArnSet

§

impl RefUnwindSafe for ArnSet

§

impl Send for ArnSet

§

impl Sync for ArnSet

§

impl Unpin for ArnSet

§

impl UnwindSafe for ArnSet

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.