cel_expr/value

CEL values, as expressions take them from activations and constants and give them as results.

Types

A CEL value. Ints are int64s and uints from 0 to 2^64 - 1, as CEL has them; a value out of its type’s range fails the expression that uses it.

pub type Value {
  Null
  Bool(Bool)
  Int(Int)
  Uint(Int)
  Double(Float)
  Nan
  Infinity
  NegativeInfinity
  String(String)
  Bytes(BitArray)
  List(List(Value))
  Map(dict.Dict(Value, Value))
  Timestamp(nanoseconds: Int)
  Duration(nanoseconds: Int)
  Type(name: String)
  Message(type_name: String, raw: dynamic.Dynamic)
  Optional(option.Option(Value))
  Opaque(type_name: String, value: dynamic.Dynamic)
}

Constructors

  • Null
  • Bool(Bool)
  • Int(Int)
  • Uint(Int)
  • Double(Float)
  • Nan

    The doubles a Gleam Float cannot hold.

  • Infinity
  • NegativeInfinity
  • String(String)
  • Bytes(BitArray)
  • List(List(Value))
  • A map, whose keys are ints, uints, bools or strings.

  • Timestamp(nanoseconds: Int)

    A google.protobuf.Timestamp: nanoseconds since the Unix epoch.

  • Duration(nanoseconds: Int)

    A google.protobuf.Duration, in nanoseconds.

  • Type(name: String)

    A type, by name, such as int or example.v1.User.

  • Message(type_name: String, raw: dynamic.Dynamic)

    A protobuf message of the type named type_name, which only its provider reads: see cel_expr/pb to make one from its encoding, and to encode one.

  • Optional(option.Option(Value))

    A value of the optional extension’s optional_type.

  • Opaque(type_name: String, value: dynamic.Dynamic)

    A value of a type this binding does not model, such as the network extension’s net.IP and net.CIDR, kept as it is.

Values

pub fn type_name(value: Value) -> String

The name of a value’s type, as CEL’s type() gives it.

✨ Search Document