pub enum EntityUidJson<Context = NoStaticContext> {
ExplicitExprEscape {
__expr: String,
context: PhantomData<Context>,
},
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.
Fields
§
context: PhantomData<Context>Phantom value for the Context type parameter
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<C: DeserializationContext> EntityUidJson<C>
impl<C: DeserializationContext> EntityUidJson<C>
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,
dynamic_ctx: impl Fn() -> JsonDeserializationErrorContext + Clone,
) -> Result<EntityUID, JsonDeserializationError>
pub fn into_euid( self, dynamic_ctx: impl Fn() -> JsonDeserializationErrorContext + Clone, ) -> Result<EntityUID, JsonDeserializationError>
Convert this EntityUidJson into an EntityUID
Trait Implementations§
Source§impl<Context: Clone> Clone for EntityUidJson<Context>
impl<Context: Clone> Clone for EntityUidJson<Context>
Source§fn clone(&self) -> EntityUidJson<Context>
fn clone(&self) -> EntityUidJson<Context>
Returns a duplicate 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<Context: Debug> Debug for EntityUidJson<Context>
impl<Context: Debug> Debug for EntityUidJson<Context>
Source§impl<'de, Context> Deserialize<'de> for EntityUidJson<Context>
impl<'de, Context> Deserialize<'de> for EntityUidJson<Context>
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<'de, C: DeserializationContext> DeserializeAs<'de, EntityUID> for EntityUidJson<C>
impl<'de, C: DeserializationContext> DeserializeAs<'de, EntityUID> for EntityUidJson<C>
Source§fn deserialize_as<D>(deserializer: D) -> Result<EntityUID, D::Error>where
D: Deserializer<'de>,
fn deserialize_as<D>(deserializer: D) -> Result<EntityUID, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer.
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
Converts to this type from the input type.
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
Converts to this type from the input type.
Source§impl<Context: PartialEq> PartialEq for EntityUidJson<Context>
impl<Context: PartialEq> PartialEq for EntityUidJson<Context>
Source§impl<Context> Serialize for EntityUidJson<Context>
impl<Context> Serialize for EntityUidJson<Context>
Source§impl<C> SerializeAs<EntityUID> for EntityUidJson<C>
impl<C> SerializeAs<EntityUID> for EntityUidJson<C>
Source§fn serialize_as<S>(source: &EntityUID, serializer: S) -> Result<S::Ok, S::Error>where
S: Serializer,
fn serialize_as<S>(source: &EntityUID, serializer: S) -> Result<S::Ok, S::Error>where
S: Serializer,
Serialize this value into the given Serde serializer.
impl<Context: Eq> Eq for EntityUidJson<Context>
impl<Context> StructuralPartialEq for EntityUidJson<Context>
Auto Trait Implementations§
impl<Context> Freeze for EntityUidJson<Context>
impl<Context> RefUnwindSafe for EntityUidJson<Context>where
Context: RefUnwindSafe,
impl<Context> Send for EntityUidJson<Context>where
Context: Send,
impl<Context> Sync for EntityUidJson<Context>where
Context: Sync,
impl<Context> Unpin for EntityUidJson<Context>where
Context: Unpin,
impl<Context> UnwindSafe for EntityUidJson<Context>where
Context: UnwindSafe,
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§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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