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 named target must have a compatible R class definition. Explicit wrapping does not consult the class registry or verify the selected system; a mismatch is reported by R when the generated constructor or method is used.
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.