pub enum PrincipalOrResourceConstraint {
Any,
In(EntityReference),
Eq(EntityReference),
}
Expand description
Represents the constraints for principals and resources.
Can either not constrain, or constrain via ==
or in
for a single entity literal.
Variants§
Any
Unconstrained
In(EntityReference)
Hierarchical constraint
Eq(EntityReference)
Equality constraint
Implementations§
source§impl PrincipalOrResourceConstraint
impl PrincipalOrResourceConstraint
sourcepub fn is_eq_slot() -> Self
pub fn is_eq_slot() -> Self
Constrained to equal a slot
sourcepub fn is_in_slot() -> Self
pub fn is_in_slot() -> Self
Constrained to be in a slot
sourcepub fn as_expr(&self, v: PrincipalOrResource) -> Expr
pub fn as_expr(&self, v: PrincipalOrResource) -> Expr
sourcepub fn display(&self, v: PrincipalOrResource) -> String
pub fn display(&self, v: PrincipalOrResource) -> String
sourcepub fn iter_euids(&self) -> impl Iterator<Item = &EntityUID>
pub fn iter_euids(&self) -> impl Iterator<Item = &EntityUID>
Get an iterator over all of the entity uids in this constraint.
Trait Implementations§
source§impl Clone for PrincipalOrResourceConstraint
impl Clone for PrincipalOrResourceConstraint
source§fn clone(&self) -> PrincipalOrResourceConstraint
fn clone(&self) -> PrincipalOrResourceConstraint
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<'de> Deserialize<'de> for PrincipalOrResourceConstraint
impl<'de> Deserialize<'de> for PrincipalOrResourceConstraint
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<PrincipalOrResourceConstraint> for PrincipalConstraint
impl From<PrincipalOrResourceConstraint> for PrincipalConstraint
source§fn from(constraint: PrincipalOrResourceConstraint) -> PrincipalConstraint
fn from(constraint: PrincipalOrResourceConstraint) -> PrincipalConstraint
Converts to this type from the input type.
source§impl From<PrincipalOrResourceConstraint> for ResourceConstraint
impl From<PrincipalOrResourceConstraint> for ResourceConstraint
source§fn from(constraint: PrincipalOrResourceConstraint) -> ResourceConstraint
fn from(constraint: PrincipalOrResourceConstraint) -> ResourceConstraint
Converts to this type from the input type.
source§impl Hash for PrincipalOrResourceConstraint
impl Hash for PrincipalOrResourceConstraint
source§impl PartialEq for PrincipalOrResourceConstraint
impl PartialEq for PrincipalOrResourceConstraint
source§fn eq(&self, other: &PrincipalOrResourceConstraint) -> bool
fn eq(&self, other: &PrincipalOrResourceConstraint) -> bool
Tests for
self
and other
values to be equal, and is used by ==
.source§impl TryFrom<PrincipalConstraint> for PrincipalOrResourceConstraint
impl TryFrom<PrincipalConstraint> for PrincipalOrResourceConstraint
source§type Error = EstToAstError
type Error = EstToAstError
The type returned in the event of a conversion error.
source§fn try_from(
constraint: PrincipalConstraint,
) -> Result<PrincipalOrResourceConstraint, EstToAstError>
fn try_from( constraint: PrincipalConstraint, ) -> Result<PrincipalOrResourceConstraint, EstToAstError>
Performs the conversion.
source§impl TryFrom<ResourceConstraint> for PrincipalOrResourceConstraint
impl TryFrom<ResourceConstraint> for PrincipalOrResourceConstraint
source§type Error = EstToAstError
type Error = EstToAstError
The type returned in the event of a conversion error.
source§fn try_from(
constraint: ResourceConstraint,
) -> Result<PrincipalOrResourceConstraint, EstToAstError>
fn try_from( constraint: ResourceConstraint, ) -> Result<PrincipalOrResourceConstraint, EstToAstError>
Performs the conversion.
impl Eq for PrincipalOrResourceConstraint
impl StructuralPartialEq for PrincipalOrResourceConstraint
Auto Trait Implementations§
impl Freeze for PrincipalOrResourceConstraint
impl RefUnwindSafe for PrincipalOrResourceConstraint
impl Send for PrincipalOrResourceConstraint
impl Sync for PrincipalOrResourceConstraint
impl Unpin for PrincipalOrResourceConstraint
impl UnwindSafe for PrincipalOrResourceConstraint
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more