pub struct Checker<'a> { /* private fields */ }Expand description
Type checker for CEL expressions.
The checker takes raw data (variables, functions, container) rather than a type environment struct, making it independent and reusable.
Implementations§
Source§impl<'a> Checker<'a>
impl<'a> Checker<'a>
Sourcepub fn new(
variables: &HashMap<String, CelType>,
functions: &'a HashMap<String, FunctionDecl>,
container: &'a str,
) -> Self
pub fn new( variables: &HashMap<String, CelType>, functions: &'a HashMap<String, FunctionDecl>, container: &'a str, ) -> Self
Create a new type checker with the given data.
§Arguments
variables- Variable declarations (name -> type)functions- Function declarations indexed by namecontainer- Container namespace for qualified name resolution
Sourcepub fn with_proto_types(self, registry: &'a ProtoTypeRegistry) -> Self
pub fn with_proto_types(self, registry: &'a ProtoTypeRegistry) -> Self
Set the proto type registry for resolving protobuf types.
Sourcepub fn check(self, expr: &SpannedExpr) -> CheckResult
pub fn check(self, expr: &SpannedExpr) -> CheckResult
Type check an expression and return the result.
Auto Trait Implementations§
impl<'a> Freeze for Checker<'a>
impl<'a> RefUnwindSafe for Checker<'a>
impl<'a> Send for Checker<'a>
impl<'a> Sync for Checker<'a>
impl<'a> Unpin for Checker<'a>
impl<'a> UnwindSafe for Checker<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more