Skip to main content

Module traits

Module traits 

Source
Expand description

Builtin trait system: Builtin, FromArgs, CoerceArg, and argument decoding helpers.

R arguments have three states that matter: missing (not provided), NULL (explicitly passed), or a value. This module models all three through the RArg<T> enum and provides derive-friendly coercion traits.

Structs§

BuiltinInfo
Metadata for a trait-based builtin, generated by #[derive(FromArgs)].
Dots
Captures all remaining positional arguments (... in R).

Enums§

RArg
The three states of an R function argument.

Traits§

Builtin
A trait-based builtin function.
CoerceArg
Coerce an RValue to a Rust type. Implemented for common R parameter types.
FromArgs
Decode R call arguments into a typed struct.

Functions§

coerce_arg
Helper called by FromArgs derive-generated code.
coerce_arg_three_way
Helper called by FromArgs derive-generated code for RArg<T> fields. Produces the three-way Missing/Null/Value from a raw Option<&RValue>.
find_arg
Find an argument by name (with partial matching) or positional index.
find_named_arg
Find an argument by name only (exact match first, then unique partial match). Used by the FromArgs derive macro with a runtime positional counter.