Skip to main content

Module cel

Module cel 

Source
Expand description

Helpers used by compile-time-expanded CEL rules emitted by the plugin.

CEL rules are transpiled to native Rust at codegen time, so this module is a narrow support layer rather than an interpreter: scalar widening (CelScalar), Duration/Timestamp conversion (duration_from_secs_nanos, timestamp_from_secs_nanos), and the per-evaluation now binding (now_local).

Traits§

CelScalar
Width-converts a proto scalar (or enum wrapper) into CEL’s wide types (i64 / u64 / f64).

Functions§

duration_from_secs_nanos
Construct a chrono::Duration from a protobuf-shaped (seconds, nanos) pair (the wire format of google.protobuf.Duration).
now_local
Current wall-clock time as a chrono::DateTime<chrono::FixedOffset>.
parse_duration
Parse a CEL duration("…") string into a chrono::Duration.
parse_timestamp
Parse a CEL timestamp("…") string (RFC3339).
timestamp_from_secs_nanos
Construct a chrono::DateTime<chrono::FixedOffset> from a protobuf-shaped (seconds, nanos) pair (the wire format of google.protobuf.Timestamp).