pub struct Params {
pub params: Vec<Param>,
pub vararg: Option<String>,
}Expand description
A function header’s parameters: the fixed/defaulted positional parameters in
order, plus an optional trailing variadic parameter (many rest) that
collects the surplus arguments into a List. Required parameters come first,
then defaulted ones, then the variadic — the parser enforces that order.
Fields§
§params: Vec<Param>§vararg: Option<String>Implementations§
Source§impl Params
impl Params
Sourcepub fn has_vararg(&self) -> bool
pub fn has_vararg(&self) -> bool
Whether a trailing many rest variadic parameter is present.
Sourcepub fn required(&self) -> usize
pub fn required(&self) -> usize
The number of leading parameters with no default — the minimum a call must supply.
Sourcepub fn max_positional(&self) -> Option<usize>
pub fn max_positional(&self) -> Option<usize>
The largest number of positional arguments the header can bind without a
variadic parameter: every named parameter. None when a variadic is
present (unbounded).
Sourcepub fn binding_names(&self) -> Vec<String>
pub fn binding_names(&self) -> Vec<String>
The names the body binds: every parameter, then the variadic (which arrives as an already-packed List). This is what the compiled wrapper takes as value parameters.