Expand description
§#[derive(MatchArg)] - Enum ↔ R String with match.arg Support
This module implements the #[derive(MatchArg)] macro which generates
the MatchArg trait implementation for C-style enums, enabling automatic
conversion between Rust enums and R character strings with partial matching.
§Usage
ⓘ
#[derive(Copy, Clone, MatchArg)]
enum Mode {
Fast,
Safe,
Debug,
}
// Generates impl MatchArg for Mode, TryFromSexp for Mode, IntoR for Mode.§Attributes
#[match_arg(rename = "name")]- Rename a variant’s choice string#[match_arg(rename_all = "snake_case")]- Rename all variants (snake_case, kebab-case, lower, upper)
Structs§
- Match
ArgAttrs 🔒 - Parsed
#[match_arg(...)]attributes from an enum or variant.
Functions§
- derive_
match_ arg - Main entry point for
#[derive(MatchArg)]. - parse_
match_ 🔒arg_ attrs - Parse
#[match_arg(...)]attributes from a list ofsyn::Attribute.