Expand description
Function signature parsing for #[miniextendr].
This module handles parsing and normalizing Rust function signatures for the
#[miniextendr] attribute macro. It provides:
MiniextendrFunctionParsed: Parsed function with normalization and codegen helpersMiniextendrFnAttrs: Parsed#[miniextendr(...)]attribute optionsCoercionMapping: Type coercion analysis for automatic RβRust conversion
StructsΒ§
- Miniextendr
FnAttrs π - Parsed arguments for the
#[miniextendr(...)]attribute on functions. - Miniextendr
Function πParsed - Parsed + normalized Rust function item for
#[miniextendr]. - Param
Attrs π - Collapsed per-parameter attribute state for a single function parameter.
- PerParam
Miniextendr πAttr - Parsed per-parameter
#[miniextendr(...)]attribute content. - ROnExit π
- Parsed
r_on_exitattribute foron.exit()cleanup code in R wrappers.
EnumsΒ§
- Coercion
Mapping π - Result of coercion analysis for a type. Contains the R native type to extract from SEXP and the target type to coerce to.
- Return
Pref π - Preferred return-conversion path for
IntoR.
ConstantsΒ§
- FN_
BOOL_ πFLAGS_ HELP - Comma-separated list of all fn-level boolean flags, for error messages.
- FN_
NESTED_ πOPTIONS_ HELP - Comma-separated list of fn-level nested options, for error messages.
FunctionsΒ§
- get_
missing_ πinner_ type - Extract the inner type
TfromMissing<T>, if the type isMissing<T>. - is_
dots_ πtype - Check if a type is
Dotsor&Dots(the variadic...parameter type). - is_
miniextendr_ πchoices_ attr - Returns
trueifattris a#[miniextendr(...)]attribute containingchoices(...). - is_
miniextendr_ πcoerce_ attr - Returns
trueifattris a#[miniextendr(...)]attribute containingcoerce. - is_
miniextendr_ πmatch_ arg_ attr - Returns
trueifattris a#[miniextendr(...)]attribute containingmatch_arg. - is_
miniextendr_ πseveral_ ok_ attr - Returns
trueifattris a#[miniextendr(...)]attribute containingseveral_ok. - is_
missing_ πtype - Check if a type is
Missing<T>. - is_
vector_ πlike_ type - Check if a type is a vector-like type that
several_okcan populate. - parse_
choices_ πattr - Extracts the list of choice strings from a
#[miniextendr(choices("a", "b", "c"))]attribute. - parse_
default_ πattr - Extracts the default value from a
#[miniextendr(default = "...")]attribute. - parse_
lit_ πstr - Parse the value of a
name = "..."meta item as a string literal. - parse_
per_ πparam_ attr - Parse all per-parameter options from a
#[miniextendr(...)]attribute. - type_
ends_ πwith - Check if a type path ends with the given identifier (e.g., βDotsβ, βMissingβ).
- validate_
param_ πtype - Validate a parameterβs type for
MissingandDotsconflicts. - validate_
per_ πparam_ attr_ conflicts - Validate per-parameter attribute conflicts.