A support library for macro authors when defining new macros.
This library, provided by the standard distribution, provides the types
consumed in the interfaces of procedurally defined macro definitions such as
#[proc_macro], macro attributes
custom derive attributes
See the book for more.
Tracked access to environment variables.
Tracked access to additional files.
Public implementation details for the
TokenStream type, such as iterators.
quote!(..) accepts arbitrary tokens and expands into a
TokenStream describing the input.
quote!(a + b) will produce a expression, that, when evaluated, constructs
[Ident("a"), Punct('+', Alone), Ident("b")].
A structure representing a diagnostic message and associated children messages.
A line-column pair representing the start or end of a
The source file of a given
A delimited token stream.
An identifier (
Error returned from
A literal string (
"hello"), byte string (
'a'), byte character (
b'a'), an integer or floating point number
with or without a suffix (
Boolean literals like
false do not belong here, they are
Punct is a single punctuation character such as
A region of source code, along with macro expansion information.
The main type provided by this crate, representing an abstract stream of tokens, or, more specifically, a sequence of token trees. The type provide interfaces for iterating over those token trees and, conversely, collecting a number of token trees into one stream.
An enum representing a diagnostic level.
Describes how a sequence of token trees is delimited.
A single token or a delimited sequence of token trees (e.g.,
[1, (), ..]).
Trait implemented by types that can be converted into a set of
Determines whether proc_macro has been made accessible to the currently running program.
TokenStream into a
This is the actual implementation of the
quote!() proc macro.
Span into a
This is needed to implement a custom quoter.