pub enum Builtin {
Length,
Count,
IsEmpty,
IsNull,
Contains,
StartsWith,
EndsWith,
AsInt,
AsFloat,
AsString,
AsBool,
}Expand description
The closed catalog of pure builtins (v2.26.0). All are total + pure.
Collection/string predicates only; the predicate-taking folds (any/all/
none) need lambdas and are deferred, as are sum/min/max and in/??.
Variants§
Length
.length — collection element count, or character count of a string.
Count
.count — alias of length.
IsEmpty
.is_empty — length == 0.
IsNull
.is_null — the value is absent / empty / null.
Contains
.contains(x) — array membership, or string substring.
StartsWith
.starts_with(s) — string prefix test.
EndsWith
.ends_with(s) — string suffix test.
AsInt
v2.26.0 — .as_int — honest coercion of a Json value to an
integer. Fail-closed: a value that is not a JSON integer resolves
to null, never a panic (doctrine open_data_is_total).
AsFloat
v2.26.0 — .as_float — honest coercion to a float (an integer
widens; anything else → null).
AsString
v2.26.0 — .as_string — honest coercion to a string (only a
JSON string succeeds; a number / bool / null → null).
AsBool
v2.26.0 — .as_bool — honest coercion to a boolean (only a
JSON bool succeeds; anything else → null).