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

Function main

example/src/serde.rs:11–22  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

9}
10
11fn main() {
12 let program = Program::compile("foo.a == foo.b").unwrap();
13 let mut context = Context::default();
14
15 // MyStruct will be implicitly serialized into the CEL appropriate types
16 context
17 .add_variable("foo", MyStruct { a: 1, b: 1 })
18 .unwrap();
19
20 let value = program.execute(&context).unwrap();
21 assert_eq!(value, true.into());
22}

Callers

nothing calls this directly

Calls 2

add_variableMethod · 0.80
executeMethod · 0.80

Tested by

no test coverage detected