Expand description
Amplifying Rust language capabilities: helper functions for creating proc macro libraries
§Examples
#[name]
- single form
#[name = "literal"]
- optional single value
#[name = TypeName]
#[name("literal", TypeName)]
- list of arguments
Structs§
- AttrReq
- Structure requirements for parametrized attribute
- Parametrized
Attr - Representation for all allowed forms of
#[attr(...)]
attribute. If attribute has a multiple occurrences they are all assembled into a single list. Repeated named arguments are not allowed and result in errors. - Singular
Attr - Structure describing a procedural macro attribute with an optional value.
The means that if one has something like
#[name1]
,#[name2 = "value"]
,#[name3 = ::std::path::PathBuf)]
thanname1
,name2 = "value"
, andname3 = ::std::path::PathBuf
are three different attributes which can be parsed and represented by theSingularAttr
structure.
Enums§
- ArgValue
- Value for attribute or attribute argument, i.e. for
#[attr = value]
and#[attr(arg = value)]
this is thevalue
part of the attribute. Can be either a single literal or a single valid rust type name - Attr
- Structure representing internal structure of collected instances of a proc
macro attribute having some specific name (accessible via
Attr::name()
). - Error
- Errors representing inconsistency in proc macro attribute structure
- ListReq
- LitReq
- Value
Req - Requirements for attribute or named argument value presence