Enum cedar_policy_core::est::ExprNoExt
source · pub enum ExprNoExt {
Show 28 variants
Value(CedarValueJson),
Var(Var),
Slot(SlotId),
Unknown {
name: SmolStr,
},
Not {
arg: Arc<Expr>,
},
Neg {
arg: Arc<Expr>,
},
Eq {
left: Arc<Expr>,
right: Arc<Expr>,
},
NotEq {
left: Arc<Expr>,
right: Arc<Expr>,
},
In {
left: Arc<Expr>,
right: Arc<Expr>,
},
Less {
left: Arc<Expr>,
right: Arc<Expr>,
},
LessEq {
left: Arc<Expr>,
right: Arc<Expr>,
},
Greater {
left: Arc<Expr>,
right: Arc<Expr>,
},
GreaterEq {
left: Arc<Expr>,
right: Arc<Expr>,
},
And {
left: Arc<Expr>,
right: Arc<Expr>,
},
Or {
left: Arc<Expr>,
right: Arc<Expr>,
},
Add {
left: Arc<Expr>,
right: Arc<Expr>,
},
Sub {
left: Arc<Expr>,
right: Arc<Expr>,
},
Mul {
left: Arc<Expr>,
right: Arc<Expr>,
},
Contains {
left: Arc<Expr>,
right: Arc<Expr>,
},
ContainsAll {
left: Arc<Expr>,
right: Arc<Expr>,
},
ContainsAny {
left: Arc<Expr>,
right: Arc<Expr>,
},
GetAttr {
left: Arc<Expr>,
attr: SmolStr,
},
HasAttr {
left: Arc<Expr>,
attr: SmolStr,
},
Like {
left: Arc<Expr>,
pattern: SmolStr,
},
Is {
left: Arc<Expr>,
entity_type: SmolStr,
in_expr: Option<Arc<Expr>>,
},
If {
cond_expr: Arc<Expr>,
then_expr: Arc<Expr>,
else_expr: Arc<Expr>,
},
Set(Vec<Expr>),
Record(HashMap<SmolStr, Expr>),
}
Expand description
Serde JSON structure for [any Cedar expression other than an extension function call] in the EST format
Variants§
Value(CedarValueJson)
Literal value (including anything that’s legal to express in the attribute-value JSON format)
Var(Var)
Var
Slot(SlotId)
Template slot
Unknown
Unknown (for partial evaluation)
Not
!
Neg
-
Eq
==
NotEq
!=
In
in
Less
<
LessEq
<=
Greater
>
GreaterEq
>=
And
&&
Or
||
Add
+
Sub
-
Mul
*
Contains
contains()
Fields
ContainsAll
containsAll()
Fields
ContainsAny
containsAny()
Fields
GetAttr
Get-attribute
HasAttr
has
Like
like
Is
<entity> is <entity_type> in <entity_or_entity_set>
Fields
If
Ternary
Fields
Set(Vec<Expr>)
Set literal, whose elements may be arbitrary expressions (which is why we need this case specifically and can’t just use Expr::Value)
Record(HashMap<SmolStr, Expr>)
Record literal, whose elements may be arbitrary expressions (which is why we need this case specifically and can’t just use Expr::Value)
Trait Implementations§
source§impl<'de> Deserialize<'de> for ExprNoExt
impl<'de> Deserialize<'de> for ExprNoExt
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 PartialEq for ExprNoExt
impl PartialEq for ExprNoExt
impl StructuralPartialEq for ExprNoExt
Auto Trait Implementations§
impl Freeze for ExprNoExt
impl RefUnwindSafe for ExprNoExt
impl Send for ExprNoExt
impl Sync for ExprNoExt
impl Unpin for ExprNoExt
impl UnwindSafe for ExprNoExt
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