Crate prom_attire [] [src]

Procedural Macro Attributes
For when you need the best dressed procedural macro.

prom_attire lets you define a struct (or multiple) that you can use to parse the attributes passed in to your procedural macro.


Basic example

#[derive(PromAttire, PartialEq, Debug)]
struct Attributes<'a> {
    awesome: Option<&'a str>,
let ast = syn::parse_derive_input("
    #[awesome = \"yes\"]
    struct Foo {}
let attrs = Attributes::from(ast.attrs.as_slice());
assert_eq!(attrs, Attributes {
    awesome: Some("yes"),

More examples Coming Soon, for now if you check the list of examples to add and look at the tests you may be able to work out how to do what you want.



The procedural macro implementing #[derive(PromAttire)]