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
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
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§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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
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>
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