#[non_exhaustive]pub struct OperatorInfo {
pub name: &'static str,
pub aliases: &'static [&'static str],
pub family: &'static str,
pub feature: Option<&'static str>,
pub min_args: usize,
pub max_args: Option<usize>,
pub reads_context: bool,
pub effect: &'static str,
pub cost: &'static str,
pub scoped_arg: Option<ScopedArg>,
}Expand description
One built-in operator, as its operator-table row declares it.
Returned by crate::Engine::operators. Every field is a build-time
fact: the same rows drive compilation, dispatch and the optimizer, so
this description cannot drift from what the engine does.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: &'static strCanonical name ("val", "if", "switch").
aliases: &'static [&'static str]Other names the compiler accepts for the same operator ("var",
"?:", "match").
family: &'static strOperator family ("Core", "DateTime", "ExtString", …).
feature: Option<&'static str>The Cargo feature that gates the family, or None for the core
JSONLogic operators.
min_args: usizeFewest arguments the operator reads, as declared on its table row:
== and map report 2, and and if report 1. Variadics that
accept an empty list (+, cat, missing) report 0.
max_args: Option<usize>Most arguments the operator’s signature reads, or None when it
does not declare a maximum.
reads_context: boolWhether the operator reads the data context (val, missing,
exists, fractional).
effect: &'static strWhat evaluating the operator does besides computing a value:
"pure", "clock" (now), "throws" (throw) or "catches"
(try).
cost: &'static strWhat the operator’s work is proportional to: "node" (constant),
"bytes", "per_item", "n_log_n", "quadratic" or "elements".
scoped_arg: Option<ScopedArg>Which argument, if any, runs under a pushed context frame (an iterator body, a key expression, a catch arm).