pub trait FromArgs: Sized {
// Required methods
fn from_args(
args: &[RValue],
named: &[(String, RValue)],
) -> Result<Self, RError>;
fn info() -> &'static BuiltinInfo;
}Expand description
Decode R call arguments into a typed struct.
Implemented by #[derive(FromArgs)] on structs whose fields represent
R function parameters. Field names become R parameter names, field types
determine coercion, and #[default(...)] marks optional parameters.
Field type determines behavior:
T— required, error if missingOption<T>— optional,Noneif missingRArg<T>— three-way: Missing / Null / ValueDots— captures remaining positional args
Required Methods§
Sourcefn from_args(
args: &[RValue],
named: &[(String, RValue)],
) -> Result<Self, RError>
fn from_args( args: &[RValue], named: &[(String, RValue)], ) -> Result<Self, RError>
Decode positional and named R arguments into Self.
Sourcefn info() -> &'static BuiltinInfo
fn info() -> &'static BuiltinInfo
Static metadata: parameter count, names, docs.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.