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 fordurationandtimestamptypes using thechronocrate (andchrono-tzfor IANA time zone arguments).regex: Enables support for regular expressions.json: Enables conversion between CEL values and JSON.ext_encoders(default): Enables theextensions::encodersextension library,base64.encodeandbase64.decode, using thebase64crate.
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
Envfrom a typed Rustfnitem, generating the arg-downcast and result-wrapping at expansion time. - add_
overload - Register a global (non-member) function overload on an
Envfrom a typed Rustfnitem, 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.
- Overload
Error - Details about an operator or function call for which no overload matched.
- Program
- Struct
Def - 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.
- Type
Registry - The types known to an
Env, by name.
Enums§
- Declaration
Error - An error declaring something in an
Envor aContext. - Execution
Error - Serialization
Error - Type
Decl - A type to register with an
Env, seeEnv::add_type.
Traits§
- Struct
Type - A struct type that expressions can construct, e.g.
acme.Account{id: 1}.