Enum cedar_policy_core::entities::EntityUidJson
source · pub enum EntityUidJson {
ExplicitExprEscape {
__expr: String,
},
ExplicitEntityEscape {
__entity: TypeAndId,
},
ImplicitEntityEscape(TypeAndId),
FoundValue(Value),
}
Expand description
Serde JSON format for Cedar values where we know we’re expecting an entity reference
Variants§
ExplicitExprEscape
This was removed in 3.0 and is only here for generating nice error messages.
ExplicitEntityEscape
Explicit __entity
escape; see notes on CedarValueJson::EntityEscape
ImplicitEntityEscape(TypeAndId)
Implicit __entity
escape, in which case we’ll see just the TypeAndId
structure
FoundValue(Value)
Implicit catch-all case for error handling
Implementations§
source§impl EntityUidJson
impl EntityUidJson
sourcepub fn new(entity_type: impl Into<SmolStr>, id: impl Into<SmolStr>) -> Self
pub fn new(entity_type: impl Into<SmolStr>, id: impl Into<SmolStr>) -> Self
Construct an EntityUidJson
from entity type name and eid.
This will use the ImplicitEntityEscape
form, if it matters.
sourcepub fn into_euid(
self,
ctx: impl Fn() -> JsonDeserializationErrorContext + Clone
) -> Result<EntityUID, JsonDeserializationError>
pub fn into_euid( self, ctx: impl Fn() -> JsonDeserializationErrorContext + Clone ) -> Result<EntityUID, JsonDeserializationError>
Convert this EntityUidJson
into an EntityUID
Trait Implementations§
source§impl Clone for EntityUidJson
impl Clone for EntityUidJson
source§fn clone(&self) -> EntityUidJson
fn clone(&self) -> EntityUidJson
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 Debug for EntityUidJson
impl Debug for EntityUidJson
source§impl<'de> Deserialize<'de> for EntityUidJson
impl<'de> Deserialize<'de> for EntityUidJson
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 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 PartialEq for EntityUidJson
impl PartialEq for EntityUidJson
source§fn eq(&self, other: &EntityUidJson) -> bool
fn eq(&self, other: &EntityUidJson) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for EntityUidJson
impl Serialize for EntityUidJson
impl Eq for EntityUidJson
impl StructuralPartialEq for EntityUidJson
Auto Trait Implementations§
impl Freeze for EntityUidJson
impl RefUnwindSafe for EntityUidJson
impl Send for EntityUidJson
impl Sync for EntityUidJson
impl Unpin for EntityUidJson
impl UnwindSafe for EntityUidJson
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> 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