MCPcopy Create free account
hub / github.com/cel-rust/cel-rust / main

Function main

example/src/variables.rs:3–10  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1use cel::{Context, Program};
2
3fn main() {
4 let program = Program::compile("foo * 2").unwrap();
5 let mut context = Context::default();
6 context.add_variable("foo", 10).unwrap();
7
8 let value = program.execute(&context).unwrap();
9 assert_eq!(value, 20.into());
10}

Callers

nothing calls this directly

Calls 2

add_variableMethod · 0.80
executeMethod · 0.80

Tested by

no test coverage detected