Function cel_interpreter::functions::has

source ·
pub fn has(ftx: &FunctionContext<'_>) -> Result<Value, ExecutionError>
Expand description

Returns true if the provided argument can be resolved. This function is useful for checking if a property exists on a type before attempting to resolve it. Resolving a property that does not exist will result in a ExecutionError::NoSuchKey error.

Operates similar to the has macro describe in the Go CEL implementation spec: https://github.com/google/cel-spec/blob/master/doc/langdef.md#macros.

§Examples

has(foo.bar.baz)