cel-interpreter 0.7.0

An interpreter for the Common Expression Language (CEL)
Documentation
1
2
3
4
5
6
7
8
9
use crate::context::Context;
use crate::objects::ResolveResult;
use crate::Program;

/// Tests the provided script and returns the result. An optional context can be provided.
pub(crate) fn test_script(script: &str, ctx: Option<Context>) -> ResolveResult {
    let program = Program::compile(script).unwrap();
    program.execute(&ctx.unwrap_or(Context::default()))
}