Enum cedar_policy_core::entities::EntityUidJSON
source · pub enum EntityUidJSON {
ExplicitExprEscape {
__expr: SmolStr,
},
ExplicitEntityEscape {
__entity: TypeAndId,
},
ImplicitExprEscape(SmolStr),
ImplicitEntityEscape(TypeAndId),
}
Expand description
Serde JSON format for Cedar values where we know we’re expecting an entity reference
Variants§
ExplicitExprEscape
Fields
Explicit __expr
escape; see notes on JSONValue::ExprEscape.
Deprecated since the 1.2 release; use
{ "__entity": { "type": "...", "id": "..." } }
instead.
ExplicitEntityEscape
Explicit __entity
escape; see notes on JSONValue::EntityEscape
ImplicitExprEscape(SmolStr)
Implicit __expr
escape, in which case we’ll just see a JSON string.
Deprecated since the 1.2 release; use
{ "type": "...", "id": "..." }
instead.
ImplicitEntityEscape(TypeAndId)
Implicit __entity
escape, in which case we’ll see just the TypeAndId
structure
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
) -> Result<EntityUID, JsonDeserializationError>
pub fn into_euid( self, ctx: impl Fn() -> JsonDeserializationErrorContext ) -> 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
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
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>,
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
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
source§impl PartialEq for EntityUidJSON
impl PartialEq for EntityUidJSON
source§fn eq(&self, other: &EntityUidJSON) -> bool
fn eq(&self, other: &EntityUidJSON) -> bool
self
and other
values to be equal, and is used
by ==
.