| Crates.io | token-parser-derive |
| lib.rs | token-parser-derive |
| version | 0.3.0 |
| created_at | 2021-04-12 10:02:01.711081+00 |
| updated_at | 2026-01-21 22:42:59.225511+00 |
| description | Derive macros to make structs parsable into tokens |
| homepage | |
| repository | https://gitlab.com/porky11/token-parser-derive |
| max_upload_size | |
| id | 382316 |
| size | 6,865 |
Derive macros for the token-parser crate. Automatically implements the Parsable trait for tuple structs.
Parsable: Parses unnamed fields sequentially using Parsable::parse_next.SymbolParsable: Parses unnamed fields (single-field recommended) using FromStr from a symbol string.use token_parser::Parsable;
use token_parser_derive::{Parsable, SymbolParsable};
// Sequential parsing from parser
#[derive(Parsable)]
struct Point(f32, f32);
// Symbol parsing (e.g., numbers/strings)
#[derive(SymbolParsable)]
struct Token(String);