pub struct FnDef {
pub id: FuncId,
pub name: &'static str,
pub aliases: &'static [&'static str],
pub kind: Kind,
pub category: Category,
pub params: &'static [Arg],
pub required: usize,
pub variadic: bool,
pub ret: Ret,
pub doc: &'static str,
pub over: Over,
}Expand description
One built-in function.
Fields§
§id: FuncId§name: &'static strCanonical (Excel) spelling.
aliases: &'static [&'static str]Other spellings that mean exactly this function.
kind: Kind§category: Category§params: &'static [Arg]Leading required arguments, then optional optional ones; with
variadic, the last parameter repeats (at least once).
required: usize§variadic: bool§ret: Ret§doc: &'static strOne-line description for the reference page.
over: OverFor Kind::Aggregate / Kind::PerItem: the reduced arguments.
Implementations§
Source§impl FnDef
impl FnDef
Sourcepub fn param(&self, i: usize) -> Arg
pub fn param(&self, i: usize) -> Arg
The expected type of argument i (variadic tails repeat the last).
Sourcepub fn reduced(&self, i: usize, arg: &Expr) -> bool
pub fn reduced(&self, i: usize, arg: &Expr) -> bool
Whether argument i (as parsed, arg) is reduced over the OVER
categories. For Over::Leading the parser marked the reduced
references with their over.
Sourcepub fn param_names(&self) -> Vec<String>
pub fn param_names(&self) -> Vec<String>
The parameters’ names, for signature help and ghost text: from the
table in functions/params.rs, else those the description spells
(PMT(rate, nper, pv, [fv], [type])), else each parameter’s type
(number). Optional ones are [bracketed], a variadic tail is …,
a reduced one is x OVER T, and a list result ends in INTO K.
Sourcepub fn hint(&self) -> String
pub fn hint(&self) -> String
PMT(rate, nper, pv, [fv], [type]): the name and Self::param_names.