Expand description
Explicit R class-system return markers. Explicit R class-system return markers.
WrapAsR6<T> and its siblings select the constructor used by the generated
R wrapper. The matching attribute is #[miniextendr(wrap = "r6")].
Both forms leave Rust-to-R value conversion to T; they only select the
R-side wrapping expression. See docs/MINIEXTENDR_ATTRIBUTE.md for examples.
ConvertTo<T> and ConvertFrom<T> additionally register an inherent S7
method with S7::convert. ConvertTo<T> names the target payload;
ConvertFrom<Self> infers the source from its static method’s sole typed
parameter. Both use the existing S7 class-name resolver, including registered
R class renames, and have matching s7(convert_to = "Target") /
s7(convert_from = "Source") attributes.
Markers are recognized by their last path segment. Type aliases and renamed
imports do not select wrapping. Put Invisible/Visible outside the whole
return, and Option, Result, or Vec outside the class marker.
The marker selects the class system; the class name is the R name the
target’s #[miniextendr] impl block registers, resolved when the R wrappers
are written, so a class = "..." rename applies (Self is the implementing
class). A target with no impl block keeps its Rust name: quietly for S3, Env
and vctrs, where any string is a class, and with a warning for R6, S7 and S4,
whose class object must exist. Nothing checks that the selected system
matches the class definition; a mismatch is reported by R when the
generated constructor or method is used.
Re-exports§
Macros§
Structs§
- Convert
From - Return the enclosing S7 class from a static conversion method. Its sole typed source parameter determines the
s7(convert_from = "Source")registration. - Convert
To - Return an S7 target class and register the inherent method with
S7::convert. The equivalent attribute iss7(convert_to = "Target"). - Wrap
AsEnv - Return
Twith its Env dispatch class. - Wrap
AsR6 - Return
Tthrough its R6 constructor (T$new(.ptr = value)). - Wrap
AsS3 - Return
Twith its named S3 class. - Wrap
AsS4 - Return
Tthroughmethods::new("T", ptr = value). - Wrap
AsS7 - Return
Tthrough its S7 constructor (T(.ptr = value)). - Wrap
AsVctrs - Return
Twith its named vctrs class, preserving its existing class hierarchy.