token-parser-derive

Crates.iotoken-parser-derive
lib.rstoken-parser-derive
version0.3.0
created_at2021-04-12 10:02:01.711081+00
updated_at2026-01-21 22:42:59.225511+00
descriptionDerive macros to make structs parsable into tokens
homepage
repositoryhttps://gitlab.com/porky11/token-parser-derive
max_upload_size
id382316
size6,865
Fabio Krapohl (porky11)

documentation

README

Token Parser Derive

Derive macros for the token-parser crate. Automatically implements the Parsable trait for tuple structs.

Features

  • Parsable: Parses unnamed fields sequentially using Parsable::parse_next.
  • SymbolParsable: Parses unnamed fields (single-field recommended) using FromStr from a symbol string.

Usage

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);
Commit count: 25

cargo fmt