StatementBuilder

Struct StatementBuilder 

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

A Statement builder, used with PolicyBuilder::evaluate_statement().

Implementations§

Source§

impl StatementBuilder

Source

pub fn new() -> Self

Create a new, empty, statement builder

Source

pub fn named(&mut self, sid: &str) -> &mut Self

Set the id of this statement

Source

pub fn auto_named(&mut self) -> &mut Self

Set the id of this statement to a randomly generate value.

Source

pub fn allows(&mut self) -> &mut Self

Set the effect of this statement to Allow.

Source

pub fn does_not_allow(&mut self) -> &mut Self

Set the effect of this statement to Deny.

Source

pub fn unspecified_principals(&mut self) -> &mut Self

Unsets the principal associated with this statement

Source

pub fn any_principal(&mut self, p_type: PrincipalType) -> &mut Self

Sets the principal of this statement to be a wildcard.

Source

pub fn only_this_principal( &mut self, p_type: PrincipalType, arn: &str, ) -> &mut Self

Sets the principal of this statement to be only this value.

Source

pub fn only_these_principals( &mut self, p_type: PrincipalType, arns: Vec<&str>, ) -> &mut Self

Sets the principal of this statement to be any of these values.

Source

pub fn not_this_principal( &mut self, p_type: PrincipalType, arn: &str, ) -> &mut Self

Sets the principal of this statement to exclude this value.

Source

pub fn not_these_principals( &mut self, p_type: PrincipalType, arns: Vec<&str>, ) -> &mut Self

Sets the principal of this statement to exclude of these values.

Source

pub fn may_perform_any_action(&mut self) -> &mut Self

Sets the action of this statement to be a wildcard.

Source

pub fn may_perform_action(&mut self, action: &str) -> &mut Self

Sets the action of this statement to be only this value.

Source

pub fn may_perform_actions(&mut self, actions: Vec<&str>) -> &mut Self

Sets the action of this statement to be any of these values.

Source

pub fn may_perform_no_action(&mut self) -> &mut Self

Sets the action of this statement to exclude the wildcard.

Source

pub fn may_not_perform_action(&mut self, action: &str) -> &mut Self

Sets the action of this statement to exclude this value.

Source

pub fn may_not_perform_actions(&mut self, actions: Vec<&str>) -> &mut Self

Sets the action of this statement to exclude any of these values.

Source

pub fn on_any_resource(&mut self) -> &mut Self

Sets the resource of this statement to be a wildcard.

Source

pub fn on_resource(&mut self, resource: &str) -> &mut Self

Sets the resource of this statement to be only this value.

Source

pub fn on_resources(&mut self, resources: Vec<&str>) -> &mut Self

Sets the resource of this statement to be any of these values.

Source

pub fn on_no_resource(&mut self) -> &mut Self

Sets the resource of this statement to exclude the wildcard.

Source

pub fn not_on_resource(&mut self, resource: &str) -> &mut Self

Sets the resource of this statement to exclude this value.

Source

pub fn not_on_resources(&mut self, resources: Vec<&str>) -> &mut Self

Sets the resource of this statement to exclude any of these values.

Source

pub fn if_condition(&mut self, condition: &mut ConditionBuilder) -> &mut Self

Adds this condition to the statement.

Trait Implementations§

Source§

impl Clone for StatementBuilder

Source§

fn clone(&self) -> StatementBuilder

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for StatementBuilder

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for StatementBuilder

Source§

fn default() -> Self

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

impl From<&mut StatementBuilder> for Statement

Source§

fn from(sb: &mut StatementBuilder) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.