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§
Source§impl 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§
Source§impl<'de> Deserialize<'de> for Principal
impl<'de> Deserialize<'de> for Principal
Source§fn 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
Source§impl From<SpecifiedPrincipal> for Principal
impl From<SpecifiedPrincipal> for Principal
Source§fn from(sp: SpecifiedPrincipal) -> Self
fn from(sp: SpecifiedPrincipal) -> Self
Converts to this type from the input type.
impl Eq for Principal
impl StructuralPartialEq for Principal
Auto Trait Implementations§
impl Freeze for Principal
impl RefUnwindSafe for Principal
impl Send for Principal
impl Sync for Principal
impl Unpin for Principal
impl UnwindSafe for Principal
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more