A custom CEL function, registered with CEL.Env.build/1's :functions
option. See the "Custom CEL functions" guide.
:name— the name expressions call it by.:modes— how it is called::global(f(x), the default),:receiver(x.f(y), wherexis the first argument), or{:namespace, "ns"}(ns.f(x)). A function may list several.:overloads— oneCEL.Function.Overloadper signature.
Other fields are used by CEL's built-in functions and may change.
Summary
Types
Used by CEL's built-in functions.
{Module, function}; the other forms are CEL's own.
Extra arguments an overload's :eval receives; see CEL.Function.Overload.
How expressions call a function; :intrinsic is for operators.
Used by CEL's built-in functions.
An argument or result type: a CEL.Type.t/0, or {:param, name} for a
type parameter. CEL's built-in functions use further forms.
Types
@type args() :: [pattern()]
@type combine() :: :assignable | :common
Used by CEL's built-in functions.
@type eval() :: nil | :intrinsic | {:mfa, mfa_target()} | mfa_target()
{Module, function}; the other forms are CEL's own.
@type eval_context() :: :types | :vars | :call
Extra arguments an overload's :eval receives; see CEL.Function.Overload.
@type mode() :: :global | :receiver | :intrinsic | {:namespace, String.t()}
How expressions call a function; :intrinsic is for operators.
@type on_dyn() :: :match | :fallback
Used by CEL's built-in functions.
@type pattern() :: CEL.Type.t() | {:param, String.t()} | builtin_pattern()
An argument or result type: a CEL.Type.t/0, or {:param, name} for a
type parameter. CEL's built-in functions use further forms.
@type result() :: pattern()
@type t() :: %CEL.Function{ dynamic_overloads: [CEL.Function.Overload.t()], modes: [mode()], name: String.t(), overloads: [CEL.Function.Overload.t()] }