Skip to main content

Module dots

Module dots 

Source
Expand description

R’s ... (variadic arguments) support.

Provides Dots, the Rust representation of R’s ... parameter. The generated R wrapper captures ... as list(...) and passes it to Rust.

§Usage

Use ... as the parameter type — the macro handles the rest:

ⓘ
#[miniextendr]
pub fn greet(prefix: &str, dots: ...) {
    let list = dots.as_list();
    // Access by name: list.get_named::<String>("key")
    // Access by position: list.get_index::<i32>(0)
}

Use name: ... syntax for a custom parameter name, or combine with typed_list! for structure validation:

ⓘ
#[miniextendr(dots = typed_list!(x: i32, y: f64))]
pub fn validated(args: ...) {
    // dots_typed.x and dots_typed.y are available
}

Re-exports§

use crate::from_r::SexpTypeError; 🔒
use crate::from_r::TryFromSexp; 🔒
use crate::list::List; 🔒
use crate::typed_list::TypedList; 🔒
use crate::typed_list::TypedListError; 🔒
use crate::typed_list::TypedListSpec; 🔒
use crate::typed_list::validate_list; 🔒
use crate::SEXP; 🔒
use crate::SexpExt; 🔒

Structs§

Dots
Rust type representing R’s ... (variadic arguments).