Enum cedar_policy_core::est::ExprNoExt

source ·
pub enum ExprNoExt {
Show 27 variants Value(JSONValue), 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, }, 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(JSONValue)

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)

Fields

§name: SmolStr

Name of the unknown

§

Not

!

Fields

§arg: Arc<Expr>

Argument

§

Neg

-

Fields

§arg: Arc<Expr>

Argument

§

Eq

==

Fields

§left: Arc<Expr>

Left-hand argument

§right: Arc<Expr>

Right-hand argument

§

NotEq

!=

Fields

§left: Arc<Expr>

Left-hand argument

§right: Arc<Expr>

Right-hand argument

§

In

in

Fields

§left: Arc<Expr>

Left-hand argument

§right: Arc<Expr>

Right-hand argument

§

Less

<

Fields

§left: Arc<Expr>

Left-hand argument

§right: Arc<Expr>

Right-hand argument

§

LessEq

<=

Fields

§left: Arc<Expr>

Left-hand argument

§right: Arc<Expr>

Right-hand argument

§

Greater

>

Fields

§left: Arc<Expr>

Left-hand argument

§right: Arc<Expr>

Right-hand argument

§

GreaterEq

>=

Fields

§left: Arc<Expr>

Left-hand argument

§right: Arc<Expr>

Right-hand argument

§

And

&&

Fields

§left: Arc<Expr>

Left-hand argument

§right: Arc<Expr>

Right-hand argument

§

Or

||

Fields

§left: Arc<Expr>

Left-hand argument

§right: Arc<Expr>

Right-hand argument

§

Add

+

Fields

§left: Arc<Expr>

Left-hand argument

§right: Arc<Expr>

Right-hand argument

§

Sub

-

Fields

§left: Arc<Expr>

Left-hand argument

§right: Arc<Expr>

Right-hand argument

§

Mul

*

Fields

§left: Arc<Expr>

Left-hand argument

§right: Arc<Expr>

Right-hand argument

§

Contains

contains()

Fields

§left: Arc<Expr>

Left-hand argument (receiver)

§right: Arc<Expr>

Right-hand argument (inside the ())

§

ContainsAll

containsAll()

Fields

§left: Arc<Expr>

Left-hand argument (receiver)

§right: Arc<Expr>

Right-hand argument (inside the ())

§

ContainsAny

containsAny()

Fields

§left: Arc<Expr>

Left-hand argument (receiver)

§right: Arc<Expr>

Right-hand argument (inside the ())

§

GetAttr

Get-attribute

Fields

§left: Arc<Expr>

Left-hand argument

§attr: SmolStr

Attribute name

§

HasAttr

has

Fields

§left: Arc<Expr>

Left-hand argument

§attr: SmolStr

Attribute name

§

Like

like

Fields

§left: Arc<Expr>

Left-hand argument

§pattern: SmolStr

Pattern

§

If

Ternary

Fields

§cond_expr: Arc<Expr>

Condition

§then_expr: Arc<Expr>

then expression

§else_expr: Arc<Expr>

else expression

§

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 Clone for ExprNoExt

source§

fn clone(&self) -> ExprNoExt

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ExprNoExt

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for ExprNoExt

source§

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

source§

fn eq(&self, other: &ExprNoExt) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for ExprNoExt

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl StructuralPartialEq for ExprNoExt

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
source§

impl<T> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,