Expand description
Dispatch #[miniextendr] on structs and enums to the appropriate derive helpers.
This module handles #[miniextendr] when applied to structs or enums (not functions,
impl blocks, or traits). It dispatches to the correct derive helper based on:
- Field count (1-field โ ALTREP by default, multi-field โ ExternalPtr by default)
- Explicit mode attributes (
list,dataframe,externalptr,match_arg,factor) - Preference markers (
prefer = "...")
ยงDisambiguation table
| Syntax | Result |
|---|---|
#[miniextendr] on 1-field struct | ALTREP (backwards compat) |
#[miniextendr(externalptr)] on 1-field struct | ExternalPtr |
#[miniextendr(list)] on 1-field struct | List conversion |
#[miniextendr(class = "...", base = "...")] on 1-field struct | ALTREP (explicit) |
#[miniextendr] on multi-field struct | ExternalPtr |
#[miniextendr(list)] on multi-field struct | IntoList + TryFromList + PreferList |
#[miniextendr(dataframe)] on multi-field struct | DataFrameRow + PreferDataFrame |
#[miniextendr(prefer = "...")] on struct | Prefer* marker |
#[miniextendr] on fieldless enum | RFactor |
#[miniextendr(match_arg)] on fieldless enum | MatchArg |
Structsยง
- Struct
Enum ๐Attrs - Parsed attributes for
#[miniextendr]on structs/enums.
Functionsยง
- expand_
enum ๐ - Dispatches
#[miniextendr]on a fieldless enum to the correct derive path. - expand_
struct ๐ - Dispatches
#[miniextendr]on a struct to the correct derive path. - expand_
struct_ or_ enum - Main dispatch entry point for
#[miniextendr]on a struct or enum. - field_
count ๐ - Returns the number of fields on a struct (named, unnamed, or unit).
- is_
fieldless_ ๐enum - Returns
trueif every variant of the enum is a unit variant (no fields). - parse_
attrs ๐ - Parses the attribute arguments of
#[miniextendr(...)]when applied to a struct or enum. - strip_
miniextendr_ ๐attrs - Strip
#[miniextendr(...)]attributes from a DeriveInput.