ExprKind

Enum ExprKind 

Source
pub enum ExprKind {
    Constant(Constant),
    Ident(IdentExpr),
    Select(SelectExpr),
    Call(CallExpr),
    List(ListExpr),
    Struct(StructExpr),
    Map(MapExpr),
    Comprehension(ComprehensionExpr),
}
Expand description

The kind/type of a CEL expression.

ExprKind is an enum representing all possible expression types in CEL. Each variant contains the specific data for that expression type.

§Variants

Variants§

§

Constant(Constant)

A constant literal value.

§

Ident(IdentExpr)

An identifier reference.

§

Select(SelectExpr)

A field selection or presence test.

§

Call(CallExpr)

A function or method call.

§

List(ListExpr)

A list literal.

§

Struct(StructExpr)

A struct literal.

§

Map(MapExpr)

A map literal.

§

Comprehension(ComprehensionExpr)

A comprehension expression.

Implementations§

Source§

impl ExprKind

Source

pub fn is_constant(&self) -> bool

Returns true if this is a constant expression.

Source

pub fn is_ident(&self) -> bool

Returns true if this is an identifier expression.

Source

pub fn is_select(&self) -> bool

Returns true if this is a select expression.

Source

pub fn is_call(&self) -> bool

Returns true if this is a call expression.

Source

pub fn is_list(&self) -> bool

Returns true if this is a list expression.

Source

pub fn is_struct(&self) -> bool

Returns true if this is a struct expression.

Source

pub fn is_map(&self) -> bool

Returns true if this is a map expression.

Source

pub fn is_comprehension(&self) -> bool

Returns true if this is a comprehension expression.

Source

pub fn as_constant(&self) -> Option<&Constant>

Returns a reference to the constant value if this is a constant expression.

Source

pub fn as_ident(&self) -> Option<&IdentExpr>

Returns a reference to the identifier if this is an identifier expression.

Source

pub fn as_select(&self) -> Option<&SelectExpr>

Returns a reference to the select expression if this is a select expression.

Source

pub fn as_call(&self) -> Option<&CallExpr>

Returns a reference to the call expression if this is a call expression.

Source

pub fn as_list(&self) -> Option<&ListExpr>

Returns a reference to the list expression if this is a list expression.

Source

pub fn as_struct(&self) -> Option<&StructExpr>

Returns a reference to the struct expression if this is a struct expression.

Source

pub fn as_map(&self) -> Option<&MapExpr>

Returns a reference to the map expression if this is a map expression.

Source

pub fn as_comprehension(&self) -> Option<&ComprehensionExpr>

Returns a reference to the comprehension expression if this is a comprehension expression.

Source

pub fn as_constant_mut(&mut self) -> Option<&mut Constant>

Returns a mutable reference to the constant value if this is a constant expression.

Source

pub fn as_ident_mut(&mut self) -> Option<&mut IdentExpr>

Returns a mutable reference to the identifier if this is an identifier expression.

Source

pub fn as_select_mut(&mut self) -> Option<&mut SelectExpr>

Returns a mutable reference to the select expression if this is a select expression.

Source

pub fn as_call_mut(&mut self) -> Option<&mut CallExpr>

Returns a mutable reference to the call expression if this is a call expression.

Source

pub fn as_list_mut(&mut self) -> Option<&mut ListExpr>

Returns a mutable reference to the list expression if this is a list expression.

Source

pub fn as_struct_mut(&mut self) -> Option<&mut StructExpr>

Returns a mutable reference to the struct expression if this is a struct expression.

Source

pub fn as_map_mut(&mut self) -> Option<&mut MapExpr>

Returns a mutable reference to the map expression if this is a map expression.

Source

pub fn as_comprehension_mut(&mut self) -> Option<&mut ComprehensionExpr>

Returns a mutable reference to the comprehension expression if this is a comprehension expression.

Trait Implementations§

Source§

impl Debug for ExprKind

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

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
§

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

§

type Error = Infallible

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

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

Performs the conversion.
§

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

§

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

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

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

Performs the conversion.