Expand description
private prelude for proc macro stuff
Should be included with use super::prelude::*, not crate::,
so that it works with tests/directly.rs too.
Re-exports§
pub use std::fmt::Write as _;pub use strum::IntoEnumIterator as _;pub use void::ResultVoidErrExt as _;pub use void::ResultVoidExt as _;pub use super::approx_equal::tokens_cmpeq;pub use super::approx_equal::Equality;pub use super::define::escape_dollars;pub use super::framework::TokenAccumulator;pub use super::paste::TokenPastesAsIdent;pub use super::utils::braced_group;pub use super::utils::delimit_token_group;pub use super::utils::dummy_path;pub use super::utils::engine_macro_name;pub use super::utils::group_clone_set_stream;pub use super::utils::group_new_with_span;pub use super::utils::respan_hygiene;pub use super::utils::spans_join;pub use super::utils::typepath_add_missing_argument_colons;pub use super::utils::DocAttributes;pub use super::utils::ErrorAccumulator;pub use super::utils::ErrorGenerator;pub use super::utils::ErrorLoc;pub use super::utils::Grouping;pub use super::utils::IdentAny;pub use super::utils::MacroExport;pub use super::utils::MakeError;pub use super::utils::ModuleName;pub use super::utils::ModulePath;pub use super::utils::TemplateName;pub use super::utils::TemplatePath;pub use super::utils::ToTokensPunctComposable;pub use super::utils::TokenOutputTrimmer;pub use super::utils::Concatenated;pub use super::utils::Discard;pub use meta::CheckUsed as mCU;pub use super::utils::dprint;pub use itertools::Either::*;pub use super::compat_syn_2::*;pub use super::compat_syn_common::*;pub use super::options::*;
Modules§
- cmp
- Utilities for comparing and ordering values.
- fmt
- Utilities for formatting and printing
Strings. - iter
- Composable external iteration.
- mem
- Basic functions for dealing with memory.
- ptr
- Manually manage memory through raw pointers.
- token
- Tokens representing Rust punctuation, keywords, and delimiters.
Macros§
- Token
- A type-macro that expands to the name of the Rust type representation of a given token.
- braced
- Parse a set of curly braces and expose their content to subsequent parsers.
- bracketed
- Parse a set of square brackets and expose their content to subsequent parsers.
- chain
- Chain zero or more iterators together into one sequence.
- format_
ident - Formatting macro for constructing
Idents. - izip
- Create an iterator running multiple iterators in lockstep.
- parenthesized
- Parse a set of parentheses and expose their content to subsequent parsers.
- quote
- The whole point.
- quote_
spanned - Same as
quote!, but applies a given span to all tokens originating within the macro invocation.
Structs§
- BTree
Set - An ordered set based on a B-Tree.
- Cell
- A mutable memory location.
- HashSet
- A hash set implemented as a
HashMapwhere the value is(). - Ident
- A word of Rust code, which may be a keyword or legal variable name.
- Lookahead1
- Support for checking the next token in a stream to decide how to parse.
- Parse
Buffer - Cursor position within a buffered token stream.
- Phantom
Data - Zero-sized type used to mark things that “act like” they own a
T. - Punct
- A
Punctis a single punctuation character like+,-or#. - Punctuated
- A punctuated sequence of syntax tree nodes of type
Tseparated by punctuation of typeP. - Span
- A region of source code, along with macro expansion information.
- Token
Stream - An abstract stream of tokens, or more concretely a sequence of token trees.
- VecDeque
- A double-ended queue implemented with a growable ring buffer.
Enums§
- Delimiter
- Describes how a sequence of token trees is delimited.
- Either
- The enum
Eitherwith variantsLeftandRightis a general purpose sum type with two cases. - Either
OrBoth - Value that either holds a single A or B, or both.
- TT
- A single token or a delimited sequence of token trees (e.g.
[1, (), ..]). - Token
Tree - A single token or a delimited sequence of token trees (e.g.
[1, (), ..]). - Void
- The empty type for cases which can’t occur.
Traits§
- Debug
?formatting.- Default
- A trait for giving a type a useful default value.
- Deref
- Used for immutable dereferencing operations, like
*v. - Display
- Format trait for an empty format,
{}. - FromStr
- Parse a value from a string
- Ident
Ext - Additional methods for
Identnot provided by proc-macro2 or libproc_macro. - Itertools
- An
Iteratorblanket implementation that provides extra adaptors and methods. - Parse
- Parsing interface implemented by all types that can be parsed in a default way from a token stream.
- Parser
- Parser that can parse Rust tokens into a particular syntax tree node.
- ToTokens
- Types that can be interpolated inside a
quote!invocation. - TryFrom
- Simple and safe type conversions that may fail in a controlled
way under some circumstances. It is the reciprocal of
TryInto. - TryInto
- An attempted conversion that consumes
self, which may or may not be expensive.
Functions§
- chain
- Takes two iterables and creates a new iterator over both in sequence.
- panicking
- Determines whether the current thread is unwinding because of panic.
Type Aliases§
- Parse
Stream - Input to a Syn parser function.
Derive Macros§
- AsRef
Str - Converts enum variants to
&'a str, where'ais the lifetime of the input enum reference. - Debug
- Derive macro generating an impl of the trait
Debug. - Default
- Derive macro generating an impl of the trait
Default. - Display
- Converts enum variants to strings.
- Enum
Iter - Creates a new type that iterates over the variants of an enum.
- Enum
String - Converts strings to enum variants based on their name.