pub struct FuncParam {
pub name: String,
pub param_type: Option<TypeTag>,
pub allowed: Option<&'static [&'static str]>,
pub docs: &'static str,
pub options: Option<&'static [ParamOption]>,
pub optional: bool,
}Expand description
One declared parameter of a registered function. param_type is None
for unconstrained Value parameters (the macro accepts any value).
allowed names the closed value set for constrained STRING
parameters, declared once via #[values(...)]: the generated
extractor enforces membership and the reference renders the set,
so the list cannot rot apart from the check. docs carries the
parameter’s description (parsed from the # Arguments doc section
for macro functions, written inline for hand-built entries) and
renders into every reference surface. options declares the known
keys of a MAP options parameter: same single-source rule as
allowed, with per-key types, required flags, defaults, and docs.
optional marks a trailing MAP parameter callers may omit: the
runtime fills an empty MAP, and signatures render = {}. Only
trailing MAP params may be optional (run-start validation
rejects anything else), so omission always means “no options”.
The macro never emits optional params: only hand-built entries
use them, and only for options MAPs.
Fields§
§name: String§param_type: Option<TypeTag>§allowed: Option<&'static [&'static str]>§docs: &'static str§options: Option<&'static [ParamOption]>§optional: bool