Struct cedar_policy::Entity
source · #[repr(transparent)]pub struct Entity(_);
Expand description
Entity datatype
Implementations§
source§impl Entity
impl Entity
sourcepub fn new(
uid: EntityUid,
attrs: HashMap<String, RestrictedExpression>,
parents: HashSet<EntityUid>
) -> Self
pub fn new( uid: EntityUid, attrs: HashMap<String, RestrictedExpression>, parents: HashSet<EntityUid> ) -> Self
Create a new Entity
with this Uid, attributes, and parents.
Attribute values are specified here as “restricted expressions”.
See docs on RestrictedExpression
sourcepub fn with_uid(uid: EntityUid) -> Self
pub fn with_uid(uid: EntityUid) -> Self
Create a new Entity
with this Uid, no attributes, and no parents.
sourcepub fn attr(&self, attr: &str) -> Option<Result<EvalResult, EvaluationError>>
pub fn attr(&self, attr: &str) -> Option<Result<EvalResult, EvaluationError>>
Get the value for the given attribute, or None
if not present.
This can also return Some(Err) if the attribute had an illegal value.
Trait Implementations§
source§impl PartialEq<Entity> for Entity
impl PartialEq<Entity> for Entity
impl Eq for Entity
impl StructuralEq for Entity
impl StructuralPartialEq for Entity
Auto Trait Implementations§
impl RefUnwindSafe for Entity
impl Send for Entity
impl Sync for Entity
impl Unpin for Entity
impl UnwindSafe for Entity
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
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.