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
Constant: Literal constant valuesIdentExpr: Variable or identifier referencesSelectExpr: Field selection or presence testsCallExpr: Function or method callsListExpr: List literal expressionsStructExpr: Struct literal expressionsMapExpr: Map literal expressionsComprehensionExpr: Comprehension expressions for list/map processing
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
impl ExprKind
Sourcepub fn is_constant(&self) -> bool
pub fn is_constant(&self) -> bool
Returns true if this is a constant expression.
Sourcepub fn is_comprehension(&self) -> bool
pub fn is_comprehension(&self) -> bool
Returns true if this is a comprehension expression.
Sourcepub fn as_constant(&self) -> Option<&Constant>
pub fn as_constant(&self) -> Option<&Constant>
Returns a reference to the constant value if this is a constant expression.
Sourcepub fn as_ident(&self) -> Option<&IdentExpr>
pub fn as_ident(&self) -> Option<&IdentExpr>
Returns a reference to the identifier if this is an identifier expression.
Sourcepub fn as_select(&self) -> Option<&SelectExpr>
pub fn as_select(&self) -> Option<&SelectExpr>
Returns a reference to the select expression if this is a select expression.
Sourcepub fn as_call(&self) -> Option<&CallExpr>
pub fn as_call(&self) -> Option<&CallExpr>
Returns a reference to the call expression if this is a call expression.
Sourcepub fn as_list(&self) -> Option<&ListExpr>
pub fn as_list(&self) -> Option<&ListExpr>
Returns a reference to the list expression if this is a list expression.
Sourcepub fn as_struct(&self) -> Option<&StructExpr>
pub fn as_struct(&self) -> Option<&StructExpr>
Returns a reference to the struct expression if this is a struct expression.
Sourcepub fn as_map(&self) -> Option<&MapExpr>
pub fn as_map(&self) -> Option<&MapExpr>
Returns a reference to the map expression if this is a map expression.
Sourcepub fn as_comprehension(&self) -> Option<&ComprehensionExpr>
pub fn as_comprehension(&self) -> Option<&ComprehensionExpr>
Returns a reference to the comprehension expression if this is a comprehension expression.
Sourcepub fn as_constant_mut(&mut self) -> Option<&mut Constant>
pub fn as_constant_mut(&mut self) -> Option<&mut Constant>
Returns a mutable reference to the constant value if this is a constant expression.
Sourcepub fn as_ident_mut(&mut self) -> Option<&mut IdentExpr>
pub fn as_ident_mut(&mut self) -> Option<&mut IdentExpr>
Returns a mutable reference to the identifier if this is an identifier expression.
Sourcepub fn as_select_mut(&mut self) -> Option<&mut SelectExpr>
pub fn as_select_mut(&mut self) -> Option<&mut SelectExpr>
Returns a mutable reference to the select expression if this is a select expression.
Sourcepub fn as_call_mut(&mut self) -> Option<&mut CallExpr>
pub fn as_call_mut(&mut self) -> Option<&mut CallExpr>
Returns a mutable reference to the call expression if this is a call expression.
Sourcepub fn as_list_mut(&mut self) -> Option<&mut ListExpr>
pub fn as_list_mut(&mut self) -> Option<&mut ListExpr>
Returns a mutable reference to the list expression if this is a list expression.
Sourcepub fn as_struct_mut(&mut self) -> Option<&mut StructExpr>
pub fn as_struct_mut(&mut self) -> Option<&mut StructExpr>
Returns a mutable reference to the struct expression if this is a struct expression.
Sourcepub fn as_map_mut(&mut self) -> Option<&mut MapExpr>
pub fn as_map_mut(&mut self) -> Option<&mut MapExpr>
Returns a mutable reference to the map expression if this is a map expression.
Sourcepub fn as_comprehension_mut(&mut self) -> Option<&mut ComprehensionExpr>
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§
Auto Trait Implementations§
impl Freeze for ExprKind
impl RefUnwindSafe for ExprKind
impl Send for ExprKind
impl Sync for ExprKind
impl Unpin for ExprKind
impl UnwindSafe for ExprKind
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
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