cel_expr/types

CEL types, which declare the types of an environment’s variables and of its custom functions’ overloads (see cel_expr/env), so that expressions are type-checked as they compile.

Types

A CEL type.

pub type Type {
  Int
  Uint
  Double
  Bool
  String
  Bytes
  Null
  Dyn
  Any
  Timestamp
  Duration
  List(element: Type)
  Map(key: Type, value: Type)
  Message(name: String)
  Wrapper(Type)
  TypeOf(Type)
  Param(name: String)
  Opaque(name: String, parameters: List(Type))
}

Constructors

  • Int
  • Uint
  • Double
  • Bool
  • String
  • Bytes
  • Null

    The type of null.

  • Dyn

    Any type, checked as the expression is evaluated.

  • Any

    google.protobuf.Any.

  • Timestamp
  • Duration
  • List(element: Type)
  • Map(key: Type, value: Type)
  • Message(name: String)

    A protobuf message type, by full name, such as example.v1.User, which the environment’s provider knows.

  • Wrapper(Type)

    A protobuf wrapper of a primitive type, such as google.protobuf.Int64Value for Wrapper(Int), which null can also be assigned to.

  • TypeOf(Type)

    The type of types, whose values are the given type.

  • Param(name: String)

    A type parameter of an overload, by name, which the arguments’ types bind: List(Param("T")) to Param("T") is a function from a list to its elements’ type.

  • Opaque(name: String, parameters: List(Type))

    An abstract type with type parameters, such as optional_type(int).

Values

pub fn optional(of type_: Type) -> Type

The optional extension’s optional_type of a type.

✨ Search Document