Struct cedar_policy_core::ast::EntityUID
source · pub struct EntityUID { /* private fields */ }
Expand description
Unique ID for an entity. These represent entities in the AST.
Implementations§
source§impl EntityUID
impl EntityUID
sourcepub fn with_eid_and_type(typename: &str, eid: &str) -> Result<Self, ParseErrors>
pub fn with_eid_and_type(typename: &str, eid: &str) -> Result<Self, ParseErrors>
Create an EntityUID
with the given (unqualified) typename, and the given string as its EID.
sourcepub fn components(self) -> (EntityType, Eid)
pub fn components(self) -> (EntityType, Eid)
Split into the EntityType
representing the entity type, and the Eid
representing its name
sourcepub fn from_components(name: Name, eid: Eid) -> Self
pub fn from_components(name: Name, eid: Eid) -> Self
Create a nominally-typed EntityUID
with the given typename and EID
sourcepub fn unspecified_from_eid(eid: Eid) -> Self
pub fn unspecified_from_eid(eid: Eid) -> Self
Create an unspecified EntityUID
with the given EID
sourcepub fn entity_type(&self) -> &EntityType
pub fn entity_type(&self) -> &EntityType
Get the type component.
Trait Implementations§
source§impl<'de> Deserialize<'de> for EntityUID
impl<'de> Deserialize<'de> for EntityUID
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<&EntityUID> for EntityUidJSON
impl From<&EntityUID> for EntityUidJSON
Convert an EntityUID to EntityUidJSON, using the ExplicitEntityEscape option
source§fn from(uid: &EntityUID) -> EntityUidJSON
fn from(uid: &EntityUID) -> EntityUidJSON
Converts to this type from the input type.
source§impl From<EntityUID> for EntityReference
impl From<EntityUID> for EntityReference
source§impl From<EntityUID> for EntityUidJSON
impl From<EntityUID> for EntityUidJSON
Convert an EntityUID to EntityUidJSON, using the ExplicitEntityEscape option
source§fn from(uid: EntityUID) -> EntityUidJSON
fn from(uid: EntityUID) -> EntityUidJSON
Converts to this type from the input type.
source§impl FromNormalizedStr for EntityUID
impl FromNormalizedStr for EntityUID
source§fn describe_self() -> &'static str
fn describe_self() -> &'static str
Short string description of the
Self
type, to be used in error messages.
What are we trying to parse?source§fn from_normalized_str(s: &str) -> Result<Self, ParseErrors>
fn from_normalized_str(s: &str) -> Result<Self, ParseErrors>
Create a
Self
by parsing a string, which is required to be normalized.
That is, the input is required to roundtrip with the Display
impl on Self
:
Self::from_normalized_str(x).to_string() == x
must hold. Read moresource§impl Ord for EntityUID
impl Ord for EntityUID
source§impl PartialOrd for EntityUID
impl PartialOrd for EntityUID
source§impl TCNode<EntityUID> for Entity
impl TCNode<EntityUID> for Entity
source§fn add_edge_to(&mut self, k: EntityUID)
fn add_edge_to(&mut self, k: EntityUID)
Add an edge out off this node to the node with key
k
.source§fn out_edges(&self) -> Box<dyn Iterator<Item = &EntityUID> + '_>
fn out_edges(&self) -> Box<dyn Iterator<Item = &EntityUID> + '_>
Retrieve an iterator for the edges out of this node.
source§fn has_edge_to(&self, e: &EntityUID) -> bool
fn has_edge_to(&self, e: &EntityUID) -> bool
Return true when their is an edge between this node and the node with
key
k
.impl Eq for EntityUID
impl StructuralPartialEq for EntityUID
Auto Trait Implementations§
impl Freeze for EntityUID
impl RefUnwindSafe for EntityUID
impl Send for EntityUID
impl Sync for EntityUID
impl Unpin for EntityUID
impl UnwindSafe for EntityUID
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