Skip to main content

Crate token_parser_derive

Crate token_parser_derive 

Source
Expand description

Derive macros to automatically implement the Parsable trait from token-parser.

Supports:

  • Tuple structs: parsed positionally ((value1 value2 …)).
  • Named structs: parsed with one sub-list per field in any order (((name1 value1) (name2 value2) …)). Requires the struct to implement Default. Unknown field names yield UnknownField. Last value wins on duplicates. Missing fields keep their default.
  • Unit structs: parsed as the empty list ().
  • SymbolParsable: parses a tuple struct’s fields from the symbol string via FromStr.

Derive Macros§

Parsable
Derive the Parsable trait.
SymbolParsable
Derive the Parsable trait by parsing unnamed fields using the FromStr trait.