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
Explicit __expr escape; see notes on JSONValue::ExprEscape.
Deprecated since the 1.2 release; use
{ "__entity": { "type": "...", "id": "..." } } instead.
Fields
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
Convert an EntityUID to EntityUidJSON, using the ExplicitEntityEscape option
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
Convert an EntityUID to EntityUidJSON, using the ExplicitEntityEscape option
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§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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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