Enum scratchstack_aspen::Principal
source · [−]pub enum Principal {
Any,
Specified(SpecifiedPrincipal),
}Expand description
A principal statement in an Aspen policy.
Principal enums are immutable.
Variants
Any
Any principal (wildcard: *)
Specified(SpecifiedPrincipal)
A set of principals specified by a source and a list of identifiers for that source.
Implementations
sourceimpl Principal
impl Principal
sourcepub fn is_any(&self) -> bool
pub fn is_any(&self) -> bool
Indicates whether this Principal is Principal::Any.
sourcepub fn specified(&self) -> Option<&SpecifiedPrincipal>
pub fn specified(&self) -> Option<&SpecifiedPrincipal>
If this Principal is Principal::Specified, returns the SpecifiedPrincipal. Otherwise returns None.
sourcepub fn matches(&self, actor: &PrincipalActor) -> bool
pub fn matches(&self, actor: &PrincipalActor) -> bool
Indicates whether this Principal matches an identity from the PrincipalActor.
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Principal
impl<'de> Deserialize<'de> for Principal
sourcefn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl From<SpecifiedPrincipal> for Principal
impl From<SpecifiedPrincipal> for Principal
sourcefn from(sp: SpecifiedPrincipal) -> Self
fn from(sp: SpecifiedPrincipal) -> Self
Converts to this type from the input type.
impl Eq for Principal
impl StructuralEq for Principal
impl StructuralPartialEq for Principal
Auto Trait Implementations
impl RefUnwindSafe for Principal
impl Send for Principal
impl Sync for Principal
impl Unpin for Principal
impl UnwindSafe for Principal
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