Anonymous
A Rust library that provides macros for creating anonymous structs, enums, and trait implementations.
Installation
Add this to your Cargo.toml:
[]
= "0.1.0"
Usage
Anonymous Structs (structx!)
You can use the structx! macro to create anonymous structs with named fields.
use structx;
Anonymous Enums (enumx!)
You can use the enumx! macro to define ad-hoc enums.
use enumx;
Anonymous Trait Implementations (implx!)
You can use the implx! macro to create an anonymous struct that implements a specific trait.
use implx;
;
p.greet;
}
Features
structx!: Create structs on the fly with named fields and derive support.enumx!: Define anonymous enums (sum types) inline.implx!: Create anonymous structs implementing a trait with internal state.
License
MPL-2.0