# Crate proc_macro 1.15.0 [−] [src]

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. Currently the primary use of this crate is to provide the ability to define new custom derive modes through `#[proc_macro_derive]`.

Note that this crate is intentionally very bare-bones currently. The main type, `TokenStream`, only supports `fmt::Display` and `FromStr` implementations, indicating that it can only go to and come from a string. This functionality is intended to be expanded over time as more surface area for macro authors is stabilized.

See the book for more.

## Structs

LexError | Error returned from `TokenStream::from_str`.
TokenStream | The main type provided by this crate, representing an abstract stream of tokens.

# Help

## Keyboard Shortcuts

?
  Show this help dialog
S
  Focus the search field
⇤
  Move up in search results
⇥
  Move down in search results
⏎
  Go to active search result
+
  Collapse/expand all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g. `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g. `vec -> usize` or `* -> vec`)