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

Method add_function

cel/src/context.rs:198–205  ·  view source on GitHub ↗
(&mut self, name: &str, value: F)

Source from the content-addressed store, hash-verified

196 }
197
198 pub fn add_function<T: 'static, F>(&mut self, name: &str, value: F)
199 where
200 F: IntoFunction<T> + 'static + Send + Sync,
201 {
202 if let Context::Root { functions, .. } = self {
203 functions.add(name, value);
204 };
205 }
206
207 pub fn resolve(&self, expr: &Expression) -> Result<Value, ExecutionError> {
208 Value::resolve(expr, self)

Callers 4

mainFunction · 0.80
test_maxFunction · 0.80
test_minFunction · 0.80
test_opaque_fnFunction · 0.80

Calls 1

addMethod · 0.45

Tested by 3

test_maxFunction · 0.64
test_minFunction · 0.64
test_opaque_fnFunction · 0.64