Skip to main content

Crate cel

Crate cel 

Source
Expand description

§CEL-Rust

A parser and interpreter for the Common Expression Language (CEL) in Rust.

common explains CEL’s type system: how values, types, operators and functions fit together, and how to add types of your own.

§Optional Features

  • chrono: Enables support for duration and timestamp types using the chrono crate (and chrono-tz for IANA time zone arguments).
  • regex: Enables support for regular expressions.
  • json: Enables conversion between CEL values and JSON.
  • ext_encoders (default): Enables the extensions::encoders extension library, base64.encode and base64.decode, using the base64 crate.

Re-exports§

pub use common::ast::IdedExpr;
pub use context::Context;
pub use functions::FunctionContext;
pub use objects::ResolveResult;
pub use objects::Value;
pub use parser::ParseError;
pub use parser::ParseErrors;

Modules§

common
The expression tree, ast, and CEL’s type system: how values, types, operators and functions fit together.
context
extensions
extractors
functions
objects
parser

Macros§

add_member_overload
Register a member-function overload on an Env from a typed Rust fn item, generating the arg-downcast and result-wrapping at expansion time.
add_overload
Register a global (non-member) function overload on an Env from a typed Rust fn item, generating the arg-downcast and result-wrapping at expansion time.
impl_conversions
impl_handler

Structs§

Duration
A wrapper Duration type which allows conversion to Value::Duration for types using automatic conversion with serde::Serialize.
Env
An environment for the CEL execution.
OverloadError
Details about an operator or function call for which no overload matched.
Program
StructDef
A definition for a custom struct type.
Timestamp
A wrapper Timestamp type which allows conversion to Value::Timestamp for types using automatic conversion with serde::Serialize.
TypeRegistry
The types known to an Env, by name.

Enums§

DeclarationError
An error declaring something in an Env or a Context.
ExecutionError
SerializationError
TypeDecl
A type to register with an Env, see Env::add_type.

Traits§

StructType
A struct type that expressions can construct, e.g. acme.Account{id: 1}.

Functions§

to_value