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

Function optional_value

cel/src/functions.rs:241–246  ·  view source on GitHub ↗
(This(this): This<Value>)

Source from the content-addressed store, hash-verified

239 }
240}
241pub fn optional_value(This(this): This<Value>) -> Result<Value> {
242 <&OptionalValue>::try_from(&this)?
243 .value()
244 .cloned()
245 .ok_or_else(|| ExecutionError::function_error("value", "optional.none() dereference"))
246}
247
248pub fn optional_has_value(This(this): This<Value>) -> Result<bool> {
249 Ok(<&OptionalValue>::try_from(&this)?.value().is_some())

Callers

nothing calls this directly

Calls 1

valueMethod · 0.80

Tested by

no test coverage detected