CEL.Field (CEL v0.2.0)

Copy Markdown View Source

A field of a message type, as a CEL.TypeProvider describes it.

  • :name — the field's name, as expressions select it.
  • :type — its CEL.Type.t/0: a list type for a repeated field, a map type for a map field, and the CEL type of a well-known type, such as :timestamp or {:wrapper, :int}, for a field holding one.
  • :kind — :singular, :repeated or :map.
  • :oneof — the name of the oneof the field is in, or nil.
  • :ref — the provider's own handle on the field. CEL keeps it in checked expressions and hands it back when reading the field, and never looks inside.

The checker looks a field up once, with CEL.TypeProvider.find_field/3, and evaluation reads it through the same struct.

Summary

Types

kind()

@type kind() :: :singular | :repeated | :map

t()

@type t() :: %CEL.Field{
  kind: kind(),
  name: String.t(),
  oneof: CEL.TypeProvider.name() | nil,
  ref: term(),
  type: CEL.Type.t()
}