Skip to main content

find_dots_param

Function find_dots_param 

Source
pub(crate) fn find_dots_param(
    inputs: &Punctuated<FnArg, Comma>,
) -> Result<Option<Ident>>
Expand description

Find the dots parameter of a signature by type, at any position, and return its Rust binding.

The parameter of type &Dots or LazyDots is R’s ... at its own position: the R formals and the .Call() arguments follow the Rust signature order, with ... where it sits (list(...) or environment() in the call, DotsKind::r_call_arg), and every formal after it is matched by exact name only, as R does for any formal after ....

A function takes at most one ..., so a second &Dots / LazyDots parameter is an error spanned on it. The parameter needs a plain name: the body reads the dots through it.