pub trait CelScalar: Copy {
// Required methods
fn cel_int(self) -> i64;
fn cel_uint(self) -> u64;
fn cel_double(self) -> f64;
}Expand description
Width-converts a proto scalar (or enum wrapper) into CEL’s wide types
(i64 / u64 / f64).
Used by codegen-emitted native CEL bodies so a single emitted
comparison/arithmetic expression works regardless of the underlying Rust
representation (i32, u32, i64, u64, f32, f64, or
buffa::EnumValue<E>).
Required Methods§
Sourcefn cel_int(self) -> i64
fn cel_int(self) -> i64
Coerce to CEL’s int wide type. Numeric as-casts; for
EnumValue<E> returns i64::from(self.to_i32()).
Sourcefn cel_uint(self) -> u64
fn cel_uint(self) -> u64
Coerce to CEL’s uint wide type. Numeric as-casts; for floats
the cast truncates toward zero.
Sourcefn cel_double(self) -> f64
fn cel_double(self) -> f64
Coerce to CEL’s double wide type.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.