pub trait IntoRVecElement: Sized {
// Required method
fn elements_into_sexp(values: Vec<Self>) -> SEXP;
}Expand description
How a Vec<Self> becomes a single R vector SEXP.
This is the shared element-marker behind the one impl<T: …> IntoR for Vec<T> blanket slot. Implemented concretely per type — by #[derive(IntoR)]
for newtypes (forwarding to Vec<Inner>), and by the MatchArg bridge in
match_arg.rs for match.arg enums (STRSXP by variant name). See the module
docs for why this cannot be two competing blankets.
Required Methods§
Sourcefn elements_into_sexp(values: Vec<Self>) -> SEXP
fn elements_into_sexp(values: Vec<Self>) -> SEXP
Convert all elements into one R vector SEXP.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl<T: MatchArg> IntoRVecElement for T
Bridge: every MatchArg type is an IntoRVecElement,
so Vec<MyEnum> converts to an R character vector (STRSXP) via
match_arg_vec_into_sexp.
IntoR for Vec<T> has a single blanket slot (see crate::newtype). Routing
MatchArg through IntoRVecElement lets #[derive(IntoR)] newtypes share
that slot — a newtype implements IntoRVecElement concretely in its own crate,
which coexists with this bridge because a local newtype is provably not
MatchArg (deriving both MatchArg and IntoR on one type is an E0119
coherence error, by design). Stable Rust has no negative trait bounds, so a
second impl<T: …> IntoR for Vec<T> blanket would conflict directly; this
indirection is what avoids that.