# Struct proc_macro::TokenStream 1.15.0 [−] [src]

    pub struct TokenStream { /* fields omitted */ }

The main type provided by this crate, representing an abstract stream of tokens.

This is both the input and output of `#[proc_macro_derive]` definitions. Currently it's required to be a list of valid Rust items, but this restriction may be lifted in the future.

The API of this type is intentionally bare-bones, but it'll be expanded over time!

## Trait Implementations

### `impl FromStr for TokenStream`
[src]

#### `type Err = LexError`

The associated error which can be returned from parsing.

#### `fn from_str(src: &str) -> Result<TokenStream, LexError>`

Parses a string `s` to return a value of this type. Read more

### `impl Display for TokenStream`
[src]

#### `fn fmt(&self, f: &mut Formatter) -> Result`

Formats the value using the given formatter. Read more

# 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`)