Skip to main content

Module tuples

Module tuples 

Source
Expand description

Tuple conversions: read an R list (VECSXP) positionally into (A, B, ...).

Inbound counterpart of the IntoR tuple family (crate::into_r, tuple to unnamed list region) โ€” same arities (1 through 12), same VECSXP shape.

Semantics:

  • The input must be a list (VECSXP) of exactly N elements; names are ignored (conversion is positional).
  • Element i converts via <Ti as TryFromSexp>::try_from_sexp.
  • All failing elements are collected into one batched diagnostic (1-based positions, matching R indexing) instead of bailing on the first failure.

Macrosยง

impl_tuple_try_from_sexp ๐Ÿ”’
Implement TryFromSexp for tuples of various sizes (1-12). Reads an unnamed R list (VECSXP) positionally; mirrors impl_tuple_into_r!.
impl_tuple_vec_try_from_sexp ๐Ÿ”’
Tuple rows keep their own R object/class, as Vec<List> does. Validators therefore run per row; nullable rows skip the validator for NULL.

Functionsยง

check_list_shape ๐Ÿ”’