diff --git a/.lock b/.lock new file mode 100644 index 0000000..e69de29 diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 0000000..e69de29 diff --git a/bitflag_attr/all.html b/bitflag_attr/all.html new file mode 100644 index 0000000..f029da3 --- /dev/null +++ b/bitflag_attr/all.html @@ -0,0 +1 @@ +List of all items in this crate

List of all items

Attribute Macros

\ No newline at end of file diff --git a/bitflag_attr/attr.bitflag.html b/bitflag_attr/attr.bitflag.html new file mode 100644 index 0000000..6d18469 --- /dev/null +++ b/bitflag_attr/attr.bitflag.html @@ -0,0 +1,31 @@ +bitflag in bitflag_attr - Rust

Attribute Macro bitflag_attr::bitflag

source ·
#[bitflag]
Expand description

An attribute macro that transforms an C-like enum into a bitflag struct implementing an type API +similar to the bitflags crate, and implementing traits as listed below.

+

§Generated trait implementatations

+

This macro generates some trait implementations: fmt::Debug, ops:Not, ops:BitAnd, +ops:BitOr, ops:BitXor, ops:BitAndAssign, ops:BitOrAssign, ops:BitXorAssign, +fmt::Binary, fmt::LowerHex, fmt::UpperHex, fmt::Octal, From, Clone, +Copy

+

§Example

+
use bitflag_attr::bitflag;
+
+#[bitflag(u32)]
+#[derive(PartialEq, PartialOrd, Eq, Ord, Hash)]
+pub enum Flags {
+    /// The value `A`, at bit position `0`.
+    A = 0b00000001,
+    /// The value `B`, at bit position `1`.
+    B = 0b00000010,
+    /// The value `C`, at bit position `2`.
+    C = 0b00000100,
+
+    /// The combination of `A`, `B`, and `C`.
+    ABC = A | B | C,
+}
+

§Syntax

#[bitflag($ty)]
+$visibility enum $StructName {
+    FlagOne = flag1_value_expr,
+    FlagTwo = flag2_value_expr,
+    // ...
+    FlagN = flagn_value_expr,
+}
+
\ No newline at end of file diff --git a/bitflag_attr/index.html b/bitflag_attr/index.html new file mode 100644 index 0000000..de2fdd0 --- /dev/null +++ b/bitflag_attr/index.html @@ -0,0 +1,2 @@ +bitflag_attr - Rust

Crate bitflag_attr

source ·

Attribute Macros§

  • An attribute macro that transforms an C-like enum into a bitflag struct implementing an type API +similar to the bitflags crate, and implementing traits as listed below.
\ No newline at end of file diff --git a/bitflag_attr/sidebar-items.js b/bitflag_attr/sidebar-items.js new file mode 100644 index 0000000..d5f726a --- /dev/null +++ b/bitflag_attr/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"attr":["bitflag"]}; \ No newline at end of file diff --git a/crates.js b/crates.js new file mode 100644 index 0000000..a2145ec --- /dev/null +++ b/crates.js @@ -0,0 +1 @@ +window.ALL_CRATES = ["bitflag_attr","proc_macro2","quote","syn","unicode_ident"]; \ No newline at end of file diff --git a/help.html b/help.html new file mode 100644 index 0000000..d98142b --- /dev/null +++ b/help.html @@ -0,0 +1 @@ +Help

Rustdoc help

Back
\ No newline at end of file diff --git a/proc_macro2/all.html b/proc_macro2/all.html new file mode 100644 index 0000000..46e8599 --- /dev/null +++ b/proc_macro2/all.html @@ -0,0 +1 @@ +List of all items in this crate

List of all items

Structs

Enums

\ No newline at end of file diff --git a/proc_macro2/enum.Delimiter.html b/proc_macro2/enum.Delimiter.html new file mode 100644 index 0000000..4cd0526 --- /dev/null +++ b/proc_macro2/enum.Delimiter.html @@ -0,0 +1,29 @@ +Delimiter in proc_macro2 - Rust

Enum proc_macro2::Delimiter

source ·
pub enum Delimiter {
+    Parenthesis,
+    Brace,
+    Bracket,
+    None,
+}
Expand description

Describes how a sequence of token trees is delimited.

+

Variants§

§

Parenthesis

( ... )

+
§

Brace

{ ... }

+
§

Bracket

[ ... ]

+
§

None

∅ ... ∅

+

An invisible delimiter, that may, for example, appear around tokens +coming from a “macro variable” $var. It is important to preserve +operator priorities in cases like $var * 3 where $var is 1 + 2. +Invisible delimiters may not survive roundtrip of a token stream through +a string.

+

Trait Implementations§

source§

impl Clone for Delimiter

source§

fn clone(&self) -> Delimiter

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Delimiter

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq for Delimiter

source§

fn eq(&self, other: &Delimiter) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Copy for Delimiter

source§

impl Eq for Delimiter

source§

impl StructuralPartialEq for Delimiter

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/proc_macro2/enum.Spacing.html b/proc_macro2/enum.Spacing.html new file mode 100644 index 0000000..2c4d43f --- /dev/null +++ b/proc_macro2/enum.Spacing.html @@ -0,0 +1,23 @@ +Spacing in proc_macro2 - Rust

Enum proc_macro2::Spacing

source ·
pub enum Spacing {
+    Alone,
+    Joint,
+}
Expand description

Whether a Punct is followed immediately by another Punct or followed by +another token or whitespace.

+

Variants§

§

Alone

E.g. + is Alone in + =, +ident or +().

+
§

Joint

E.g. + is Joint in += or ' is Joint in '#.

+

Additionally, single quote ' can join with identifiers to form +lifetimes 'ident.

+

Trait Implementations§

source§

impl Clone for Spacing

source§

fn clone(&self) -> Spacing

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Spacing

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq for Spacing

source§

fn eq(&self, other: &Spacing) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Copy for Spacing

source§

impl Eq for Spacing

source§

impl StructuralPartialEq for Spacing

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/proc_macro2/enum.TokenTree.html b/proc_macro2/enum.TokenTree.html new file mode 100644 index 0000000..80f9e2e --- /dev/null +++ b/proc_macro2/enum.TokenTree.html @@ -0,0 +1,35 @@ +TokenTree in proc_macro2 - Rust

Enum proc_macro2::TokenTree

source ·
pub enum TokenTree {
+    Group(Group),
+    Ident(Ident),
+    Punct(Punct),
+    Literal(Literal),
+}
Expand description

A single token or a delimited sequence of token trees (e.g. [1, (), ..]).

+

Variants§

§

Group(Group)

A token stream surrounded by bracket delimiters.

+
§

Ident(Ident)

An identifier.

+
§

Punct(Punct)

A single punctuation character (+, ,, $, etc.).

+
§

Literal(Literal)

A literal character ('a'), string ("hello"), number (2.3), etc.

+

Implementations§

source§

impl TokenTree

source

pub fn span(&self) -> Span

Returns the span of this tree, delegating to the span method of +the contained token or a delimited stream.

+
source

pub fn set_span(&mut self, span: Span)

Configures the span for only this token.

+

Note that if this token is a Group then this method will not configure +the span of each of the internal tokens, this will simply delegate to +the set_span method of each variant.

+

Trait Implementations§

source§

impl Clone for TokenTree

source§

fn clone(&self) -> TokenTree

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for TokenTree

Prints token tree in a form convenient for debugging.

+
source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for TokenTree

Prints the token tree as a string that is supposed to be losslessly +convertible back into the same token tree (modulo spans), except for +possibly TokenTree::Groups with Delimiter::None delimiters and negative +numeric literals.

+
source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Extend<TokenTree> for TokenStream

source§

fn extend<I: IntoIterator<Item = TokenTree>>(&mut self, streams: I)

Extends a collection with the contents of an iterator. Read more
source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
source§

impl From<Group> for TokenTree

source§

fn from(g: Group) -> Self

Converts to this type from the input type.
source§

impl From<Ident> for TokenTree

source§

fn from(g: Ident) -> Self

Converts to this type from the input type.
source§

impl From<Literal> for TokenTree

source§

fn from(g: Literal) -> Self

Converts to this type from the input type.
source§

impl From<Punct> for TokenTree

source§

fn from(g: Punct) -> Self

Converts to this type from the input type.
source§

impl From<TokenTree> for TokenStream

source§

fn from(token: TokenTree) -> Self

Converts to this type from the input type.
source§

impl FromIterator<TokenTree> for TokenStream

Collects a number of token trees into a single stream.

+
source§

fn from_iter<I: IntoIterator<Item = TokenTree>>(streams: I) -> Self

Creates a value from an iterator. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/proc_macro2/extra/index.html b/proc_macro2/extra/index.html new file mode 100644 index 0000000..e6c2824 --- /dev/null +++ b/proc_macro2/extra/index.html @@ -0,0 +1,4 @@ +proc_macro2::extra - Rust

Module proc_macro2::extra

source ·
Expand description

Items which do not have a correspondence to any API in the proc_macro crate, +but are necessary to include in proc-macro2.

+

Structs§

  • An object that holds a Group’s span_open() and span_close() together +in a more compact representation than holding those 2 spans individually.
\ No newline at end of file diff --git a/proc_macro2/extra/sidebar-items.js b/proc_macro2/extra/sidebar-items.js new file mode 100644 index 0000000..efa6967 --- /dev/null +++ b/proc_macro2/extra/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":["DelimSpan"]}; \ No newline at end of file diff --git a/proc_macro2/extra/struct.DelimSpan.html b/proc_macro2/extra/struct.DelimSpan.html new file mode 100644 index 0000000..413f9d1 --- /dev/null +++ b/proc_macro2/extra/struct.DelimSpan.html @@ -0,0 +1,17 @@ +DelimSpan in proc_macro2::extra - Rust

Struct proc_macro2::extra::DelimSpan

source ·
pub struct DelimSpan { /* private fields */ }
Expand description

An object that holds a Group’s span_open() and span_close() together +in a more compact representation than holding those 2 spans individually.

+

Implementations§

source§

impl DelimSpan

source

pub fn join(&self) -> Span

Returns a span covering the entire delimited group.

+
source

pub fn open(&self) -> Span

Returns a span for the opening punctuation of the group only.

+
source

pub fn close(&self) -> Span

Returns a span for the closing punctuation of the group only.

+

Trait Implementations§

source§

impl Clone for DelimSpan

source§

fn clone(&self) -> DelimSpan

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for DelimSpan

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Copy for DelimSpan

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/proc_macro2/index.html b/proc_macro2/index.html new file mode 100644 index 0000000..5c64e27 --- /dev/null +++ b/proc_macro2/index.html @@ -0,0 +1,64 @@ +proc_macro2 - Rust

Crate proc_macro2

source ·
Expand description

githubcrates-iodocs-rs

+
+

A wrapper around the procedural macro API of the compiler’s proc_macro +crate. This library serves two purposes:

+
    +
  • +

    Bring proc-macro-like functionality to other contexts like build.rs and +main.rs. Types from proc_macro are entirely specific to procedural +macros and cannot ever exist in code outside of a procedural macro. +Meanwhile proc_macro2 types may exist anywhere including non-macro code. +By developing foundational libraries like syn and quote against +proc_macro2 rather than proc_macro, the procedural macro ecosystem +becomes easily applicable to many other use cases and we avoid +reimplementing non-macro equivalents of those libraries.

    +
  • +
  • +

    Make procedural macros unit testable. As a consequence of being +specific to procedural macros, nothing that uses proc_macro can be +executed from a unit test. In order for helper libraries or components of +a macro to be testable in isolation, they must be implemented using +proc_macro2.

    +
  • +
+

§Usage

+

The skeleton of a typical procedural macro typically looks like this:

+ +
extern crate proc_macro;
+
+#[proc_macro_derive(MyDerive)]
+pub fn my_derive(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
+    let input = proc_macro2::TokenStream::from(input);
+
+    let output: proc_macro2::TokenStream = {
+        /* transform input */
+    };
+
+    proc_macro::TokenStream::from(output)
+}
+

If parsing with Syn, you’ll use parse_macro_input! instead to +propagate parse errors correctly back to the compiler when parsing fails.

+

§Unstable features

+

The default feature set of proc-macro2 tracks the most recent stable +compiler API. Functionality in proc_macro that is not yet stable is not +exposed by proc-macro2 by default.

+

To opt into the additional APIs available in the most recent nightly +compiler, the procmacro2_semver_exempt config flag must be passed to +rustc. We will polyfill those nightly-only APIs back to Rust 1.56.0. As +these are unstable APIs that track the nightly compiler, minor versions of +proc-macro2 may make breaking changes to them at any time.

+
RUSTFLAGS='--cfg procmacro2_semver_exempt' cargo build
+
+

Note that this must not only be done for your crate, but for any crate that +depends on your crate. This infectious nature is intentional, as it serves +as a reminder that you are outside of the normal semver guarantees.

+

Semver exempt methods are marked as such in the proc-macro2 documentation.

+

§Thread-Safety

+

Most types in this crate are !Sync because the underlying compiler +types make use of thread-local memory, meaning they cannot be accessed from +a different thread.

+

Modules§

  • Items which do not have a correspondence to any API in the proc_macro crate, +but are necessary to include in proc-macro2.
  • Public implementation details for the TokenStream type, such as iterators.

Structs§

  • A delimited token stream.
  • A word of Rust code, which may be a keyword or legal variable name.
  • Error returned from TokenStream::from_str.
  • A literal string ("hello"), byte string (b"hello"), character ('a'), +byte character (b'a'), an integer or floating point number with or without +a suffix (1, 1u8, 2.3, 2.3f32).
  • A Punct is a single punctuation character like +, - or #.
  • A region of source code, along with macro expansion information.
  • An abstract stream of tokens, or more concretely a sequence of token trees.

Enums§

  • Describes how a sequence of token trees is delimited.
  • Whether a Punct is followed immediately by another Punct or followed by +another token or whitespace.
  • A single token or a delimited sequence of token trees (e.g. [1, (), ..]).
\ No newline at end of file diff --git a/proc_macro2/sidebar-items.js b/proc_macro2/sidebar-items.js new file mode 100644 index 0000000..ad457cb --- /dev/null +++ b/proc_macro2/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["Delimiter","Spacing","TokenTree"],"mod":["extra","token_stream"],"struct":["Group","Ident","LexError","Literal","Punct","Span","TokenStream"]}; \ No newline at end of file diff --git a/proc_macro2/struct.Group.html b/proc_macro2/struct.Group.html new file mode 100644 index 0000000..68f39c6 --- /dev/null +++ b/proc_macro2/struct.Group.html @@ -0,0 +1,46 @@ +Group in proc_macro2 - Rust

Struct proc_macro2::Group

source ·
pub struct Group { /* private fields */ }
Expand description

A delimited token stream.

+

A Group internally contains a TokenStream which is surrounded by +Delimiters.

+

Implementations§

source§

impl Group

source

pub fn new(delimiter: Delimiter, stream: TokenStream) -> Self

Creates a new Group with the given delimiter and token stream.

+

This constructor will set the span for this group to +Span::call_site(). To change the span you can use the set_span +method below.

+
source

pub fn delimiter(&self) -> Delimiter

Returns the punctuation used as the delimiter for this group: a set of +parentheses, square brackets, or curly braces.

+
source

pub fn stream(&self) -> TokenStream

Returns the TokenStream of tokens that are delimited in this Group.

+

Note that the returned token stream does not include the delimiter +returned above.

+
source

pub fn span(&self) -> Span

Returns the span for the delimiters of this token stream, spanning the +entire Group.

+
pub fn span(&self) -> Span {
+           ^^^^^^^
+
source

pub fn span_open(&self) -> Span

Returns the span pointing to the opening delimiter of this group.

+
pub fn span_open(&self) -> Span {
+                ^
+
source

pub fn span_close(&self) -> Span

Returns the span pointing to the closing delimiter of this group.

+
pub fn span_close(&self) -> Span {
+                       ^
+
source

pub fn delim_span(&self) -> DelimSpan

Returns an object that holds this group’s span_open() and +span_close() together (in a more compact representation than holding +those 2 spans individually).

+
source

pub fn set_span(&mut self, span: Span)

Configures the span for this Group’s delimiters, but not its internal +tokens.

+

This method will not set the span of all the internal tokens spanned +by this group, but rather it will only set the span of the delimiter +tokens at the level of the Group.

+

Trait Implementations§

source§

impl Clone for Group

source§

fn clone(&self) -> Group

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Group

source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for Group

Prints the group as a string that should be losslessly convertible back +into the same group (modulo spans), except for possibly TokenTree::Groups +with Delimiter::None delimiters.

+
source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<Group> for TokenTree

source§

fn from(g: Group) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl Freeze for Group

§

impl RefUnwindSafe for Group

§

impl !Send for Group

§

impl !Sync for Group

§

impl Unpin for Group

§

impl UnwindSafe for Group

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/proc_macro2/struct.Ident.html b/proc_macro2/struct.Ident.html new file mode 100644 index 0000000..69ef7c7 --- /dev/null +++ b/proc_macro2/struct.Ident.html @@ -0,0 +1,106 @@ +Ident in proc_macro2 - Rust

Struct proc_macro2::Ident

source ·
pub struct Ident { /* private fields */ }
Expand description

A word of Rust code, which may be a keyword or legal variable name.

+

An identifier consists of at least one Unicode code point, the first of +which has the XID_Start property and the rest of which have the XID_Continue +property.

+
    +
  • The empty string is not an identifier. Use Option<Ident>.
  • +
  • A lifetime is not an identifier. Use syn::Lifetime instead.
  • +
+

An identifier constructed with Ident::new is permitted to be a Rust +keyword, though parsing one through its Parse implementation rejects +Rust keywords. Use input.call(Ident::parse_any) when parsing to match the +behaviour of Ident::new.

+

§Examples

+

A new ident can be created from a string using the Ident::new function. +A span must be provided explicitly which governs the name resolution +behavior of the resulting identifier.

+ +
use proc_macro2::{Ident, Span};
+
+fn main() {
+    let call_ident = Ident::new("calligraphy", Span::call_site());
+
+    println!("{}", call_ident);
+}
+

An ident can be interpolated into a token stream using the quote! macro.

+ +
use proc_macro2::{Ident, Span};
+use quote::quote;
+
+fn main() {
+    let ident = Ident::new("demo", Span::call_site());
+
+    // Create a variable binding whose name is this ident.
+    let expanded = quote! { let #ident = 10; };
+
+    // Create a variable binding with a slightly different name.
+    let temp_ident = Ident::new(&format!("new_{}", ident), Span::call_site());
+    let expanded = quote! { let #temp_ident = 10; };
+}
+

A string representation of the ident is available through the to_string() +method.

+ +
// Examine the ident as a string.
+let ident_string = ident.to_string();
+if ident_string.len() > 60 {
+    println!("Very long identifier: {}", ident_string)
+}
+

Implementations§

source§

impl Ident

source

pub fn new(string: &str, span: Span) -> Self

Creates a new Ident with the given string as well as the specified +span.

+

The string argument must be a valid identifier permitted by the +language, otherwise the function will panic.

+

Note that span, currently in rustc, configures the hygiene information +for this identifier.

+

As of this time Span::call_site() explicitly opts-in to “call-site” +hygiene meaning that identifiers created with this span will be resolved +as if they were written directly at the location of the macro call, and +other code at the macro call site will be able to refer to them as well.

+

Later spans like Span::def_site() will allow to opt-in to +“definition-site” hygiene meaning that identifiers created with this +span will be resolved at the location of the macro definition and other +code at the macro call site will not be able to refer to them.

+

Due to the current importance of hygiene this constructor, unlike other +tokens, requires a Span to be specified at construction.

+
§Panics
+

Panics if the input string is neither a keyword nor a legal variable +name. If you are not sure whether the string contains an identifier and +need to handle an error case, use +syn::parse_str::<Ident> +rather than Ident::new.

+
source

pub fn new_raw(string: &str, span: Span) -> Self

Same as Ident::new, but creates a raw identifier (r#ident). The +string argument must be a valid identifier permitted by the language +(including keywords, e.g. fn). Keywords which are usable in path +segments (e.g. self, super) are not supported, and will cause a +panic.

+
source

pub fn span(&self) -> Span

Returns the span of this Ident.

+
source

pub fn set_span(&mut self, span: Span)

Configures the span of this Ident, possibly changing its hygiene +context.

+

Trait Implementations§

source§

impl Clone for Ident

source§

fn clone(&self) -> Ident

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Ident

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for Ident

Prints the identifier as a string that should be losslessly convertible back +into the same identifier.

+
source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<Ident> for TokenTree

source§

fn from(g: Ident) -> Self

Converts to this type from the input type.
source§

impl Hash for Ident

source§

fn hash<H: Hasher>(&self, hasher: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Ord for Ident

source§

fn cmp(&self, other: &Ident) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where + Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl<T> PartialEq<T> for Ident
where + T: ?Sized + AsRef<str>,

source§

fn eq(&self, other: &T) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl PartialEq for Ident

source§

fn eq(&self, other: &Ident) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for Ident

source§

fn partial_cmp(&self, other: &Ident) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= +operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= +operator. Read more
source§

impl Eq for Ident

Auto Trait Implementations§

§

impl Freeze for Ident

§

impl RefUnwindSafe for Ident

§

impl !Send for Ident

§

impl !Sync for Ident

§

impl Unpin for Ident

§

impl UnwindSafe for Ident

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/proc_macro2/struct.LexError.html b/proc_macro2/struct.LexError.html new file mode 100644 index 0000000..94a0804 --- /dev/null +++ b/proc_macro2/struct.LexError.html @@ -0,0 +1,13 @@ +LexError in proc_macro2 - Rust

Struct proc_macro2::LexError

source ·
pub struct LexError { /* private fields */ }
Expand description

Error returned from TokenStream::from_str.

+

Implementations§

source§

impl LexError

source

pub fn span(&self) -> Span

Trait Implementations§

source§

impl Debug for LexError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for LexError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for LexError

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/proc_macro2/struct.Literal.html b/proc_macro2/struct.Literal.html new file mode 100644 index 0000000..c6588ee --- /dev/null +++ b/proc_macro2/struct.Literal.html @@ -0,0 +1,311 @@ +Literal in proc_macro2 - Rust

Struct proc_macro2::Literal

source ·
pub struct Literal { /* private fields */ }
Expand description

A literal string ("hello"), byte string (b"hello"), character ('a'), +byte character (b'a'), an integer or floating point number with or without +a suffix (1, 1u8, 2.3, 2.3f32).

+

Boolean literals like true and false do not belong here, they are +Idents.

+

Implementations§

source§

impl Literal

source

pub fn u8_suffixed(n: u8) -> Literal

Creates a new suffixed integer literal with the specified value.

+

This function will create an integer like 1u32 where the integer +value specified is the first part of the token and the integral is +also suffixed at the end. Literals created from negative numbers may +not survive roundtrips through TokenStream or strings and may be +broken into two tokens (- and positive literal).

+

Literals created through this method have the Span::call_site() +span by default, which can be configured with the set_span method +below.

+
source

pub fn u16_suffixed(n: u16) -> Literal

Creates a new suffixed integer literal with the specified value.

+

This function will create an integer like 1u32 where the integer +value specified is the first part of the token and the integral is +also suffixed at the end. Literals created from negative numbers may +not survive roundtrips through TokenStream or strings and may be +broken into two tokens (- and positive literal).

+

Literals created through this method have the Span::call_site() +span by default, which can be configured with the set_span method +below.

+
source

pub fn u32_suffixed(n: u32) -> Literal

Creates a new suffixed integer literal with the specified value.

+

This function will create an integer like 1u32 where the integer +value specified is the first part of the token and the integral is +also suffixed at the end. Literals created from negative numbers may +not survive roundtrips through TokenStream or strings and may be +broken into two tokens (- and positive literal).

+

Literals created through this method have the Span::call_site() +span by default, which can be configured with the set_span method +below.

+
source

pub fn u64_suffixed(n: u64) -> Literal

Creates a new suffixed integer literal with the specified value.

+

This function will create an integer like 1u32 where the integer +value specified is the first part of the token and the integral is +also suffixed at the end. Literals created from negative numbers may +not survive roundtrips through TokenStream or strings and may be +broken into two tokens (- and positive literal).

+

Literals created through this method have the Span::call_site() +span by default, which can be configured with the set_span method +below.

+
source

pub fn u128_suffixed(n: u128) -> Literal

Creates a new suffixed integer literal with the specified value.

+

This function will create an integer like 1u32 where the integer +value specified is the first part of the token and the integral is +also suffixed at the end. Literals created from negative numbers may +not survive roundtrips through TokenStream or strings and may be +broken into two tokens (- and positive literal).

+

Literals created through this method have the Span::call_site() +span by default, which can be configured with the set_span method +below.

+
source

pub fn usize_suffixed(n: usize) -> Literal

Creates a new suffixed integer literal with the specified value.

+

This function will create an integer like 1u32 where the integer +value specified is the first part of the token and the integral is +also suffixed at the end. Literals created from negative numbers may +not survive roundtrips through TokenStream or strings and may be +broken into two tokens (- and positive literal).

+

Literals created through this method have the Span::call_site() +span by default, which can be configured with the set_span method +below.

+
source

pub fn i8_suffixed(n: i8) -> Literal

Creates a new suffixed integer literal with the specified value.

+

This function will create an integer like 1u32 where the integer +value specified is the first part of the token and the integral is +also suffixed at the end. Literals created from negative numbers may +not survive roundtrips through TokenStream or strings and may be +broken into two tokens (- and positive literal).

+

Literals created through this method have the Span::call_site() +span by default, which can be configured with the set_span method +below.

+
source

pub fn i16_suffixed(n: i16) -> Literal

Creates a new suffixed integer literal with the specified value.

+

This function will create an integer like 1u32 where the integer +value specified is the first part of the token and the integral is +also suffixed at the end. Literals created from negative numbers may +not survive roundtrips through TokenStream or strings and may be +broken into two tokens (- and positive literal).

+

Literals created through this method have the Span::call_site() +span by default, which can be configured with the set_span method +below.

+
source

pub fn i32_suffixed(n: i32) -> Literal

Creates a new suffixed integer literal with the specified value.

+

This function will create an integer like 1u32 where the integer +value specified is the first part of the token and the integral is +also suffixed at the end. Literals created from negative numbers may +not survive roundtrips through TokenStream or strings and may be +broken into two tokens (- and positive literal).

+

Literals created through this method have the Span::call_site() +span by default, which can be configured with the set_span method +below.

+
source

pub fn i64_suffixed(n: i64) -> Literal

Creates a new suffixed integer literal with the specified value.

+

This function will create an integer like 1u32 where the integer +value specified is the first part of the token and the integral is +also suffixed at the end. Literals created from negative numbers may +not survive roundtrips through TokenStream or strings and may be +broken into two tokens (- and positive literal).

+

Literals created through this method have the Span::call_site() +span by default, which can be configured with the set_span method +below.

+
source

pub fn i128_suffixed(n: i128) -> Literal

Creates a new suffixed integer literal with the specified value.

+

This function will create an integer like 1u32 where the integer +value specified is the first part of the token and the integral is +also suffixed at the end. Literals created from negative numbers may +not survive roundtrips through TokenStream or strings and may be +broken into two tokens (- and positive literal).

+

Literals created through this method have the Span::call_site() +span by default, which can be configured with the set_span method +below.

+
source

pub fn isize_suffixed(n: isize) -> Literal

Creates a new suffixed integer literal with the specified value.

+

This function will create an integer like 1u32 where the integer +value specified is the first part of the token and the integral is +also suffixed at the end. Literals created from negative numbers may +not survive roundtrips through TokenStream or strings and may be +broken into two tokens (- and positive literal).

+

Literals created through this method have the Span::call_site() +span by default, which can be configured with the set_span method +below.

+
source

pub fn u8_unsuffixed(n: u8) -> Literal

Creates a new unsuffixed integer literal with the specified value.

+

This function will create an integer like 1 where the integer +value specified is the first part of the token. No suffix is +specified on this token, meaning that invocations like +Literal::i8_unsuffixed(1) are equivalent to +Literal::u32_unsuffixed(1). Literals created from negative numbers +may not survive roundtrips through TokenStream or strings and may +be broken into two tokens (- and positive literal).

+

Literals created through this method have the Span::call_site() +span by default, which can be configured with the set_span method +below.

+
source

pub fn u16_unsuffixed(n: u16) -> Literal

Creates a new unsuffixed integer literal with the specified value.

+

This function will create an integer like 1 where the integer +value specified is the first part of the token. No suffix is +specified on this token, meaning that invocations like +Literal::i8_unsuffixed(1) are equivalent to +Literal::u32_unsuffixed(1). Literals created from negative numbers +may not survive roundtrips through TokenStream or strings and may +be broken into two tokens (- and positive literal).

+

Literals created through this method have the Span::call_site() +span by default, which can be configured with the set_span method +below.

+
source

pub fn u32_unsuffixed(n: u32) -> Literal

Creates a new unsuffixed integer literal with the specified value.

+

This function will create an integer like 1 where the integer +value specified is the first part of the token. No suffix is +specified on this token, meaning that invocations like +Literal::i8_unsuffixed(1) are equivalent to +Literal::u32_unsuffixed(1). Literals created from negative numbers +may not survive roundtrips through TokenStream or strings and may +be broken into two tokens (- and positive literal).

+

Literals created through this method have the Span::call_site() +span by default, which can be configured with the set_span method +below.

+
source

pub fn u64_unsuffixed(n: u64) -> Literal

Creates a new unsuffixed integer literal with the specified value.

+

This function will create an integer like 1 where the integer +value specified is the first part of the token. No suffix is +specified on this token, meaning that invocations like +Literal::i8_unsuffixed(1) are equivalent to +Literal::u32_unsuffixed(1). Literals created from negative numbers +may not survive roundtrips through TokenStream or strings and may +be broken into two tokens (- and positive literal).

+

Literals created through this method have the Span::call_site() +span by default, which can be configured with the set_span method +below.

+
source

pub fn u128_unsuffixed(n: u128) -> Literal

Creates a new unsuffixed integer literal with the specified value.

+

This function will create an integer like 1 where the integer +value specified is the first part of the token. No suffix is +specified on this token, meaning that invocations like +Literal::i8_unsuffixed(1) are equivalent to +Literal::u32_unsuffixed(1). Literals created from negative numbers +may not survive roundtrips through TokenStream or strings and may +be broken into two tokens (- and positive literal).

+

Literals created through this method have the Span::call_site() +span by default, which can be configured with the set_span method +below.

+
source

pub fn usize_unsuffixed(n: usize) -> Literal

Creates a new unsuffixed integer literal with the specified value.

+

This function will create an integer like 1 where the integer +value specified is the first part of the token. No suffix is +specified on this token, meaning that invocations like +Literal::i8_unsuffixed(1) are equivalent to +Literal::u32_unsuffixed(1). Literals created from negative numbers +may not survive roundtrips through TokenStream or strings and may +be broken into two tokens (- and positive literal).

+

Literals created through this method have the Span::call_site() +span by default, which can be configured with the set_span method +below.

+
source

pub fn i8_unsuffixed(n: i8) -> Literal

Creates a new unsuffixed integer literal with the specified value.

+

This function will create an integer like 1 where the integer +value specified is the first part of the token. No suffix is +specified on this token, meaning that invocations like +Literal::i8_unsuffixed(1) are equivalent to +Literal::u32_unsuffixed(1). Literals created from negative numbers +may not survive roundtrips through TokenStream or strings and may +be broken into two tokens (- and positive literal).

+

Literals created through this method have the Span::call_site() +span by default, which can be configured with the set_span method +below.

+
source

pub fn i16_unsuffixed(n: i16) -> Literal

Creates a new unsuffixed integer literal with the specified value.

+

This function will create an integer like 1 where the integer +value specified is the first part of the token. No suffix is +specified on this token, meaning that invocations like +Literal::i8_unsuffixed(1) are equivalent to +Literal::u32_unsuffixed(1). Literals created from negative numbers +may not survive roundtrips through TokenStream or strings and may +be broken into two tokens (- and positive literal).

+

Literals created through this method have the Span::call_site() +span by default, which can be configured with the set_span method +below.

+
source

pub fn i32_unsuffixed(n: i32) -> Literal

Creates a new unsuffixed integer literal with the specified value.

+

This function will create an integer like 1 where the integer +value specified is the first part of the token. No suffix is +specified on this token, meaning that invocations like +Literal::i8_unsuffixed(1) are equivalent to +Literal::u32_unsuffixed(1). Literals created from negative numbers +may not survive roundtrips through TokenStream or strings and may +be broken into two tokens (- and positive literal).

+

Literals created through this method have the Span::call_site() +span by default, which can be configured with the set_span method +below.

+
source

pub fn i64_unsuffixed(n: i64) -> Literal

Creates a new unsuffixed integer literal with the specified value.

+

This function will create an integer like 1 where the integer +value specified is the first part of the token. No suffix is +specified on this token, meaning that invocations like +Literal::i8_unsuffixed(1) are equivalent to +Literal::u32_unsuffixed(1). Literals created from negative numbers +may not survive roundtrips through TokenStream or strings and may +be broken into two tokens (- and positive literal).

+

Literals created through this method have the Span::call_site() +span by default, which can be configured with the set_span method +below.

+
source

pub fn i128_unsuffixed(n: i128) -> Literal

Creates a new unsuffixed integer literal with the specified value.

+

This function will create an integer like 1 where the integer +value specified is the first part of the token. No suffix is +specified on this token, meaning that invocations like +Literal::i8_unsuffixed(1) are equivalent to +Literal::u32_unsuffixed(1). Literals created from negative numbers +may not survive roundtrips through TokenStream or strings and may +be broken into two tokens (- and positive literal).

+

Literals created through this method have the Span::call_site() +span by default, which can be configured with the set_span method +below.

+
source

pub fn isize_unsuffixed(n: isize) -> Literal

Creates a new unsuffixed integer literal with the specified value.

+

This function will create an integer like 1 where the integer +value specified is the first part of the token. No suffix is +specified on this token, meaning that invocations like +Literal::i8_unsuffixed(1) are equivalent to +Literal::u32_unsuffixed(1). Literals created from negative numbers +may not survive roundtrips through TokenStream or strings and may +be broken into two tokens (- and positive literal).

+

Literals created through this method have the Span::call_site() +span by default, which can be configured with the set_span method +below.

+
source

pub fn f64_unsuffixed(f: f64) -> Literal

Creates a new unsuffixed floating-point literal.

+

This constructor is similar to those like Literal::i8_unsuffixed where +the float’s value is emitted directly into the token but no suffix is +used, so it may be inferred to be a f64 later in the compiler. +Literals created from negative numbers may not survive round-trips +through TokenStream or strings and may be broken into two tokens (- +and positive literal).

+
§Panics
+

This function requires that the specified float is finite, for example +if it is infinity or NaN this function will panic.

+
source

pub fn f64_suffixed(f: f64) -> Literal

Creates a new suffixed floating-point literal.

+

This constructor will create a literal like 1.0f64 where the value +specified is the preceding part of the token and f64 is the suffix of +the token. This token will always be inferred to be an f64 in the +compiler. Literals created from negative numbers may not survive +round-trips through TokenStream or strings and may be broken into two +tokens (- and positive literal).

+
§Panics
+

This function requires that the specified float is finite, for example +if it is infinity or NaN this function will panic.

+
source

pub fn f32_unsuffixed(f: f32) -> Literal

Creates a new unsuffixed floating-point literal.

+

This constructor is similar to those like Literal::i8_unsuffixed where +the float’s value is emitted directly into the token but no suffix is +used, so it may be inferred to be a f64 later in the compiler. +Literals created from negative numbers may not survive round-trips +through TokenStream or strings and may be broken into two tokens (- +and positive literal).

+
§Panics
+

This function requires that the specified float is finite, for example +if it is infinity or NaN this function will panic.

+
source

pub fn f32_suffixed(f: f32) -> Literal

Creates a new suffixed floating-point literal.

+

This constructor will create a literal like 1.0f32 where the value +specified is the preceding part of the token and f32 is the suffix of +the token. This token will always be inferred to be an f32 in the +compiler. Literals created from negative numbers may not survive +round-trips through TokenStream or strings and may be broken into two +tokens (- and positive literal).

+
§Panics
+

This function requires that the specified float is finite, for example +if it is infinity or NaN this function will panic.

+
source

pub fn string(string: &str) -> Literal

String literal.

+
source

pub fn character(ch: char) -> Literal

Character literal.

+
source

pub fn byte_character(byte: u8) -> Literal

Byte character literal.

+
source

pub fn byte_string(bytes: &[u8]) -> Literal

Byte string literal.

+
source

pub fn c_string(string: &CStr) -> Literal

C string literal.

+
source

pub fn span(&self) -> Span

Returns the span encompassing this literal.

+
source

pub fn set_span(&mut self, span: Span)

Configures the span associated for this literal.

+
source

pub fn subspan<R: RangeBounds<usize>>(&self, range: R) -> Option<Span>

Returns a Span that is a subset of self.span() containing only +the source bytes in range range. Returns None if the would-be +trimmed span is outside the bounds of self.

+

Warning: the underlying proc_macro::Literal::subspan method is +nightly-only. When called from within a procedural macro not using a +nightly compiler, this method will always return None.

+

Trait Implementations§

source§

impl Clone for Literal

source§

fn clone(&self) -> Literal

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Literal

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for Literal

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<Literal> for TokenTree

source§

fn from(g: Literal) -> Self

Converts to this type from the input type.
source§

impl FromStr for Literal

§

type Err = LexError

The associated error which can be returned from parsing.
source§

fn from_str(repr: &str) -> Result<Self, LexError>

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

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/proc_macro2/struct.Punct.html b/proc_macro2/struct.Punct.html new file mode 100644 index 0000000..09ea3fd --- /dev/null +++ b/proc_macro2/struct.Punct.html @@ -0,0 +1,31 @@ +Punct in proc_macro2 - Rust

Struct proc_macro2::Punct

source ·
pub struct Punct { /* private fields */ }
Expand description

A Punct is a single punctuation character like +, - or #.

+

Multicharacter operators like += are represented as two instances of +Punct with different forms of Spacing returned.

+

Implementations§

source§

impl Punct

source

pub fn new(ch: char, spacing: Spacing) -> Self

Creates a new Punct from the given character and spacing.

+

The ch argument must be a valid punctuation character permitted by the +language, otherwise the function will panic.

+

The returned Punct will have the default span of Span::call_site() +which can be further configured with the set_span method below.

+
source

pub fn as_char(&self) -> char

Returns the value of this punctuation character as char.

+
source

pub fn spacing(&self) -> Spacing

Returns the spacing of this punctuation character, indicating whether +it’s immediately followed by another Punct in the token stream, so +they can potentially be combined into a multicharacter operator +(Joint), or it’s followed by some other token or whitespace (Alone) +so the operator has certainly ended.

+
source

pub fn span(&self) -> Span

Returns the span for this punctuation character.

+
source

pub fn set_span(&mut self, span: Span)

Configure the span for this punctuation character.

+

Trait Implementations§

source§

impl Clone for Punct

source§

fn clone(&self) -> Punct

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Punct

source§

fn fmt(&self, fmt: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for Punct

Prints the punctuation character as a string that should be losslessly +convertible back into the same character.

+
source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<Punct> for TokenTree

source§

fn from(g: Punct) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl Freeze for Punct

§

impl RefUnwindSafe for Punct

§

impl !Send for Punct

§

impl !Sync for Punct

§

impl Unpin for Punct

§

impl UnwindSafe for Punct

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/proc_macro2/struct.Span.html b/proc_macro2/struct.Span.html new file mode 100644 index 0000000..6a9315d --- /dev/null +++ b/proc_macro2/struct.Span.html @@ -0,0 +1,43 @@ +Span in proc_macro2 - Rust

Struct proc_macro2::Span

source ·
pub struct Span { /* private fields */ }
Expand description

A region of source code, along with macro expansion information.

+

Implementations§

source§

impl Span

source

pub fn call_site() -> Self

The span of the invocation of the current procedural macro.

+

Identifiers created with this span will be resolved as if they were +written directly at the macro call location (call-site hygiene) and +other code at the macro call site will be able to refer to them as well.

+
source

pub fn mixed_site() -> Self

The span located at the invocation of the procedural macro, but with +local variables, labels, and $crate resolved at the definition site +of the macro. This is the same hygiene behavior as macro_rules.

+
source

pub fn resolved_at(&self, other: Span) -> Span

Creates a new span with the same line/column information as self but +that resolves symbols as though it were at other.

+
source

pub fn located_at(&self, other: Span) -> Span

Creates a new span with the same name resolution behavior as self but +with the line/column information of other.

+
source

pub fn unwrap(self) -> Span

Convert proc_macro2::Span to proc_macro::Span.

+

This method is available when building with a nightly compiler, or when +building with rustc 1.29+ without semver exempt features.

+
§Panics
+

Panics if called from outside of a procedural macro. Unlike +proc_macro2::Span, the proc_macro::Span type can only exist within +the context of a procedural macro invocation.

+
source

pub fn join(&self, other: Span) -> Option<Span>

Create a new span encompassing self and other.

+

Returns None if self and other are from different files.

+

Warning: the underlying proc_macro::Span::join method is +nightly-only. When called from within a procedural macro not using a +nightly compiler, this method will always return None.

+
source

pub fn source_text(&self) -> Option<String>

Returns the source text behind a span. This preserves the original +source code, including spaces and comments. It only returns a result if +the span corresponds to real source code.

+

Note: The observable result of a macro should only rely on the tokens +and not on this source text. The result of this function is a best +effort to be used for diagnostics only.

+

Trait Implementations§

source§

impl Clone for Span

source§

fn clone(&self) -> Span

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Span

Prints a span in a form convenient for debugging.

+
source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<Span> for Span

source§

fn from(proc_span: Span) -> Self

Converts to this type from the input type.
source§

impl Copy for Span

Auto Trait Implementations§

§

impl Freeze for Span

§

impl RefUnwindSafe for Span

§

impl !Send for Span

§

impl !Sync for Span

§

impl Unpin for Span

§

impl UnwindSafe for Span

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/proc_macro2/struct.TokenStream.html b/proc_macro2/struct.TokenStream.html new file mode 100644 index 0000000..10bbeed --- /dev/null +++ b/proc_macro2/struct.TokenStream.html @@ -0,0 +1,34 @@ +TokenStream in proc_macro2 - Rust

Struct proc_macro2::TokenStream

source ·
pub struct TokenStream { /* private fields */ }
Expand description

An abstract stream of tokens, or more concretely a sequence of token trees.

+

This type provides interfaces for iterating over token trees and for +collecting token trees into one stream.

+

Token stream is both the input and output of #[proc_macro], +#[proc_macro_attribute] and #[proc_macro_derive] definitions.

+

Implementations§

source§

impl TokenStream

source

pub fn new() -> Self

Returns an empty TokenStream containing no token trees.

+
source

pub fn is_empty(&self) -> bool

Checks if this TokenStream is empty.

+

Trait Implementations§

source§

impl Clone for TokenStream

source§

fn clone(&self) -> TokenStream

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for TokenStream

Prints token in a form convenient for debugging.

+
source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for TokenStream

TokenStream::default() returns an empty stream, +i.e. this is equivalent with TokenStream::new().

+
source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Display for TokenStream

Prints the token stream as a string that is supposed to be losslessly +convertible back into the same token stream (modulo spans), except for +possibly TokenTree::Groups with Delimiter::None delimiters and negative +numeric literals.

+
source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Extend<TokenStream> for TokenStream

source§

fn extend<I: IntoIterator<Item = TokenStream>>(&mut self, streams: I)

Extends a collection with the contents of an iterator. Read more
source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
source§

impl Extend<TokenTree> for TokenStream

source§

fn extend<I: IntoIterator<Item = TokenTree>>(&mut self, streams: I)

Extends a collection with the contents of an iterator. Read more
source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
source§

impl From<TokenStream> for TokenStream

source§

fn from(inner: TokenStream) -> Self

Converts to this type from the input type.
source§

impl From<TokenStream> for TokenStream

source§

fn from(inner: TokenStream) -> Self

Converts to this type from the input type.
source§

impl From<TokenTree> for TokenStream

source§

fn from(token: TokenTree) -> Self

Converts to this type from the input type.
source§

impl FromIterator<TokenStream> for TokenStream

source§

fn from_iter<I: IntoIterator<Item = TokenStream>>(streams: I) -> Self

Creates a value from an iterator. Read more
source§

impl FromIterator<TokenTree> for TokenStream

Collects a number of token trees into a single stream.

+
source§

fn from_iter<I: IntoIterator<Item = TokenTree>>(streams: I) -> Self

Creates a value from an iterator. Read more
source§

impl FromStr for TokenStream

Attempts to break the string into tokens and parse those tokens into a token +stream.

+

May fail for a number of reasons, for example, if the string contains +unbalanced delimiters or characters not existing in the language.

+

NOTE: Some errors may cause panics instead of returning LexError. We +reserve the right to change these errors into LexErrors later.

+
§

type Err = LexError

The associated error which can be returned from parsing.
source§

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

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

impl IntoIterator for TokenStream

§

type Item = TokenTree

The type of the elements being iterated over.
§

type IntoIter = IntoIter

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> IntoIter

Creates an iterator from a value. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/proc_macro2/token_stream/index.html b/proc_macro2/token_stream/index.html new file mode 100644 index 0000000..2e3efd2 --- /dev/null +++ b/proc_macro2/token_stream/index.html @@ -0,0 +1,2 @@ +proc_macro2::token_stream - Rust

Module proc_macro2::token_stream

source ·
Expand description

Public implementation details for the TokenStream type, such as iterators.

+

Re-exports§

Structs§

  • An iterator over TokenStream’s TokenTrees.
\ No newline at end of file diff --git a/proc_macro2/token_stream/sidebar-items.js b/proc_macro2/token_stream/sidebar-items.js new file mode 100644 index 0000000..3999696 --- /dev/null +++ b/proc_macro2/token_stream/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":["IntoIter"]}; \ No newline at end of file diff --git a/proc_macro2/token_stream/struct.IntoIter.html b/proc_macro2/token_stream/struct.IntoIter.html new file mode 100644 index 0000000..c9acaed --- /dev/null +++ b/proc_macro2/token_stream/struct.IntoIter.html @@ -0,0 +1,197 @@ +IntoIter in proc_macro2::token_stream - Rust

Struct proc_macro2::token_stream::IntoIter

source ·
pub struct IntoIter { /* private fields */ }
Expand description

An iterator over TokenStream’s TokenTrees.

+

The iteration is “shallow”, e.g. the iterator doesn’t recurse into +delimited groups, and returns whole groups as token trees.

+

Trait Implementations§

source§

impl Clone for IntoIter

source§

fn clone(&self) -> IntoIter

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for IntoIter

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Iterator for IntoIter

§

type Item = TokenTree

The type of the elements being iterated over.
source§

fn next(&mut self) -> Option<TokenTree>

Advances the iterator and returns the next value. Read more
source§

fn size_hint(&self) -> (usize, Option<usize>)

Returns the bounds on the remaining length of the iterator. Read more
source§

fn next_chunk<const N: usize>( + &mut self +) -> Result<[Self::Item; N], IntoIter<Self::Item, N>>
where + Self: Sized,

🔬This is a nightly-only experimental API. (iter_next_chunk)
Advances the iterator and returns an array containing the next N values. Read more
1.0.0 · source§

fn count(self) -> usize
where + Self: Sized,

Consumes the iterator, counting the number of iterations and returning it. Read more
1.0.0 · source§

fn last(self) -> Option<Self::Item>
where + Self: Sized,

Consumes the iterator, returning the last element. Read more
source§

fn advance_by(&mut self, n: usize) -> Result<(), NonZero<usize>>

🔬This is a nightly-only experimental API. (iter_advance_by)
Advances the iterator by n elements. Read more
1.0.0 · source§

fn nth(&mut self, n: usize) -> Option<Self::Item>

Returns the nth element of the iterator. Read more
1.28.0 · source§

fn step_by(self, step: usize) -> StepBy<Self>
where + Self: Sized,

Creates an iterator starting at the same point, but stepping by +the given amount at each iteration. Read more
1.0.0 · source§

fn chain<U>(self, other: U) -> Chain<Self, <U as IntoIterator>::IntoIter>
where + Self: Sized, + U: IntoIterator<Item = Self::Item>,

Takes two iterators and creates a new iterator over both in sequence. Read more
1.0.0 · source§

fn zip<U>(self, other: U) -> Zip<Self, <U as IntoIterator>::IntoIter>
where + Self: Sized, + U: IntoIterator,

‘Zips up’ two iterators into a single iterator of pairs. Read more
source§

fn intersperse(self, separator: Self::Item) -> Intersperse<Self>
where + Self: Sized, + Self::Item: Clone,

🔬This is a nightly-only experimental API. (iter_intersperse)
Creates a new iterator which places a copy of separator between adjacent +items of the original iterator. Read more
source§

fn intersperse_with<G>(self, separator: G) -> IntersperseWith<Self, G>
where + Self: Sized, + G: FnMut() -> Self::Item,

🔬This is a nightly-only experimental API. (iter_intersperse)
Creates a new iterator which places an item generated by separator +between adjacent items of the original iterator. Read more
1.0.0 · source§

fn map<B, F>(self, f: F) -> Map<Self, F>
where + Self: Sized, + F: FnMut(Self::Item) -> B,

Takes a closure and creates an iterator which calls that closure on each +element. Read more
1.21.0 · source§

fn for_each<F>(self, f: F)
where + Self: Sized, + F: FnMut(Self::Item),

Calls a closure on each element of an iterator. Read more
1.0.0 · source§

fn filter<P>(self, predicate: P) -> Filter<Self, P>
where + Self: Sized, + P: FnMut(&Self::Item) -> bool,

Creates an iterator which uses a closure to determine if an element +should be yielded. Read more
1.0.0 · source§

fn filter_map<B, F>(self, f: F) -> FilterMap<Self, F>
where + Self: Sized, + F: FnMut(Self::Item) -> Option<B>,

Creates an iterator that both filters and maps. Read more
1.0.0 · source§

fn enumerate(self) -> Enumerate<Self>
where + Self: Sized,

Creates an iterator which gives the current iteration count as well as +the next value. Read more
1.0.0 · source§

fn peekable(self) -> Peekable<Self>
where + Self: Sized,

Creates an iterator which can use the peek and peek_mut methods +to look at the next element of the iterator without consuming it. See +their documentation for more information. Read more
1.0.0 · source§

fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P>
where + Self: Sized, + P: FnMut(&Self::Item) -> bool,

Creates an iterator that skips elements based on a predicate. Read more
1.0.0 · source§

fn take_while<P>(self, predicate: P) -> TakeWhile<Self, P>
where + Self: Sized, + P: FnMut(&Self::Item) -> bool,

Creates an iterator that yields elements based on a predicate. Read more
1.57.0 · source§

fn map_while<B, P>(self, predicate: P) -> MapWhile<Self, P>
where + Self: Sized, + P: FnMut(Self::Item) -> Option<B>,

Creates an iterator that both yields elements based on a predicate and maps. Read more
1.0.0 · source§

fn skip(self, n: usize) -> Skip<Self>
where + Self: Sized,

Creates an iterator that skips the first n elements. Read more
1.0.0 · source§

fn take(self, n: usize) -> Take<Self>
where + Self: Sized,

Creates an iterator that yields the first n elements, or fewer +if the underlying iterator ends sooner. Read more
1.0.0 · source§

fn scan<St, B, F>(self, initial_state: St, f: F) -> Scan<Self, St, F>
where + Self: Sized, + F: FnMut(&mut St, Self::Item) -> Option<B>,

An iterator adapter which, like fold, holds internal state, but +unlike fold, produces a new iterator. Read more
1.0.0 · source§

fn flat_map<U, F>(self, f: F) -> FlatMap<Self, U, F>
where + Self: Sized, + U: IntoIterator, + F: FnMut(Self::Item) -> U,

Creates an iterator that works like map, but flattens nested structure. Read more
source§

fn map_windows<F, R, const N: usize>(self, f: F) -> MapWindows<Self, F, N>
where + Self: Sized, + F: FnMut(&[Self::Item; N]) -> R,

🔬This is a nightly-only experimental API. (iter_map_windows)
Calls the given function f for each contiguous window of size N over +self and returns an iterator over the outputs of f. Like slice::windows(), +the windows during mapping overlap as well. Read more
1.0.0 · source§

fn fuse(self) -> Fuse<Self>
where + Self: Sized,

Creates an iterator which ends after the first None. Read more
1.0.0 · source§

fn inspect<F>(self, f: F) -> Inspect<Self, F>
where + Self: Sized, + F: FnMut(&Self::Item),

Does something with each element of an iterator, passing the value on. Read more
1.0.0 · source§

fn by_ref(&mut self) -> &mut Self
where + Self: Sized,

Borrows an iterator, rather than consuming it. Read more
1.0.0 · source§

fn collect<B>(self) -> B
where + B: FromIterator<Self::Item>, + Self: Sized,

Transforms an iterator into a collection. Read more
source§

fn collect_into<E>(self, collection: &mut E) -> &mut E
where + E: Extend<Self::Item>, + Self: Sized,

🔬This is a nightly-only experimental API. (iter_collect_into)
Collects all the items from an iterator into a collection. Read more
1.0.0 · source§

fn partition<B, F>(self, f: F) -> (B, B)
where + Self: Sized, + B: Default + Extend<Self::Item>, + F: FnMut(&Self::Item) -> bool,

Consumes an iterator, creating two collections from it. Read more
source§

fn is_partitioned<P>(self, predicate: P) -> bool
where + Self: Sized, + P: FnMut(Self::Item) -> bool,

🔬This is a nightly-only experimental API. (iter_is_partitioned)
Checks if the elements of this iterator are partitioned according to the given predicate, +such that all those that return true precede all those that return false. Read more
1.27.0 · source§

fn try_fold<B, F, R>(&mut self, init: B, f: F) -> R
where + Self: Sized, + F: FnMut(B, Self::Item) -> R, + R: Try<Output = B>,

An iterator method that applies a function as long as it returns +successfully, producing a single, final value. Read more
1.27.0 · source§

fn try_for_each<F, R>(&mut self, f: F) -> R
where + Self: Sized, + F: FnMut(Self::Item) -> R, + R: Try<Output = ()>,

An iterator method that applies a fallible function to each item in the +iterator, stopping at the first error and returning that error. Read more
1.0.0 · source§

fn fold<B, F>(self, init: B, f: F) -> B
where + Self: Sized, + F: FnMut(B, Self::Item) -> B,

Folds every element into an accumulator by applying an operation, +returning the final result. Read more
1.51.0 · source§

fn reduce<F>(self, f: F) -> Option<Self::Item>
where + Self: Sized, + F: FnMut(Self::Item, Self::Item) -> Self::Item,

Reduces the elements to a single one, by repeatedly applying a reducing +operation. Read more
source§

fn try_reduce<F, R>( + &mut self, + f: F +) -> <<R as Try>::Residual as Residual<Option<<R as Try>::Output>>>::TryType
where + Self: Sized, + F: FnMut(Self::Item, Self::Item) -> R, + R: Try<Output = Self::Item>, + <R as Try>::Residual: Residual<Option<Self::Item>>,

🔬This is a nightly-only experimental API. (iterator_try_reduce)
Reduces the elements to a single one by repeatedly applying a reducing operation. If the +closure returns a failure, the failure is propagated back to the caller immediately. Read more
1.0.0 · source§

fn all<F>(&mut self, f: F) -> bool
where + Self: Sized, + F: FnMut(Self::Item) -> bool,

Tests if every element of the iterator matches a predicate. Read more
1.0.0 · source§

fn any<F>(&mut self, f: F) -> bool
where + Self: Sized, + F: FnMut(Self::Item) -> bool,

Tests if any element of the iterator matches a predicate. Read more
1.0.0 · source§

fn find<P>(&mut self, predicate: P) -> Option<Self::Item>
where + Self: Sized, + P: FnMut(&Self::Item) -> bool,

Searches for an element of an iterator that satisfies a predicate. Read more
1.30.0 · source§

fn find_map<B, F>(&mut self, f: F) -> Option<B>
where + Self: Sized, + F: FnMut(Self::Item) -> Option<B>,

Applies function to the elements of iterator and returns +the first non-none result. Read more
source§

fn try_find<F, R>( + &mut self, + f: F +) -> <<R as Try>::Residual as Residual<Option<Self::Item>>>::TryType
where + Self: Sized, + F: FnMut(&Self::Item) -> R, + R: Try<Output = bool>, + <R as Try>::Residual: Residual<Option<Self::Item>>,

🔬This is a nightly-only experimental API. (try_find)
Applies function to the elements of iterator and returns +the first true result or the first error. Read more
1.0.0 · source§

fn position<P>(&mut self, predicate: P) -> Option<usize>
where + Self: Sized, + P: FnMut(Self::Item) -> bool,

Searches for an element in an iterator, returning its index. Read more
1.6.0 · source§

fn max_by_key<B, F>(self, f: F) -> Option<Self::Item>
where + B: Ord, + Self: Sized, + F: FnMut(&Self::Item) -> B,

Returns the element that gives the maximum value from the +specified function. Read more
1.15.0 · source§

fn max_by<F>(self, compare: F) -> Option<Self::Item>
where + Self: Sized, + F: FnMut(&Self::Item, &Self::Item) -> Ordering,

Returns the element that gives the maximum value with respect to the +specified comparison function. Read more
1.6.0 · source§

fn min_by_key<B, F>(self, f: F) -> Option<Self::Item>
where + B: Ord, + Self: Sized, + F: FnMut(&Self::Item) -> B,

Returns the element that gives the minimum value from the +specified function. Read more
1.15.0 · source§

fn min_by<F>(self, compare: F) -> Option<Self::Item>
where + Self: Sized, + F: FnMut(&Self::Item, &Self::Item) -> Ordering,

Returns the element that gives the minimum value with respect to the +specified comparison function. Read more
1.0.0 · source§

fn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB)
where + FromA: Default + Extend<A>, + FromB: Default + Extend<B>, + Self: Sized + Iterator<Item = (A, B)>,

Converts an iterator of pairs into a pair of containers. Read more
1.36.0 · source§

fn copied<'a, T>(self) -> Copied<Self>
where + T: 'a + Copy, + Self: Sized + Iterator<Item = &'a T>,

Creates an iterator which copies all of its elements. Read more
1.0.0 · source§

fn cloned<'a, T>(self) -> Cloned<Self>
where + T: 'a + Clone, + Self: Sized + Iterator<Item = &'a T>,

Creates an iterator which clones all of its elements. Read more
1.0.0 · source§

fn cycle(self) -> Cycle<Self>
where + Self: Sized + Clone,

Repeats an iterator endlessly. Read more
source§

fn array_chunks<const N: usize>(self) -> ArrayChunks<Self, N>
where + Self: Sized,

🔬This is a nightly-only experimental API. (iter_array_chunks)
Returns an iterator over N elements of the iterator at a time. Read more
1.11.0 · source§

fn sum<S>(self) -> S
where + Self: Sized, + S: Sum<Self::Item>,

Sums the elements of an iterator. Read more
1.11.0 · source§

fn product<P>(self) -> P
where + Self: Sized, + P: Product<Self::Item>,

Iterates over the entire iterator, multiplying all the elements Read more
source§

fn cmp_by<I, F>(self, other: I, cmp: F) -> Ordering
where + Self: Sized, + I: IntoIterator, + F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Ordering,

🔬This is a nightly-only experimental API. (iter_order_by)
Lexicographically compares the elements of this Iterator with those +of another with respect to the specified comparison function. Read more
1.5.0 · source§

fn partial_cmp<I>(self, other: I) -> Option<Ordering>
where + I: IntoIterator, + Self::Item: PartialOrd<<I as IntoIterator>::Item>, + Self: Sized,

Lexicographically compares the PartialOrd elements of +this Iterator with those of another. The comparison works like short-circuit +evaluation, returning a result without comparing the remaining elements. +As soon as an order can be determined, the evaluation stops and a result is returned. Read more
source§

fn partial_cmp_by<I, F>(self, other: I, partial_cmp: F) -> Option<Ordering>
where + Self: Sized, + I: IntoIterator, + F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Option<Ordering>,

🔬This is a nightly-only experimental API. (iter_order_by)
Lexicographically compares the elements of this Iterator with those +of another with respect to the specified comparison function. Read more
1.5.0 · source§

fn eq<I>(self, other: I) -> bool
where + I: IntoIterator, + Self::Item: PartialEq<<I as IntoIterator>::Item>, + Self: Sized,

Determines if the elements of this Iterator are equal to those of +another. Read more
source§

fn eq_by<I, F>(self, other: I, eq: F) -> bool
where + Self: Sized, + I: IntoIterator, + F: FnMut(Self::Item, <I as IntoIterator>::Item) -> bool,

🔬This is a nightly-only experimental API. (iter_order_by)
Determines if the elements of this Iterator are equal to those of +another with respect to the specified equality function. Read more
1.5.0 · source§

fn ne<I>(self, other: I) -> bool
where + I: IntoIterator, + Self::Item: PartialEq<<I as IntoIterator>::Item>, + Self: Sized,

Determines if the elements of this Iterator are not equal to those of +another. Read more
1.5.0 · source§

fn lt<I>(self, other: I) -> bool
where + I: IntoIterator, + Self::Item: PartialOrd<<I as IntoIterator>::Item>, + Self: Sized,

Determines if the elements of this Iterator are lexicographically +less than those of another. Read more
1.5.0 · source§

fn le<I>(self, other: I) -> bool
where + I: IntoIterator, + Self::Item: PartialOrd<<I as IntoIterator>::Item>, + Self: Sized,

Determines if the elements of this Iterator are lexicographically +less or equal to those of another. Read more
1.5.0 · source§

fn gt<I>(self, other: I) -> bool
where + I: IntoIterator, + Self::Item: PartialOrd<<I as IntoIterator>::Item>, + Self: Sized,

Determines if the elements of this Iterator are lexicographically +greater than those of another. Read more
1.5.0 · source§

fn ge<I>(self, other: I) -> bool
where + I: IntoIterator, + Self::Item: PartialOrd<<I as IntoIterator>::Item>, + Self: Sized,

Determines if the elements of this Iterator are lexicographically +greater than or equal to those of another. Read more
source§

fn is_sorted_by<F>(self, compare: F) -> bool
where + Self: Sized, + F: FnMut(&Self::Item, &Self::Item) -> bool,

🔬This is a nightly-only experimental API. (is_sorted)
Checks if the elements of this iterator are sorted using the given comparator function. Read more
source§

fn is_sorted_by_key<F, K>(self, f: F) -> bool
where + Self: Sized, + F: FnMut(Self::Item) -> K, + K: PartialOrd,

🔬This is a nightly-only experimental API. (is_sorted)
Checks if the elements of this iterator are sorted using the given key extraction +function. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<I> IntoIterator for I
where + I: Iterator,

§

type Item = <I as Iterator>::Item

The type of the elements being iterated over.
§

type IntoIter = I

Which kind of iterator are we turning this into?
const: unstable · source§

fn into_iter(self) -> I

Creates an iterator from a value. Read more
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/quote/all.html b/quote/all.html new file mode 100644 index 0000000..a786938 --- /dev/null +++ b/quote/all.html @@ -0,0 +1 @@ +List of all items in this crate

List of all items

Traits

Macros

\ No newline at end of file diff --git a/quote/ext/trait.TokenStreamExt.html b/quote/ext/trait.TokenStreamExt.html new file mode 100644 index 0000000..26d9966 --- /dev/null +++ b/quote/ext/trait.TokenStreamExt.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../quote/trait.TokenStreamExt.html...

+ + + \ No newline at end of file diff --git a/quote/ident_fragment/trait.IdentFragment.html b/quote/ident_fragment/trait.IdentFragment.html new file mode 100644 index 0000000..77a08b9 --- /dev/null +++ b/quote/ident_fragment/trait.IdentFragment.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../quote/trait.IdentFragment.html...

+ + + \ No newline at end of file diff --git a/quote/index.html b/quote/index.html new file mode 100644 index 0000000..cb3a5ac --- /dev/null +++ b/quote/index.html @@ -0,0 +1,58 @@ +quote - Rust

Crate quote

source ·
Expand description

githubcrates-iodocs-rs

+
+

This crate provides the quote! macro for turning Rust syntax tree data +structures into tokens of source code.

+

Procedural macros in Rust receive a stream of tokens as input, execute +arbitrary Rust code to determine how to manipulate those tokens, and produce +a stream of tokens to hand back to the compiler to compile into the caller’s +crate. Quasi-quoting is a solution to one piece of that — producing +tokens to return to the compiler.

+

The idea of quasi-quoting is that we write code that we treat as data. +Within the quote! macro, we can write what looks like code to our text +editor or IDE. We get all the benefits of the editor’s brace matching, +syntax highlighting, indentation, and maybe autocompletion. But rather than +compiling that as code into the current crate, we can treat it as data, pass +it around, mutate it, and eventually hand it back to the compiler as tokens +to compile into the macro caller’s crate.

+

This crate is motivated by the procedural macro use case, but is a +general-purpose Rust quasi-quoting library and is not specific to procedural +macros.

+
[dependencies]
+quote = "1.0"
+

+

§Example

+

The following quasi-quoted block of code is something you might find in a +procedural macro having to do with data structure serialization. The #var +syntax performs interpolation of runtime variables into the quoted tokens. +Check out the documentation of the quote! macro for more detail about +the syntax. See also the quote_spanned! macro which is important for +implementing hygienic procedural macros.

+ +
let tokens = quote! {
+    struct SerializeWith #generics #where_clause {
+        value: &'a #field_ty,
+        phantom: core::marker::PhantomData<#item_ty>,
+    }
+
+    impl #generics serde::Serialize for SerializeWith #generics #where_clause {
+        fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+        where
+            S: serde::Serializer,
+        {
+            #path(self.value, serializer)
+        }
+    }
+
+    SerializeWith {
+        value: #value,
+        phantom: core::marker::PhantomData::<#item_ty>,
+    }
+};
+
+

§Non-macro code generators

+

When using quote in a build.rs or main.rs and writing the output out to a +file, consider having the code generator pass the tokens through +prettyplease before writing. This way if an error occurs in the generated +code it is convenient for a human to read and debug.

+

Macros§

  • Formatting macro for constructing Idents.
  • The whole point.
  • Same as quote!, but applies a given span to all tokens originating within +the macro invocation.

Traits§

  • Specialized formatting trait used by format_ident!.
  • Types that can be interpolated inside a quote! invocation.
  • TokenStream extension trait with methods for appending tokens.
\ No newline at end of file diff --git a/quote/macro.format_ident!.html b/quote/macro.format_ident!.html new file mode 100644 index 0000000..08480a5 --- /dev/null +++ b/quote/macro.format_ident!.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to macro.format_ident.html...

+ + + \ No newline at end of file diff --git a/quote/macro.format_ident.html b/quote/macro.format_ident.html new file mode 100644 index 0000000..103752f --- /dev/null +++ b/quote/macro.format_ident.html @@ -0,0 +1,76 @@ +format_ident in quote - Rust

Macro quote::format_ident

source ·
macro_rules! format_ident {
+    ($fmt:expr) => { ... };
+    ($fmt:expr, $($rest:tt)*) => { ... };
+}
Expand description

Formatting macro for constructing Idents.

+
+

§Syntax

+

Syntax is copied from the format! macro, supporting both positional and +named arguments.

+

Only a limited set of formatting traits are supported. The current mapping +of format types to traits is:

+ +

See std::fmt for more information.

+
+

§IdentFragment

+

Unlike format!, this macro uses the IdentFragment formatting trait by +default. This trait is like Display, with a few differences:

+
    +
  • IdentFragment is only implemented for a limited set of types, such as +unsigned integers and strings.
  • +
  • Ident arguments will have their r# prefixes stripped, if present.
  • +
+
+

§Hygiene

+

The Span of the first Ident argument is used as the span of the final +identifier, falling back to Span::call_site when no identifiers are +provided.

+ +
// If `ident` is an Ident, the span of `my_ident` will be inherited from it.
+let my_ident = format_ident!("My{}{}", ident, "IsCool");
+assert_eq!(my_ident, "MyIdentIsCool");
+

Alternatively, the span can be overridden by passing the span named +argument.

+ +
let my_span = /* ... */;
+format_ident!("MyIdent", span = my_span);
+


+

§Panics

+

This method will panic if the resulting formatted string is not a valid +identifier.

+
+

§Examples

+

Composing raw and non-raw identifiers:

+ +
let my_ident = format_ident!("My{}", "Ident");
+assert_eq!(my_ident, "MyIdent");
+
+let raw = format_ident!("r#Raw");
+assert_eq!(raw, "r#Raw");
+
+let my_ident_raw = format_ident!("{}Is{}", my_ident, raw);
+assert_eq!(my_ident_raw, "MyIdentIsRaw");
+

Integer formatting options:

+ +
let num: u32 = 10;
+
+let decimal = format_ident!("Id_{}", num);
+assert_eq!(decimal, "Id_10");
+
+let octal = format_ident!("Id_{:o}", num);
+assert_eq!(octal, "Id_12");
+
+let binary = format_ident!("Id_{:b}", num);
+assert_eq!(binary, "Id_1010");
+
+let lower_hex = format_ident!("Id_{:x}", num);
+assert_eq!(lower_hex, "Id_a");
+
+let upper_hex = format_ident!("Id_{:X}", num);
+assert_eq!(upper_hex, "Id_A");
+
\ No newline at end of file diff --git a/quote/macro.quote!.html b/quote/macro.quote!.html new file mode 100644 index 0000000..e493619 --- /dev/null +++ b/quote/macro.quote!.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to macro.quote.html...

+ + + \ No newline at end of file diff --git a/quote/macro.quote.html b/quote/macro.quote.html new file mode 100644 index 0000000..af20122 --- /dev/null +++ b/quote/macro.quote.html @@ -0,0 +1,189 @@ +quote in quote - Rust

Macro quote::quote

source ·
macro_rules! quote {
+    ($($tt:tt)*) => { ... };
+}
Expand description

The whole point.

+

Performs variable interpolation against the input and produces it as +proc_macro2::TokenStream.

+

Note: for returning tokens to the compiler in a procedural macro, use +.into() on the result to convert to proc_macro::TokenStream.

+
+

§Interpolation

+

Variable interpolation is done with #var (similar to $var in +macro_rules! macros). This grabs the var variable that is currently in +scope and inserts it in that location in the output tokens. Any type +implementing the ToTokens trait can be interpolated. This includes most +Rust primitive types as well as most of the syntax tree types from the Syn +crate.

+

Repetition is done using #(...)* or #(...),* again similar to +macro_rules!. This iterates through the elements of any variable +interpolated within the repetition and inserts a copy of the repetition body +for each one. The variables in an interpolation may be a Vec, slice, +BTreeSet, or any Iterator.

+
    +
  • #(#var)* — no separators
  • +
  • #(#var),* — the character before the asterisk is used as a separator
  • +
  • #( struct #var; )* — the repetition can contain other tokens
  • +
  • #( #k => println!("{}", #v), )* — even multiple interpolations
  • +
+
+

§Hygiene

+

Any interpolated tokens preserve the Span information provided by their +ToTokens implementation. Tokens that originate within the quote! +invocation are spanned with Span::call_site().

+

A different span can be provided through the quote_spanned! macro.

+
+

§Return type

+

The macro evaluates to an expression of type proc_macro2::TokenStream. +Meanwhile Rust procedural macros are expected to return the type +proc_macro::TokenStream.

+

The difference between the two types is that proc_macro types are entirely +specific to procedural macros and cannot ever exist in code outside of a +procedural macro, while proc_macro2 types may exist anywhere including +tests and non-macro code like main.rs and build.rs. This is why even the +procedural macro ecosystem is largely built around proc_macro2, because +that ensures the libraries are unit testable and accessible in non-macro +contexts.

+

There is a From-conversion in both directions so returning the output of +quote! from a procedural macro usually looks like tokens.into() or +proc_macro::TokenStream::from(tokens).

+
+

§Examples

§Procedural macro

+

The structure of a basic procedural macro is as follows. Refer to the Syn +crate for further useful guidance on using quote! as part of a procedural +macro.

+ +
extern crate proc_macro;
+
+use proc_macro::TokenStream;
+use quote::quote;
+
+#[proc_macro_derive(HeapSize)]
+pub fn derive_heap_size(input: TokenStream) -> TokenStream {
+    // Parse the input and figure out what implementation to generate...
+    let name = /* ... */;
+    let expr = /* ... */;
+
+    let expanded = quote! {
+        // The generated impl.
+        impl heapsize::HeapSize for #name {
+            fn heap_size_of_children(&self) -> usize {
+                #expr
+            }
+        }
+    };
+
+    // Hand the output tokens back to the compiler.
+    TokenStream::from(expanded)
+}
+


+

§Combining quoted fragments

+

Usually you don’t end up constructing an entire final TokenStream in one +piece. Different parts may come from different helper functions. The tokens +produced by quote! themselves implement ToTokens and so can be +interpolated into later quote! invocations to build up a final result.

+ +
let type_definition = quote! {...};
+let methods = quote! {...};
+
+let tokens = quote! {
+    #type_definition
+    #methods
+};
+


+

§Constructing identifiers

+

Suppose we have an identifier ident which came from somewhere in a macro +input and we need to modify it in some way for the macro output. Let’s +consider prepending the identifier with an underscore.

+

Simply interpolating the identifier next to an underscore will not have the +behavior of concatenating them. The underscore and the identifier will +continue to be two separate tokens as if you had written _ x.

+ +
// incorrect
+quote! {
+    let mut _#ident = 0;
+}
+

The solution is to build a new identifier token with the correct value. As +this is such a common case, the format_ident! macro provides a +convenient utility for doing so correctly.

+ +
let varname = format_ident!("_{}", ident);
+quote! {
+    let mut #varname = 0;
+}
+

Alternatively, the APIs provided by Syn and proc-macro2 can be used to +directly build the identifier. This is roughly equivalent to the above, but +will not handle ident being a raw identifier.

+ +
let concatenated = format!("_{}", ident);
+let varname = syn::Ident::new(&concatenated, ident.span());
+quote! {
+    let mut #varname = 0;
+}
+


+

§Making method calls

+

Let’s say our macro requires some type specified in the macro input to have +a constructor called new. We have the type in a variable called +field_type of type syn::Type and want to invoke the constructor.

+ +
// incorrect
+quote! {
+    let value = #field_type::new();
+}
+

This works only sometimes. If field_type is String, the expanded code +contains String::new() which is fine. But if field_type is something +like Vec<i32> then the expanded code is Vec<i32>::new() which is invalid +syntax. Ordinarily in handwritten Rust we would write Vec::<i32>::new() +but for macros often the following is more convenient.

+ +
quote! {
+    let value = <#field_type>::new();
+}
+

This expands to <Vec<i32>>::new() which behaves correctly.

+

A similar pattern is appropriate for trait methods.

+ +
quote! {
+    let value = <#field_type as core::default::Default>::default();
+}
+


+

§Interpolating text inside of doc comments

+

Neither doc comments nor string literals get interpolation behavior in +quote:

+ +
quote! {
+    /// try to interpolate: #ident
+    ///
+    /// ...
+}
+ +
quote! {
+    #[doc = "try to interpolate: #ident"]
+}
+

Instead the best way to build doc comments that involve variables is by +formatting the doc string literal outside of quote.

+ +
let msg = format!(...);
+quote! {
+    #[doc = #msg]
+    ///
+    /// ...
+}
+


+

§Indexing into a tuple struct

+

When interpolating indices of a tuple or tuple struct, we need them not to +appears suffixed as integer literals by interpolating them as syn::Index +instead.

+ +
let i = 0usize..self.fields.len();
+
+// expands to 0 + self.0usize.heap_size() + self.1usize.heap_size() + ...
+// which is not valid syntax
+quote! {
+    0 #( + self.#i.heap_size() )*
+}
+ +
let i = (0..self.fields.len()).map(syn::Index::from);
+
+// expands to 0 + self.0.heap_size() + self.1.heap_size() + ...
+quote! {
+    0 #( + self.#i.heap_size() )*
+}
+
\ No newline at end of file diff --git a/quote/macro.quote_spanned!.html b/quote/macro.quote_spanned!.html new file mode 100644 index 0000000..11ece3b --- /dev/null +++ b/quote/macro.quote_spanned!.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to macro.quote_spanned.html...

+ + + \ No newline at end of file diff --git a/quote/macro.quote_spanned.html b/quote/macro.quote_spanned.html new file mode 100644 index 0000000..77604c5 --- /dev/null +++ b/quote/macro.quote_spanned.html @@ -0,0 +1,52 @@ +quote_spanned in quote - Rust

Macro quote::quote_spanned

source ·
macro_rules! quote_spanned {
+    ($span:expr=> $($tt:tt)*) => { ... };
+}
Expand description

Same as quote!, but applies a given span to all tokens originating within +the macro invocation.

+
+

§Syntax

+

A span expression of type Span, followed by =>, followed by the tokens +to quote. The span expression should be brief — use a variable for +anything more than a few characters. There should be no space before the +=> token.

+ +
let span = /* ... */;
+
+// On one line, use parentheses.
+let tokens = quote_spanned!(span=> Box::into_raw(Box::new(#init)));
+
+// On multiple lines, place the span at the top and use braces.
+let tokens = quote_spanned! {span=>
+    Box::into_raw(Box::new(#init))
+};
+

The lack of space before the => should look jarring to Rust programmers +and this is intentional. The formatting is designed to be visibly +off-balance and draw the eye a particular way, due to the span expression +being evaluated in the context of the procedural macro and the remaining +tokens being evaluated in the generated code.

+
+

§Hygiene

+

Any interpolated tokens preserve the Span information provided by their +ToTokens implementation. Tokens that originate within the quote_spanned! +invocation are spanned with the given span argument.

+
+

§Example

+

The following procedural macro code uses quote_spanned! to assert that a +particular Rust type implements the Sync trait so that references can be +safely shared between threads.

+ +
let ty_span = ty.span();
+let assert_sync = quote_spanned! {ty_span=>
+    struct _AssertSync where #ty: Sync;
+};
+

If the assertion fails, the user will see an error like the following. The +input span of their type is highlighted in the error.

+
error[E0277]: the trait bound `*const (): std::marker::Sync` is not satisfied
+  --> src/main.rs:10:21
+   |
+10 |     static ref PTR: *const () = &();
+   |                     ^^^^^^^^^ `*const ()` cannot be shared between threads safely
+
+

In this example it is important for the where-clause to be spanned with the +line/column information of the user’s input type so that error messages are +placed appropriately by the compiler.

+
\ No newline at end of file diff --git a/quote/sidebar-items.js b/quote/sidebar-items.js new file mode 100644 index 0000000..408ea38 --- /dev/null +++ b/quote/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"macro":["format_ident","quote","quote_spanned"],"trait":["IdentFragment","ToTokens","TokenStreamExt"]}; \ No newline at end of file diff --git a/quote/to_tokens/trait.ToTokens.html b/quote/to_tokens/trait.ToTokens.html new file mode 100644 index 0000000..635e89b --- /dev/null +++ b/quote/to_tokens/trait.ToTokens.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../quote/trait.ToTokens.html...

+ + + \ No newline at end of file diff --git a/quote/trait.IdentFragment.html b/quote/trait.IdentFragment.html new file mode 100644 index 0000000..82907da --- /dev/null +++ b/quote/trait.IdentFragment.html @@ -0,0 +1,15 @@ +IdentFragment in quote - Rust

Trait quote::IdentFragment

source ·
pub trait IdentFragment {
+    // Required method
+    fn fmt(&self, f: &mut Formatter<'_>) -> Result;
+
+    // Provided method
+    fn span(&self) -> Option<Span> { ... }
+}
Expand description

Specialized formatting trait used by format_ident!.

+

Ident arguments formatted using this trait will have their r# prefix +stripped, if present.

+

See format_ident! for more information.

+

Required Methods§

source

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Format this value as an identifier fragment.

+

Provided Methods§

source

fn span(&self) -> Option<Span>

Span associated with this IdentFragment.

+

If non-None, may be inherited by formatted identifiers.

+

Implementations on Foreign Types§

source§

impl IdentFragment for bool

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

source§

impl IdentFragment for char

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

source§

impl IdentFragment for str

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

source§

impl IdentFragment for u8

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

source§

impl IdentFragment for u16

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

source§

impl IdentFragment for u32

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

source§

impl IdentFragment for u64

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

source§

impl IdentFragment for u128

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

source§

impl IdentFragment for usize

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

source§

impl IdentFragment for Ident

source§

fn span(&self) -> Option<Span>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

source§

impl IdentFragment for String

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

source§

impl<T> IdentFragment for Cow<'_, T>
where + T: IdentFragment + ToOwned + ?Sized,

source§

fn span(&self) -> Option<Span>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

source§

impl<T: IdentFragment + ?Sized> IdentFragment for &T

source§

fn span(&self) -> Option<Span>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

source§

impl<T: IdentFragment + ?Sized> IdentFragment for &mut T

source§

fn span(&self) -> Option<Span>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Implementors§

\ No newline at end of file diff --git a/quote/trait.ToTokens.html b/quote/trait.ToTokens.html new file mode 100644 index 0000000..ebdf0ac --- /dev/null +++ b/quote/trait.ToTokens.html @@ -0,0 +1,44 @@ +ToTokens in quote - Rust

Trait quote::ToTokens

source ·
pub trait ToTokens {
+    // Required method
+    fn to_tokens(&self, tokens: &mut TokenStream);
+
+    // Provided methods
+    fn to_token_stream(&self) -> TokenStream { ... }
+    fn into_token_stream(self) -> TokenStream
+       where Self: Sized { ... }
+}
Expand description

Types that can be interpolated inside a quote! invocation.

+

Required Methods§

source

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream.

+

The token append methods provided by the TokenStreamExt extension +trait may be useful for implementing ToTokens.

+
§Example
+

Example implementation for a struct representing Rust paths like +std::cmp::PartialEq:

+ +
use proc_macro2::{TokenTree, Spacing, Span, Punct, TokenStream};
+use quote::{TokenStreamExt, ToTokens};
+
+pub struct Path {
+    pub global: bool,
+    pub segments: Vec<PathSegment>,
+}
+
+impl ToTokens for Path {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
+        for (i, segment) in self.segments.iter().enumerate() {
+            if i > 0 || self.global {
+                // Double colon `::`
+                tokens.append(Punct::new(':', Spacing::Joint));
+                tokens.append(Punct::new(':', Spacing::Alone));
+            }
+            segment.to_tokens(tokens);
+        }
+    }
+}
+

Provided Methods§

source

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object.

+

This method is implicitly implemented using to_tokens, and acts as a +convenience method for consumers of the ToTokens trait.

+
source

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object.

+

This method is implicitly implemented using to_tokens, and acts as a +convenience method for consumers of the ToTokens trait.

+

Implementations on Foreign Types§

source§

impl ToTokens for TokenTree

source§

fn to_tokens(&self, dst: &mut TokenStream)

source§

impl ToTokens for bool

source§

fn to_tokens(&self, tokens: &mut TokenStream)

source§

impl ToTokens for char

source§

fn to_tokens(&self, tokens: &mut TokenStream)

source§

impl ToTokens for f32

source§

fn to_tokens(&self, tokens: &mut TokenStream)

source§

impl ToTokens for f64

source§

fn to_tokens(&self, tokens: &mut TokenStream)

source§

impl ToTokens for i8

source§

fn to_tokens(&self, tokens: &mut TokenStream)

source§

impl ToTokens for i16

source§

fn to_tokens(&self, tokens: &mut TokenStream)

source§

impl ToTokens for i32

source§

fn to_tokens(&self, tokens: &mut TokenStream)

source§

impl ToTokens for i64

source§

fn to_tokens(&self, tokens: &mut TokenStream)

source§

impl ToTokens for i128

source§

fn to_tokens(&self, tokens: &mut TokenStream)

source§

impl ToTokens for isize

source§

fn to_tokens(&self, tokens: &mut TokenStream)

source§

impl ToTokens for str

source§

fn to_tokens(&self, tokens: &mut TokenStream)

source§

impl ToTokens for u8

source§

fn to_tokens(&self, tokens: &mut TokenStream)

source§

impl ToTokens for u16

source§

fn to_tokens(&self, tokens: &mut TokenStream)

source§

impl ToTokens for u32

source§

fn to_tokens(&self, tokens: &mut TokenStream)

source§

impl ToTokens for u64

source§

fn to_tokens(&self, tokens: &mut TokenStream)

source§

impl ToTokens for u128

source§

fn to_tokens(&self, tokens: &mut TokenStream)

source§

impl ToTokens for usize

source§

fn to_tokens(&self, tokens: &mut TokenStream)

source§

impl ToTokens for Group

source§

fn to_tokens(&self, tokens: &mut TokenStream)

source§

impl ToTokens for Ident

source§

fn to_tokens(&self, tokens: &mut TokenStream)

source§

impl ToTokens for Literal

source§

fn to_tokens(&self, tokens: &mut TokenStream)

source§

impl ToTokens for Punct

source§

fn to_tokens(&self, tokens: &mut TokenStream)

source§

impl ToTokens for TokenStream

source§

impl ToTokens for String

source§

fn to_tokens(&self, tokens: &mut TokenStream)

source§

impl<'a, T: ?Sized + ToOwned + ToTokens> ToTokens for Cow<'a, T>

source§

fn to_tokens(&self, tokens: &mut TokenStream)

source§

impl<'a, T: ?Sized + ToTokens> ToTokens for &'a T

source§

fn to_tokens(&self, tokens: &mut TokenStream)

source§

impl<'a, T: ?Sized + ToTokens> ToTokens for &'a mut T

source§

fn to_tokens(&self, tokens: &mut TokenStream)

source§

impl<T: ToTokens> ToTokens for Option<T>

source§

fn to_tokens(&self, tokens: &mut TokenStream)

source§

impl<T: ?Sized + ToTokens> ToTokens for Box<T>

source§

fn to_tokens(&self, tokens: &mut TokenStream)

source§

impl<T: ?Sized + ToTokens> ToTokens for Rc<T>

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Implementors§

\ No newline at end of file diff --git a/quote/trait.TokenStreamExt.html b/quote/trait.TokenStreamExt.html new file mode 100644 index 0000000..cbe6511 --- /dev/null +++ b/quote/trait.TokenStreamExt.html @@ -0,0 +1,56 @@ +TokenStreamExt in quote - Rust

Trait quote::TokenStreamExt

source ·
pub trait TokenStreamExt: Sealed {
+    // Required methods
+    fn append<U>(&mut self, token: U)
+       where U: Into<TokenTree>;
+    fn append_all<I>(&mut self, iter: I)
+       where I: IntoIterator,
+             I::Item: ToTokens;
+    fn append_separated<I, U>(&mut self, iter: I, op: U)
+       where I: IntoIterator,
+             I::Item: ToTokens,
+             U: ToTokens;
+    fn append_terminated<I, U>(&mut self, iter: I, term: U)
+       where I: IntoIterator,
+             I::Item: ToTokens,
+             U: ToTokens;
+}
Expand description

TokenStream extension trait with methods for appending tokens.

+

This trait is sealed and cannot be implemented outside of the quote crate.

+

Required Methods§

source

fn append<U>(&mut self, token: U)
where + U: Into<TokenTree>,

For use by ToTokens implementations.

+

Appends the token specified to this list of tokens.

+
source

fn append_all<I>(&mut self, iter: I)
where + I: IntoIterator, + I::Item: ToTokens,

For use by ToTokens implementations.

+ +
struct X;
+
+impl ToTokens for X {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
+        tokens.append_all(&[true, false]);
+    }
+}
+
+let tokens = quote!(#X);
+assert_eq!(tokens.to_string(), "true false");
+
source

fn append_separated<I, U>(&mut self, iter: I, op: U)
where + I: IntoIterator, + I::Item: ToTokens, + U: ToTokens,

For use by ToTokens implementations.

+

Appends all of the items in the iterator I, separated by the tokens +U.

+
source

fn append_terminated<I, U>(&mut self, iter: I, term: U)
where + I: IntoIterator, + I::Item: ToTokens, + U: ToTokens,

For use by ToTokens implementations.

+

Appends all tokens in the iterator I, appending U after each +element, including after the last element of the iterator.

+

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl TokenStreamExt for TokenStream

source§

fn append<U>(&mut self, token: U)
where + U: Into<TokenTree>,

source§

fn append_all<I>(&mut self, iter: I)
where + I: IntoIterator, + I::Item: ToTokens,

source§

fn append_separated<I, U>(&mut self, iter: I, op: U)
where + I: IntoIterator, + I::Item: ToTokens, + U: ToTokens,

source§

fn append_terminated<I, U>(&mut self, iter: I, term: U)
where + I: IntoIterator, + I::Item: ToTokens, + U: ToTokens,

Implementors§

\ No newline at end of file diff --git a/search-index.js b/search-index.js new file mode 100644 index 0000000..5fa4872 --- /dev/null +++ b/search-index.js @@ -0,0 +1,9 @@ +var searchIndex = new Map(JSON.parse('[\ +["bitflag_attr",{"t":"X","n":["bitflag"],"q":[[0,"bitflag_attr"]],"i":[0],"f":"`","D":"b","p":[],"r":[],"b":[],"c":"OjAAAAAAAAA=","e":"OjAAAAEAAAAAAAAAEAAAAAAA"}],\ +["proc_macro2",{"t":"PPPGFPFPPFFPPPFPGFFGNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNCNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNCNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNFNNNNNNNNNNNNNNFENNNNNNNNNNNNNN","n":["Alone","Brace","Bracket","Delimiter","Group","Group","Ident","Ident","Joint","LexError","Literal","Literal","None","Parenthesis","Punct","Punct","Spacing","Span","TokenStream","TokenTree","as_char","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","byte_character","byte_string","c_string","call_site","character","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","cmp","default","delim_span","delimiter","eq","eq","eq","eq","extend","extend","extra","f32_suffixed","f32_unsuffixed","f64_suffixed","f64_unsuffixed","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from_iter","from_iter","from_str","from_str","hash","i128_suffixed","i128_unsuffixed","i16_suffixed","i16_unsuffixed","i32_suffixed","i32_unsuffixed","i64_suffixed","i64_unsuffixed","i8_suffixed","i8_unsuffixed","into","into","into","into","into","into","into","into","into","into","into_iter","is_empty","isize_suffixed","isize_unsuffixed","join","located_at","mixed_site","new","new","new","new","new_raw","partial_cmp","resolved_at","set_span","set_span","set_span","set_span","set_span","source_text","spacing","span","span","span","span","span","span","span_close","span_open","stream","string","subspan","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_string","to_string","to_string","to_string","to_string","to_string","to_string","token_stream","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","u128_suffixed","u128_unsuffixed","u16_suffixed","u16_unsuffixed","u32_suffixed","u32_unsuffixed","u64_suffixed","u64_unsuffixed","u8_suffixed","u8_unsuffixed","unwrap","usize_suffixed","usize_unsuffixed","DelimSpan","borrow","borrow_mut","clone","clone_into","close","fmt","from","into","join","open","to_owned","try_from","try_into","type_id","IntoIter","TokenStream","borrow","borrow_mut","clone","clone_into","fmt","from","into","into_iter","next","size_hint","to_owned","try_from","try_into","type_id"],"q":[[0,"proc_macro2"],[230,"proc_macro2::extra"],[245,"proc_macro2::token_stream"],[261,"core::ffi::c_str"],[262,"core::cmp"],[263,"core::marker"],[264,"core::convert"],[265,"core::iter::traits::collect"],[266,"core::fmt"],[267,"proc_macro"],[268,"core::result"],[269,"core::hash"],[270,"core::option"],[271,"alloc::string"],[272,"core::ops::range"],[273,"core::any"]],"i":[14,13,13,0,0,11,0,11,14,0,0,11,13,13,0,11,0,0,0,0,1,27,10,9,11,12,13,1,14,15,6,27,10,9,11,12,13,1,14,15,6,6,6,6,9,6,10,9,11,12,13,1,14,15,6,10,9,11,12,13,1,14,15,6,15,10,12,12,13,14,15,15,10,10,0,6,6,6,6,27,27,10,10,9,11,11,12,12,13,1,1,14,15,15,6,6,27,10,10,10,9,9,11,11,11,11,11,12,13,1,14,15,6,10,10,10,6,15,6,6,6,6,6,6,6,6,6,6,27,10,9,11,12,13,1,14,15,6,10,10,6,6,9,9,9,10,12,1,15,15,15,9,11,12,1,15,6,9,1,27,11,12,1,15,6,12,12,12,6,6,10,9,11,12,13,1,14,15,6,27,10,11,12,1,15,6,0,27,10,9,11,12,13,1,14,15,6,27,10,9,11,12,13,1,14,15,6,27,10,9,11,12,13,1,14,15,6,6,6,6,6,6,6,6,6,6,6,9,6,6,0,18,18,18,18,18,18,18,18,18,18,18,18,18,18,0,0,39,39,39,39,39,39,39,39,39,39,39,39,39,39],"f":"````````````````````{{{d{b}}}f}{{{d{c}}}{{d{e}}}{}{}}000000000{{{d{hc}}}{{d{he}}}{}{}}000000000{jl}{{{d{{n{j}}}}}l}{{{d{A`}}}l}{{}Ab}{fl}{{{d{Ad}}}Ad}{{{d{Ab}}}Ab}{{{d{Af}}}Af}{{{d{Ah}}}Ah}{{{d{Aj}}}Aj}{{{d{b}}}b}{{{d{Al}}}Al}{{{d{An}}}An}{{{d{l}}}l}{{{d{c}}{d{he}}}B`{}{}}00000000{{{d{An}}{d{An}}}Bb}{{}Ad}{{{d{Ah}}}Bd}{{{d{Ah}}}Aj}{{{d{Aj}}{d{Aj}}}Bf}{{{d{Al}}{d{Al}}}Bf}{{{d{An}}{d{c}}}Bf{Bh{Bl{Bj}}}}{{{d{An}}{d{An}}}Bf}{{{d{hAd}}c}B`{{C`{}{{Bn{Ad}}}}}}{{{d{hAd}}c}B`{{C`{}{{Bn{Af}}}}}}`{Cbl}0{Cdl}0{{{d{Cf}}{d{hCh}}}Cj}0{{{d{Ad}}{d{hCh}}}Cj}0{{{d{Ab}}{d{hCh}}}Cj}{{{d{Af}}{d{hCh}}}Cj}0{{{d{Ah}}{d{hCh}}}Cj}0{{{d{Aj}}{d{hCh}}}Cj}{{{d{b}}{d{hCh}}}Cj}0{{{d{Al}}{d{hCh}}}Cj}{{{d{An}}{d{hCh}}}Cj}0{{{d{l}}{d{hCh}}}Cj}0{cc{}}{ClAd}{AfAd}22{CnAb}{AhAf}{AnAf}5{lAf}{bAf}777777{cAd{{C`{}{{Bn{Af}}}}}}{cAd{{C`{}{{Bn{Ad}}}}}}{{{d{Bj}}}{{D`{AdCf}}}}{{{d{Bj}}}{{D`{lCf}}}}{{{d{An}}{d{hc}}}B`Db}{Ddl}0{Dfl}0{Dhl}0{Djl}0{Dll}0{ce{}{}}000000000{AdDn}{{{d{Ad}}}Bf}{E`l}0{{{d{Ab}}Ab}{{Eb{Ab}}}}{{{d{Ab}}Ab}Ab}{{}Ab}{{}Ad}{{AjAd}Ah}{{fAl}b}{{{d{Bj}}Ab}An}0{{{d{An}}{d{An}}}{{Eb{Bb}}}}6{{{d{hAf}}Ab}B`}{{{d{hAh}}Ab}B`}{{{d{hb}}Ab}B`}{{{d{hAn}}Ab}B`}{{{d{hl}}Ab}B`}{{{d{Ab}}}{{Eb{Ed}}}}{{{d{b}}}Al}{{{d{Cf}}}Ab}{{{d{Af}}}Ab}{{{d{Ah}}}Ab}{{{d{b}}}Ab}{{{d{An}}}Ab}{{{d{l}}}Ab}33{{{d{Ah}}}Ad}{{{d{Bj}}}l}{{{d{l}}c}{{Eb{Ab}}}{{Eh{Ef}}}}{{{d{c}}}e{}{}}00000000{{{d{c}}}Ed{}}000000`{c{{D`{e}}}{}{}}0000000000000000000{{{d{c}}}Ej{}}000000000{Ell}0{Enl}0{F`l}0{Fbl}0{jl}0{AbCn}{Efl}0`{{{d{c}}}{{d{e}}}{}{}}{{{d{hc}}}{{d{he}}}{}{}}{{{d{Bd}}}Bd}{{{d{c}}{d{he}}}B`{}{}}{{{d{Bd}}}Ab}{{{d{Bd}}{d{hCh}}}Cj}{cc{}}{ce{}{}}33{{{d{c}}}e{}{}}{c{{D`{e}}}{}{}}0{{{d{c}}}Ej{}}``:9{{{d{Dn}}}Dn}8{{{d{Dn}}{d{hCh}}}Cj}655{{{d{hDn}}}{{Eb{Af}}}}{{{d{Dn}}}{{Fd{Ef{Eb{Ef}}}}}}6554","D":"Nh","p":[[5,"Punct",0],[1,"reference"],[1,"char"],[0,"mut"],[1,"u8"],[5,"Literal",0],[1,"slice"],[5,"CStr",261],[5,"Span",0],[5,"TokenStream",0],[6,"TokenTree",0],[5,"Group",0],[6,"Delimiter",0],[6,"Spacing",0],[5,"Ident",0],[1,"unit"],[6,"Ordering",262],[5,"DelimSpan",230],[1,"bool"],[10,"Sized",263],[1,"str"],[10,"AsRef",264],[17,"Item"],[10,"IntoIterator",265],[1,"f32"],[1,"f64"],[5,"LexError",0],[5,"Formatter",266],[8,"Result",266],[5,"TokenStream",267],[5,"Span",267],[6,"Result",268],[10,"Hasher",269],[1,"i128"],[1,"i16"],[1,"i32"],[1,"i64"],[1,"i8"],[5,"IntoIter",245],[1,"isize"],[6,"Option",270],[5,"String",271],[1,"usize"],[10,"RangeBounds",272],[5,"TypeId",273],[1,"u128"],[1,"u16"],[1,"u32"],[1,"u64"],[1,"tuple"]],"r":[[246,0]],"b":[[70,"impl-PartialEq%3CT%3E-for-Ident"],[71,"impl-PartialEq-for-Ident"],[72,"impl-Extend%3CTokenStream%3E-for-TokenStream"],[73,"impl-Extend%3CTokenTree%3E-for-TokenStream"],[79,"impl-Debug-for-LexError"],[80,"impl-Display-for-LexError"],[81,"impl-Debug-for-TokenStream"],[82,"impl-Display-for-TokenStream"],[84,"impl-Debug-for-TokenTree"],[85,"impl-Display-for-TokenTree"],[86,"impl-Display-for-Group"],[87,"impl-Debug-for-Group"],[89,"impl-Debug-for-Punct"],[90,"impl-Display-for-Punct"],[92,"impl-Display-for-Ident"],[93,"impl-Debug-for-Ident"],[94,"impl-Debug-for-Literal"],[95,"impl-Display-for-Literal"],[97,"impl-From%3CTokenStream%3E-for-TokenStream"],[98,"impl-From%3CTokenTree%3E-for-TokenStream"],[102,"impl-From%3CGroup%3E-for-TokenTree"],[103,"impl-From%3CIdent%3E-for-TokenTree"],[105,"impl-From%3CLiteral%3E-for-TokenTree"],[106,"impl-From%3CPunct%3E-for-TokenTree"],[113,"impl-FromIterator%3CTokenTree%3E-for-TokenStream"],[114,"impl-FromIterator%3CTokenStream%3E-for-TokenStream"]],"c":"OjAAAAAAAAA=","e":"OzAAAAEAAJEAEgAWABMALwATAEUABQBQABAAYgABAGYAAgBqAAEAcgAEAIsAAACXAAAAoAAAAKsADwC8AB0A6AADAO0AAADyAAMA9wAFAP8ABgA="}],\ +["quote",{"t":"KKKMMMMMQNNQQNNNNM","n":["IdentFragment","ToTokens","TokenStreamExt","append","append_all","append_separated","append_terminated","fmt","format_ident","into_token_stream","into_token_stream","quote","quote_spanned","span","span","to_token_stream","to_token_stream","to_tokens"],"q":[[0,"quote"],[18,"quote::ext"],[19,"proc_macro2"],[20,"core::convert"],[21,"core::iter::traits::collect"],[22,"quote::to_tokens"],[23,"quote::ident_fragment"],[24,"core::fmt"],[25,"core::option"]],"i":[0,0,0,2,2,2,2,9,0,8,8,0,0,9,9,8,8,8],"f":"```{{{f{bd}}c}h{{l{j}}}}{{{f{bd}}c}hn}{{{f{bd}}ce}hnA`}0{{{f{Ab}}{f{bAd}}}Af}`{A`Ah}0``{{{f{Ab}}}{{Al{Aj}}}}0{{{f{A`}}}Ah}0{{{f{A`}}{f{bAh}}}h}","D":"Bf","p":[[0,"mut"],[10,"TokenStreamExt",0,18],[1,"reference"],[1,"unit"],[6,"TokenTree",19],[10,"Into",20],[10,"IntoIterator",21],[10,"ToTokens",0,22],[10,"IdentFragment",0,23],[5,"Formatter",24],[8,"Result",24],[5,"TokenStream",19],[5,"Span",19],[6,"Option",25]],"r":[[0,23],[1,22],[2,18]],"b":[],"c":"OjAAAAAAAAA=","e":"OjAAAAAAAAA="}],\ +["syn",{"t":"FPPPPFFPPPFPFPPGFPPFFGPPPPPPPFPPFPPPPPPPPPPPPPPPPPPFFPPGFFFPPFPPPPPFGPFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFPFPGFFGFFFPPPPPGPGFFFFPPGGFPPPPPPFPPPFGFFFFGPFPPPPPPGPFFFFFFFFFFFFFFFFPPFPPPPFPGPPFFFFFFFFFPFPPFPPPPPPPPGPPGGFFPPPPPPPPPPPPPPPPPPPPTPPPPPFGFFFFFFFFFFFFFFFFFPPPPPGFFFPPFPPGFPPPPPPPPPPIPGPPPPFPPPPGGFPPPPPPPQPPPFGGFFFFPPPPPPPFGPPPPPPPPPFFFFFFFFFGFFFFFFFPGPPPPPPPPFFFFFGFFPPPPPPPPPFGFGPPPOOOOOOOOOOOOOOONOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOONNNNOOOOOOOOOOOOONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOOOOOOOOOOOOOOOOOOOOOQOOOOOOOQOCOOOONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOOOOOOOOOOOOOOOOOOOOOOOOOONNOOOOOOOOOOOOQQONNNOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOONNNNNOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOCOOOOOOOOOONNNNNNNNOOOONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOOOOOOOOOOOOOOOOOOONOOOOOOONNNNOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOOOOONNOOOOOOOOOOONOOOONOOONOOOOONOOOOOOOOOOOOOOOOONOOOOCOOOOOOOOOOOOOOOOOOONNNNNNNNNNNNNOOOOOOOOOOOOOOOOOOOOOOOOQCHNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNHNNNNNNNHNQNNNNNNNQQNHNNNNNNNNOOOOOOOOONNOOOOOOOOOOOOOOOCOOOOOOONOOOONNNNOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOONNNNNNNNNNNOOOOONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOOCNOOOOOOOOOOONNNNNNNNOONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNCNNNNNNNNOOOOOOONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOOOOOOOOOOOOOOOOONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOOOOOOOOOONOOOOOOOONNNNNNOOOOOOOOOOOOOOOOOOOOOOOOOOOOOONNNNOFFNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNKMTMFNNNNONNHONNNNFFFRKFIKKIFNNNNNNNNNNNNNNNNNNNNNCNNNNNNNNNNNNNNNNNNNNNNNNNNNNMNNNMNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNKKMMPFFFFGFFFPNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNKMFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFKFFFFFFFFFFFFFNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN","n":["Abi","Add","AddAssign","And","AngleBracketed","AngleBracketedGenericArguments","Arm","Array","Array","Assign","AssocConst","AssocConst","AssocType","AssocType","Async","AttrStyle","Attribute","Await","BareFn","BareFnArg","BareVariadic","BinOp","Binary","BitAnd","BitAndAssign","BitOr","BitOrAssign","BitXor","BitXorAssign","Block","Block","Bool","BoundLifetimes","Brace","Bracket","Break","Byte","ByteStr","CStr","Call","Cast","Char","Closed","Closure","Const","Const","Const","Const","Const","Const","Const","ConstParam","Constraint","Constraint","Continue","Data","DataEnum","DataStruct","DataUnion","Default","Deref","DeriveInput","Div","DivAssign","Enum","Enum","Eq","Error","Expr","Expr","ExprArray","ExprAssign","ExprAsync","ExprAwait","ExprBinary","ExprBlock","ExprBreak","ExprCall","ExprCast","ExprClosure","ExprConst","ExprContinue","ExprField","ExprForLoop","ExprGroup","ExprIf","ExprIndex","ExprInfer","ExprLet","ExprLit","ExprLoop","ExprMacro","ExprMatch","ExprMethodCall","ExprParen","ExprPath","ExprRange","ExprReference","ExprRepeat","ExprReturn","ExprStruct","ExprTry","ExprTryBlock","ExprTuple","ExprUnary","ExprUnsafe","ExprWhile","ExprYield","ExternCrate","Field","Field","FieldMutability","FieldPat","FieldValue","Fields","FieldsNamed","FieldsUnnamed","File","Float","Fn","Fn","Fn","Fn","FnArg","ForLoop","ForeignItem","ForeignItemFn","ForeignItemMacro","ForeignItemStatic","ForeignItemType","ForeignMod","Ge","GenericArgument","GenericParam","Generics","Glob","Group","Group","Group","Gt","HalfOpen","Ident","Ident","If","Impl","ImplGenerics","ImplItem","ImplItemConst","ImplItemFn","ImplItemMacro","ImplItemType","ImplRestriction","ImplTrait","Index","Index","Infer","Infer","Inherited","Inner","Int","Item","Item","ItemConst","ItemEnum","ItemExternCrate","ItemFn","ItemForeignMod","ItemImpl","ItemMacro","ItemMod","ItemStatic","ItemStruct","ItemTrait","ItemTraitAlias","ItemType","ItemUnion","ItemUse","Label","Le","Let","Lifetime","Lifetime","Lifetime","Lifetime","Lifetime","LifetimeParam","List","Lit","Lit","Lit","LitBool","LitByte","LitByteStr","LitCStr","LitChar","LitFloat","LitInt","LitStr","Local","Local","LocalInit","Loop","Lt","Macro","Macro","Macro","Macro","Macro","Macro","Macro","Macro","Macro","MacroDelimiter","Match","Maybe","Member","Meta","MetaList","MetaNameValue","MethodCall","Mod","Mul","MulAssign","Mut","Name","NameValue","Named","Named","Ne","Neg","Never","None","None","None","None","Not","Or","Or","Outer","PLACEHOLDER","Paren","Paren","Paren","Paren","Parenthesized","ParenthesizedGenericArguments","Pat","PatConst","PatIdent","PatLit","PatMacro","PatOr","PatParen","PatPath","PatRange","PatReference","PatRest","PatSlice","PatStruct","PatTuple","PatTupleStruct","PatType","PatWild","Path","Path","Path","Path","Path","Path","PathArguments","PathSegment","PredicateLifetime","PredicateType","Ptr","Public","QSelf","Range","Range","RangeLimits","Receiver","Receiver","Reference","Reference","Reference","Rem","RemAssign","Rename","Repeat","Rest","Restricted","Result","Return","ReturnType","Shl","ShlAssign","Shr","ShrAssign","Signature","Slice","Slice","Static","Static","StaticMutability","Stmt","StmtMacro","Str","Struct","Struct","Struct","Struct","Sub","SubAssign","Token","Trait","Trait","TraitAlias","TraitBound","TraitBoundModifier","TraitItem","TraitItemConst","TraitItemFn","TraitItemMacro","TraitItemType","TraitObject","Try","TryBlock","Tuple","Tuple","Tuple","TupleStruct","Turbofish","Type","Type","Type","Type","Type","Type","Type","Type","Type","Type","TypeArray","TypeBareFn","TypeGenerics","TypeGroup","TypeImplTrait","TypeInfer","TypeMacro","TypeNever","TypeParam","TypeParamBound","TypeParen","TypePath","TypePtr","TypeReference","TypeSlice","TypeTraitObject","TypeTuple","Typed","UnOp","Unary","Union","Union","Unit","Unnamed","Unnamed","Unsafe","Use","UseGlob","UseGroup","UseName","UsePath","UseRename","UseTree","Variadic","Variant","Verbatim","Verbatim","Verbatim","Verbatim","Verbatim","Verbatim","Verbatim","Verbatim","Verbatim","VisRestricted","Visibility","WhereClause","WherePredicate","While","Wild","Yield","abi","abi","abi","and_token","and_token","and_token","apostrophe","args","args","args","arguments","arms","as_token","as_token","as_token","as_turbofish","async_token","asyncness","asyncness","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","attrs","auto_token","await_token","bang_token","bang_token","base","base","base10_digits","base10_digits","base10_parse","base10_parse","block","block","block","block","block","block","block","block","body","body","body","body","body","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","bounded_ty","bounds","bounds","bounds","bounds","bounds","bounds","bounds","bounds","bounds","brace_token","brace_token","brace_token","brace_token","brace_token","brace_token","brace_token","brace_token","brace_token","brace_token","brace_token","braced","bracket_token","bracket_token","bracket_token","bracket_token","bracket_token","bracket_token","bracket_token","bracketed","break_token","buffer","by_ref","capture","capture","cases","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","cmp","cmp","colon2_token","colon2_token","colon_token","colon_token","colon_token","colon_token","colon_token","colon_token","colon_token","colon_token","colon_token","colon_token","colon_token","colon_token","colon_token","colon_token","colon_token","colon_token","colon_token","colon_token","colon_token","comma","comma","comma","cond","cond","const_params","const_params_mut","const_token","const_token","const_token","const_token","const_token","const_token","const_token","constness","constness","content","continue_token","crate_token","custom_keyword","custom_punctuation","data","default","default","default","default","default","default","default","default","defaultness","defaultness","defaultness","defaultness","delimiter","delimiter","discriminant","diverge","dot2_token","dot2_token","dot_token","dot_token","dot_token","dots","dots","dyn_token","elem","elem","elem","elem","elem","elem","elems","elems","elems","elems","elems","elems","else_branch","end","end","enum_token","enum_token","eq","eq","eq","eq","eq","eq_token","eq_token","eq_token","eq_token","eq_token","eq_token","eq_token","eq_token","eq_token","eq_token","eq_token","eq_token","eq_token","eq_token","expr","expr","expr","expr","expr","expr","expr","expr","expr","expr","expr","expr","expr","expr","expr","expr","expr","expr","expr","ext","extern_token","extern_token","fat_arrow_token","fields","fields","fields","fields","fields","fields","fields","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fn_token","fn_token","for_token","for_token","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","func","generics","generics","generics","generics","generics","generics","generics","generics","generics","generics","generics","generics","generics","generics","generics","generics","generics","generics","get_ident","group_token","group_token","gt_token","gt_token","gt_token","gt_token","guard","hash","hash","hash","hash","ident","ident","ident","ident","ident","ident","ident","ident","ident","ident","ident","ident","ident","ident","ident","ident","ident","ident","ident","ident","ident","ident","ident","ident","ident","ident","ident","ident","ident","ident","ident","ident","if_token","impl_token","impl_token","in_token","in_token","index","index","init","inputs","inputs","inputs","inputs","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into_iter","into_iter","into_iter","is_empty","is_empty","is_ident","is_none","items","items","items","items","items","iter","iter_mut","label","label","label","label","label","label","leading_colon","leading_colon","leading_vert","left","left","len","len","len","let_token","let_token","lifetime","lifetime","lifetime","lifetime","lifetimes","lifetimes","lifetimes","lifetimes","lifetimes","lifetimes","lifetimes_mut","limits","limits","lit","lit","loop_token","lt_token","lt_token","lt_token","lt_token","mac","mac","mac","mac","mac","mac","mac","mac","make_where_clause","match_token","member","member","member","meta","meta","method","mod_token","modifier","movability","mutability","mutability","mutability","mutability","mutability","mutability","mutability","mutability","mutability","name","name","name","name","named","new","new","new","new","new","new","new","new","new","new","new","new","new_raw","op","op","or1_token","or2_token","output","output","output","output","params","paren_token","paren_token","paren_token","paren_token","paren_token","paren_token","paren_token","paren_token","paren_token","paren_token","paren_token","paren_token","paren_token","paren_token","paren_token","parenthesized","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse2","parse_any","parse_args","parse_args","parse_args_with","parse_args_with","parse_body","parse_body_with","parse_file","parse_inner","parse_macro_input","parse_mod_style","parse_multi","parse_multi_with_leading_vert","parse_named","parse_nested_meta","parse_nested_meta","parse_outer","parse_quote","parse_quote_spanned","parse_single","parse_str","parse_turbofish","parse_unnamed","parse_with","parse_with_earlier_boundary_rule","parse_within","parse_without_eager_brace","partial_cmp","partial_cmp","pat","pat","pat","pat","pat","pat","pat","pat","pat","path","path","path","path","path","path","path","path","path","path","path","path","path","position","pound_token","predicates","pub_token","punctuated","qself","qself","qself","qself","qself","qself","question_token","receiver","receiver","reference","rename","rename","require_ident","require_list","require_name_value","require_path_only","rest","rest","restriction","return_token","right","right","segments","self_token","self_ty","semi","semi_token","semi_token","semi_token","semi_token","semi_token","semi_token","semi_token","semi_token","semi_token","semi_token","semi_token","semi_token","semi_token","semi_token","semi_token","semi_token","semi_token","semi_token","semi_token","semi_token","semi_token","semi_token","semi_token","semi_token","set_span","set_span","set_span","set_span","set_span","set_span","set_span","set_span","set_span","set_span","set_span","shebang","sig","sig","sig","sig","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","spanned","split_for_impl","star_token","star_token","start","start","static_token","static_token","stmts","struct_token","struct_token","style","subpat","suffix","suffix","suffix","suffix","suffix","suffix","suffix","suffix","supertraits","then_branch","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_string","to_string","to_string","to_string","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","token","token","token","token","token","token","token","token","token","tokens","tokens","trait_","trait_token","trait_token","tree","tree","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_token","turbofish","ty","ty","ty","ty","ty","ty","ty","ty","ty","ty","ty","ty","ty","ty","ty","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_params","type_params_mut","type_token","type_token","type_token","type_token","underscore_token","underscore_token","underscore_token","union_token","union_token","unnamed","unraw","unsafe_token","unsafety","unsafety","unsafety","unsafety","unsafety","unsafety","use_token","value","value","value","value","value","value","value","value","value","variadic","variadic","variants","variants","vis","vis","vis","vis","vis","vis","vis","vis","vis","vis","vis","vis","vis","vis","vis","vis","vis","vis","vis","vis","where_clause","where_token","while_token","without_plus","without_plus","without_plus","without_plus","yield_token","Cursor","TokenBuffer","begin","borrow","borrow","borrow_mut","borrow_mut","clone","clone_into","empty","eof","eq","from","from","group","ident","into","into","lifetime","literal","new","new2","partial_cmp","punct","span","to_owned","token_stream","token_tree","try_from","try_from","try_into","try_into","type_id","type_id","IdentExt","parse_any","peek_any","unraw","ParseNestedMeta","borrow","borrow_mut","error","from","input","into","parse_nested_meta","parser","path","try_from","try_into","type_id","value","Error","Lookahead1","Nothing","Output","Parse","ParseBuffer","ParseStream","Parser","Peek","Result","StepCursor","advance_to","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","call","clone","clone","clone","clone_into","clone_into","clone_into","combine","cursor","deref","discouraged","drop","error","error","error","extend","fmt","fmt","fmt","fmt","fork","from","from","from","from","from","from","into","into","into","into","into","into_compile_error","into_iter","into_iter","is_empty","lookahead1","new","new_spanned","parse","parse","parse","parse","parse2","parse_any_delimiter","parse_str","parse_terminated","peek","peek","peek2","peek3","span","span","span","step","to_compile_error","to_owned","to_owned","to_owned","to_string","to_string","to_tokens","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","AnyDelimiter","Speculative","advance_to","parse_any_delimiter","End","IntoIter","IntoPairs","Iter","IterMut","Pair","Pairs","PairsMut","Punctuated","Punctuated","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clear","clone","clone","clone","clone","clone","clone","clone_from","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","cloned","default","empty_or_trailing","extend","extend","first","first_mut","from","from","from","from","from","from","from","from","from_iter","from_iter","index","index_mut","insert","into","into","into","into","into","into","into","into","into_iter","into_iter","into_iter","into_iter","into_iter","into_iter","into_iter","into_iter","into_iter","into_pairs","into_tuple","into_value","is_empty","iter","iter_mut","last","last_mut","len","len","len","len","len","len","len","new","new","next","next","next","next","next","next","next_back","next_back","next_back","next_back","next_back","next_back","pairs","pairs_mut","parse_separated_nonempty","parse_separated_nonempty_with","parse_terminated","parse_terminated_with","pop","pop_punct","punct","punct_mut","push","push_punct","push_value","size_hint","size_hint","size_hint","size_hint","size_hint","size_hint","span","span","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_tokens","to_tokens","trailing_punct","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","value","value_mut","Spanned","span","Abstract","And","AndAnd","AndEq","As","Async","At","Auto","Await","Become","Box","Brace","Bracket","Break","Caret","CaretEq","Colon","Comma","Const","Continue","Crate","Default","Do","Dollar","Dot","DotDot","DotDotDot","DotDotEq","Dyn","Else","Enum","Eq","EqEq","Extern","FatArrow","Final","Fn","For","Ge","Group","Gt","If","Impl","In","LArrow","Le","Let","Loop","Lt","Macro","Match","Minus","MinusEq","Mod","Move","Mut","Ne","Not","Or","OrEq","OrOr","Override","Paren","PathSep","Percent","PercentEq","Plus","PlusEq","Pound","Priv","Pub","Question","RArrow","Ref","Return","SelfType","SelfValue","Semi","Shl","ShlEq","Shr","ShrEq","Slash","SlashEq","Star","StarEq","Static","Struct","Super","Tilde","Token","Trait","Try","Type","Typeof","Underscore","Union","Unsafe","Unsized","Use","Virtual","Where","While","Yield","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","default","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","parse","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","span","spans","spans","spans","spans","spans","spans","spans","spans","spans","spans","spans","spans","spans","spans","spans","spans","spans","spans","spans","spans","spans","spans","spans","spans","spans","spans","spans","spans","spans","spans","spans","spans","spans","spans","spans","spans","spans","spans","spans","spans","spans","spans","spans","spans","spans","spans","spans","surround","surround","surround","surround","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","to_tokens","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id"],"q":[[0,"syn"],[3657,"syn::buffer"],[3691,"syn::ext"],[3695,"syn::meta"],[3709,"syn::parse"],[3808,"syn::parse::discouraged"],[3812,"syn::punctuated"],[3974,"syn::spanned"],[3976,"syn::token"],[5661,"syn::generics"],[5662,"syn::lit"],[5663,"syn::error"],[5664,"core::str::traits"],[5665,"proc_macro2"],[5666,"syn::lifetime"],[5667,"syn::attr"],[5668,"syn::data"],[5669,"syn::derive"],[5670,"syn::expr"],[5671,"syn::file"],[5672,"syn::item"],[5673,"syn::mac"],[5674,"syn::op"],[5675,"syn::pat"],[5676,"syn::path"],[5677,"syn::restriction"],[5678,"syn::stmt"],[5679,"syn::ty"],[5680,"core::cmp"],[5681,"core::convert"],[5682,"core::marker"],[5683,"core::fmt"],[5684,"core::result"],[5685,"core::option"],[5686,"core::hash"],[5687,"core::ffi::c_str"],[5688,"proc_macro"],[5689,"alloc::vec"],[5690,"core::ops::function"],[5691,"proc_macro2::extra"],[5692,"alloc::string"],[5693,"core::any"],[5694,"alloc::ffi::c_str"],[5695,"syn::lookahead"],[5696,"core::iter::traits::collect"],[5697,"quote::to_tokens"],[5698,"core::clone"],[5699,"core::default"]],"i":[0,139,139,139,156,0,0,28,172,28,0,157,0,157,28,0,0,28,172,0,0,0,28,139,139,139,139,139,139,0,28,130,0,138,138,28,130,130,130,28,28,130,72,28,28,75,87,114,119,141,157,0,0,157,28,0,0,0,0,190,140,0,139,139,24,87,139,0,0,168,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,87,0,28,0,0,0,0,0,0,0,130,87,109,114,119,0,28,0,0,0,0,0,87,139,0,0,0,103,28,103,172,139,72,0,141,28,87,0,0,0,0,0,0,0,172,0,28,28,172,164,14,130,0,168,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,139,28,0,75,80,84,157,0,15,0,28,141,0,0,0,0,0,0,0,0,0,168,0,28,139,0,28,87,109,114,119,141,168,172,0,28,82,0,0,0,0,28,87,139,139,128,103,15,19,67,139,140,172,82,128,156,166,140,139,141,14,28,28,138,141,172,156,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,28,103,141,172,0,0,0,0,172,164,0,28,141,0,0,125,28,141,172,139,139,103,28,141,164,0,28,0,139,139,139,139,0,141,172,87,109,0,0,0,130,24,28,87,141,139,139,0,80,87,87,0,0,0,0,0,0,0,172,28,28,28,141,172,141,0,0,75,84,87,109,114,119,141,157,190,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,125,0,28,24,87,19,19,67,28,87,0,0,0,0,0,0,0,0,28,80,87,109,114,119,130,141,172,0,0,0,0,28,141,28,92,124,174,56,145,183,12,36,52,158,155,51,37,106,163,1,31,38,124,18,22,23,29,30,31,32,33,34,35,36,37,38,39,39,40,41,42,43,44,45,46,47,48,48,49,50,50,51,52,53,54,54,55,55,56,57,58,59,60,61,62,63,64,65,66,69,71,73,76,77,78,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,110,111,112,113,115,116,117,118,120,121,122,123,126,127,142,143,144,145,146,147,148,149,150,151,152,153,169,171,188,189,98,32,137,179,32,41,4,6,4,6,31,34,39,39,61,64,91,121,38,42,49,65,71,10,11,1,3,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,4,6,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,10,11,1,3,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,4,6,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,86,76,77,85,86,99,117,161,176,185,20,26,51,59,89,92,93,98,108,148,167,0,13,29,45,57,147,173,184,0,35,0,142,31,38,143,10,11,1,3,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,4,6,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,10,11,1,3,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,4,6,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,10,12,104,158,22,69,70,76,77,78,85,86,88,96,98,111,115,117,120,126,151,153,161,71,127,189,44,65,74,74,39,39,78,88,115,120,182,38,124,95,40,90,0,0,23,74,79,156,77,78,115,116,117,93,120,121,122,16,137,18,170,59,146,32,41,52,127,189,185,173,175,180,182,183,184,29,62,147,149,150,186,44,55,55,26,89,10,10,12,67,68,17,30,47,77,78,88,96,99,100,120,122,159,160,170,35,37,42,43,45,47,51,53,56,57,58,60,63,66,69,88,96,120,170,0,90,187,71,18,25,27,59,97,101,148,10,10,10,12,67,68,4,6,124,174,42,79,10,10,10,10,10,10,10,11,1,3,12,13,14,15,15,15,15,16,17,18,19,19,19,20,21,22,23,23,23,23,24,25,26,27,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,67,67,67,68,68,69,70,71,72,73,74,75,75,75,75,76,77,77,78,79,80,80,80,81,82,83,84,84,84,85,86,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,103,103,103,103,103,104,105,106,107,108,109,109,109,109,109,110,111,112,113,114,114,114,114,114,115,116,117,118,119,119,119,119,119,120,121,122,123,124,125,125,125,126,127,128,129,130,130,130,130,130,130,130,130,130,131,132,133,134,135,4,4,6,6,136,137,138,139,140,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,142,143,144,145,146,147,148,149,150,151,152,153,154,154,155,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,36,23,88,89,93,97,98,99,100,101,112,115,117,120,122,124,159,160,161,154,43,175,74,79,158,163,71,10,12,67,68,12,18,22,23,77,78,88,89,90,94,95,96,97,98,99,100,101,104,105,106,111,112,115,117,120,122,124,142,155,159,160,161,44,93,176,42,165,45,68,169,38,124,162,174,10,11,1,3,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,4,6,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,19,19,19,19,156,154,156,73,92,93,98,108,19,19,34,35,40,42,49,65,102,154,143,30,33,19,57,173,47,169,126,76,85,183,74,38,79,81,86,174,74,55,55,48,48,49,74,79,158,163,50,50,94,113,118,123,171,178,74,51,41,69,153,0,13,52,95,81,38,22,56,96,111,126,142,145,182,183,70,187,188,189,20,10,12,76,130,131,132,133,134,135,4,6,136,10,33,63,38,38,38,124,162,174,74,21,36,52,53,62,81,124,144,149,150,162,165,174,180,186,0,0,0,10,12,15,16,17,18,20,21,23,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,128,130,131,131,132,133,134,135,4,6,136,137,139,140,151,154,155,157,158,162,164,167,168,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,190,0,10,13,16,13,16,137,137,0,13,0,154,141,141,22,13,16,13,0,0,141,0,158,22,131,28,167,28,10,12,42,47,71,127,144,145,151,153,169,13,15,16,17,54,54,59,81,137,148,150,165,181,163,13,83,165,0,54,54,59,148,150,181,60,124,52,126,90,106,154,15,15,15,59,148,98,58,30,33,154,126,93,95,25,57,88,90,94,96,97,99,100,102,110,111,112,113,115,116,117,118,120,122,123,169,171,173,10,12,130,131,132,133,134,135,4,6,136,73,91,110,116,121,10,10,10,11,1,3,12,12,13,15,16,17,18,19,20,21,22,23,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,67,68,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,130,130,131,131,132,132,133,133,134,134,135,135,4,4,6,6,136,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,167,168,169,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,68,136,0,74,107,182,55,55,96,111,167,25,97,13,142,130,131,132,133,134,135,4,6,98,44,10,11,1,3,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,4,6,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,10,12,4,6,10,11,1,3,12,13,15,16,17,18,19,20,21,22,23,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,130,131,132,133,134,135,4,6,136,137,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,164,165,167,168,169,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,0,131,132,133,134,135,4,6,136,16,137,93,98,99,102,104,10,11,1,3,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,4,6,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,10,11,1,3,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,4,6,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,61,52,22,37,78,88,96,100,111,115,120,122,126,151,159,163,188,10,11,1,3,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,4,6,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,74,74,100,112,117,122,46,152,177,27,101,21,10,64,92,93,95,98,124,174,102,131,132,133,134,135,136,17,136,160,124,174,26,89,22,23,88,89,90,91,95,96,97,98,99,100,101,102,110,111,112,120,121,122,74,83,65,172,176,185,190,66,0,0,232,232,233,232,233,233,233,233,233,233,232,233,233,233,232,233,233,233,232,232,233,233,233,233,233,233,232,233,232,233,232,233,0,237,237,237,0,224,224,224,224,224,224,224,0,224,224,224,224,224,0,0,0,222,0,0,0,0,0,0,0,240,238,244,240,242,243,238,244,240,242,243,240,238,242,243,238,242,243,238,240,242,0,240,244,240,242,238,238,238,240,240,240,238,238,244,240,242,243,238,244,240,242,243,238,238,238,240,240,238,238,219,240,222,243,222,240,222,240,244,240,240,240,238,240,243,240,238,238,242,243,238,240,243,238,244,240,242,243,238,244,240,242,243,238,244,240,242,243,0,0,252,253,258,0,0,0,0,0,0,0,0,258,249,255,260,256,257,211,212,258,249,255,260,256,257,211,212,258,249,249,255,256,257,211,258,249,249,255,256,257,211,258,258,249,249,249,249,249,249,249,255,260,256,257,211,212,258,249,249,249,249,249,249,255,260,256,257,211,212,258,249,249,249,255,260,256,257,211,212,249,258,258,249,249,249,249,249,249,255,260,256,257,211,212,249,258,255,260,256,257,211,212,255,260,256,257,211,212,249,249,249,249,249,249,249,249,258,258,249,249,249,255,260,256,257,211,212,249,258,249,255,256,257,211,258,249,258,249,249,255,260,256,257,211,212,258,249,255,260,256,257,211,212,258,249,255,260,256,257,211,212,258,258,258,0,262,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,263,204,264,265,266,267,268,269,270,271,272,273,201,274,275,276,277,278,200,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,205,202,297,298,203,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,263,204,264,265,266,267,268,269,270,271,272,273,201,274,275,276,277,278,200,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,205,202,297,298,203,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,263,204,264,265,266,267,268,269,270,271,272,273,201,274,275,276,277,278,200,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,205,202,297,298,203,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,263,204,264,265,266,267,268,269,270,271,272,273,201,274,275,276,277,278,200,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,205,202,297,298,203,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,263,204,264,265,266,267,268,269,270,271,272,273,201,274,275,276,277,278,200,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,205,202,297,298,203,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,204,311,314,315,317,318,319,320,324,328,331,332,335,336,340,342,344,345,347,352,354,356,204,311,314,315,317,318,319,320,324,328,331,332,335,336,340,342,344,345,347,352,354,356,263,204,264,265,266,267,268,269,270,271,272,273,201,274,275,276,277,278,200,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,205,202,297,298,203,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,263,204,264,265,266,267,268,269,270,271,272,273,201,274,275,276,277,278,200,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,205,202,297,298,203,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,204,264,265,266,267,268,269,270,271,272,273,201,274,275,276,277,278,200,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,205,202,297,298,203,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,204,264,265,266,267,268,269,270,271,272,273,201,274,275,276,277,278,200,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,205,202,297,298,203,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,263,264,265,266,267,268,269,270,271,272,273,201,274,275,276,277,278,200,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,205,202,297,298,203,299,300,301,302,303,304,305,306,307,308,309,310,357,358,359,204,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,263,357,358,359,263,204,264,265,266,267,268,269,270,271,272,273,201,274,275,276,277,278,200,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,205,202,297,298,203,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,204,264,265,266,267,268,269,270,271,272,273,201,274,275,276,277,278,200,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,205,202,297,298,203,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,263,204,264,265,266,267,268,269,270,271,272,273,201,274,275,276,277,278,200,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,205,202,297,298,203,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,263,204,264,265,266,267,268,269,270,271,272,273,201,274,275,276,277,278,200,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,205,202,297,298,203,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,263,204,264,265,266,267,268,269,270,271,272,273,201,274,275,276,277,278,200,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,205,202,297,298,203,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359],"f":"```````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````{{{d{b}}}f}``````````````````````````````````````````````````````````````````````````````````````````````````````````{{{d{h}}}{{d{j}}}}{{{d{l}}}{{d{j}}}}{{{d{h}}}{{n{c}}}A`}{{{d{l}}}{{n{c}}}A`}`````````````{{{d{c}}}{{d{e}}}{}{}}0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000{{{d{Abc}}}{{d{Abe}}}{}{}}0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000````````````````````````````````````{{{d{Ad}}}Ad}{{{d{Af}}}Af}{{{d{b}}}b}{{{d{f}}}f}{{{d{Ah}}}Ah}{{{d{Aj}}}Aj}{{{d{Al}}}Al}{{{d{An}}}An}{{{d{B`}}}B`}{{{d{Bb}}}Bb}{{{d{Bd}}}Bd}{{{d{Bf}}}Bf}{{{d{Bh}}}Bh}{{{d{Bj}}}Bj}{{{d{Bl}}}Bl}{{{d{Bn}}}Bn}{{{d{C`}}}C`}{{{d{Cb}}}Cb}{{{d{Cd}}}Cd}{{{d{Cf}}}Cf}{{{d{Ch}}}Ch}{{{d{Cj}}}Cj}{{{d{Cl}}}Cl}{{{d{Cn}}}Cn}{{{d{D`}}}D`}{{{d{Db}}}Db}{{{d{Dd}}}Dd}{{{d{Df}}}Df}{{{d{Dh}}}Dh}{{{d{Dj}}}Dj}{{{d{Dl}}}Dl}{{{d{Dn}}}Dn}{{{d{E`}}}E`}{{{d{Eb}}}Eb}{{{d{Ed}}}Ed}{{{d{Ef}}}Ef}{{{d{Eh}}}Eh}{{{d{Ej}}}Ej}{{{d{El}}}El}{{{d{En}}}En}{{{d{F`}}}F`}{{{d{Fb}}}Fb}{{{d{Fd}}}Fd}{{{d{Ff}}}Ff}{{{d{Fh}}}Fh}{{{d{Fj}}}Fj}{{{d{Fl}}}Fl}{{{d{Fn}}}Fn}{{{d{G`}}}G`}{{{d{Gb}}}Gb}{{{d{Gd}}}Gd}{{{d{Gf}}}Gf}{{{d{Gh}}}Gh}{{{d{Gj}}}Gj}{{{d{Gl}}}Gl}{{{d{Gn}}}Gn}{{{d{H`}}}H`}{{{d{Hb}}}Hb}{{{d{Hd}}}Hd}{{{d{Hf}}}Hf}{{{d{Hh}}}Hh}{{{d{Hj}}}Hj}{{{d{Hl}}}Hl}{{{d{Hn}}}Hn}{{{d{I`}}}I`}{{{d{Ib}}}Ib}{{{d{Id}}}Id}{{{d{If}}}If}{{{d{Ih}}}Ih}{{{d{Ij}}}Ij}{{{d{Il}}}Il}{{{d{In}}}In}{{{d{J`}}}J`}{{{d{Jb}}}Jb}{{{d{Jd}}}Jd}{{{d{Jf}}}Jf}{{{d{Jh}}}Jh}{{{d{Jj}}}Jj}{{{d{Jl}}}Jl}{{{d{Jn}}}Jn}{{{d{K`}}}K`}{{{d{Kb}}}Kb}{{{d{Kd}}}Kd}{{{d{Kf}}}Kf}{{{d{Kh}}}Kh}{{{d{Kj}}}Kj}{{{d{Kl}}}Kl}{{{d{Kn}}}Kn}{{{d{L`}}}L`}{{{d{Lb}}}Lb}{{{d{Ld}}}Ld}{{{d{Lf}}}Lf}{{{d{Lh}}}Lh}{{{d{Lj}}}Lj}{{{d{Ll}}}Ll}{{{d{Ln}}}Ln}{{{d{M`}}}M`}{{{d{Mb}}}Mb}{{{d{Md}}}Md}{{{d{Mf}}}Mf}{{{d{Mh}}}Mh}{{{d{Mj}}}Mj}{{{d{Ml}}}Ml}{{{d{Mn}}}Mn}{{{d{N`}}}N`}{{{d{Nb}}}Nb}{{{d{Nd}}}Nd}{{{d{Nf}}}Nf}{{{d{Nh}}}Nh}{{{d{Nj}}}Nj}{{{d{Nl}}}Nl}{{{d{Nn}}}Nn}{{{d{O`}}}O`}{{{d{Ob}}}Ob}{{{d{Od}}}Od}{{{d{Of}}}Of}{{{d{Oh}}}Oh}{{{d{Oj}}}Oj}{{{d{Ol}}}Ol}{{{d{On}}}On}{{{d{A@`}}}A@`}{{{d{A@b}}}A@b}{{{d{A@d}}}A@d}{{{d{A@f}}}A@f}{{{d{A@h}}}A@h}{{{d{A@j}}}A@j}{{{d{A@l}}}A@l}{{{d{A@n}}}A@n}{{{d{h}}}h}{{{d{l}}}l}{{{d{AA`}}}AA`}{{{d{AAb}}}AAb}{{{d{AAd}}}AAd}{{{d{AAf}}}AAf}{{{d{AAh}}}AAh}{{{d{AAj}}}AAj}{{{d{AAl}}}AAl}{{{d{AAn}}}AAn}{{{d{AB`}}}AB`}{{{d{ABb}}}ABb}{{{d{ABd}}}ABd}{{{d{ABf}}}ABf}{{{d{ABh}}}ABh}{{{d{ABj}}}ABj}{{{d{ABl}}}ABl}{{{d{ABn}}}ABn}{{{d{AC`}}}AC`}{{{d{ACb}}}ACb}{{{d{ACd}}}ACd}{{{d{ACf}}}ACf}{{{d{ACh}}}ACh}{{{d{ACj}}}ACj}{{{d{ACl}}}ACl}{{{d{ACn}}}ACn}{{{d{AD`}}}AD`}{{{d{ADb}}}ADb}{{{d{ADd}}}ADd}{{{d{ADf}}}ADf}{{{d{ADh}}}ADh}{{{d{ADj}}}ADj}{{{d{ADl}}}ADl}{{{d{ADn}}}ADn}{{{d{AE`}}}AE`}{{{d{AEb}}}AEb}{{{d{AEd}}}AEd}{{{d{AEf}}}AEf}{{{d{AEh}}}AEh}{{{d{AEj}}}AEj}{{{d{AEl}}}AEl}{{{d{AEn}}}AEn}{{{d{AF`}}}AF`}{{{d{AFb}}}AFb}{{{d{AFd}}}AFd}{{{d{AFf}}}AFf}{{{d{AFh}}}AFh}{{{d{AFj}}}AFj}{{{d{AFl}}}AFl}{{{d{AFn}}}AFn}{{{d{AG`}}}AG`}{{{d{AGb}}}AGb}{{{d{AGd}}}AGd}{{{d{AGf}}}AGf}{{{d{AGh}}}AGh}{{{d{AGj}}}AGj}{{{d{AGl}}}AGl}{{{d{c}}{d{Abe}}}AGn{}{}}0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000{{{d{Ad}}{d{Ad}}}AH`}{{{d{Ah}}{d{Ah}}}AH`}```````````````````````````````````````````{{}Id}{{}In}{{}ACh}``````````````````````````````````````{{{d{Ad}}{d{c}}}AHb{{AHd{j}}AHf}}{{{d{Ad}}{d{Ad}}}AHb}{{{d{Ah}}{d{Ah}}}AHb}{{{d{Hf}}{d{Hf}}}AHb}{{{d{Hh}}{d{Hh}}}AHb}````````````````````````````````````````````{{{d{Ad}}{d{AbAHh}}}{{AHl{AGnAHj}}}}00{{{d{Ah}}{d{AbAHh}}}AHn}{{{d{Hf}}{d{AbAHh}}}AHn}{{{d{Hh}}{d{AbAHh}}}AHn}{{{d{h}}{d{AbAHh}}}AHn}{{{d{l}}{d{AbAHh}}}AHn}````{AI`Ad}{AIbAd}{AIdAd}{AIfAd}{cc{}}{AIhAd}{AIjAd}222222{BbAn}3{ACdAn}{B`An}555{BhBf}{BjBf}7777{LjBn}{KbBn}9{LbBn}::::{FbCh}{FfCh}{G`Ch}{EdCh}{DhCh}{HdCh}{cc{}}{DfCh}{GhCh}{CnCh}{D`Ch}{GnCh}{GfCh}{H`Ch}{DnCh}{DdCh}{CjCh}{HbCh}{FjCh}{DbCh}{DjCh}{F`Ch}{FhCh}{FdCh}{EhCh}{EfCh}{ElCh}{GbCh}{ClCh}{FnCh}{DlCh}{EbCh}{E`Ch}{FlCh}{GlCh}{EnCh}{GdCh}{EjCh}{GjCh}{cc{}}0000000000000000000000000000000000000{AIlHf}{AdHf}{HhHf}33{AIlHh}444444{IhIf}{IjIf}{IlIf}77{AdIj}888{AhJ`}9{JbJ`}:::{JjJh};{JlJh}<<{KlJn}{KnJn}{LdJn}{LlJn}{LfJn}{LjJn}{KbJn}{cc{}}{K`Jn}{KfJn}{LhJn}{KdJn}{L`Jn}{LbJn}{KhJn}{BnJn}{KjJn}999999999999999{MfLn}{MhLn}{MdLn}{M`Ln}={MbLn}>>>>>{MnMj}{N`Mj}{NbMj}{MlMj}{cc{}}0000{NhNd}{NjNd}2{NfNd}{NlNd}4444{O`Nn}{OfNn}{OdNn}{ObNn}888888{OlOj}{ABnOj}::::::{A@lA@d}{hA@d}{AA`A@d}{A@nA@d}{lA@d}{A@fA@d}{A@jA@d}{A@hA@d}{cc{}}0000{AInh}1{AInl}222222{AAnAAj}{AC`AAj}{FlAAj}{F`AAj}{ABdAAj}{ABnAAj}{FdAAj}{ABlAAj}{ABbAAj}{ABfAAj}{FnAAj}={ABhAAj}{AAlAAj}{DnAAj}{AB`AAj}{ABjAAj}{cc{}}000000000000{cACd{{AJ`{ACf}}}}1{cACf{{AJ`{Ad}}}}2222222222222222{AElAEh}{AFnAEh}{AFbAEh}{AFfAEh}{AFlAEh}{AG`AEh}{AFdAEh}{AEjAEh}{AFhAEh}{AGbAEh}{AEnAEh}{AFjAEh}>{AGdAEh}{AF`AEh}{cc{}}00000000000000000```````````````````{{{d{ACd}}}{{AJb{{d{Ad}}}}}}```````{{{d{Ad}}{d{Abc}}}AGnAJd}{{{d{Ah}}{d{Abc}}}AGnAJd}{{{d{Hf}}{d{Abc}}}AGnAJd}{{{d{Hh}}{d{Abc}}}AGnAJd}````````````````````````````````````````````{ce{}{}}0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000{{{d{Bf}}}c{}}{Bfc{}}{{{d{AbBf}}}c{}}{{{d{Bf}}}AHb}{{{d{ACh}}}AHb}{{{d{ACd}}{d{c}}}AHbAHf}1`````{{{d{Bf}}}{{AJf{Bl}}}}{{{d{AbBf}}}{{AJh{Bl}}}}```````````{{{d{Bf}}}AIl}````{{{d{Ol}}}{{AJb{{d{Ah}}}}}}```````````````````````````{{{d{AbId}}}{{d{AbJf}}}}````````````````````````{{{d{j}}AJj}Ad}{{{d{j}}AJj}Ah}{AhIh}{AInA@d}{{{d{j}}AJj}A@f}{{{d{{AJn{AJl}}}}AJj}A@h}{{{d{AK`}}AJj}A@j}{{AJlAJj}A@l}{{AKbAJj}A@n}{{{d{j}}AJj}h}{{{d{j}}AJj}l}{{AHbAJj}AA`};``````````````````````````{AKd{{n{c}}}AKf}{AKh{{n{Ad}}}}{AKh{{n{Ah}}}}{AKh{{n{An}}}}{AKh{{n{B`}}}}{AKh{{n{Bb}}}}{AKh{{n{Bd}}}}{AKh{{n{Bh}}}}{AKh{{n{Bj}}}}{AKh{{n{Bn}}}}{AKh{{n{Ch}}}}{AKh{{n{Cj}}}}{AKh{{n{Cl}}}}{AKh{{n{Cn}}}}{AKh{{n{D`}}}}{AKh{{n{Db}}}}{AKh{{n{Dd}}}}{AKh{{n{Df}}}}{AKh{{n{Dh}}}}{AKh{{n{Dj}}}}{AKh{{n{Dl}}}}{AKh{{n{Dn}}}}{AKh{{n{E`}}}}{AKh{{n{Eb}}}}{AKh{{n{Ed}}}}{AKh{{n{Eh}}}}{AKh{{n{Ej}}}}{AKh{{n{El}}}}{AKh{{n{En}}}}{AKh{{n{F`}}}}{AKh{{n{Fb}}}}{AKh{{n{Fd}}}}{AKh{{n{Ff}}}}{AKh{{n{Fh}}}}{AKh{{n{Fj}}}}{AKh{{n{Fl}}}}{AKh{{n{Fn}}}}{AKh{{n{G`}}}}{AKh{{n{Gb}}}}{AKh{{n{Gd}}}}{AKh{{n{Gf}}}}{AKh{{n{Gh}}}}{AKh{{n{Gj}}}}{AKh{{n{Gl}}}}{AKh{{n{Gn}}}}{AKh{{n{H`}}}}{AKh{{n{Hb}}}}{AKh{{n{Hd}}}}{AKh{{n{Hf}}}}{AKh{{n{Hh}}}}{AKh{{n{Hj}}}}{AKh{{n{Hl}}}}{AKh{{n{Hn}}}}{AKh{{n{I`}}}}{AKh{{n{Ib}}}}{AKh{{n{Id}}}}{AKh{{n{If}}}}{AKh{{n{Ih}}}}{AKh{{n{Ij}}}}{AKh{{n{Il}}}}{AKh{{n{In}}}}{AKh{{n{J`}}}}{AKh{{n{Jb}}}}{AKh{{n{Jd}}}}{AKh{{n{Jf}}}}{AKh{{n{Jh}}}}{AKh{{n{Jn}}}}{AKh{{n{K`}}}}{AKh{{n{Kb}}}}{AKh{{n{Kd}}}}{AKh{{n{Kf}}}}{AKh{{n{Kh}}}}{AKh{{n{Kj}}}}{AKh{{n{Kl}}}}{AKh{{n{Kn}}}}{AKh{{n{L`}}}}{AKh{{n{Lb}}}}{AKh{{n{Ld}}}}{AKh{{n{Lf}}}}{AKh{{n{Lh}}}}{AKh{{n{Lj}}}}{AKh{{n{Ll}}}}{AKh{{n{Ln}}}}{AKh{{n{Mj}}}}{AKh{{n{Ml}}}}{AKh{{n{Mn}}}}{AKh{{n{N`}}}}{AKh{{n{Nb}}}}{AKh{{n{Nd}}}}{AKh{{n{Nf}}}}{AKh{{n{Nh}}}}{AKh{{n{Nj}}}}{AKh{{n{Nl}}}}{AKh{{n{Nn}}}}{AKh{{n{O`}}}}{AKh{{n{Ob}}}}{AKh{{n{Od}}}}{AKh{{n{Of}}}}{AKh{{n{Oh}}}}{AKh{{n{Oj}}}}{AKh{{n{Ol}}}}{AKh{{n{A@`}}}}{AKh{{n{A@d}}}}{{{d{A@f}}}{{n{c}}}AKf}{AKh{{n{A@f}}}}{AKh{{n{A@h}}}}{AKh{{n{A@j}}}}{AKh{{n{A@l}}}}{AKh{{n{A@n}}}}{AKh{{n{h}}}}{AKh{{n{l}}}}{AKh{{n{AA`}}}}{AKh{{n{AAb}}}}{AKh{{n{AAf}}}}{AKh{{n{AAh}}}}{AKh{{n{ABn}}}}{AKh{{n{ACd}}}}{AKh{{n{ACf}}}}{AKh{{n{ACj}}}}{AKh{{n{ACl}}}}{AKh{{n{ADd}}}}{AKh{{n{ADh}}}}{AKh{{n{ADn}}}}{AKh{{n{AE`}}}}{AKh{{n{AEh}}}}{AKh{{n{AEj}}}}{AKh{{n{AEl}}}}{AKh{{n{AEn}}}}{AKh{{n{AF`}}}}{AKh{{n{AFb}}}}{AKh{{n{AFd}}}}{AKh{{n{AFf}}}}{AKh{{n{AFh}}}}{AKh{{n{AFj}}}}{AKh{{n{AFl}}}}{AKh{{n{AFn}}}}{AKh{{n{AG`}}}}{AKh{{n{AGb}}}}{AKh{{n{AGd}}}}{AKh{{n{AGf}}}}{AKh{{n{AGh}}}}{AKh{{n{AGl}}}}{AKj{{n{c}}}AKf}{AKh{{n{Ad}}}}{{{d{Aj}}}{{n{c}}}AKf}{{{d{B`}}}{{n{c}}}AKf}{{{d{Aj}}c}nAKl}{{{d{B`}}c}nAKl}{{{d{AAb}}}{{n{c}}}AKf}{{{d{AAb}}c}nAKl}{{{d{j}}}{{n{Ib}}}}{AKh{{n{{AKn{Aj}}}}}}`{AKh{{n{ACd}}}}{AKh{{n{AAj}}}}0{AKh{{n{Bl}}}}{{{d{Aj}}c}{{n{AGn}}}{{ALd{AL`}{{ALb{{n{AGn}}}}}}}}{{{d{B`}}c}{{n{AGn}}}{{ALd{AL`}{{ALb{{n{AGn}}}}}}}}5``3{{{d{j}}}{{n{c}}}AKf}{AKh{{n{ACl}}}}4{{{d{A@f}}c}nAKl}{AKh{{n{Ch}}}}{AKh{{n{{AKn{AE`}}}}}}1{{{d{Ad}}{d{Ad}}}{{AJb{AH`}}}}{{{d{Ah}}{d{Ah}}}{{AJb{AH`}}}}`````````{{{d{Aj}}}{{d{ACd}}}}{{{d{An}}}{{d{ACd}}}}```````````````````````{{{d{Oh}}}{{AJb{{d{Ol}}}}}}````{{{d{ACd}}}{{n{{d{Ad}}}}}}{{{d{An}}}{{n{{d{B`}}}}}}{{{d{An}}}{{n{{d{Bb}}}}}}{{{d{An}}}{{n{{d{ACd}}}}}}``````````````````````````````````{{{d{AbAd}}AJj}AGn}{{{d{AbAh}}AJj}AGn}{{{d{AbA@d}}AJj}AGn}{{{d{AbA@f}}AJj}AGn}{{{d{AbA@h}}AJj}AGn}{{{d{AbA@j}}AJj}AGn}{{{d{AbA@l}}AJj}AGn}{{{d{AbA@n}}AJj}AGn}{{{d{Abh}}AJj}AGn}{{{d{Abl}}AJj}AGn}{{{d{AbAA`}}AJj}AGn}`````{{{d{Ad}}}AJj}{{{d{c}}}AJj{}}{{{d{Ad}}}{{AJb{AJj}}}}1111{{{d{Ah}}}AJj}2222222222222222222222222222222222222222222222222{{{d{Hf}}}{{AJb{AJj}}}}33{{{d{Hh}}}{{AJb{AJj}}}}4444444444444444444444444444444444444444444444444444444444444{{{d{A@d}}}AJj}{{{d{A@f}}}AJj}6{{{d{A@h}}}AJj}7{{{d{A@j}}}AJj}8{{{d{A@l}}}AJj}9{{{d{A@n}}}AJj}:{{{d{h}}}AJj};;{{{d{l}}}AJj}{{{d{AA`}}}AJj}=={{{d{AAd}}}{{d{ALf}}}}>>>>>>>>>>>>>>>>>>>>>>>>{{{d{ADf}}}AJj}?????????????????????????```{{{d{Id}}}{{ALh{Afb{AJb{{d{Jf}}}}}}}}```````````{{{d{A@d}}}{{d{j}}}}{{{d{A@f}}}{{d{j}}}}{{{d{A@h}}}{{d{j}}}}{{{d{A@j}}}{{d{j}}}}{{{d{A@l}}}{{d{j}}}}{{{d{A@n}}}{{d{j}}}}{{{d{h}}}{{d{j}}}}{{{d{l}}}{{d{j}}}}``{{{d{c}}}e{}{}}0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000{{{d{c}}}ALj{}}000{{{d{Ad}}{d{AbAKj}}}AGn}{{{d{Af}}{d{AbAKj}}}AGn}{{{d{b}}{d{AbAKj}}}AGn}{{{d{f}}{d{AbAKj}}}AGn}{{{d{Ah}}{d{AbAKj}}}AGn}{{{d{Aj}}{d{AbAKj}}}AGn}{{{d{An}}{d{AbAKj}}}AGn}{{{d{B`}}{d{AbAKj}}}AGn}{{{d{Bb}}{d{AbAKj}}}AGn}{{{d{Bd}}{d{AbAKj}}}AGn}{{{d{Bf}}{d{AbAKj}}}AGn}{{{d{Bh}}{d{AbAKj}}}AGn}{{{d{Bj}}{d{AbAKj}}}AGn}{{{d{Bl}}{d{AbAKj}}}AGn}{{{d{Bn}}{d{AbAKj}}}AGn}{{{d{Ch}}{d{AbAKj}}}AGn}{{{d{Cj}}{d{AbAKj}}}AGn}{{{d{Cl}}{d{AbAKj}}}AGn}{{{d{Cn}}{d{AbAKj}}}AGn}{{{d{D`}}{d{AbAKj}}}AGn}{{{d{Db}}{d{AbAKj}}}AGn}{{{d{Dd}}{d{AbAKj}}}AGn}{{{d{Df}}{d{AbAKj}}}AGn}{{{d{Dh}}{d{AbAKj}}}AGn}{{{d{Dj}}{d{AbAKj}}}AGn}{{{d{Dl}}{d{AbAKj}}}AGn}{{{d{Dn}}{d{AbAKj}}}AGn}{{{d{E`}}{d{AbAKj}}}AGn}{{{d{Eb}}{d{AbAKj}}}AGn}{{{d{Ed}}{d{AbAKj}}}AGn}{{{d{Ef}}{d{AbAKj}}}AGn}{{{d{Eh}}{d{AbAKj}}}AGn}{{{d{Ej}}{d{AbAKj}}}AGn}{{{d{El}}{d{AbAKj}}}AGn}{{{d{En}}{d{AbAKj}}}AGn}{{{d{F`}}{d{AbAKj}}}AGn}{{{d{Fb}}{d{AbAKj}}}AGn}{{{d{Fd}}{d{AbAKj}}}AGn}{{{d{Ff}}{d{AbAKj}}}AGn}{{{d{Fh}}{d{AbAKj}}}AGn}{{{d{Fj}}{d{AbAKj}}}AGn}{{{d{Fl}}{d{AbAKj}}}AGn}{{{d{Fn}}{d{AbAKj}}}AGn}{{{d{G`}}{d{AbAKj}}}AGn}{{{d{Gb}}{d{AbAKj}}}AGn}{{{d{Gd}}{d{AbAKj}}}AGn}{{{d{Gf}}{d{AbAKj}}}AGn}{{{d{Gh}}{d{AbAKj}}}AGn}{{{d{Gj}}{d{AbAKj}}}AGn}{{{d{Gl}}{d{AbAKj}}}AGn}{{{d{Gn}}{d{AbAKj}}}AGn}{{{d{H`}}{d{AbAKj}}}AGn}{{{d{Hb}}{d{AbAKj}}}AGn}{{{d{Hd}}{d{AbAKj}}}AGn}{{{d{Hf}}{d{AbAKj}}}AGn}{{{d{Hh}}{d{AbAKj}}}AGn}{{{d{Hj}}{d{AbAKj}}}AGn}{{{d{Hl}}{d{AbAKj}}}AGn}{{{d{Hn}}{d{AbAKj}}}AGn}{{{d{I`}}{d{AbAKj}}}AGn}{{{d{Ib}}{d{AbAKj}}}AGn}{{{d{Id}}{d{AbAKj}}}AGn}{{{d{If}}{d{AbAKj}}}AGn}{{{d{Ih}}{d{AbAKj}}}AGn}{{{d{Ij}}{d{AbAKj}}}AGn}{{{d{Il}}{d{AbAKj}}}AGn}{{{d{In}}{d{AbAKj}}}AGn}{{{d{J`}}{d{AbAKj}}}AGn}{{{d{Jb}}{d{AbAKj}}}AGn}{{{d{Jd}}{d{AbAKj}}}AGn}{{{d{Jf}}{d{AbAKj}}}AGn}{{{d{Jh}}{d{AbAKj}}}AGn}{{{d{Jj}}{d{AbAKj}}}AGn}{{{d{Jl}}{d{AbAKj}}}AGn}{{{d{Jn}}{d{AbAKj}}}AGn}{{{d{K`}}{d{AbAKj}}}AGn}{{{d{Kb}}{d{AbAKj}}}AGn}{{{d{Kd}}{d{AbAKj}}}AGn}{{{d{Kf}}{d{AbAKj}}}AGn}{{{d{Kh}}{d{AbAKj}}}AGn}{{{d{Kj}}{d{AbAKj}}}AGn}{{{d{Kl}}{d{AbAKj}}}AGn}{{{d{Kn}}{d{AbAKj}}}AGn}{{{d{L`}}{d{AbAKj}}}AGn}{{{d{Lb}}{d{AbAKj}}}AGn}{{{d{Ld}}{d{AbAKj}}}AGn}{{{d{Lf}}{d{AbAKj}}}AGn}{{{d{Lh}}{d{AbAKj}}}AGn}{{{d{Lj}}{d{AbAKj}}}AGn}{{{d{Ll}}{d{AbAKj}}}AGn}{{{d{Ln}}{d{AbAKj}}}AGn}{{{d{M`}}{d{AbAKj}}}AGn}{{{d{Mb}}{d{AbAKj}}}AGn}{{{d{Md}}{d{AbAKj}}}AGn}{{{d{Mf}}{d{AbAKj}}}AGn}{{{d{Mh}}{d{AbAKj}}}AGn}{{{d{Mj}}{d{AbAKj}}}AGn}{{{d{Ml}}{d{AbAKj}}}AGn}{{{d{Mn}}{d{AbAKj}}}AGn}{{{d{N`}}{d{AbAKj}}}AGn}{{{d{Nb}}{d{AbAKj}}}AGn}{{{d{Nd}}{d{AbAKj}}}AGn}{{{d{Nf}}{d{AbAKj}}}AGn}{{{d{Nh}}{d{AbAKj}}}AGn}{{{d{Nj}}{d{AbAKj}}}AGn}{{{d{Nl}}{d{AbAKj}}}AGn}{{{d{Nn}}{d{AbAKj}}}AGn}{{{d{O`}}{d{AbAKj}}}AGn}{{{d{Ob}}{d{AbAKj}}}AGn}{{{d{Od}}{d{AbAKj}}}AGn}{{{d{Of}}{d{AbAKj}}}AGn}{{{d{Oh}}{d{AbAKj}}}AGn}{{{d{Oj}}{d{AbAKj}}}AGn}{{{d{Ol}}{d{AbAKj}}}AGn}{{{d{On}}{d{AbAKj}}}AGn}{{{d{A@`}}{d{AbAKj}}}AGn}{{{d{A@d}}{d{AbAKj}}}AGn}{{{d{A@f}}{d{AbAKj}}}AGn}{{{d{A@h}}{d{AbAKj}}}AGn}{{{d{A@j}}{d{AbAKj}}}AGn}{{{d{A@l}}{d{AbAKj}}}AGn}{{{d{A@n}}{d{AbAKj}}}AGn}{{{d{h}}{d{AbAKj}}}AGn}{{{d{l}}{d{AbAKj}}}AGn}{{{d{AA`}}{d{AbAKj}}}AGn}{{{d{AAb}}{d{AbAKj}}}AGn}{{{d{AAf}}{d{AbAKj}}}AGn}{{{d{AAh}}{d{AbAKj}}}AGn}{{{d{AAj}}{d{AbAKj}}}AGn}{{{d{AAl}}{d{AbAKj}}}AGn}{{{d{AAn}}{d{AbAKj}}}AGn}{{{d{AB`}}{d{AbAKj}}}AGn}{{{d{ABb}}{d{AbAKj}}}AGn}{{{d{ABd}}{d{AbAKj}}}AGn}{{{d{ABf}}{d{AbAKj}}}AGn}{{{d{ABh}}{d{AbAKj}}}AGn}{{{d{ABj}}{d{AbAKj}}}AGn}{{{d{ABl}}{d{AbAKj}}}AGn}{{{d{ABn}}{d{AbAKj}}}AGn}{{{d{AC`}}{d{AbAKj}}}AGn}{{{d{ACb}}{d{AbAKj}}}AGn}{{{d{ACd}}{d{AbAKj}}}AGn}{{{d{ACf}}{d{AbAKj}}}AGn}{{{d{ACh}}{d{AbAKj}}}AGn}{{{d{ACj}}{d{AbAKj}}}AGn}{{{d{ACl}}{d{AbAKj}}}AGn}{{{d{ACn}}{d{AbAKj}}}AGn}{{{d{AD`}}{d{AbAKj}}}AGn}{{{d{ADb}}{d{AbAKj}}}AGn}{{{d{ADd}}{d{AbAKj}}}AGn}{{{d{ADh}}{d{AbAKj}}}AGn}{{{d{ADj}}{d{AbAKj}}}AGn}{{{d{ADn}}{d{AbAKj}}}AGn}{{{d{AE`}}{d{AbAKj}}}AGn}{{{d{AEb}}{d{AbAKj}}}AGn}{{{d{AEf}}{d{AbAKj}}}AGn}{{{d{AEh}}{d{AbAKj}}}AGn}{{{d{AEj}}{d{AbAKj}}}AGn}{{{d{AEl}}{d{AbAKj}}}AGn}{{{d{AEn}}{d{AbAKj}}}AGn}{{{d{AF`}}{d{AbAKj}}}AGn}{{{d{AFb}}{d{AbAKj}}}AGn}{{{d{AFd}}{d{AbAKj}}}AGn}{{{d{AFf}}{d{AbAKj}}}AGn}{{{d{AFh}}{d{AbAKj}}}AGn}{{{d{AFj}}{d{AbAKj}}}AGn}{{{d{AFl}}{d{AbAKj}}}AGn}{{{d{AFn}}{d{AbAKj}}}AGn}{{{d{AG`}}{d{AbAKj}}}AGn}{{{d{AGb}}{d{AbAKj}}}AGn}{{{d{AGd}}{d{AbAKj}}}AGn}{{{d{AGf}}{d{AbAKj}}}AGn}{{{d{AGh}}{d{AbAKj}}}AGn}{{{d{AGj}}{d{AbAKj}}}AGn}{{{d{AGl}}{d{AbAKj}}}AGn}`{{{d{A@f}}}AIn}{{{d{A@h}}}AIn}{{{d{A@j}}}AIn}{{{d{A@l}}}AIn}{{{d{A@n}}}AIn}{{{d{h}}}AIn}{{{d{l}}}AIn}{{{d{AA`}}}Ad}```````{c{{AHl{e}}}{}{}}000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000`````````````````{{{d{c}}}ALl{}}0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000````````````{{{d{Ad}}}Ad}````````{{{d{A@f}}}ALj}{{{d{A@h}}}{{AKn{AJl}}}}{{{d{A@j}}}ALn}{{{d{A@l}}}AJl}{{{d{A@n}}}AKb}{{{d{AA`}}}AHb}``````````````````````````````{AKh{{n{AEh}}}}{AKh{{n{AF`}}}}{AKh{{n{AGb}}}}{AKh{{n{AGl}}}}```{{{d{AM`}}}AMb}{{{d{c}}}{{d{e}}}{}{}}0{{{d{Abc}}}{{d{Abe}}}{}{}}0{{{d{AMb}}}AMb}{{{d{c}}{d{Abe}}}AGn{}{}}{{}AMb}{AMbAHb}{{{d{AMb}}{d{AMb}}}AHb}{cc{}}0{{AMbAMd}{{AJb{{ALh{AMbALfAMb}}}}}}{AMb{{AJb{{ALh{AdAMb}}}}}}{ce{}{}}0{AMb{{AJb{{ALh{AhAMb}}}}}}{AMb{{AJb{{ALh{AInAMb}}}}}}{AKdAM`}{AKjAM`}{{{d{AMb}}{d{AMb}}}{{AJb{AH`}}}}{AMb{{AJb{{ALh{AMfAMb}}}}}}{AMbAJj}{{{d{c}}}e{}{}}{AMbAKj}{AMb{{AJb{{ALh{AMhAMb}}}}}}{c{{AHl{e}}}{}{}}000{{{d{c}}}ALl{}}0`{AKh{{n{AMj}}}}`{{{d{AMj}}}Ad}`{{{d{c}}}{{d{e}}}{}{}}{{{d{Abc}}}{{d{Abe}}}{}{}}{{{d{AL`}}c}AMlAMn}{cc{}}`{ce{}{}}{{{d{AL`}}c}{{n{AGn}}}{{ALd{AL`}{{ALb{{n{AGn}}}}}}}}{c{{`{{AKl{}{{ALb{AGn}}}}}}}{{ALd{AL`}{{ALb{{n{AGn}}}}}}}}`::9{{{d{AL`}}}{{n{AKh}}}}```````````{{{d{AN`}}{d{AN`}}}AGn}8888877777{{{d{AN`}}{ANb{AKh}{{ALb{{n{c}}}}}}}{{n{c}}}{}}{{{d{AMl}}}AMl}{{{d{ANd}}}ANd}{{{d{ANf}}}ANf}{{{d{c}}{d{Abe}}}AGn{}{}}00{{{d{AbAMl}}AMl}AGn}{{{d{AN`}}}AMb}{{{d{ANd}}}{{d{c}}}{}}`{{{d{AbAN`}}}AGn}{ANhAMl}{{{d{AN`}}c}AMlAMn}{{ANdc}AMlAMn}{{{d{AbAMl}}c}AGn{{ANl{}{{ANj{AMl}}}}}}{{{d{AMl}}{d{AbAHh}}}AHn}0{{{d{AN`}}{d{AbAHh}}}AHn}0{{{d{AN`}}}AN`}{cc{}}{ANnAMl}1111{ce{}{}}0000{AMlAKj}{AMlc{}}{{{d{AMl}}}c{}}{{{d{AN`}}}AHb}{{{d{AN`}}}ANh}{{AJjc}AMlAMn}{{ce}AMlAO`AMn}{AKh{{n{AKf}}}}{{{d{AN`}}}{{n{c}}}AKf}{{{AKl{}{{ALb{c}}}}AKd}{{n{c}}}{}}{AKh{{n{ANf}}}}{{{AKl{}{{ALb{c}}}}AKj}{{n{c}}}{}}{{{d{AN`}}}{{n{{ALh{AMdALfAN`}}}}}}{{{AKl{}{{ALb{c}}}}{d{j}}}{{n{c}}}{}}{{{d{AN`}}{ANb{AKh}{{ALb{{n{c}}}}}}e}{{n{{AOb{c}}}}}{}AOd}{{{d{ANh}}c}AHbAOd}{{{d{AN`}}c}AHbAOd}00{{{d{AMl}}}AJj}{{{d{AN`}}}AJj}{{{d{c}}}AJj{}}{{{d{AN`}}e}{{n{c}}}{}{{AOf{ANd}{{ALb{{n{{ALh{cAMb}}}}}}}}}}{{{d{AMl}}}AKj}{{{d{c}}}e{}{}}00{{{d{c}}}ALj{}}0{{{d{ANf}}{d{AbAKj}}}AGn}{c{{AHl{e}}}{}{}}000000000{{{d{c}}}ALl{}}0000``{{{d{AOh}}{d{AOh}}}AGn}{{{d{AOj}}}{{n{{ALh{AMdALfAN`}}}}}}``````````{{{d{c}}}{{d{e}}}{}{}}0000000{{{d{Abc}}}{{d{Abe}}}{}{}}0000000{{{d{Ab{AOb{ce}}}}}AGn{}{}}{{{d{{AOb{ce}}}}}{{AOb{ce}}}AOlAOl}{{{d{{AOn{ce}}}}}{{AOn{ce}}}{}{}}{{{d{{B@`{ce}}}}}{{B@`{ce}}}AOlAOl}{{{d{{B@b{c}}}}}{{B@b{c}}}AOl}{{{d{{AJf{c}}}}}{{AJf{c}}}{}}{{{d{{B@d{ce}}}}}{{B@d{ce}}}AOlAOl}{{{d{Ab{AOb{ce}}}}{d{{AOb{ce}}}}}AGnAOlAOl}{{{d{c}}{d{Abe}}}AGn{}{}}00000{{{B@d{{d{c}}{d{e}}}}}{{B@d{ce}}}AOlAOl}{{}{{AOb{ce}}}{}{}}{{{d{{AOb{ce}}}}}AHb{}{}}{{{d{Ab{AOb{ce}}}}g}AGn{}B@f{{ANl{}{{ANj{{B@d{ce}}}}}}}}{{{d{Ab{AOb{ce}}}}g}AGn{}B@f{{ANl{}{{ANj{c}}}}}}{{{d{{AOb{ce}}}}}{{AJb{{d{c}}}}}{}{}}{{{d{Ab{AOb{ce}}}}}{{AJb{{d{Abc}}}}}{}{}}{cc{}}0000000{g{{AOb{ce}}}{}{}{{ANl{}{{ANj{{B@d{ce}}}}}}}}{e{{AOb{cg}}}{}{{ANl{}{{ANj{c}}}}}B@f}{{{d{{AOb{ce}}}}AIl}{{d{g}}}{}{}{}}{{{d{Ab{AOb{ce}}}}AIl}{{d{Abg}}}{}{}{}}{{{d{Ab{AOb{ce}}}}AIlc}AGn{}B@f}{ce{}{}}0000000{{{AOb{ce}}}g{}{}{}}{{{d{Ab{AOb{ce}}}}}g{}{}{}}{{{d{{AOb{ce}}}}}g{}{}{}}333333{{{AOb{ce}}}{{B@`{ce}}}{}{}}{{{B@d{ce}}}{{ALh{c{AJb{e}}}}}{}{}}{{{B@d{ce}}}c{}{}}{{{d{{AOb{ce}}}}}AHb{}{}}{{{d{{AOb{ce}}}}}{{AJf{c}}}{}{}}{{{d{Ab{AOb{ce}}}}}{{AJh{c}}}{}{}}{{{d{{AOb{ce}}}}}{{AJb{{d{c}}}}}{}{}}{{{d{Ab{AOb{ce}}}}}{{AJb{{d{Abc}}}}}{}{}}{{{d{{AOb{ce}}}}}AIl{}{}}{{{d{{AOn{ce}}}}}AIl{}{}}{{{d{{B@h{ce}}}}}AIl{}{}}{{{d{{B@`{ce}}}}}AIl{}{}}{{{d{{B@b{c}}}}}AIl{}}{{{d{{AJf{c}}}}}AIl{}}{{{d{{AJh{c}}}}}AIl{}}{{}{{AOb{ce}}}{}{}}{{c{AJb{e}}}{{B@d{ce}}}{}{}}{{{d{Ab{AOn{ce}}}}}{{AJb{g}}}{}{}{}}{{{d{Ab{B@h{ce}}}}}{{AJb{g}}}{}{}{}}{{{d{Ab{B@`{ce}}}}}{{AJb{g}}}{}{}{}}{{{d{Ab{B@b{c}}}}}{{AJb{e}}}{}{}}{{{d{Ab{AJf{c}}}}}{{AJb{e}}}{}{}}{{{d{Ab{AJh{c}}}}}{{AJb{e}}}{}{}}543210{{{d{{AOb{ce}}}}}{{AOn{ce}}}{}{}}{{{d{Ab{AOb{ce}}}}}{{B@h{ce}}}{}{}}{AKh{{n{{AOb{ce}}}}}AKf{B@jAKf}}{{AKh{ANb{AKh}{{ALb{{n{c}}}}}}}{{n{{AOb{ce}}}}}{}{B@jAKf}}{AKh{{n{{AOb{ce}}}}}AKfAKf}{{AKh{ANb{AKh}{{ALb{{n{c}}}}}}}{{n{{AOb{ce}}}}}{}AKf}{{{d{Ab{AOb{ce}}}}}{{AJb{{B@d{ce}}}}}{}{}}{{{d{Ab{AOb{ce}}}}}{{AJb{e}}}{}{}}{{{d{{B@d{ce}}}}}{{AJb{{d{e}}}}}{}{}}{{{d{Ab{B@d{ce}}}}}{{AJb{{d{Abe}}}}}{}{}}{{{d{Ab{AOb{ce}}}}c}AGn{}B@f}{{{d{Ab{AOb{ce}}}}e}AGn{}{}}{{{d{Ab{AOb{ce}}}}c}AGn{}{}}{{{d{{AOn{ce}}}}}{{ALh{AIl{AJb{AIl}}}}}{}{}}{{{d{{B@h{ce}}}}}{{ALh{AIl{AJb{AIl}}}}}{}{}}{{{d{{B@`{ce}}}}}{{ALh{AIl{AJb{AIl}}}}}{}{}}{{{d{{B@b{c}}}}}{{ALh{AIl{AJb{AIl}}}}}{}}{{{d{{AJf{c}}}}}{{ALh{AIl{AJb{AIl}}}}}{}}{{{d{{AJh{c}}}}}{{ALh{AIl{AJb{AIl}}}}}{}}{{{d{c}}}AJj{}}0{{{d{c}}}e{}{}}00000{{{d{{AOb{ce}}}}{d{AbAKj}}}AGnAO`AO`}{{{d{{B@d{ce}}}}{d{AbAKj}}}AGnAO`AO`}{{{d{{AOb{ce}}}}}AHb{}{}}{c{{AHl{e}}}{}{}}000000000000000{{{d{c}}}ALl{}}0000000{{{d{{B@d{ce}}}}}{{d{c}}}{}{}}{{{d{Ab{B@d{ce}}}}}{{d{Abc}}}{}{}}`{{{d{B@l}}}AJj}````````````````````````````````````````````````````````````````````````````````````````````````````````{{{d{c}}}{{d{e}}}{}{}}000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000{{{d{Abc}}}{{d{Abe}}}{}{}}000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000{{{d{B@n}}}B@n}{{{d{AIh}}}AIh}{{{d{BA`}}}BA`}{{{d{BAb}}}BAb}{{{d{BAd}}}BAd}{{{d{BAf}}}BAf}{{{d{BAh}}}BAh}{{{d{BAj}}}BAj}{{{d{BAl}}}BAl}{{{d{BAn}}}BAn}{{{d{BB`}}}BB`}{{{d{BBb}}}BBb}{{{d{AIb}}}AIb}{{{d{BBd}}}BBd}{{{d{BBf}}}BBf}{{{d{BBh}}}BBh}{{{d{BBj}}}BBj}{{{d{BBl}}}BBl}{{{d{AI`}}}AI`}{{{d{BBn}}}BBn}{{{d{BC`}}}BC`}{{{d{BCb}}}BCb}{{{d{BCd}}}BCd}{{{d{BCf}}}BCf}{{{d{BCh}}}BCh}{{{d{BCj}}}BCj}{{{d{BCl}}}BCl}{{{d{BCn}}}BCn}{{{d{BD`}}}BD`}{{{d{BDb}}}BDb}{{{d{BDd}}}BDd}{{{d{BDf}}}BDf}{{{d{BDh}}}BDh}{{{d{BDj}}}BDj}{{{d{BDl}}}BDl}{{{d{BDn}}}BDn}{{{d{BE`}}}BE`}{{{d{AIj}}}AIj}{{{d{AId}}}AId}{{{d{BEb}}}BEb}{{{d{BEd}}}BEd}{{{d{AIf}}}AIf}{{{d{BEf}}}BEf}{{{d{BEh}}}BEh}{{{d{BEj}}}BEj}{{{d{BEl}}}BEl}{{{d{BEn}}}BEn}{{{d{BF`}}}BF`}{{{d{BFb}}}BFb}{{{d{BFd}}}BFd}{{{d{BFf}}}BFf}{{{d{BFh}}}BFh}{{{d{BFj}}}BFj}{{{d{BFl}}}BFl}{{{d{BFn}}}BFn}{{{d{BG`}}}BG`}{{{d{BGb}}}BGb}{{{d{BGd}}}BGd}{{{d{BGf}}}BGf}{{{d{BGh}}}BGh}{{{d{BGj}}}BGj}{{{d{BGl}}}BGl}{{{d{BGn}}}BGn}{{{d{BH`}}}BH`}{{{d{BHb}}}BHb}{{{d{BHd}}}BHd}{{{d{BHf}}}BHf}{{{d{BHh}}}BHh}{{{d{BHj}}}BHj}{{{d{BHl}}}BHl}{{{d{BHn}}}BHn}{{{d{BI`}}}BI`}{{{d{BIb}}}BIb}{{{d{BId}}}BId}{{{d{BIf}}}BIf}{{{d{BIh}}}BIh}{{{d{BIj}}}BIj}{{{d{BIl}}}BIl}{{{d{BIn}}}BIn}{{{d{BJ`}}}BJ`}{{{d{BJb}}}BJb}{{{d{BJd}}}BJd}{{{d{BJf}}}BJf}{{{d{BJh}}}BJh}{{{d{BJj}}}BJj}{{{d{BJl}}}BJl}{{{d{BJn}}}BJn}{{{d{BK`}}}BK`}{{{d{BKb}}}BKb}{{{d{BKd}}}BKd}{{{d{BKf}}}BKf}{{{d{BKh}}}BKh}{{{d{BKj}}}BKj}{{{d{BKl}}}BKl}{{{d{BKn}}}BKn}{{{d{BL`}}}BL`}{{{d{BLb}}}BLb}{{{d{BLd}}}BLd}{{{d{BLf}}}BLf}{{{d{BLh}}}BLh}{{{d{BLj}}}BLj}{{{d{BLl}}}BLl}{{{d{BLn}}}BLn}{{{d{c}}{d{Abe}}}AGn{}{}}000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000{{}B@n}{{}AIh}{{}BA`}{{}BAb}{{}BAd}{{}BAf}{{}BAh}{{}BAj}{{}BAl}{{}BAn}{{}BB`}{{}BBb}{{}AIb}{{}BBd}{{}BBf}{{}BBh}{{}BBj}{{}BBl}{{}AI`}{{}BBn}{{}BC`}{{}BCb}{{}BCd}{{}BCf}{{}BCh}{{}BCj}{{}BCl}{{}BCn}{{}BD`}{{}BDb}{{}BDd}{{}BDf}{{}BDh}{{}BDj}{{}BDl}{{}BDn}{{}BE`}{{}AIj}{{}AId}{{}BEb}{{}BEd}{{}AIf}{{}BEf}{{}BEh}{{}BEj}{{}BEl}{{}BEn}{{}BF`}{{}BFb}{{}BFd}{{}BFf}{{}BFh}{{}BFj}{{}BFl}{{}BFn}{{}BG`}{{}BGb}{{}BGd}{{}BGf}{{}BGh}{{}BGj}{{}BGl}{{}BGn}{{}BH`}{{}BHb}{{}BHd}{{}BHf}{{}BHh}{{}BHj}{{}BHl}{{}BHn}{{}BI`}{{}BIb}{{}BId}{{}BIf}{{}BIh}{{}BIj}{{}BIl}{{}BIn}{{}BJ`}{{}BJb}{{}BJd}{{}BJf}{{}BJh}{{}BJj}{{}BJl}{{}BJn}{{}BK`}{{}BKb}{{}BKd}{{}BKf}{{}BKh}{{}BKj}{{}BKl}{{}BKn}{{}BL`}{{}BLb}{{}BLd}{{}BLf}{{}BLh}{{}BLj}{{}BLl}{{}BLn}{{{d{AIh}}}{{d{c}}}{}}{{{d{BFn}}}{{d{c}}}{}}{{{d{BGd}}}{{d{c}}}{}}{{{d{BGf}}}{{d{c}}}{}}{{{d{BGj}}}{{d{c}}}{}}{{{d{BGl}}}{{d{c}}}{}}{{{d{BGn}}}{{d{c}}}{}}{{{d{BH`}}}{{d{c}}}{}}{{{d{BHh}}}{{d{c}}}{}}{{{d{BI`}}}{{d{c}}}{}}{{{d{BIf}}}{{d{c}}}{}}{{{d{BIh}}}{{d{c}}}{}}{{{d{BIn}}}{{d{c}}}{}}{{{d{BJ`}}}{{d{c}}}{}}{{{d{BJh}}}{{d{c}}}{}}{{{d{BJl}}}{{d{c}}}{}}{{{d{BK`}}}{{d{c}}}{}}{{{d{BKb}}}{{d{c}}}{}}{{{d{BKf}}}{{d{c}}}{}}{{{d{BL`}}}{{d{c}}}{}}{{{d{BLd}}}{{d{c}}}{}}{{{d{BLh}}}{{d{c}}}{}}{{{d{AbAIh}}}{{d{Abc}}}{}}{{{d{AbBFn}}}{{d{Abc}}}{}}{{{d{AbBGd}}}{{d{Abc}}}{}}{{{d{AbBGf}}}{{d{Abc}}}{}}{{{d{AbBGj}}}{{d{Abc}}}{}}{{{d{AbBGl}}}{{d{Abc}}}{}}{{{d{AbBGn}}}{{d{Abc}}}{}}{{{d{AbBH`}}}{{d{Abc}}}{}}{{{d{AbBHh}}}{{d{Abc}}}{}}{{{d{AbBI`}}}{{d{Abc}}}{}}{{{d{AbBIf}}}{{d{Abc}}}{}}{{{d{AbBIh}}}{{d{Abc}}}{}}{{{d{AbBIn}}}{{d{Abc}}}{}}{{{d{AbBJ`}}}{{d{Abc}}}{}}{{{d{AbBJh}}}{{d{Abc}}}{}}{{{d{AbBJl}}}{{d{Abc}}}{}}{{{d{AbBK`}}}{{d{Abc}}}{}}{{{d{AbBKb}}}{{d{Abc}}}{}}{{{d{AbBKf}}}{{d{Abc}}}{}}{{{d{AbBL`}}}{{d{Abc}}}{}}{{{d{AbBLd}}}{{d{Abc}}}{}}{{{d{AbBLh}}}{{d{Abc}}}{}}{cc{}}000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000{ce{}{}}000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000{AKh{{n{AIh}}}}{AKh{{n{BA`}}}}{AKh{{n{BAb}}}}{AKh{{n{BAd}}}}{AKh{{n{BAf}}}}{AKh{{n{BAh}}}}{AKh{{n{BAj}}}}{AKh{{n{BAl}}}}{AKh{{n{BAn}}}}{AKh{{n{BB`}}}}{AKh{{n{BBb}}}}{AKh{{n{AIb}}}}{AKh{{n{BBd}}}}{AKh{{n{BBf}}}}{AKh{{n{BBh}}}}{AKh{{n{BBj}}}}{AKh{{n{BBl}}}}{AKh{{n{AI`}}}}{AKh{{n{BBn}}}}{AKh{{n{BC`}}}}{AKh{{n{BCb}}}}{AKh{{n{BCd}}}}{AKh{{n{BCf}}}}{AKh{{n{BCh}}}}{AKh{{n{BCj}}}}{AKh{{n{BCl}}}}{AKh{{n{BCn}}}}{AKh{{n{BD`}}}}{AKh{{n{BDb}}}}{AKh{{n{BDd}}}}{AKh{{n{BDf}}}}{AKh{{n{BDh}}}}{AKh{{n{BDj}}}}{AKh{{n{BDl}}}}{AKh{{n{BDn}}}}{AKh{{n{BE`}}}}{AKh{{n{AIj}}}}{AKh{{n{AId}}}}{AKh{{n{BEb}}}}{AKh{{n{BEd}}}}{AKh{{n{AIf}}}}{AKh{{n{BEf}}}}{AKh{{n{BEh}}}}{AKh{{n{BEj}}}}{AKh{{n{BEl}}}}{AKh{{n{BEn}}}}{AKh{{n{BF`}}}}{AKh{{n{BFb}}}}{AKh{{n{BFd}}}}{AKh{{n{BFf}}}}{AKh{{n{BFh}}}}{AKh{{n{BFj}}}}{AKh{{n{BFl}}}}{AKh{{n{BFn}}}}{AKh{{n{BG`}}}}{AKh{{n{BGb}}}}{AKh{{n{BGd}}}}{AKh{{n{BGf}}}}{AKh{{n{BGh}}}}{AKh{{n{BGj}}}}{AKh{{n{BGl}}}}{AKh{{n{BGn}}}}{AKh{{n{BH`}}}}{AKh{{n{BHb}}}}{AKh{{n{BHd}}}}{AKh{{n{BHf}}}}{AKh{{n{BHh}}}}{AKh{{n{BHj}}}}{AKh{{n{BHl}}}}{AKh{{n{BHn}}}}{AKh{{n{BI`}}}}{AKh{{n{BIb}}}}{AKh{{n{BId}}}}{AKh{{n{BIf}}}}{AKh{{n{BIh}}}}{AKh{{n{BIj}}}}{AKh{{n{BIl}}}}{AKh{{n{BIn}}}}{AKh{{n{BJ`}}}}{AKh{{n{BJb}}}}{AKh{{n{BJd}}}}{AKh{{n{BJf}}}}{AKh{{n{BJh}}}}{AKh{{n{BJj}}}}{AKh{{n{BJl}}}}{AKh{{n{BJn}}}}{AKh{{n{BK`}}}}{AKh{{n{BKb}}}}{AKh{{n{BKd}}}}{AKh{{n{BKf}}}}{AKh{{n{BKh}}}}{AKh{{n{BKj}}}}{AKh{{n{BKl}}}}{AKh{{n{BKn}}}}{AKh{{n{BL`}}}}{AKh{{n{BLb}}}}{AKh{{n{BLd}}}}{AKh{{n{BLf}}}}{AKh{{n{BLh}}}}{{{d{c}}}AJj{}}00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000```````````````````````````````````````````````````````````````````````````````````````````````````````{{{d{B@n}}{d{AbAKj}}c}AGn{{AOf{{d{AbAKj}}}}}}{{{d{BLj}}{d{AbAKj}}c}AGn{{AOf{{d{AbAKj}}}}}}{{{d{BLl}}{d{AbAKj}}c}AGn{{AOf{{d{AbAKj}}}}}}{{{d{BLn}}{d{AbAKj}}c}AGn{{AOf{{d{AbAKj}}}}}}{{{d{c}}}e{}{}}000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000{{{d{AIh}}{d{AbAKj}}}AGn}{{{d{BA`}}{d{AbAKj}}}AGn}{{{d{BAb}}{d{AbAKj}}}AGn}{{{d{BAd}}{d{AbAKj}}}AGn}{{{d{BAf}}{d{AbAKj}}}AGn}{{{d{BAh}}{d{AbAKj}}}AGn}{{{d{BAj}}{d{AbAKj}}}AGn}{{{d{BAl}}{d{AbAKj}}}AGn}{{{d{BAn}}{d{AbAKj}}}AGn}{{{d{BB`}}{d{AbAKj}}}AGn}{{{d{BBb}}{d{AbAKj}}}AGn}{{{d{AIb}}{d{AbAKj}}}AGn}{{{d{BBd}}{d{AbAKj}}}AGn}{{{d{BBf}}{d{AbAKj}}}AGn}{{{d{BBh}}{d{AbAKj}}}AGn}{{{d{BBj}}{d{AbAKj}}}AGn}{{{d{BBl}}{d{AbAKj}}}AGn}{{{d{AI`}}{d{AbAKj}}}AGn}{{{d{BBn}}{d{AbAKj}}}AGn}{{{d{BC`}}{d{AbAKj}}}AGn}{{{d{BCb}}{d{AbAKj}}}AGn}{{{d{BCd}}{d{AbAKj}}}AGn}{{{d{BCf}}{d{AbAKj}}}AGn}{{{d{BCh}}{d{AbAKj}}}AGn}{{{d{BCj}}{d{AbAKj}}}AGn}{{{d{BCl}}{d{AbAKj}}}AGn}{{{d{BCn}}{d{AbAKj}}}AGn}{{{d{BD`}}{d{AbAKj}}}AGn}{{{d{BDb}}{d{AbAKj}}}AGn}{{{d{BDd}}{d{AbAKj}}}AGn}{{{d{BDf}}{d{AbAKj}}}AGn}{{{d{BDh}}{d{AbAKj}}}AGn}{{{d{BDj}}{d{AbAKj}}}AGn}{{{d{BDl}}{d{AbAKj}}}AGn}{{{d{BDn}}{d{AbAKj}}}AGn}{{{d{BE`}}{d{AbAKj}}}AGn}{{{d{AIj}}{d{AbAKj}}}AGn}{{{d{AId}}{d{AbAKj}}}AGn}{{{d{BEb}}{d{AbAKj}}}AGn}{{{d{BEd}}{d{AbAKj}}}AGn}{{{d{AIf}}{d{AbAKj}}}AGn}{{{d{BEf}}{d{AbAKj}}}AGn}{{{d{BEh}}{d{AbAKj}}}AGn}{{{d{BEj}}{d{AbAKj}}}AGn}{{{d{BEl}}{d{AbAKj}}}AGn}{{{d{BEn}}{d{AbAKj}}}AGn}{{{d{BF`}}{d{AbAKj}}}AGn}{{{d{BFb}}{d{AbAKj}}}AGn}{{{d{BFd}}{d{AbAKj}}}AGn}{{{d{BFf}}{d{AbAKj}}}AGn}{{{d{BFh}}{d{AbAKj}}}AGn}{{{d{BFj}}{d{AbAKj}}}AGn}{{{d{BFl}}{d{AbAKj}}}AGn}{{{d{BFn}}{d{AbAKj}}}AGn}{{{d{BG`}}{d{AbAKj}}}AGn}{{{d{BGb}}{d{AbAKj}}}AGn}{{{d{BGd}}{d{AbAKj}}}AGn}{{{d{BGf}}{d{AbAKj}}}AGn}{{{d{BGh}}{d{AbAKj}}}AGn}{{{d{BGj}}{d{AbAKj}}}AGn}{{{d{BGl}}{d{AbAKj}}}AGn}{{{d{BGn}}{d{AbAKj}}}AGn}{{{d{BH`}}{d{AbAKj}}}AGn}{{{d{BHb}}{d{AbAKj}}}AGn}{{{d{BHd}}{d{AbAKj}}}AGn}{{{d{BHf}}{d{AbAKj}}}AGn}{{{d{BHh}}{d{AbAKj}}}AGn}{{{d{BHj}}{d{AbAKj}}}AGn}{{{d{BHl}}{d{AbAKj}}}AGn}{{{d{BHn}}{d{AbAKj}}}AGn}{{{d{BI`}}{d{AbAKj}}}AGn}{{{d{BIb}}{d{AbAKj}}}AGn}{{{d{BId}}{d{AbAKj}}}AGn}{{{d{BIf}}{d{AbAKj}}}AGn}{{{d{BIh}}{d{AbAKj}}}AGn}{{{d{BIj}}{d{AbAKj}}}AGn}{{{d{BIl}}{d{AbAKj}}}AGn}{{{d{BIn}}{d{AbAKj}}}AGn}{{{d{BJ`}}{d{AbAKj}}}AGn}{{{d{BJb}}{d{AbAKj}}}AGn}{{{d{BJd}}{d{AbAKj}}}AGn}{{{d{BJf}}{d{AbAKj}}}AGn}{{{d{BJh}}{d{AbAKj}}}AGn}{{{d{BJj}}{d{AbAKj}}}AGn}{{{d{BJl}}{d{AbAKj}}}AGn}{{{d{BJn}}{d{AbAKj}}}AGn}{{{d{BK`}}{d{AbAKj}}}AGn}{{{d{BKb}}{d{AbAKj}}}AGn}{{{d{BKd}}{d{AbAKj}}}AGn}{{{d{BKf}}{d{AbAKj}}}AGn}{{{d{BKh}}{d{AbAKj}}}AGn}{{{d{BKj}}{d{AbAKj}}}AGn}{{{d{BKl}}{d{AbAKj}}}AGn}{{{d{BKn}}{d{AbAKj}}}AGn}{{{d{BL`}}{d{AbAKj}}}AGn}{{{d{BLb}}{d{AbAKj}}}AGn}{{{d{BLd}}{d{AbAKj}}}AGn}{{{d{BLf}}{d{AbAKj}}}AGn}{{{d{BLh}}{d{AbAKj}}}AGn}{c{{AHl{e}}}{}{}}0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000{{{d{c}}}ALl{}}000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","D":"J@`","p":[[5,"TypeGenerics",0,5661],[1,"reference"],[5,"Turbofish",0,5661],[5,"LitInt",0,5662],[1,"str"],[5,"LitFloat",0,5662],[8,"Result",3709,5663],[10,"FromStr",5664],[0,"mut"],[5,"Ident",0,5665],[5,"ImplGenerics",0,5661],[5,"Lifetime",0,5666],[5,"Attribute",0,5667],[6,"AttrStyle",0,5667],[6,"Meta",0,5667],[5,"MetaList",0,5667],[5,"MetaNameValue",0,5667],[5,"Variant",0,5668],[6,"Fields",0,5668],[5,"FieldsNamed",0,5668],[5,"FieldsUnnamed",0,5668],[5,"Field",0,5668],[5,"DeriveInput",0,5669],[6,"Data",0,5669],[5,"DataStruct",0,5669],[5,"DataEnum",0,5669],[5,"DataUnion",0,5669],[6,"Expr",0,5670],[5,"ExprArray",0,5670],[5,"ExprAssign",0,5670],[5,"ExprAsync",0,5670],[5,"ExprAwait",0,5670],[5,"ExprBinary",0,5670],[5,"ExprBlock",0,5670],[5,"ExprBreak",0,5670],[5,"ExprCall",0,5670],[5,"ExprCast",0,5670],[5,"ExprClosure",0,5670],[5,"ExprConst",0,5670],[5,"ExprContinue",0,5670],[5,"ExprField",0,5670],[5,"ExprForLoop",0,5670],[5,"ExprGroup",0,5670],[5,"ExprIf",0,5670],[5,"ExprIndex",0,5670],[5,"ExprInfer",0,5670],[5,"ExprLet",0,5670],[5,"ExprLit",0,5670],[5,"ExprLoop",0,5670],[5,"ExprMacro",0,5670],[5,"ExprMatch",0,5670],[5,"ExprMethodCall",0,5670],[5,"ExprParen",0,5670],[5,"ExprPath",0,5670],[5,"ExprRange",0,5670],[5,"ExprReference",0,5670],[5,"ExprRepeat",0,5670],[5,"ExprReturn",0,5670],[5,"ExprStruct",0,5670],[5,"ExprTry",0,5670],[5,"ExprTryBlock",0,5670],[5,"ExprTuple",0,5670],[5,"ExprUnary",0,5670],[5,"ExprUnsafe",0,5670],[5,"ExprWhile",0,5670],[5,"ExprYield",0,5670],[6,"Member",0,5670],[5,"Index",0,5670],[5,"FieldValue",0,5670],[5,"Label",0,5670],[5,"Arm",0,5670],[6,"RangeLimits",0,5670],[5,"File",0,5671],[5,"Generics",0,5661],[6,"GenericParam",0,5661],[5,"LifetimeParam",0,5661],[5,"TypeParam",0,5661],[5,"ConstParam",0,5661],[5,"BoundLifetimes",0,5661],[6,"TypeParamBound",0,5661],[5,"TraitBound",0,5661],[6,"TraitBoundModifier",0,5661],[5,"WhereClause",0,5661],[6,"WherePredicate",0,5661],[5,"PredicateLifetime",0,5661],[5,"PredicateType",0,5661],[6,"Item",0,5672],[5,"ItemConst",0,5672],[5,"ItemEnum",0,5672],[5,"ItemExternCrate",0,5672],[5,"ItemFn",0,5672],[5,"ItemForeignMod",0,5672],[5,"ItemImpl",0,5672],[5,"ItemMacro",0,5672],[5,"ItemMod",0,5672],[5,"ItemStatic",0,5672],[5,"ItemStruct",0,5672],[5,"ItemTrait",0,5672],[5,"ItemTraitAlias",0,5672],[5,"ItemType",0,5672],[5,"ItemUnion",0,5672],[5,"ItemUse",0,5672],[6,"UseTree",0,5672],[5,"UsePath",0,5672],[5,"UseName",0,5672],[5,"UseRename",0,5672],[5,"UseGlob",0,5672],[5,"UseGroup",0,5672],[6,"ForeignItem",0,5672],[5,"ForeignItemFn",0,5672],[5,"ForeignItemStatic",0,5672],[5,"ForeignItemType",0,5672],[5,"ForeignItemMacro",0,5672],[6,"TraitItem",0,5672],[5,"TraitItemConst",0,5672],[5,"TraitItemFn",0,5672],[5,"TraitItemType",0,5672],[5,"TraitItemMacro",0,5672],[6,"ImplItem",0,5672],[5,"ImplItemConst",0,5672],[5,"ImplItemFn",0,5672],[5,"ImplItemType",0,5672],[5,"ImplItemMacro",0,5672],[5,"Signature",0,5672],[6,"FnArg",0,5672],[5,"Receiver",0,5672],[5,"Variadic",0,5672],[6,"StaticMutability",0,5672],[6,"ImplRestriction",0,5672],[6,"Lit",0,5662],[5,"LitStr",0,5662],[5,"LitByteStr",0,5662],[5,"LitCStr",0,5662],[5,"LitByte",0,5662],[5,"LitChar",0,5662],[5,"LitBool",0,5662],[5,"Macro",0,5673],[6,"MacroDelimiter",0,5673],[6,"BinOp",0,5674],[6,"UnOp",0,5674],[6,"Pat",0,5675],[5,"PatIdent",0,5675],[5,"PatOr",0,5675],[5,"PatParen",0,5675],[5,"PatReference",0,5675],[5,"PatRest",0,5675],[5,"PatSlice",0,5675],[5,"PatStruct",0,5675],[5,"PatTuple",0,5675],[5,"PatTupleStruct",0,5675],[5,"PatType",0,5675],[5,"PatWild",0,5675],[5,"FieldPat",0,5675],[5,"Path",0,5676],[5,"PathSegment",0,5676],[6,"PathArguments",0,5676],[6,"GenericArgument",0,5676],[5,"AngleBracketedGenericArguments",0,5676],[5,"AssocType",0,5676],[5,"AssocConst",0,5676],[5,"Constraint",0,5676],[5,"ParenthesizedGenericArguments",0,5676],[5,"QSelf",0,5676],[6,"Visibility",0,5677],[5,"VisRestricted",0,5677],[6,"FieldMutability",0,5677],[5,"Block",0,5678],[6,"Stmt",0,5678],[5,"Local",0,5678],[5,"LocalInit",0,5678],[5,"StmtMacro",0,5678],[6,"Type",0,5679],[5,"TypeArray",0,5679],[5,"TypeBareFn",0,5679],[5,"TypeGroup",0,5679],[5,"TypeImplTrait",0,5679],[5,"TypeInfer",0,5679],[5,"TypeMacro",0,5679],[5,"TypeNever",0,5679],[5,"TypeParen",0,5679],[5,"TypePath",0,5679],[5,"TypePtr",0,5679],[5,"TypeReference",0,5679],[5,"TypeSlice",0,5679],[5,"TypeTraitObject",0,5679],[5,"TypeTuple",0,5679],[5,"Abi",0,5679],[5,"BareFnArg",0,5679],[5,"BareVariadic",0,5679],[6,"ReturnType",0,5679],[1,"unit"],[6,"Ordering",5680],[1,"bool"],[10,"AsRef",5681],[10,"Sized",5682],[5,"Formatter",5683],[5,"Error",5683],[6,"Result",5684],[8,"Result",5683],[5,"Extern",3976],[5,"Crate",3976],[5,"SelfValue",3976],[5,"Super",3976],[5,"Underscore",3976],[5,"SelfType",3976],[1,"usize"],[5,"Literal",5665],[10,"Into",5681],[6,"Option",5685],[10,"Hasher",5686],[5,"Iter",3812],[5,"IterMut",3812],[5,"Span",5665],[1,"u8"],[1,"slice"],[5,"CStr",5687],[1,"char"],[5,"TokenStream",5688],[10,"Parse",3709],[8,"ParseStream",3709],[5,"TokenStream",5665],[10,"Parser",3709],[5,"Vec",5689],[5,"ParseNestedMeta",3695],[17,"Output"],[10,"FnMut",5690],[5,"DelimSpan",5691],[1,"tuple"],[5,"String",5692],[5,"TypeId",5693],[5,"CString",5694],[5,"TokenBuffer",3657],[5,"Cursor",3657],[6,"Delimiter",5665],[5,"Punct",5665],[6,"TokenTree",5665],[10,"IdentExt",3691],[5,"Error",3709,5663],[10,"Display",5683],[5,"ParseBuffer",3709],[1,"fn"],[5,"StepCursor",3709],[5,"Nothing",3709],[5,"Lookahead1",3709,5695],[17,"Item"],[10,"IntoIterator",5696],[5,"LexError",5665],[10,"ToTokens",5697],[5,"Punctuated",3812],[10,"Peek",3709,5695],[10,"FnOnce",5690],[10,"Speculative",3808],[10,"AnyDelimiter",3808],[10,"Clone",5698],[5,"Pairs",3812],[5,"IntoPairs",3812],[5,"IntoIter",3812],[6,"Pair",3812],[10,"Default",5699],[5,"PairsMut",3812],[10,"Token",3976],[10,"Spanned",3974],[5,"Group",3976],[5,"Abstract",3976],[5,"As",3976],[5,"Async",3976],[5,"Auto",3976],[5,"Await",3976],[5,"Become",3976],[5,"Box",3976],[5,"Break",3976],[5,"Const",3976],[5,"Continue",3976],[5,"Default",3976],[5,"Do",3976],[5,"Dyn",3976],[5,"Else",3976],[5,"Enum",3976],[5,"Final",3976],[5,"Fn",3976],[5,"For",3976],[5,"If",3976],[5,"Impl",3976],[5,"In",3976],[5,"Let",3976],[5,"Loop",3976],[5,"Macro",3976],[5,"Match",3976],[5,"Mod",3976],[5,"Move",3976],[5,"Mut",3976],[5,"Override",3976],[5,"Priv",3976],[5,"Pub",3976],[5,"Ref",3976],[5,"Return",3976],[5,"Static",3976],[5,"Struct",3976],[5,"Trait",3976],[5,"Try",3976],[5,"Type",3976],[5,"Typeof",3976],[5,"Union",3976],[5,"Unsafe",3976],[5,"Unsized",3976],[5,"Use",3976],[5,"Virtual",3976],[5,"Where",3976],[5,"While",3976],[5,"Yield",3976],[5,"And",3976],[5,"AndAnd",3976],[5,"AndEq",3976],[5,"At",3976],[5,"Caret",3976],[5,"CaretEq",3976],[5,"Colon",3976],[5,"Comma",3976],[5,"Dollar",3976],[5,"Dot",3976],[5,"DotDot",3976],[5,"DotDotDot",3976],[5,"DotDotEq",3976],[5,"Eq",3976],[5,"EqEq",3976],[5,"FatArrow",3976],[5,"Ge",3976],[5,"Gt",3976],[5,"LArrow",3976],[5,"Le",3976],[5,"Lt",3976],[5,"Minus",3976],[5,"MinusEq",3976],[5,"Ne",3976],[5,"Not",3976],[5,"Or",3976],[5,"OrEq",3976],[5,"OrOr",3976],[5,"PathSep",3976],[5,"Percent",3976],[5,"PercentEq",3976],[5,"Plus",3976],[5,"PlusEq",3976],[5,"Pound",3976],[5,"Question",3976],[5,"RArrow",3976],[5,"Semi",3976],[5,"Shl",3976],[5,"ShlEq",3976],[5,"Shr",3976],[5,"ShrEq",3976],[5,"Slash",3976],[5,"SlashEq",3976],[5,"Star",3976],[5,"StarEq",3976],[5,"Tilde",3976],[5,"Brace",3976],[5,"Bracket",3976],[5,"Paren",3976]],"r":[[0,5679],[5,5676],[6,5670],[10,5676],[12,5676],[15,5667],[16,5667],[19,5679],[20,5679],[21,5674],[29,5678],[32,5661],[51,5661],[52,5676],[55,5669],[56,5669],[57,5669],[58,5669],[61,5669],[67,5663],[68,5670],[70,5670],[71,5670],[72,5670],[73,5670],[74,5670],[75,5670],[76,5670],[77,5670],[78,5670],[79,5670],[80,5670],[81,5670],[82,5670],[83,5670],[84,5670],[85,5670],[86,5670],[87,5670],[88,5670],[89,5670],[90,5670],[91,5670],[92,5670],[93,5670],[94,5670],[95,5670],[96,5670],[97,5670],[98,5670],[99,5670],[100,5670],[101,5670],[102,5670],[103,5670],[104,5670],[105,5670],[106,5670],[107,5670],[109,5668],[111,5677],[112,5675],[113,5670],[114,5668],[115,5668],[116,5668],[117,5671],[123,5672],[125,5672],[126,5672],[127,5672],[128,5672],[129,5672],[132,5676],[133,5661],[134,5661],[141,5665],[145,5661],[146,5672],[147,5672],[148,5672],[149,5672],[150,5672],[151,5672],[153,5670],[160,5672],[162,5672],[163,5672],[164,5672],[165,5672],[166,5672],[167,5672],[168,5672],[169,5672],[170,5672],[171,5672],[172,5672],[173,5672],[174,5672],[175,5672],[176,5672],[177,5670],[180,5666],[185,5661],[187,5662],[190,5662],[191,5662],[192,5662],[193,5662],[194,5662],[195,5662],[196,5662],[197,5662],[198,5678],[200,5678],[203,5673],[212,5673],[215,5670],[216,5667],[217,5667],[218,5667],[245,5676],[246,5675],[248,5675],[251,5675],[252,5675],[255,5675],[256,5675],[257,5675],[258,5675],[259,5675],[260,5675],[261,5675],[262,5675],[263,5676],[269,5676],[270,5676],[271,5661],[272,5661],[275,5676],[278,5670],[279,5672],[290,5663],[292,5679],[297,5672],[302,5672],[303,5678],[304,5678],[316,5661],[317,5661],[318,5672],[319,5672],[320,5672],[321,5672],[322,5672],[330,5661],[331,5679],[341,5679],[342,5679],[343,5661],[344,5679],[345,5679],[346,5679],[347,5679],[348,5679],[349,5661],[350,5661],[351,5679],[352,5679],[353,5679],[354,5679],[355,5679],[356,5679],[357,5679],[359,5674],[368,5672],[369,5672],[370,5672],[371,5672],[372,5672],[373,5672],[374,5672],[375,5668],[385,5677],[386,5677],[387,5661],[388,5661],[3709,5663],[3710,5695],[3717,5695],[3718,5663]],"b":[[1393,"impl-PartialEq%3CT%3E-for-Ident"],[1394,"impl-PartialEq-for-Ident"],[1442,"impl-Debug-for-Ident"],[1443,"impl-Display-for-Ident"],[1444,"impl-IdentFragment-for-Ident"],[1454,"impl-From%3CExtern%3E-for-Ident"],[1455,"impl-From%3CCrate%3E-for-Ident"],[1456,"impl-From%3CSelfValue%3E-for-Ident"],[1457,"impl-From%3CSuper%3E-for-Ident"],[1459,"impl-From%3CUnderscore%3E-for-Ident"],[1460,"impl-From%3CSelfType%3E-for-Ident"],[1467,"impl-From%3CMetaNameValue%3E-for-Meta"],[1469,"impl-From%3CPath%3E-for-Meta"],[1470,"impl-From%3CMetaList%3E-for-Meta"],[1474,"impl-From%3CFieldsNamed%3E-for-Fields"],[1475,"impl-From%3CFieldsUnnamed%3E-for-Fields"],[1480,"impl-From%3CItemUnion%3E-for-DeriveInput"],[1481,"impl-From%3CItemEnum%3E-for-DeriveInput"],[1483,"impl-From%3CItemStruct%3E-for-DeriveInput"],[1488,"impl-From%3CExprLoop%3E-for-Expr"],[1489,"impl-From%3CExprMatch%3E-for-Expr"],[1490,"impl-From%3CExprReference%3E-for-Expr"],[1491,"impl-From%3CExprForLoop%3E-for-Expr"],[1492,"impl-From%3CExprCall%3E-for-Expr"],[1493,"impl-From%3CExprYield%3E-for-Expr"],[1495,"impl-From%3CExprBreak%3E-for-Expr"],[1496,"impl-From%3CExprTry%3E-for-Expr"],[1497,"impl-From%3CExprAsync%3E-for-Expr"],[1498,"impl-From%3CExprAwait%3E-for-Expr"],[1499,"impl-From%3CExprUnary%3E-for-Expr"],[1500,"impl-From%3CExprStruct%3E-for-Expr"],[1501,"impl-From%3CExprUnsafe%3E-for-Expr"],[1502,"impl-From%3CExprConst%3E-for-Expr"],[1503,"impl-From%3CExprBlock%3E-for-Expr"],[1504,"impl-From%3CExprArray%3E-for-Expr"],[1505,"impl-From%3CExprWhile%3E-for-Expr"],[1506,"impl-From%3CExprParen%3E-for-Expr"],[1507,"impl-From%3CExprBinary%3E-for-Expr"],[1508,"impl-From%3CExprCast%3E-for-Expr"],[1509,"impl-From%3CExprLit%3E-for-Expr"],[1510,"impl-From%3CExprMethodCall%3E-for-Expr"],[1511,"impl-From%3CExprMacro%3E-for-Expr"],[1512,"impl-From%3CExprIf%3E-for-Expr"],[1513,"impl-From%3CExprGroup%3E-for-Expr"],[1514,"impl-From%3CExprInfer%3E-for-Expr"],[1515,"impl-From%3CExprRepeat%3E-for-Expr"],[1516,"impl-From%3CExprAssign%3E-for-Expr"],[1517,"impl-From%3CExprRange%3E-for-Expr"],[1518,"impl-From%3CExprClosure%3E-for-Expr"],[1519,"impl-From%3CExprField%3E-for-Expr"],[1520,"impl-From%3CExprContinue%3E-for-Expr"],[1521,"impl-From%3CExprPath%3E-for-Expr"],[1522,"impl-From%3CExprTuple%3E-for-Expr"],[1523,"impl-From%3CExprLet%3E-for-Expr"],[1524,"impl-From%3CExprReturn%3E-for-Expr"],[1525,"impl-From%3CExprIndex%3E-for-Expr"],[1526,"impl-From%3CExprTryBlock%3E-for-Expr"],[1565,"impl-From%3Cusize%3E-for-Member"],[1566,"impl-From%3CIdent%3E-for-Member"],[1567,"impl-From%3CIndex%3E-for-Member"],[1577,"impl-From%3CLifetimeParam%3E-for-GenericParam"],[1578,"impl-From%3CTypeParam%3E-for-GenericParam"],[1579,"impl-From%3CConstParam%3E-for-GenericParam"],[1586,"impl-From%3CLifetime%3E-for-TypeParamBound"],[1588,"impl-From%3CTraitBound%3E-for-TypeParamBound"],[1592,"impl-From%3CPredicateLifetime%3E-for-WherePredicate"],[1594,"impl-From%3CPredicateType%3E-for-WherePredicate"],[1597,"impl-From%3CItemMacro%3E-for-Item"],[1598,"impl-From%3CItemMod%3E-for-Item"],[1599,"impl-From%3CItemTrait%3E-for-Item"],[1600,"impl-From%3CItemUse%3E-for-Item"],[1601,"impl-From%3CItemTraitAlias%3E-for-Item"],[1602,"impl-From%3CItemUnion%3E-for-Item"],[1603,"impl-From%3CItemEnum%3E-for-Item"],[1605,"impl-From%3CItemConst%3E-for-Item"],[1606,"impl-From%3CItemFn%3E-for-Item"],[1607,"impl-From%3CItemType%3E-for-Item"],[1608,"impl-From%3CItemExternCrate%3E-for-Item"],[1609,"impl-From%3CItemStatic%3E-for-Item"],[1610,"impl-From%3CItemStruct%3E-for-Item"],[1611,"impl-From%3CItemForeignMod%3E-for-Item"],[1612,"impl-From%3CDeriveInput%3E-for-Item"],[1613,"impl-From%3CItemImpl%3E-for-Item"],[1629,"impl-From%3CUseGlob%3E-for-UseTree"],[1630,"impl-From%3CUseGroup%3E-for-UseTree"],[1631,"impl-From%3CUseRename%3E-for-UseTree"],[1632,"impl-From%3CUsePath%3E-for-UseTree"],[1634,"impl-From%3CUseName%3E-for-UseTree"],[1640,"impl-From%3CForeignItemStatic%3E-for-ForeignItem"],[1641,"impl-From%3CForeignItemType%3E-for-ForeignItem"],[1642,"impl-From%3CForeignItemMacro%3E-for-ForeignItem"],[1643,"impl-From%3CForeignItemFn%3E-for-ForeignItem"],[1649,"impl-From%3CTraitItemFn%3E-for-TraitItem"],[1650,"impl-From%3CTraitItemType%3E-for-TraitItem"],[1652,"impl-From%3CTraitItemConst%3E-for-TraitItem"],[1653,"impl-From%3CTraitItemMacro%3E-for-TraitItem"],[1658,"impl-From%3CImplItemConst%3E-for-ImplItem"],[1659,"impl-From%3CImplItemMacro%3E-for-ImplItem"],[1660,"impl-From%3CImplItemType%3E-for-ImplItem"],[1661,"impl-From%3CImplItemFn%3E-for-ImplItem"],[1668,"impl-From%3CReceiver%3E-for-FnArg"],[1669,"impl-From%3CPatType%3E-for-FnArg"],[1676,"impl-From%3CLitByte%3E-for-Lit"],[1677,"impl-From%3CLitInt%3E-for-Lit"],[1678,"impl-From%3CLitBool%3E-for-Lit"],[1679,"impl-From%3CLitChar%3E-for-Lit"],[1680,"impl-From%3CLitFloat%3E-for-Lit"],[1681,"impl-From%3CLitStr%3E-for-Lit"],[1682,"impl-From%3CLitCStr%3E-for-Lit"],[1683,"impl-From%3CLitByteStr%3E-for-Lit"],[1698,"impl-From%3CPatOr%3E-for-Pat"],[1699,"impl-From%3CPatWild%3E-for-Pat"],[1700,"impl-From%3CExprPath%3E-for-Pat"],[1701,"impl-From%3CExprLit%3E-for-Pat"],[1702,"impl-From%3CPatRest%3E-for-Pat"],[1703,"impl-From%3CPatType%3E-for-Pat"],[1704,"impl-From%3CExprMacro%3E-for-Pat"],[1705,"impl-From%3CPatTupleStruct%3E-for-Pat"],[1706,"impl-From%3CPatReference%3E-for-Pat"],[1707,"impl-From%3CPatSlice%3E-for-Pat"],[1708,"impl-From%3CExprRange%3E-for-Pat"],[1710,"impl-From%3CPatStruct%3E-for-Pat"],[1711,"impl-From%3CPatIdent%3E-for-Pat"],[1712,"impl-From%3CExprConst%3E-for-Pat"],[1713,"impl-From%3CPatParen%3E-for-Pat"],[1714,"impl-From%3CPatTuple%3E-for-Pat"],[1747,"impl-From%3CTypeBareFn%3E-for-Type"],[1748,"impl-From%3CTypeReference%3E-for-Type"],[1749,"impl-From%3CTypeInfer%3E-for-Type"],[1750,"impl-From%3CTypeNever%3E-for-Type"],[1751,"impl-From%3CTypePtr%3E-for-Type"],[1752,"impl-From%3CTypeSlice%3E-for-Type"],[1753,"impl-From%3CTypeMacro%3E-for-Type"],[1754,"impl-From%3CTypeArray%3E-for-Type"],[1755,"impl-From%3CTypeParen%3E-for-Type"],[1756,"impl-From%3CTypeTraitObject%3E-for-Type"],[1757,"impl-From%3CTypeGroup%3E-for-Type"],[1758,"impl-From%3CTypePath%3E-for-Type"],[1760,"impl-From%3CTypeTuple%3E-for-Type"],[1761,"impl-From%3CTypeImplTrait%3E-for-Type"],[2040,"impl-IntoIterator-for-%26Fields"],[2041,"impl-IntoIterator-for-Fields"],[2042,"impl-IntoIterator-for-%26mut+Fields"],[2265,"impl-LitStr"],[2266,"impl-Parse-for-LitStr"],[2427,"impl-Ident"],[2429,"impl-IdentFragment-for-Ident"],[3747,"impl-Debug-for-Error"],[3748,"impl-Display-for-Error"],[3749,"impl-Display-for-ParseBuffer%3C\'a%3E"],[3750,"impl-Debug-for-ParseBuffer%3C\'a%3E"],[3764,"impl-IntoIterator-for-Error"],[3765,"impl-IntoIterator-for-%26Error"],[3855,"impl-Extend%3CPair%3CT,+P%3E%3E-for-Punctuated%3CT,+P%3E"],[3856,"impl-Extend%3CT%3E-for-Punctuated%3CT,+P%3E"],[3867,"impl-FromIterator%3CPair%3CT,+P%3E%3E-for-Punctuated%3CT,+P%3E"],[3868,"impl-FromIterator%3CT%3E-for-Punctuated%3CT,+P%3E"],[3880,"impl-IntoIterator-for-Punctuated%3CT,+P%3E"],[3881,"impl-IntoIterator-for-%26mut+Punctuated%3CT,+P%3E"],[3882,"impl-IntoIterator-for-%26Punctuated%3CT,+P%3E"]],"c":"OjAAAAAAAAA=","e":"OzAAAAEAAB0RhAAiAAEAQQAAAJ8AAAC3AAAA1wAAAOAAAADoAAMA7wAAAPIAAAAJAQAAMwEAADoBAABqAQAAegEAAIkBDgCZAWsABgJ/AYcDAgCLAw8AnAMGAKQDAACmA3oBIgUVADoFCwBIBQ4AWAU/AJkFAgCdBRUAtAUBALwFAAC+BQEAwwUBAMkFAQDMBQAA0QUFANgFHwAeBgIAIwYAACoGAgAvBgAAMwYAADUGAAA5BgAAOwYAAD4GBgBGBggAXgYDAGMGAABpBgMAcgYBAHUGAQB7BgMAhQYBAI0GBwCaBgAAnAYAAKMGCgCvBgQAwQYAAMMGAADUBgsA4QYBAPUGEgAJBwsAFwcFAB4HHwA/BwAA+QcCAP0HAAD/BwUABwgKABMIBwAcCAEAIAgAACIIEAA0CAMAOQgSAE4IAABQCAcAWQgFAGAIEAB0CGUA2wglAAIJAAAdCQoAKgkEADAJCAA6CQYAQgkDAEoJBwBTCRgAbQkOAH0JvwA/CgUARgp5AcELCQDMCz8CDg42AEYOAwBNDgUAVQ4AAGAOAABjDgAAZg4FAHEOAQB1DgAAeQ4DAIEOAACJDgoAlQ4FAJ0OAACfDgAAow4EAKoOAAC1DgEAuw4AAL4OAADADgAAyQ4AAMwOFADlDgAA7g4QAAAPDgAQDwEAHA8DACkPCAA7DwUAQw8LAFwPDwBtDxcA8Q8uAu4SLwM="}],\ +["unicode_ident",{"t":"HH","n":["is_xid_continue","is_xid_start"],"q":[[0,"unicode_ident"]],"i":[0,0],"f":"{bd}0","D":"b","p":[[1,"char"],[1,"bool"]],"r":[],"b":[],"c":"OjAAAAAAAAA=","e":"OjAAAAEAAAAAAAEAEAAAAAEAAgA="}]\ +]')); +if (typeof exports !== 'undefined') exports.searchIndex = searchIndex; +else if (window.initSearch) window.initSearch(searchIndex); diff --git a/search.desc/bitflag_attr/bitflag_attr-desc-0-.js b/search.desc/bitflag_attr/bitflag_attr-desc-0-.js new file mode 100644 index 0000000..2aef7e3 --- /dev/null +++ b/search.desc/bitflag_attr/bitflag_attr-desc-0-.js @@ -0,0 +1 @@ +searchState.loadedDescShard("bitflag_attr", 0, "An attribute macro that transforms an C-like enum into a …") \ No newline at end of file diff --git a/search.desc/proc_macro2/proc_macro2-desc-0-.js b/search.desc/proc_macro2/proc_macro2-desc-0-.js new file mode 100644 index 0000000..d775558 --- /dev/null +++ b/search.desc/proc_macro2/proc_macro2-desc-0-.js @@ -0,0 +1 @@ +searchState.loadedDescShard("proc_macro2", 0, "github crates-io docs-rs\nE.g. + is Alone in + =, +ident or +().\n{ ... }\n[ ... ]\nDescribes how a sequence of token trees is delimited.\nA delimited token stream.\nA token stream surrounded by bracket delimiters.\nA word of Rust code, which may be a keyword or legal …\nAn identifier.\nE.g. + is Joint in += or ' is Joint in '#.\nError returned from TokenStream::from_str.\nA literal string ("hello"), byte string (b"hello"), …\nA literal character ('a'), string ("hello"), number (2.3), …\n∅ ... ∅\n( ... )\nA Punct is a single punctuation character like +, - or #.\nA single punctuation character (+, ,, $, etc.).\nWhether a Punct is followed immediately by another Punct …\nA region of source code, along with macro expansion …\nAn abstract stream of tokens, or more concretely a …\nA single token or a delimited sequence of token trees …\nReturns the value of this punctuation character as char.\nByte character literal.\nByte string literal.\nC string literal.\nThe span of the invocation of the current procedural macro.\nCharacter literal.\nReturns an object that holds this group’s span_open() and\nReturns the punctuation used as the delimiter for this …\nItems which do not have a correspondence to any API in the …\nCreates a new suffixed floating-point literal.\nCreates a new unsuffixed floating-point literal.\nCreates a new suffixed floating-point literal.\nCreates a new unsuffixed floating-point literal.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nCreates a new suffixed integer literal with the specified …\nCreates a new unsuffixed integer literal with the …\nCreates a new suffixed integer literal with the specified …\nCreates a new unsuffixed integer literal with the …\nCreates a new suffixed integer literal with the specified …\nCreates a new unsuffixed integer literal with the …\nCreates a new suffixed integer literal with the specified …\nCreates a new unsuffixed integer literal with the …\nCreates a new suffixed integer literal with the specified …\nCreates a new unsuffixed integer literal with the …\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nChecks if this TokenStream is empty.\nCreates a new suffixed integer literal with the specified …\nCreates a new unsuffixed integer literal with the …\nCreate a new span encompassing self and other.\nCreates a new span with the same name resolution behavior …\nThe span located at the invocation of the procedural …\nReturns an empty TokenStream containing no token trees.\nCreates a new Group with the given delimiter and token …\nCreates a new Punct from the given character and spacing.\nCreates a new Ident with the given string as well as the …\nSame as Ident::new, but creates a raw identifier (r#ident…\nCreates a new span with the same line/column information …\nConfigures the span for only this token.\nConfigures the span for this Group’s delimiters, but not …\nConfigure the span for this punctuation character.\nConfigures the span of this Ident, possibly changing its …\nConfigures the span associated for this literal.\nReturns the source text behind a span. This preserves the …\nReturns the spacing of this punctuation character, …\nReturns the span of this tree, delegating to the span …\nReturns the span for the delimiters of this token stream, …\nReturns the span for this punctuation character.\nReturns the span of this Ident.\nReturns the span encompassing this literal.\nReturns the span pointing to the closing delimiter of this …\nReturns the span pointing to the opening delimiter of this …\nReturns the TokenStream of tokens that are delimited in …\nString literal.\nReturns a Span that is a subset of self.span() containing …\nPublic implementation details for the TokenStream type, …\nCreates a new suffixed integer literal with the specified …\nCreates a new unsuffixed integer literal with the …\nCreates a new suffixed integer literal with the specified …\nCreates a new unsuffixed integer literal with the …\nCreates a new suffixed integer literal with the specified …\nCreates a new unsuffixed integer literal with the …\nCreates a new suffixed integer literal with the specified …\nCreates a new unsuffixed integer literal with the …\nCreates a new suffixed integer literal with the specified …\nCreates a new unsuffixed integer literal with the …\nConvert proc_macro2::Span to proc_macro::Span.\nCreates a new suffixed integer literal with the specified …\nCreates a new unsuffixed integer literal with the …\nAn object that holds a Group’s span_open() and …\nReturns a span for the closing punctuation of the group …\nReturns the argument unchanged.\nCalls U::from(self).\nReturns a span covering the entire delimited group.\nReturns a span for the opening punctuation of the group …\nAn iterator over TokenStream’s TokenTrees.\nReturns the argument unchanged.\nCalls U::from(self).") \ No newline at end of file diff --git a/search.desc/quote/quote-desc-0-.js b/search.desc/quote/quote-desc-0-.js new file mode 100644 index 0000000..139d763 --- /dev/null +++ b/search.desc/quote/quote-desc-0-.js @@ -0,0 +1 @@ +searchState.loadedDescShard("quote", 0, "github crates-io docs-rs\nSpecialized formatting trait used by format_ident!.\nTypes that can be interpolated inside a quote! invocation.\nTokenStream extension trait with methods for appending …\nFor use by ToTokens implementations.\nFor use by ToTokens implementations.\nFor use by ToTokens implementations.\nFor use by ToTokens implementations.\nFormat this value as an identifier fragment.\nFormatting macro for constructing Idents.\nConvert self directly into a TokenStream object.\nConvert self directly into a TokenStream object.\nThe whole point.\nSame as quote!, but applies a given span to all tokens …\nSpan associated with this IdentFragment.\nSpan associated with this IdentFragment.\nConvert self directly into a TokenStream object.\nConvert self directly into a TokenStream object.\nWrite self to the given TokenStream.") \ No newline at end of file diff --git a/search.desc/syn/syn-desc-0-.js b/search.desc/syn/syn-desc-0-.js new file mode 100644 index 0000000..195fa16 --- /dev/null +++ b/search.desc/syn/syn-desc-0-.js @@ -0,0 +1 @@ +searchState.loadedDescShard("syn", 0, "github crates-io docs-rs\nThe binary interface of a function: extern "C".\nThe + operator (addition)\nThe += operator\nThe && operator (logical and)\nThe <'a, T> in std::slice::iter<'a, T>.\nAngle bracketed arguments of a path segment: the <K, V> in …\nOne arm of a match expression: 0..=10 => { return true; }.\nA slice literal expression: [a, b, c, d].\nA fixed size array type: [T; n].\nAn assignment expression: a = compute().\nAn equality constraint on an associated constant: the …\nAn equality constraint on an associated constant: the …\nA binding (equality constraint) on an associated type: the …\nA binding (equality constraint) on an associated type: the …\nAn async block: async { ... }.\nDistinguishes between attributes that decorate an item and …\nAn attribute, like #[repr(transparent)].\nAn await expression: fut.await.\nA bare function type: fn(usize) -> bool.\nAn argument in a function type: the usize in …\nThe variadic argument of a function pointer like …\nA binary operator: +, +=, &.\nA binary operation: a + b, a += b.\nThe & operator (bitwise and)\nThe &= operator\nThe | operator (bitwise or)\nThe |= operator\nThe ^ operator (bitwise xor)\nThe ^= operator\nA braced block containing Rust statements.\nA blocked scope: { ... }.\nA boolean literal: true or false.\nA set of bound lifetimes: for<'a, 'b, 'c>.\nA break, with an optional label to break and an optional …\nA byte literal: b'f'.\nA byte string literal: b"foo".\nA nul-terminated C-string literal: c"foo".\nA function call expression: invoke(a, b).\nA cast expression: foo as f64.\nA character literal: 'a'.\nInclusive at the beginning and end.\nA closure expression: |a, b| a + b.\nA const block: const { ... }.\nA const generic parameter: const LENGTH: usize.\nA constant item: const MAX: u16 = 65535.\nAn associated constant within the definition of a trait.\nAn associated constant within an impl block.\nA const block: const { ... }.\nA const expression. Must be inside of a block.\nA const generic parameter: const LENGTH: usize.\nAn associated type bound: Iterator<Item: Display>.\nAn associated type bound: Iterator<Item: Display>.\nA continue, with an optional label.\nThe storage of a struct, enum or union data structure.\nAn enum input to a proc_macro_derive macro.\nA struct input to a proc_macro_derive macro.\nAn untagged union input to a proc_macro_derive macro.\nReturn type is not specified.\nThe * operator for dereferencing\nData structure sent to a proc_macro_derive macro.\nThe / operator (division)\nThe /= operator\nAn enum definition: enum Foo<A, B> { A(A), B(B) }.\nThe == operator (equality)\nError returned when a Syn parser cannot parse the input …\nA Rust expression.\nExpression, with or without trailing semicolon.\nA slice literal expression: [a, b, c, d].\nAn assignment expression: a = compute().\nAn async block: async { ... }.\nAn await expression: fut.await.\nA binary operation: a + b, a += b.\nA blocked scope: { ... }.\nA break, with an optional label to break and an optional …\nA function call expression: invoke(a, b).\nA cast expression: foo as f64.\nA closure expression: |a, b| a + b.\nA const block: const { ... }.\nA continue, with an optional label.\nAccess of a named struct field (obj.k) or unnamed tuple …\nA for loop: for pat in expr { ... }.\nAn expression contained within invisible delimiters.\nAn if expression with an optional else block: …\nA square bracketed indexing expression: vector[2].\nThe inferred value of a const generic argument, denoted _.\nA let guard: let Some(x) = opt.\nA literal in place of an expression: 1, "foo".\nConditionless loop: loop { ... }.\nA macro invocation expression: format!("{}", q).\nA match expression: match n { Some(n) => {}, None => {} }.\nA method call expression: x.foo::<T>(a, b).\nA parenthesized expression: (a + b).\nA path like std::mem::replace possibly containing generic …\nA range expression: 1..2, 1.., ..2, 1..=2, ..=2.\nA referencing operation: &a or &mut a.\nAn array literal constructed from one repeated element: …\nA return, with an optional value to be returned.\nA struct literal expression: Point { x: 1, y: 1 }.\nA try-expression: expr?.\nA try block: try { ... }.\nA tuple expression: (a, b, c, d).\nA unary operation: !x, *x.\nAn unsafe block: unsafe { ... }.\nA while loop: while expr { ... }.\nA yield expression: yield expr.\nAn extern crate item: extern crate serde.\nA field of a struct or enum variant.\nAccess of a named struct field (obj.k) or unnamed tuple …\nUnused, but reserved for RFC 3323 restrictions.\nA single field in a struct pattern.\nA field-value pair in a struct literal.\nData stored within an enum variant or struct.\nNamed fields of a struct or struct variant such as …\nUnnamed fields of a tuple struct or tuple variant such as …\nA complete file of Rust source code.\nA floating point literal: 1f64 or 1.0e10f64.\nA free-standing function: …\nA foreign function in an extern block.\nAn associated function within the definition of a trait.\nAn associated function within an impl block.\nAn argument in a function signature: the n: usize in …\nA for loop: for pat in expr { ... }.\nAn item within an extern block.\nA foreign function in an extern block.\nA macro invocation within an extern block.\nA foreign static item in an extern block: static ext: u8.\nA foreign type in an extern block: type void.\nA block of foreign items: extern "C" { ... }.\nThe >= operator (greater than or equal to)\nAn individual generic argument, like 'a, T, or Item = T.\nA generic type parameter, lifetime, or const generic: …\nLifetimes and type parameters attached to a declaration of …\nA glob import in a use item: *.\nAn expression contained within invisible delimiters.\nA braced group of imports in a use item: {A, B, C}.\nA type contained within invisible delimiters.\nThe > operator (greater than)\nInclusive at the beginning, exclusive at the end.\nA word of Rust code, which may be a keyword or legal …\nA pattern that binds a new variable: …\nAn if expression with an optional else block: …\nAn impl block providing trait or associated items: …\nReturned by Generics::split_for_impl.\nAn item within an impl block.\nAn associated constant within an impl block.\nAn associated function within an impl block.\nA macro invocation within an impl block.\nAn associated type within an impl block.\nUnused, but reserved for RFC 3323 restrictions.\nAn impl Bound1 + Bound2 + Bound3 type where Bound is a …\nThe index of an unnamed tuple struct field.\nA square bracketed indexing expression: vector[2].\nThe inferred value of a const generic argument, denoted _.\nIndication that a type should be inferred by the compiler: …\nAn inherited visibility, which usually means private.\nAn integer literal: 1 or 1u16.\nThings that can appear directly inside of a module or …\nAn item definition.\nA constant item: const MAX: u16 = 65535.\nAn enum definition: enum Foo<A, B> { A(A), B(B) }.\nAn extern crate item: extern crate serde.\nA free-standing function: …\nA block of foreign items: extern "C" { ... }.\nAn impl block providing trait or associated items: …\nA macro invocation, which includes macro_rules! …\nA module or module declaration: mod m or mod m { ... }.\nA static item: static BIKE: Shed = Shed(42).\nA struct definition: struct Foo<A> { x: A }.\nA trait definition: pub trait Iterator { ... }.\nA trait alias: pub trait SharableIterator = Iterator + Sync…\nA type alias: …\nA union definition: union Foo<A, B> { x: A, y: B }.\nA use declaration: use std::collections::HashMap.\nA lifetime labeling a for, while, or loop.\nThe <= operator (less than or equal to)\nA let guard: let Some(x) = opt.\nA Rust lifetime: 'a.\nA lifetime parameter: 'a: 'b + 'c + 'd.\nA lifetime predicate in a where clause: 'a: 'b + 'c.\nA lifetime argument.\nA lifetime definition: 'a: 'b + 'c + 'd.\nA structured list within an attribute, like …\nA Rust literal such as a string or integer or boolean.\nA literal in place of an expression: 1, "foo".\nA literal pattern: 0.\nA boolean literal: true or false.\nA byte literal: b'f'.\nA byte string literal: b"foo".\nA nul-terminated C-string literal: c"foo".\nA character literal: 'a'.\nA floating point literal: 1f64 or 1.0e10f64.\nAn integer literal: 1 or 1u16.\nA UTF-8 string literal: "foo".\nA local let binding: let x: u64 = s.parse()?.\nA local (let) binding.\nThe expression assigned in a local let binding, including …\nConditionless loop: loop { ... }.\nThe < operator (less than)\nA macro invocation: println!("{}", mac).\nA macro invocation expression: format!("{}", q).\nA macro invocation, which includes macro_rules! …\nA macro invocation within an extern block.\nA macro invocation within the definition of a trait.\nA macro invocation within an impl block.\nA macro in pattern position.\nA macro invocation in statement position.\nA macro in the type position.\nA grouping token that surrounds a macro body: m!(...) or …\nA match expression: match n { Some(n) => {}, None => {} }.\nA struct or tuple struct field accessed in a struct …\nContent of a compile-time structured attribute.\nA structured list within an attribute, like …\nA name-value pair within an attribute, like …\nA method call expression: x.foo::<T>(a, b).\nA module or module declaration: mod m or mod m { ... }.\nThe * operator (multiplication)\nThe *= operator\nAn identifier imported by a use item: HashMap.\nA name-value pair within an attribute, like …\nNamed fields of a struct or struct variant such as …\nA named field like self.x.\nThe != operator (not equal to)\nThe - operator for negation\nThe never type: !.\nThe ! operator for logical inversion\nThe || operator (logical or)\nA pattern that matches any one of a set of cases.\nAn unspecified invalid expression.\nA parenthesized expression: (a + b).\nA parenthesized pattern: (A | B).\nA parenthesized type equivalent to the inner type.\nThe (A, B) -> C in Fn(A, B) -> C.\nArguments of a function path segment: the (A, B) -> C in …\nA pattern in a local binding, function signature, match …\nA const block: const { ... }.\nA pattern that binds a new variable: …\nA literal in place of an expression: 1, "foo".\nA macro invocation expression: format!("{}", q).\nA pattern that matches any one of a set of cases.\nA parenthesized pattern: (A | B).\nA path like std::mem::replace possibly containing generic …\nA range expression: 1..2, 1.., ..2, 1..=2, ..=2.\nA reference pattern: &mut var.\nThe dots in a tuple or slice pattern: [0, 1, ..].\nA dynamically sized slice pattern: [a, b, ref i @ .., y, z]…\nA struct or struct variant pattern: Variant { x, y, .. }.\nA tuple pattern: (a, b).\nA tuple struct or tuple variant pattern: …\nA type ascription pattern: foo: f64.\nA pattern that matches any value: _.\nA path at which a named item is exported (e.g. …\nA path like std::mem::replace possibly containing generic …\nA path prefix of imports in a use item: std::....\nA path pattern like Color::Red, optionally qualified with a\nA path like std::slice::Iter, optionally qualified with a …\nAngle bracketed or parenthesized arguments of a path …\nA segment of a path together with any path arguments on …\nA lifetime predicate in a where clause: 'a: 'b + 'c.\nA type predicate in a where clause: …\nA raw pointer type: *const T or *mut T.\nA public visibility level: pub.\nThe explicit Self type in a qualified path: the T in …\nA range expression: 1..2, 1.., ..2, 1..=2, ..=2.\nA range pattern: 1..=2.\nLimit types of a range, inclusive or exclusive.\nThe self argument of an associated method.\nThe self argument of an associated method.\nA referencing operation: &a or &mut a.\nA reference pattern: &mut var.\nA reference type: &'a T or &'a mut T.\nThe % operator (modulus)\nThe %= operator\nAn renamed identifier imported by a use item: …\nAn array literal constructed from one repeated element: …\nThe dots in a tuple or slice pattern: [0, 1, ..].\nA visibility level restricted to some path: pub(self) or …\nThe result of a Syn parser.\nA return, with an optional value to be returned.\nReturn type of a function signature.\nThe << operator (shift left)\nThe <<= operator\nThe >> operator (shift right)\nThe >>= operator\nA function signature in a trait or implementation: …\nA dynamically sized slice pattern: [a, b, ref i @ .., y, z]…\nA dynamically sized slice type: [T].\nA static item: static BIKE: Shed = Shed(42).\nA foreign static item in an extern block: static ext: u8.\nThe mutability of an Item::Static or ForeignItem::Static.\nA statement, usually ending in a semicolon.\nA macro invocation in statement position.\nA UTF-8 string literal: "foo".\nA struct literal expression: Point { x: 1, y: 1 }.\nA struct definition: struct Foo<A> { x: A }.\nA struct or struct variant pattern: Variant { x, y, .. }.\nThe - operator (subtraction)\nThe -= operator\nA type-macro that expands to the name of the Rust type …\nA trait definition: pub trait Iterator { ... }.\nA trait alias: pub trait SharableIterator = Iterator + Sync…\nA trait used as a bound on a type parameter.\nA modifier on a trait bound, currently only used for the ? …\nAn item declaration within the definition of a trait.\nAn associated constant within the definition of a trait.\nAn associated function within the definition of a trait.\nA macro invocation within the definition of a trait.\nAn associated type within the definition of a trait.\nA trait object type dyn Bound1 + Bound2 + Bound3 where …\nA try-expression: expr?.\nA try block: try { ... }.\nA tuple expression: (a, b, c, d).\nA tuple pattern: (a, b).\nA tuple type: (A, B, C, String).\nA tuple struct or tuple variant pattern: …\nReturned by TypeGenerics::as_turbofish.\nThe possible types that a Rust value could have.\nA generic type parameter: T: Into<String>.\nA type predicate in a where clause: …\nA type alias: …\nA foreign type in an extern block: type void.\nAn associated type within the definition of a trait.\nAn associated type within an impl block.\nA type ascription pattern: foo: f64.\nA type argument.\nA particular type is returned.\nA fixed size array type: [T; n].\nA bare function type: fn(usize) -> bool.\nReturned by Generics::split_for_impl.\nA type contained within invisible delimiters.\nAn impl Bound1 + Bound2 + Bound3 type where Bound is a …\nIndication that a type should be inferred by the compiler: …\nA macro in the type position.\nThe never type: !.\nA generic type parameter: T: Into<String>.\nA trait or lifetime used as a bound on a type parameter.\nA parenthesized type equivalent to the inner type.\nA path like std::slice::Iter, optionally qualified with a …\nA raw pointer type: *const T or *mut T.\nA reference type: &'a T or &'a mut T.\nA dynamically sized slice type: [T].\nA trait object type dyn Bound1 + Bound2 + Bound3 where …\nA tuple type: (A, B, C, String).\nA function argument accepted by pattern and type.\nA unary operator: *, !, -.\nA unary operation: !x, *x.\nA union definition: union Foo<A, B> { x: A, y: B }.\nUnit struct or unit variant such as None.\nUnnamed fields of a tuple struct or tuple variant such as …\nAn unnamed field like self.0.\nAn unsafe block: unsafe { ... }.\nA use declaration: use std::collections::HashMap.\nA glob import in a use item: *.\nA braced group of imports in a use item: {A, B, C}.\nAn identifier imported by a use item: HashMap.\nA path prefix of imports in a use item: std::....\nAn renamed identifier imported by a use item: …\nA suffix of an import tree in a use item: Type as Renamed …\nThe variadic argument of a foreign function.\nAn enum variant.\nTokens in expression position not interpreted by Syn.\nTokens forming an item not interpreted by Syn.\nTokens in an extern block not interpreted by Syn.\nTokens within the definition of a trait not interpreted by …\nTokens within an impl block not interpreted by Syn.\nA raw token literal not interpreted by Syn.\nTokens in pattern position not interpreted by Syn.\nTokens in type position not interpreted by Syn.\nA visibility level restricted to some path: pub(self) or …\nThe visibility level of an item: inherited or pub or …\nA where clause in a definition: …\nA single predicate in a where clause: T: Deserialize<'de>.\nA while loop: while expr { ... }.\nA pattern that matches any value: _.\nA yield expression: yield expr.\nTurn a type’s generics like <X, Y> into a turbofish like …\nParses the literal into a selected number type.\nThe type being bounded\nTrait and lifetime bounds (Clone+Send+'static)\nParse a set of curly braces and expose their content to …\nParse a set of square brackets and expose their content to …\nA stably addressed token buffer supporting efficient …\nThe colon in Struct { x: x }. If written in shorthand like …\nReturns an Iterator<Item = &ConstParam> over the constant …\nReturns an Iterator<Item = &mut ConstParam> over the …\nDefine a type that supports parsing and printing a given …\nDefine a type that supports parsing and printing a …\nExplicit discriminant: Variant = 1\nExtension traits to provide parsing methods on foreign …\nContent stored in the variant.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nIf this path consists of a single ident, returns the ident.\nName of the variant.\nName of the field, if any.\nThe example in macro_rules! example { ... }.\n(A, B)\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nReturns true if there are zero fields.\nDetermines whether this is a path of length 1 equal to the …\nGet an iterator over the borrowed Field items in this …\nGet an iterator over the mutably borrowed Field items in …\nReturns the number of fields.\nReturns an Iterator<Item = &LifetimeParam> over the …\nThe for<'a> in for<'a> Foo<&'a T>\nAny lifetimes from a for binding\nReturns an Iterator<Item = &mut LifetimeParam> over the …\nInitializes an empty where-clause if there is not one …\nFacility for interpreting structured content inside of an …\nCreates a new Ident with the given string as well as the …\nPanics\nInterpret a Syn literal from a proc-macro2 literal.\nSame as Ident::new, but creates a raw identifier (r#ident…\nC\nParse a set of parentheses and expose their content to …\nParsing interface for parsing a token stream into a syntax …\nParse tokens of source code into the chosen syntax tree …\nParse a syntax tree node from the content of this string …\nParse a proc-macro2 token stream into the chosen syntax …\nParse the arguments to the attribute as a syntax tree.\nSee Attribute::parse_args.\nParse the arguments to the attribute using the given …\nSee Attribute::parse_args_with.\nParse the tokens within the macro invocation’s …\nParse the tokens within the macro invocation’s …\nParse the content of a file of Rust code.\nParses zero or more inner attributes from the stream.\nParse the input TokenStream of a macro, triggering a …\nParse a Path containing no path arguments on any of its …\nParse a pattern, possibly involving |, but not a leading |.\nParse a pattern, possibly involving |, possibly including a\nParses a named (braced struct) field.\nParse the arguments to the attribute, expecting it to …\nSee Attribute::parse_nested_meta.\nParses zero or more outer attributes from the stream.\nQuasi-quotation macro that accepts input like the quote! …\nThis macro is parse_quote! + quote_spanned!.\nParse a pattern that does not involve | at the top level.\nParse a string of Rust code into the chosen syntax tree …\nParse ::<…> with mandatory leading ::.\nParses an unnamed (tuple struct) field.\nInvoke parser on the content of this string literal.\nAn alternative to the primary Expr::parse parser (from the …\nParse the body of a block as zero or more statements, …\nAn alternative to the primary Expr::parse parser (from the …\nReturns the path that identifies the interpretation of …\nReturns the path that begins this structured meta item.\nThe Foo<&'a T> in for<'a> Foo<&'a T>\nA punctuated sequence of syntax tree nodes separated by …\nA method’s self receiver, such as &self or …\nAn error if this path is not a single ident, as defined in …\nError if this is a Meta::Path or Meta::NameValue.\nError if this is a Meta::Path or Meta::List.\nError if this is a Meta::List or Meta::NameValue.\nThe Self type of the impl.\nConfigures the span of this Ident, possibly changing its …\nReturns the span of this Ident.\nA trait that can provide the Span of the complete contents …\nSplit a type’s generics into the pieces required for impl…\nStatements in a block\nTokens representing Rust punctuation, keywords, and …\nTrait this impl implements.\nReturns an Iterator<Item = &TypeParam> over the type …\nReturns an Iterator<Item = &mut TypeParam> over the type …\nIn some positions, types may not contain the + character, …\nA cheaply copyable cursor into a TokenBuffer.\nA buffer that can be efficiently traversed multiple times, …\nCreates a cursor referencing the first token in the buffer …\nCreates a cursor referencing a static empty TokenStream.\nChecks whether the cursor is currently pointing at the end …\nReturns the argument unchanged.\nReturns the argument unchanged.\nIf the cursor is pointing at a Group with the given …\nIf the cursor is pointing at a Ident, returns it along …\nCalls U::from(self).\nCalls U::from(self).\nIf the cursor is pointing at a Lifetime, returns it along …\nIf the cursor is pointing at a Literal, return it along …\nCreates a TokenBuffer containing all the tokens from the …\nCreates a TokenBuffer containing all the tokens from the …\nIf the cursor is pointing at a Punct, returns it along …\nReturns the Span of the current token, or Span::call_site()…\nCopies all remaining tokens visible from this cursor into a\nIf the cursor is pointing at a TokenTree, returns it along …\nAdditional methods for Ident not provided by proc-macro2 …\nParses any identifier including keywords.\nPeeks any identifier including keywords. Usage: …\nStrips the raw marker r#, if any, from the beginning of an …\nContext for parsing a single property in the conventional …\nReport that the attribute’s content did not conform to …\nReturns the argument unchanged.\nCalls U::from(self).\nUsed when parsing list(...) syntax if the content inside …\nMake a parser that is usable with parse_macro_input! in a …\nUsed when parsing key = "value" syntax.\nError returned when a Syn parser cannot parse the input …\nSupport for checking the next token in a stream to decide …\nAn empty syntax tree node that consumes no tokens when …\nParsing interface implemented by all types that can be …\nCursor position within a buffered token stream.\nInput to a Syn parser function.\nParser that can parse Rust tokens into a particular syntax …\nTypes that can be parsed by looking at just one token.\nThe result of a Syn parser.\nCursor state associated with speculative parsing.\nCalls the given parser function to parse a syntax tree …\nAdd another error message to self such that when …\nProvides low-level access to the token representation …\nExtensions to the parsing API with niche applicability.\nTriggers an error at the current position of the parse …\nTriggers an error at the current position of the parse …\nTriggers an error at the current position of the parse …\nForks a parse stream so that parsing tokens out of either …\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nRender the error as an invocation of compile_error!.\nReturns whether there are tokens remaining in this stream.\nConstructs a helper for peeking at the next token in this …\nUsually the ParseStream::error method will be used …\nCreates an error with the specified message spanning the …\nParses a syntax tree node of type T, advancing the …\nParse tokens of source code into the chosen syntax tree …\nParse a proc-macro2 token stream into the chosen syntax …\nParse a string of Rust code into the chosen syntax tree …\nParses zero or more occurrences of T separated by …\nLooks at the next token in the parse stream to determine …\nLooks at the next token in the parse stream to determine …\nLooks at the second-next token in the parse stream.\nLooks at the third-next token in the parse stream.\nThe source location of the error.\nReturns the Span of the next token in the parse stream, or …\nSpeculatively parses tokens from this parse stream, …\nRender the error as an invocation of compile_error!.\nExtensions to the ParseStream API to support manipulating …\nExtensions to the ParseStream API to support speculative …\nAdvance this parse stream to the position of a forked …\nReturns the delimiter, the span of the delimiter token, …\nAn iterator over owned values of type T.\nAn iterator over owned pairs of type Pair<T, P>.\nAn iterator over borrowed values of type &T.\nAn iterator over mutably borrowed values of type &mut T.\nA single syntax tree node of type T followed by its …\nAn iterator over borrowed pairs of type Pair<&T, &P>.\nAn iterator over mutably borrowed pairs of type …\nA punctuated sequence of syntax tree nodes of type T …\nClears the sequence of all values and punctuation, making …\nReturns true if either this Punctuated is empty, or it has …\nBorrows the first element in this sequence.\nMutably borrows the first element in this sequence.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nInserts an element at position index.\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nReturns an iterator over the contents of this sequence as …\nProduces this punctuated pair as a tuple of syntax tree …\nExtracts the syntax tree node from this punctuated pair, …\nDetermines whether this punctuated sequence is empty, …\nReturns an iterator over borrowed syntax tree nodes of …\nReturns an iterator over mutably borrowed syntax tree …\nBorrows the last element in this sequence.\nMutably borrows the last element in this sequence.\nReturns the number of syntax tree nodes in this punctuated …\nCreates an empty punctuated sequence.\nCreates a punctuated pair out of a syntax tree node and an …\nReturns an iterator over the contents of this sequence as …\nReturns an iterator over the contents of this sequence as …\nParses one or more occurrences of T separated by …\nParses one or more occurrences of T using the given parse …\nParses zero or more occurrences of T separated by …\nParses zero or more occurrences of T using the given parse …\nRemoves the last punctuated pair from this sequence, or …\nRemoves the trailing punctuation from this punctuated …\nBorrows the punctuation from this punctuated pair, unless …\nMutably borrows the punctuation from this punctuated pair, …\nAppends a syntax tree node onto the end of this punctuated …\nAppends a trailing punctuation onto the end of this …\nAppends a syntax tree node onto the end of this punctuated …\nDetermines whether this punctuated sequence ends with a …\nBorrows the syntax tree node from this punctuated pair.\nMutably borrows the syntax tree node from this punctuated …\nA trait that can provide the Span of the complete contents …\nReturns a Span covering the complete contents of this …\nabstract\n&\n&&\n&=\nas\nasync\n@\nauto\nawait\nbecome\nbox\n{}\n[]\nbreak\n^\n^=\n:\n,\nconst\ncontinue\ncrate\ndefault\ndo\n$\n.\n..\n...\n..=\ndyn\nelse\nenum\n=\n==\nextern\n=>\nfinal\nfn\nfor\n>=\nNone-delimited group\n>\nif\nimpl\nin\n<-\n<=\nlet\nloop\n<\nmacro\nmatch\n-\n-=\nmod\nmove\nmut\n!=\n!\n|\n|=\n||\noverride\n()\n::\n%\n%=\n+\n+=\n#\npriv\npub\n?\n->\nref\nreturn\nSelf\nself\n;\n<<\n<<=\n>>\n>>=\n/\n/=\n*\n*=\nstatic\nstruct\nsuper\n~\nMarker trait for types that represent single tokens.\ntrait\ntry\ntype\ntypeof\n_\nunion\nunsafe\nunsized\nuse\nvirtual\nwhere\nwhile\nyield\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).") \ No newline at end of file diff --git a/search.desc/unicode_ident/unicode_ident-desc-0-.js b/search.desc/unicode_ident/unicode_ident-desc-0-.js new file mode 100644 index 0000000..6f7ed19 --- /dev/null +++ b/search.desc/unicode_ident/unicode_ident-desc-0-.js @@ -0,0 +1 @@ +searchState.loadedDescShard("unicode_ident", 0, "github crates-io docs-rs") \ No newline at end of file diff --git a/settings.html b/settings.html new file mode 100644 index 0000000..ba8d364 --- /dev/null +++ b/settings.html @@ -0,0 +1 @@ +Settings

Rustdoc settings

Back
\ No newline at end of file diff --git a/src-files.js b/src-files.js new file mode 100644 index 0000000..0678d7c --- /dev/null +++ b/src-files.js @@ -0,0 +1,8 @@ +var srcIndex = new Map(JSON.parse('[\ +["bitflag_attr",["",[],["example_generated.rs","lib.rs"]]],\ +["proc_macro2",["",[],["detection.rs","extra.rs","fallback.rs","lib.rs","marker.rs","parse.rs","rcvec.rs","wrapper.rs"]]],\ +["quote",["",[],["ext.rs","format.rs","ident_fragment.rs","lib.rs","runtime.rs","spanned.rs","to_tokens.rs"]]],\ +["syn",["",[["gen",[],["clone.rs"]]],["attr.rs","bigint.rs","buffer.rs","custom_keyword.rs","custom_punctuation.rs","data.rs","derive.rs","discouraged.rs","drops.rs","error.rs","export.rs","expr.rs","ext.rs","file.rs","gen_helper.rs","generics.rs","group.rs","ident.rs","item.rs","lib.rs","lifetime.rs","lit.rs","lookahead.rs","mac.rs","macros.rs","meta.rs","op.rs","parse.rs","parse_macro_input.rs","parse_quote.rs","pat.rs","path.rs","print.rs","punctuated.rs","restriction.rs","sealed.rs","span.rs","spanned.rs","stmt.rs","thread.rs","token.rs","ty.rs","verbatim.rs","whitespace.rs"]]],\ +["unicode_ident",["",[],["lib.rs","tables.rs"]]]\ +]')); +createSrcSidebar(); diff --git a/src/bitflag_attr/example_generated.rs.html b/src/bitflag_attr/example_generated.rs.html new file mode 100644 index 0000000..5ed6316 --- /dev/null +++ b/src/bitflag_attr/example_generated.rs.html @@ -0,0 +1,659 @@ +example_generated.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+
//! An example of the generated code from the following code:
+//!
+//! ```
+//! use bitflag_attr::bitflag;
+//!
+//! #[bitflag(u32)]
+//! #[derive(PartialEq, PartialOrd, Eq, Ord, Hash)]
+//! pub enum Flags {
+//!     /// The value `A`, at bit position `0`.
+//!     A = 0b00000001,
+//!     /// The value `B`, at bit position `1`.
+//!     B = 0b00000010,
+//!     /// The value `C`, at bit position `2`.
+//!     C = 0b00000100,
+//!
+//!     /// The combination of `A`, `B`, and `C`.
+//!     ABC = A | B | C,
+//! }
+//! ```
+
+#[repr(transparent)]
+#[derive(Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Hash)]
+pub struct Flags(u32);
+
+#[doc = " The value `A`, at bit position `0`."]
+#[allow(non_upper_case_globals)]
+const A: u32 = 0b00000001;
+#[doc = " The value `B`, at bit position `1`."]
+#[allow(non_upper_case_globals)]
+const B: u32 = 0b00000010;
+#[doc = " The value `C`, at bit position `2`."]
+#[allow(non_upper_case_globals)]
+const C: u32 = 0b00000100;
+#[doc = " The combination of `A`, `B`, and `C`."]
+#[allow(non_upper_case_globals)]
+const ABC: u32 = A | B | C;
+#[allow(non_upper_case_globals)]
+impl Flags {
+    #[doc = " The value `A`, at bit position `0`."]
+    pub const A: Flags = Self(0b00000001);
+    #[doc = " The value `B`, at bit position `1`."]
+    pub const B: Flags = Self(0b00000010);
+    #[doc = " The value `C`, at bit position `2`."]
+    pub const C: Flags = Self(0b00000100);
+    #[doc = " The combination of `A`, `B`, and `C`."]
+    pub const ABC: Flags = Self(A | B | C);
+    #[doc = r" Return the underlying bits of the bitflag"]
+    #[inline]
+    pub const fn bits(&self) -> u32 {
+        self.0
+    }
+    #[doc = r" Converts from a `bits` value. Returning [`None`] is any unknown bits are set."]
+    #[inline]
+    pub const fn from_bits(bits: u32) -> Option<Self> {
+        let truncated = Self::from_bits_truncate(bits).0;
+        if truncated == bits {
+            Some(Self(bits))
+        } else {
+            None
+        }
+    }
+    #[doc = r" Convert from `bits` value, unsetting any unknown bits."]
+    #[inline]
+    pub const fn from_bits_truncate(bits: u32) -> Self {
+        Self(bits & Self::all().0)
+    }
+    #[doc = r" Convert from `bits` value exactly."]
+    #[inline]
+    pub const fn from_bits_retain(bits: u32) -> Self {
+        Self(bits)
+    }
+    #[doc = r" Construct an empty bitflag."]
+    #[inline]
+    pub const fn empty() -> Self {
+        Self(0)
+    }
+    #[doc = r" Returns `true` if the flag is empty."]
+    #[inline]
+    pub const fn is_empty(&self) -> bool {
+        self.0 == 0
+    }
+    #[doc = r" Returns a bitflag that constains all value."]
+    #[doc = r""]
+    #[doc = r" This will include bits that do not have any flags/meaning."]
+    #[doc = r" Use [`all`](Self::all) if you want only the specified flags set."]
+    #[inline]
+    pub const fn all_bits() -> Self {
+        Self(!0)
+    }
+    #[doc = r" Returns `true` if the bitflag constains all value bits set."]
+    #[doc = r""]
+    #[doc = r" This will check for all bits."]
+    #[doc = r" Use [`is_all`](Self::is_all) if you want to check for all specified flags."]
+    #[inline]
+    pub const fn is_all_bits(&self) -> bool {
+        self.0 == !0
+    }
+    #[doc = r" Construct a bitflag with all flags set."]
+    #[doc = r""]
+    #[doc = r" This will only set the flags specified as associated constant."]
+    #[inline]
+    pub const fn all() -> Self {
+        Self(Self::A.0 | Self::B.0 | Self::C.0 | Self::ABC.0 | 0)
+    }
+    #[doc = r" Returns `true` if the bitflag contais all flags."]
+    #[doc = r""]
+    #[inline]
+    pub const fn is_all(&self) -> bool {
+        self.0 == Self::all().0
+    }
+    #[doc = r" Returns a bit flag that only has bits corresponding to the specified flags as associated constant."]
+    #[inline]
+    pub const fn truncate(&self) -> Self {
+        Self(self.0 & Self::all().0)
+    }
+    #[doc = r" Returns `true` if this bitflag intersects with any value in `other`."]
+    #[doc = r""]
+    #[doc = r" This is equivalent to `(self & other) != Self::empty()`"]
+    #[inline]
+    pub const fn intersects(&self, other: Self) -> bool {
+        (self.0 & other.0) != Self::empty().0
+    }
+    #[doc = r" Returns `true` if this bitflag contains all values of `other`."]
+    #[doc = r""]
+    #[doc = r" This is equivalent to `(self & other) == other`"]
+    #[inline]
+    pub const fn contains(&self, other: Self) -> bool {
+        (self.0 & other.0) == other.0
+    }
+    #[doc = r" Returns the bitwise NOT of the flag."]
+    #[inline]
+    #[doc(alias = "complement")]
+    pub const fn not(self) -> Self {
+        Self(!self.0)
+    }
+    #[doc = r" Returns the bitwise AND of the flag."]
+    #[inline]
+    #[doc(alias = "intersection")]
+    pub const fn and(self, other: Self) -> Self {
+        Self(self.0 & other.0)
+    }
+    #[doc = r" Returns the bitwise OR of the flag with `other`."]
+    #[inline]
+    #[doc(alias = "union")]
+    pub const fn or(self, other: Self) -> Self {
+        Self(self.0 | other.0)
+    }
+    #[doc = r" Returns the bitwise XOR of the flag with `other`."]
+    #[inline]
+    #[doc(alias = "symmetric_difference")]
+    pub const fn xor(self, other: Self) -> Self {
+        Self(self.0 ^ other.0)
+    }
+    #[doc = r" Returns the intersection from this value with `other`."]
+    #[inline]
+    #[doc(alias = "and")]
+    pub const fn intersection(self, other: Self) -> Self {
+        self.and(other)
+    }
+    #[doc = r" Returns the union from this value with `other`"]
+    #[inline]
+    #[doc(alias = "or")]
+    pub const fn union(self, other: Self) -> Self {
+        self.or(other)
+    }
+    #[doc = r" Returns the difference from this value with `other`."]
+    #[inline]
+    pub const fn difference(self, other: Self) -> Self {
+        self.and(other.not())
+    }
+    #[doc = r" Returns the symmetric difference from this value with `other`."]
+    #[inline]
+    #[doc(alias = "xor")]
+    pub const fn symmetric_difference(self, other: Self) -> Self {
+        self.xor(other)
+    }
+    #[doc = r" Returns the complement of the value."]
+    #[doc = r""]
+    #[doc = r" This is very similar to the [`not`](Self::not), but truncates non used bits"]
+    #[inline]
+    #[doc(alias = "not")]
+    pub const fn complement(self) -> Self {
+        self.not().truncate()
+    }
+    #[doc = r" Set the flags in `other` in the value."]
+    #[inline]
+    pub fn set(&mut self, other: Self) {
+        self.0 = self.and(other).0
+    }
+    #[doc = r" Unset the flags in `other` in the value."]
+    #[inline]
+    pub fn unset(&mut self, other: Self) {
+        self.0 = self.difference(other).0
+    }
+    #[doc = r" Toggle the flags in `other` in the value."]
+    #[inline]
+    pub fn toggle(&mut self, other: Self) {
+        self.0 = self.xor(other).0
+    }
+}
+impl core::ops::Not for Flags {
+    type Output = Self;
+    #[inline]
+    fn not(self) -> Self::Output {
+        self.complement()
+    }
+}
+impl core::ops::BitAnd for Flags {
+    type Output = Self;
+    #[inline]
+    fn bitand(self, rhs: Self) -> Self::Output {
+        self.and(rhs)
+    }
+}
+impl core::ops::BitOr for Flags {
+    type Output = Self;
+    #[inline]
+    fn bitor(self, rhs: Self) -> Self::Output {
+        self.or(rhs)
+    }
+}
+impl core::ops::BitXor for Flags {
+    type Output = Self;
+    #[inline]
+    fn bitxor(self, rhs: Self) -> Self::Output {
+        self.xor(rhs)
+    }
+}
+impl core::ops::BitAndAssign for Flags {
+    #[inline]
+    fn bitand_assign(&mut self, rhs: Self) {
+        core::ops::BitAndAssign::bitand_assign(&mut self.0, rhs.0)
+    }
+}
+impl core::ops::BitOrAssign for Flags {
+    #[inline]
+    fn bitor_assign(&mut self, rhs: Self) {
+        core::ops::BitOrAssign::bitor_assign(&mut self.0, rhs.0)
+    }
+}
+impl core::ops::BitXorAssign for Flags {
+    #[inline]
+    fn bitxor_assign(&mut self, rhs: Self) {
+        core::ops::BitXorAssign::bitxor_assign(&mut self.0, rhs.0)
+    }
+}
+impl core::ops::Sub for Flags {
+    type Output = Self;
+    #[doc = r" The intersection of a source flag with the complement of a target flags value"]
+    #[inline]
+    fn sub(self, rhs: Self) -> Self::Output {
+        self.difference(rhs)
+    }
+}
+impl core::ops::SubAssign for Flags {
+    #[doc = r" The intersection of a source flag with the complement of a target flags value"]
+    #[inline]
+    fn sub_assign(&mut self, rhs: Self) {
+        self.unset(rhs)
+    }
+}
+impl From<u32> for Flags {
+    #[inline]
+    fn from(val: u32) -> Self {
+        Self::from_bits_truncate(val)
+    }
+}
+impl From<Flags> for u32 {
+    #[inline]
+    fn from(val: Flags) -> Self {
+        val.0
+    }
+}
+impl core::fmt::Binary for Flags {
+    #[inline]
+    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
+        core::fmt::Binary::fmt(&self.0, f)
+    }
+}
+impl core::fmt::LowerHex for Flags {
+    #[inline]
+    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
+        core::fmt::LowerHex::fmt(&self.0, f)
+    }
+}
+impl core::fmt::UpperHex for Flags {
+    #[inline]
+    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
+        core::fmt::UpperHex::fmt(&self.0, f)
+    }
+}
+impl core::fmt::Octal for Flags {
+    #[inline]
+    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
+        core::fmt::Octal::fmt(&self.0, f)
+    }
+}
+impl core::fmt::Debug for Flags {
+    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
+        let name = "Flags";
+        if f.alternate() {
+            f.write_fmt(format_args!("{} ", &name))?;
+            let mut tmp = f.debug_map();
+            if self.contains(Self::A) {
+                tmp.entry(&"A", &"set");
+            } else {
+                tmp.entry(&"A", &"unset");
+            }
+            if self.contains(Self::B) {
+                tmp.entry(&"B", &"set");
+            } else {
+                tmp.entry(&"B", &"unset");
+            }
+            if self.contains(Self::C) {
+                tmp.entry(&"C", &"set");
+            } else {
+                tmp.entry(&"C", &"unset");
+            }
+            if self.contains(Self::ABC) {
+                tmp.entry(&"ABC", &"set");
+            } else {
+                tmp.entry(&"ABC", &"unset");
+            }
+            tmp.finish()
+        } else {
+            f.debug_tuple(&name).field(&self.0).finish()
+        }
+    }
+}
+
\ No newline at end of file diff --git a/src/bitflag_attr/lib.rs.html b/src/bitflag_attr/lib.rs.html new file mode 100644 index 0000000..c828b0b --- /dev/null +++ b/src/bitflag_attr/lib.rs.html @@ -0,0 +1,961 @@ +lib.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+
use proc_macro::{Span, TokenStream};
+use quote::quote;
+use syn::{Error, Ident, ItemEnum, Result};
+
+/// An attribute macro that transforms an C-like enum into a bitflag struct implementing an type API
+/// similar to the `bitflags` crate, and implementing traits as listed below.
+///
+/// # Generated trait implementatations
+/// This macro generates some trait implementations: [`fmt::Debug`], [`ops:Not`], [`ops:BitAnd`],
+/// [`ops:BitOr`], [`ops:BitXor`], [`ops:BitAndAssign`], [`ops:BitOrAssign`], [`ops:BitXorAssign`],
+/// [`fmt::Binary`], [`fmt::LowerHex`], [`fmt::UpperHex`], [`fmt::Octal`], [`From`], [`Clone`],
+/// [`Copy`]
+///
+/// # Example
+///
+/// ```
+/// use bitflag_attr::bitflag;
+///
+/// #[bitflag(u32)]
+/// #[derive(PartialEq, PartialOrd, Eq, Ord, Hash)]
+/// pub enum Flags {
+///     /// The value `A`, at bit position `0`.
+///     A = 0b00000001,
+///     /// The value `B`, at bit position `1`.
+///     B = 0b00000010,
+///     /// The value `C`, at bit position `2`.
+///     C = 0b00000100,
+///
+///     /// The combination of `A`, `B`, and `C`.
+///     ABC = A | B | C,
+/// }
+/// ```
+///
+/// # Syntax
+///
+/// ```text
+/// #[bitflag($ty)]
+/// $visibility enum $StructName {
+///     FlagOne = flag1_value_expr,
+///     FlagTwo = flag2_value_expr,
+///     // ...
+///     FlagN = flagn_value_expr,
+/// }
+/// ```
+///
+/// [`fmt::Debug`]: core::fmt::Debug
+/// [`ops:Not`]: core::ops::Not
+/// [`ops:BitAnd`]: core::ops::BitAnd
+/// [`ops:BitOr`]: core::ops::BitOr
+/// [`ops:BitXor`]: core::ops::BitXor
+/// [`ops:BitAndAssign`]: core::ops::BitAndAssign
+/// [`ops:BitOrAssign`]: core::ops::BitOrAssign
+/// [`ops:BitXorAssign`]: core::ops::BitXorAssign
+/// [`fmt::Binary`]: core::fmt::Binary
+/// [`fmt::LowerHex`]: core::fmt::LowerHex
+/// [`fmt::UpperHex`]: core::fmt::UpperHex
+/// [`fmt::Octal`]: core::fmt::Octal
+/// [`From`]: From
+#[proc_macro_attribute]
+pub fn bitflag(attr: TokenStream, item: TokenStream) -> TokenStream {
+    match bitflag_impl(attr, item) {
+        Ok(ts) => ts,
+        Err(err) => err.into_compile_error().into(),
+    }
+}
+
+fn bitflag_impl(attr: TokenStream, item: TokenStream) -> Result<TokenStream> {
+    let ty = parse_ty(attr)?;
+
+    let item: ItemEnum = syn::parse(item)?;
+
+    let vis = item.vis;
+    let attrs = item.attrs;
+    let ty_name = item.ident;
+
+    let number_flags = item.variants.len();
+
+    let mut all_flags = Vec::with_capacity(number_flags);
+    let mut all_flags_names = Vec::with_capacity(number_flags);
+
+    // The raw flags as private itens to allow defyning flags referencing other flag definitions
+    let mut raw_flags = Vec::with_capacity(number_flags);
+
+    let mut flags = Vec::with_capacity(number_flags); // Associated constants
+    for variant in item.variants.iter() {
+        let var_attrs = &variant.attrs;
+        let var_name = &variant.ident;
+
+        let expr = match variant.discriminant.as_ref() {
+            Some((_, expr)) => expr,
+            None => return Err(Error::new_spanned(variant, "a discrimiant must be defined")),
+        };
+
+        all_flags.push(quote!(Self::#var_name));
+        all_flags_names.push(quote!(stringify!(#var_name)));
+
+        flags.push(quote! {
+            #(#var_attrs)*
+            #vis const #var_name: #ty_name = Self(#expr);
+        });
+
+        raw_flags.push(quote! {
+            #(#var_attrs)*
+            #[allow(non_upper_case_globals)]
+            const #var_name: #ty = #expr;
+        });
+    }
+
+    let generated = quote! {
+        #[repr(transparent)]
+        #[derive(Clone, Copy)]
+        #(#attrs)*
+        #vis struct #ty_name(#ty);
+
+        #(#raw_flags)*
+
+        #[allow(non_upper_case_globals)]
+        impl #ty_name {
+            #(#flags)*
+
+            /// Return the underlying bits of the bitflag
+            #[inline]
+            #vis const fn bits(&self) -> #ty {
+                self.0
+            }
+
+            /// Converts from a `bits` value. Returning [`None`] is any unknown bits are set.
+            #[inline]
+            #vis const fn from_bits(bits: #ty) -> Option<Self> {
+                let truncated = Self::from_bits_truncate(bits).0;
+
+                if truncated == bits {
+                    Some(Self(bits))
+                } else {
+                    None
+                }
+            }
+
+            /// Convert from `bits` value, unsetting any unknown bits.
+            #[inline]
+            #vis const fn from_bits_truncate(bits: #ty) -> Self {
+                Self(bits & Self::all().0)
+            }
+
+            /// Convert from `bits` value exactly.
+            #[inline]
+            #vis const fn from_bits_retain(bits: #ty) -> Self {
+                Self(bits)
+            }
+
+            /// Construct an empty bitflag.
+            #[inline]
+            #vis const fn empty() -> Self {
+                Self(0)
+            }
+
+            /// Returns `true` if the flag is empty.
+            #[inline]
+            #vis const fn is_empty(&self) -> bool {
+                self.0 == 0
+            }
+
+            /// Returns a bitflag that constains all value.
+            ///
+            /// This will include bits that do not have any flags/meaning.
+            /// Use [`all`](Self::all) if you want only the specified flags set.
+            #[inline]
+            #vis const fn all_bits() -> Self {
+                Self(!0)
+            }
+
+            /// Returns `true` if the bitflag constains all value bits set.
+            ///
+            /// This will check for all bits.
+            /// Use [`is_all`](Self::is_all) if you want to check for all specified flags.
+            #[inline]
+            #vis const fn is_all_bits(&self) -> bool {
+                self.0 == !0
+            }
+
+            /// Construct a bitflag with all flags set.
+            ///
+            /// This will only set the flags specified as associated constant.
+            #[inline]
+            #vis const fn all() -> Self {
+                Self(#(#all_flags.0 |)* 0)
+            }
+
+            /// Returns `true` if the bitflag contais all flags.
+            ///
+            #[inline]
+            #vis const fn is_all(&self) -> bool {
+                self.0 == Self::all().0
+            }
+
+            /// Returns a bit flag that only has bits corresponding to the specified flags as associated constant.
+            #[inline]
+            #vis const fn truncate(&self) -> Self {
+                Self(self.0 & Self::all().0)
+            }
+
+            /// Returns `true` if this bitflag intersects with any value in `other`.
+            ///
+            /// This is equivalent to `(self & other) != Self::empty()`
+            #[inline]
+            #vis const fn intersects(&self, other: Self) -> bool {
+                (self.0 & other.0) != Self::empty().0
+            }
+
+            /// Returns `true` if this bitflag contains all values of `other`.
+            ///
+            /// This is equivalent to `(self & other) == other`
+            #[inline]
+            #vis const fn contains(&self, other: Self) -> bool {
+                (self.0 & other.0) == other.0
+            }
+
+            /// Returns the bitwise NOT of the flag.
+            #[inline]
+            #[doc(alias = "complement")]
+            #vis const fn not(self) -> Self {
+                Self(!self.0)
+            }
+
+            /// Returns the bitwise AND of the flag.
+            #[inline]
+            #[doc(alias = "intersection")]
+            #vis const fn and(self, other: Self) -> Self {
+                Self(self.0 & other.0)
+            }
+
+            /// Returns the bitwise OR of the flag with `other`.
+            #[inline]
+            #[doc(alias = "union")]
+            #vis const fn or(self, other: Self) -> Self {
+                Self(self.0 | other.0)
+            }
+
+            /// Returns the bitwise XOR of the flag with `other`.
+            #[inline]
+            #[doc(alias = "symmetric_difference")]
+            #vis const fn xor(self, other: Self) -> Self {
+                Self(self.0 ^ other.0)
+            }
+
+            /// Returns the intersection from this value with `other`.
+            #[inline]
+            #[doc(alias = "and")]
+            #vis const fn intersection(self, other: Self) -> Self {
+                self.and(other)
+            }
+
+            /// Returns the union from this value with `other`
+            #[inline]
+            #[doc(alias = "or")]
+            #vis const fn union(self, other: Self) -> Self {
+                self.or(other)
+            }
+
+            /// Returns the difference from this value with `other`.
+            #[inline]
+            #vis const fn difference(self, other: Self) -> Self {
+                self.and(other.not())
+            }
+
+            /// Returns the symmetric difference from this value with `other`.
+            #[inline]
+            #[doc(alias = "xor")]
+            #vis const fn symmetric_difference(self, other: Self) -> Self {
+                self.xor(other)
+            }
+
+            /// Returns the complement of the value.
+            ///
+            /// This is very similar to the [`not`](Self::not), but truncates non used bits
+            #[inline]
+            #[doc(alias = "not")]
+            #vis const fn complement(self) -> Self {
+                self.not().truncate()
+            }
+
+            /// Set the flags in `other` in the value.
+            #[inline]
+            #vis fn set(&mut self, other: Self) {
+                self.0 = self.and(other).0
+            }
+
+            /// Unset the flags in `other` in the value.
+            #[inline]
+            #vis fn unset(&mut self, other: Self) {
+                self.0 = self.difference(other).0
+            }
+
+            /// Toggle the flags in `other` in the value.
+            #[inline]
+            #vis fn toggle(&mut self, other: Self) {
+                self.0 = self.xor(other).0
+            }
+        }
+
+        impl core::ops::Not for #ty_name {
+            type Output = Self;
+
+            #[inline]
+            fn not(self) -> Self::Output {
+                self.complement()
+            }
+        }
+
+        impl core::ops::BitAnd for #ty_name {
+            type Output = Self;
+
+            #[inline]
+            fn bitand(self, rhs: Self) -> Self::Output {
+                self.and(rhs)
+            }
+        }
+
+        impl core::ops::BitOr for #ty_name {
+            type Output = Self;
+
+            #[inline]
+            fn bitor(self, rhs: Self) -> Self::Output {
+                self.or(rhs)
+            }
+        }
+
+        impl core::ops::BitXor for #ty_name {
+            type Output = Self;
+
+            #[inline]
+            fn bitxor(self, rhs: Self) -> Self::Output {
+                self.xor(rhs)
+            }
+        }
+
+        impl core::ops::BitAndAssign for #ty_name {
+            #[inline]
+            fn bitand_assign(&mut self, rhs: Self) {
+                core::ops::BitAndAssign::bitand_assign(&mut self.0, rhs.0)
+            }
+        }
+
+        impl core::ops::BitOrAssign for #ty_name {
+            #[inline]
+            fn bitor_assign(&mut self, rhs: Self) {
+                core::ops::BitOrAssign::bitor_assign(&mut self.0, rhs.0)
+            }
+        }
+
+        impl core::ops::BitXorAssign for #ty_name {
+            #[inline]
+            fn bitxor_assign(&mut self, rhs: Self) {
+                core::ops::BitXorAssign::bitxor_assign(&mut self.0, rhs.0)
+            }
+        }
+
+        impl core::ops::Sub for #ty_name {
+            type Output = Self;
+
+            /// The intersection of a source flag with the complement of a target flags value
+            #[inline]
+            fn sub(self, rhs: Self) -> Self::Output {
+                self.difference(rhs)
+            }
+        }
+
+        impl core::ops::SubAssign for #ty_name {
+            /// The intersection of a source flag with the complement of a target flags value
+            #[inline]
+            fn sub_assign(&mut self, rhs: Self) {
+                self.unset(rhs)
+            }
+        }
+
+        impl From<#ty> for #ty_name {
+            #[inline]
+            fn from(val: #ty) -> Self {
+                Self::from_bits_truncate(val)
+            }
+        }
+
+        impl From<#ty_name> for #ty {
+            #[inline]
+            fn from(val: #ty_name) -> Self {
+                val.0
+            }
+        }
+
+        impl core::fmt::Binary for #ty_name {
+            #[inline]
+            fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
+                core::fmt::Binary::fmt(&self.0, f)
+            }
+        }
+
+        impl core::fmt::LowerHex for #ty_name {
+            #[inline]
+            fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
+                core::fmt::LowerHex::fmt(&self.0, f)
+            }
+        }
+
+        impl core::fmt::UpperHex for #ty_name {
+            #[inline]
+            fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
+                core::fmt::UpperHex::fmt(&self.0, f)
+            }
+        }
+
+        impl core::fmt::Octal for #ty_name {
+            #[inline]
+            fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
+                core::fmt::Octal::fmt(&self.0, f)
+            }
+        }
+
+        impl core::fmt::Debug for #ty_name {
+            fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
+                let name = stringify!(#ty_name);
+                if f.alternate() {
+                    write!(f, "{} ", &name)?;
+                    let mut tmp = f.debug_map();
+
+                    #(if self.contains(#all_flags) {
+                        tmp.entry(&#all_flags_names, &"set");
+                    } else {
+                        tmp.entry(&#all_flags_names, &"unset");
+                    })*
+
+                    tmp.finish()
+                } else {
+                    f.debug_tuple(&name).field(&self.0).finish()
+                }
+            }
+        }
+    };
+
+    Ok(generated.into())
+}
+
+static VALID_TYPES: [&str; 21] = [
+    "i8",
+    "u8",
+    "i16",
+    "u16",
+    "i32",
+    "u32",
+    "i64",
+    "u64",
+    "isize",
+    "usize",
+    "c_char",
+    "c_schar",
+    "c_uchar",
+    "c_short",
+    "c_ushort",
+    "c_int",
+    "c_uint",
+    "c_long",
+    "c_ulong",
+    "c_longlong",
+    "c_longlong",
+];
+
+fn parse_ty(attr: TokenStream) -> syn::Result<Ident> {
+    if attr.is_empty() {
+        Ok(Ident::new("u32", Span::call_site().into()))
+    } else {
+        let ident: Ident = syn::parse::<Ident>(attr)?;
+        if VALID_TYPES.contains(&ident.to_string().as_str()) {
+            Ok(ident)
+        } else {
+            Err(Error::new_spanned(ident, "type must be a integer"))
+        }
+    }
+}
+
+#[cfg(doc)]
+mod example_generated;
+
\ No newline at end of file diff --git a/src/proc_macro2/detection.rs.html b/src/proc_macro2/detection.rs.html new file mode 100644 index 0000000..2ef7d8a --- /dev/null +++ b/src/proc_macro2/detection.rs.html @@ -0,0 +1,151 @@ +detection.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+
use core::sync::atomic::{AtomicUsize, Ordering};
+use std::sync::Once;
+
+static WORKS: AtomicUsize = AtomicUsize::new(0);
+static INIT: Once = Once::new();
+
+pub(crate) fn inside_proc_macro() -> bool {
+    match WORKS.load(Ordering::Relaxed) {
+        1 => return false,
+        2 => return true,
+        _ => {}
+    }
+
+    INIT.call_once(initialize);
+    inside_proc_macro()
+}
+
+pub(crate) fn force_fallback() {
+    WORKS.store(1, Ordering::Relaxed);
+}
+
+pub(crate) fn unforce_fallback() {
+    initialize();
+}
+
+#[cfg(not(no_is_available))]
+fn initialize() {
+    let available = proc_macro::is_available();
+    WORKS.store(available as usize + 1, Ordering::Relaxed);
+}
+
+// Swap in a null panic hook to avoid printing "thread panicked" to stderr,
+// then use catch_unwind to determine whether the compiler's proc_macro is
+// working. When proc-macro2 is used from outside of a procedural macro all
+// of the proc_macro crate's APIs currently panic.
+//
+// The Once is to prevent the possibility of this ordering:
+//
+//     thread 1 calls take_hook, gets the user's original hook
+//     thread 1 calls set_hook with the null hook
+//     thread 2 calls take_hook, thinks null hook is the original hook
+//     thread 2 calls set_hook with the null hook
+//     thread 1 calls set_hook with the actual original hook
+//     thread 2 calls set_hook with what it thinks is the original hook
+//
+// in which the user's hook has been lost.
+//
+// There is still a race condition where a panic in a different thread can
+// happen during the interval that the user's original panic hook is
+// unregistered such that their hook is incorrectly not called. This is
+// sufficiently unlikely and less bad than printing panic messages to stderr
+// on correct use of this crate. Maybe there is a libstd feature request
+// here. For now, if a user needs to guarantee that this failure mode does
+// not occur, they need to call e.g. `proc_macro2::Span::call_site()` from
+// the main thread before launching any other threads.
+#[cfg(no_is_available)]
+fn initialize() {
+    use std::panic::{self, PanicInfo};
+
+    type PanicHook = dyn Fn(&PanicInfo) + Sync + Send + 'static;
+
+    let null_hook: Box<PanicHook> = Box::new(|_panic_info| { /* ignore */ });
+    let sanity_check = &*null_hook as *const PanicHook;
+    let original_hook = panic::take_hook();
+    panic::set_hook(null_hook);
+
+    let works = panic::catch_unwind(proc_macro::Span::call_site).is_ok();
+    WORKS.store(works as usize + 1, Ordering::Relaxed);
+
+    let hopefully_null_hook = panic::take_hook();
+    panic::set_hook(original_hook);
+    if sanity_check != &*hopefully_null_hook {
+        panic!("observed race condition in proc_macro2::inside_proc_macro");
+    }
+}
+
\ No newline at end of file diff --git a/src/proc_macro2/extra.rs.html b/src/proc_macro2/extra.rs.html new file mode 100644 index 0000000..ab55395 --- /dev/null +++ b/src/proc_macro2/extra.rs.html @@ -0,0 +1,303 @@ +extra.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+
//! Items which do not have a correspondence to any API in the proc_macro crate,
+//! but are necessary to include in proc-macro2.
+
+use crate::fallback;
+use crate::imp;
+use crate::marker::{ProcMacroAutoTraits, MARKER};
+use crate::Span;
+use core::fmt::{self, Debug};
+
+/// Invalidate any `proc_macro2::Span` that exist on the current thread.
+///
+/// The implementation of `Span` uses thread-local data structures and this
+/// function clears them. Calling any method on a `Span` on the current thread
+/// created prior to the invalidation will return incorrect values or crash.
+///
+/// This function is useful for programs that process more than 2<sup>32</sup>
+/// bytes of Rust source code on the same thread. Just like rustc, proc-macro2
+/// uses 32-bit source locations, and these wrap around when the total source
+/// code processed by the same thread exceeds 2<sup>32</sup> bytes (4
+/// gigabytes). After a wraparound, `Span` methods such as `source_text()` can
+/// return wrong data.
+///
+/// # Example
+///
+/// As of late 2023, there is 200 GB of Rust code published on crates.io.
+/// Looking at just the newest version of every crate, it is 16 GB of code. So a
+/// workload that involves parsing it all would overflow a 32-bit source
+/// location unless spans are being invalidated.
+///
+/// ```
+/// use flate2::read::GzDecoder;
+/// use std::ffi::OsStr;
+/// use std::io::{BufReader, Read};
+/// use std::str::FromStr;
+/// use tar::Archive;
+///
+/// rayon::scope(|s| {
+///     for krate in every_version_of_every_crate() {
+///         s.spawn(move |_| {
+///             proc_macro2::extra::invalidate_current_thread_spans();
+///
+///             let reader = BufReader::new(krate);
+///             let tar = GzDecoder::new(reader);
+///             let mut archive = Archive::new(tar);
+///             for entry in archive.entries().unwrap() {
+///                 let mut entry = entry.unwrap();
+///                 let path = entry.path().unwrap();
+///                 if path.extension() != Some(OsStr::new("rs")) {
+///                     continue;
+///                 }
+///                 let mut content = String::new();
+///                 entry.read_to_string(&mut content).unwrap();
+///                 match proc_macro2::TokenStream::from_str(&content) {
+///                     Ok(tokens) => {/* ... */},
+///                     Err(_) => continue,
+///                 }
+///             }
+///         });
+///     }
+/// });
+/// #
+/// # fn every_version_of_every_crate() -> Vec<std::fs::File> {
+/// #     Vec::new()
+/// # }
+/// ```
+///
+/// # Panics
+///
+/// This function is not applicable to and will panic if called from a
+/// procedural macro.
+#[cfg(span_locations)]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "span-locations")))]
+pub fn invalidate_current_thread_spans() {
+    crate::imp::invalidate_current_thread_spans();
+}
+
+/// An object that holds a [`Group`]'s `span_open()` and `span_close()` together
+/// in a more compact representation than holding those 2 spans individually.
+///
+/// [`Group`]: crate::Group
+#[derive(Copy, Clone)]
+pub struct DelimSpan {
+    inner: DelimSpanEnum,
+    _marker: ProcMacroAutoTraits,
+}
+
+#[derive(Copy, Clone)]
+enum DelimSpanEnum {
+    #[cfg(wrap_proc_macro)]
+    Compiler {
+        join: proc_macro::Span,
+        open: proc_macro::Span,
+        close: proc_macro::Span,
+    },
+    Fallback(fallback::Span),
+}
+
+impl DelimSpan {
+    pub(crate) fn new(group: &imp::Group) -> Self {
+        #[cfg(wrap_proc_macro)]
+        let inner = match group {
+            imp::Group::Compiler(group) => DelimSpanEnum::Compiler {
+                join: group.span(),
+                open: group.span_open(),
+                close: group.span_close(),
+            },
+            imp::Group::Fallback(group) => DelimSpanEnum::Fallback(group.span()),
+        };
+
+        #[cfg(not(wrap_proc_macro))]
+        let inner = DelimSpanEnum::Fallback(group.span());
+
+        DelimSpan {
+            inner,
+            _marker: MARKER,
+        }
+    }
+
+    /// Returns a span covering the entire delimited group.
+    pub fn join(&self) -> Span {
+        match &self.inner {
+            #[cfg(wrap_proc_macro)]
+            DelimSpanEnum::Compiler { join, .. } => Span::_new(imp::Span::Compiler(*join)),
+            DelimSpanEnum::Fallback(span) => Span::_new_fallback(*span),
+        }
+    }
+
+    /// Returns a span for the opening punctuation of the group only.
+    pub fn open(&self) -> Span {
+        match &self.inner {
+            #[cfg(wrap_proc_macro)]
+            DelimSpanEnum::Compiler { open, .. } => Span::_new(imp::Span::Compiler(*open)),
+            DelimSpanEnum::Fallback(span) => Span::_new_fallback(span.first_byte()),
+        }
+    }
+
+    /// Returns a span for the closing punctuation of the group only.
+    pub fn close(&self) -> Span {
+        match &self.inner {
+            #[cfg(wrap_proc_macro)]
+            DelimSpanEnum::Compiler { close, .. } => Span::_new(imp::Span::Compiler(*close)),
+            DelimSpanEnum::Fallback(span) => Span::_new_fallback(span.last_byte()),
+        }
+    }
+}
+
+impl Debug for DelimSpan {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        Debug::fmt(&self.join(), f)
+    }
+}
+
\ No newline at end of file diff --git a/src/proc_macro2/fallback.rs.html b/src/proc_macro2/fallback.rs.html new file mode 100644 index 0000000..e4608a6 --- /dev/null +++ b/src/proc_macro2/fallback.rs.html @@ -0,0 +1,2453 @@ +fallback.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+753
+754
+755
+756
+757
+758
+759
+760
+761
+762
+763
+764
+765
+766
+767
+768
+769
+770
+771
+772
+773
+774
+775
+776
+777
+778
+779
+780
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+794
+795
+796
+797
+798
+799
+800
+801
+802
+803
+804
+805
+806
+807
+808
+809
+810
+811
+812
+813
+814
+815
+816
+817
+818
+819
+820
+821
+822
+823
+824
+825
+826
+827
+828
+829
+830
+831
+832
+833
+834
+835
+836
+837
+838
+839
+840
+841
+842
+843
+844
+845
+846
+847
+848
+849
+850
+851
+852
+853
+854
+855
+856
+857
+858
+859
+860
+861
+862
+863
+864
+865
+866
+867
+868
+869
+870
+871
+872
+873
+874
+875
+876
+877
+878
+879
+880
+881
+882
+883
+884
+885
+886
+887
+888
+889
+890
+891
+892
+893
+894
+895
+896
+897
+898
+899
+900
+901
+902
+903
+904
+905
+906
+907
+908
+909
+910
+911
+912
+913
+914
+915
+916
+917
+918
+919
+920
+921
+922
+923
+924
+925
+926
+927
+928
+929
+930
+931
+932
+933
+934
+935
+936
+937
+938
+939
+940
+941
+942
+943
+944
+945
+946
+947
+948
+949
+950
+951
+952
+953
+954
+955
+956
+957
+958
+959
+960
+961
+962
+963
+964
+965
+966
+967
+968
+969
+970
+971
+972
+973
+974
+975
+976
+977
+978
+979
+980
+981
+982
+983
+984
+985
+986
+987
+988
+989
+990
+991
+992
+993
+994
+995
+996
+997
+998
+999
+1000
+1001
+1002
+1003
+1004
+1005
+1006
+1007
+1008
+1009
+1010
+1011
+1012
+1013
+1014
+1015
+1016
+1017
+1018
+1019
+1020
+1021
+1022
+1023
+1024
+1025
+1026
+1027
+1028
+1029
+1030
+1031
+1032
+1033
+1034
+1035
+1036
+1037
+1038
+1039
+1040
+1041
+1042
+1043
+1044
+1045
+1046
+1047
+1048
+1049
+1050
+1051
+1052
+1053
+1054
+1055
+1056
+1057
+1058
+1059
+1060
+1061
+1062
+1063
+1064
+1065
+1066
+1067
+1068
+1069
+1070
+1071
+1072
+1073
+1074
+1075
+1076
+1077
+1078
+1079
+1080
+1081
+1082
+1083
+1084
+1085
+1086
+1087
+1088
+1089
+1090
+1091
+1092
+1093
+1094
+1095
+1096
+1097
+1098
+1099
+1100
+1101
+1102
+1103
+1104
+1105
+1106
+1107
+1108
+1109
+1110
+1111
+1112
+1113
+1114
+1115
+1116
+1117
+1118
+1119
+1120
+1121
+1122
+1123
+1124
+1125
+1126
+1127
+1128
+1129
+1130
+1131
+1132
+1133
+1134
+1135
+1136
+1137
+1138
+1139
+1140
+1141
+1142
+1143
+1144
+1145
+1146
+1147
+1148
+1149
+1150
+1151
+1152
+1153
+1154
+1155
+1156
+1157
+1158
+1159
+1160
+1161
+1162
+1163
+1164
+1165
+1166
+1167
+1168
+1169
+1170
+1171
+1172
+1173
+1174
+1175
+1176
+1177
+1178
+1179
+1180
+1181
+1182
+1183
+1184
+1185
+1186
+1187
+1188
+1189
+1190
+1191
+1192
+1193
+1194
+1195
+1196
+1197
+1198
+1199
+1200
+1201
+1202
+1203
+1204
+1205
+1206
+1207
+1208
+1209
+1210
+1211
+1212
+1213
+1214
+1215
+1216
+1217
+1218
+1219
+1220
+1221
+1222
+1223
+1224
+1225
+1226
+
#[cfg(span_locations)]
+use crate::location::LineColumn;
+use crate::parse::{self, Cursor};
+use crate::rcvec::{RcVec, RcVecBuilder, RcVecIntoIter, RcVecMut};
+use crate::{Delimiter, Spacing, TokenTree};
+#[cfg(all(span_locations, not(fuzzing)))]
+use alloc::collections::BTreeMap;
+#[cfg(all(span_locations, not(fuzzing)))]
+use core::cell::RefCell;
+#[cfg(span_locations)]
+use core::cmp;
+use core::fmt::{self, Debug, Display, Write};
+use core::mem::ManuallyDrop;
+#[cfg(span_locations)]
+use core::ops::Range;
+use core::ops::RangeBounds;
+use core::ptr;
+use core::str::{self, FromStr};
+use std::ffi::CStr;
+#[cfg(procmacro2_semver_exempt)]
+use std::path::PathBuf;
+
+/// Force use of proc-macro2's fallback implementation of the API for now, even
+/// if the compiler's implementation is available.
+pub fn force() {
+    #[cfg(wrap_proc_macro)]
+    crate::detection::force_fallback();
+}
+
+/// Resume using the compiler's implementation of the proc macro API if it is
+/// available.
+pub fn unforce() {
+    #[cfg(wrap_proc_macro)]
+    crate::detection::unforce_fallback();
+}
+
+#[derive(Clone)]
+pub(crate) struct TokenStream {
+    inner: RcVec<TokenTree>,
+}
+
+#[derive(Debug)]
+pub(crate) struct LexError {
+    pub(crate) span: Span,
+}
+
+impl LexError {
+    pub(crate) fn span(&self) -> Span {
+        self.span
+    }
+
+    pub(crate) fn call_site() -> Self {
+        LexError {
+            span: Span::call_site(),
+        }
+    }
+}
+
+impl TokenStream {
+    pub fn new() -> Self {
+        TokenStream {
+            inner: RcVecBuilder::new().build(),
+        }
+    }
+
+    pub fn is_empty(&self) -> bool {
+        self.inner.len() == 0
+    }
+
+    fn take_inner(self) -> RcVecBuilder<TokenTree> {
+        let nodrop = ManuallyDrop::new(self);
+        unsafe { ptr::read(&nodrop.inner) }.make_owned()
+    }
+}
+
+fn push_token_from_proc_macro(mut vec: RcVecMut<TokenTree>, token: TokenTree) {
+    // https://github.com/dtolnay/proc-macro2/issues/235
+    match token {
+        TokenTree::Literal(crate::Literal {
+            #[cfg(wrap_proc_macro)]
+                inner: crate::imp::Literal::Fallback(literal),
+            #[cfg(not(wrap_proc_macro))]
+                inner: literal,
+            ..
+        }) if literal.repr.starts_with('-') => {
+            push_negative_literal(vec, literal);
+        }
+        _ => vec.push(token),
+    }
+
+    #[cold]
+    fn push_negative_literal(mut vec: RcVecMut<TokenTree>, mut literal: Literal) {
+        literal.repr.remove(0);
+        let mut punct = crate::Punct::new('-', Spacing::Alone);
+        punct.set_span(crate::Span::_new_fallback(literal.span));
+        vec.push(TokenTree::Punct(punct));
+        vec.push(TokenTree::Literal(crate::Literal::_new_fallback(literal)));
+    }
+}
+
+// Nonrecursive to prevent stack overflow.
+impl Drop for TokenStream {
+    fn drop(&mut self) {
+        let mut inner = match self.inner.get_mut() {
+            Some(inner) => inner,
+            None => return,
+        };
+        while let Some(token) = inner.pop() {
+            let group = match token {
+                TokenTree::Group(group) => group.inner,
+                _ => continue,
+            };
+            #[cfg(wrap_proc_macro)]
+            let group = match group {
+                crate::imp::Group::Fallback(group) => group,
+                crate::imp::Group::Compiler(_) => continue,
+            };
+            inner.extend(group.stream.take_inner());
+        }
+    }
+}
+
+pub(crate) struct TokenStreamBuilder {
+    inner: RcVecBuilder<TokenTree>,
+}
+
+impl TokenStreamBuilder {
+    pub fn new() -> Self {
+        TokenStreamBuilder {
+            inner: RcVecBuilder::new(),
+        }
+    }
+
+    pub fn with_capacity(cap: usize) -> Self {
+        TokenStreamBuilder {
+            inner: RcVecBuilder::with_capacity(cap),
+        }
+    }
+
+    pub fn push_token_from_parser(&mut self, tt: TokenTree) {
+        self.inner.push(tt);
+    }
+
+    pub fn build(self) -> TokenStream {
+        TokenStream {
+            inner: self.inner.build(),
+        }
+    }
+}
+
+#[cfg(span_locations)]
+fn get_cursor(src: &str) -> Cursor {
+    #[cfg(fuzzing)]
+    return Cursor { rest: src, off: 1 };
+
+    // Create a dummy file & add it to the source map
+    #[cfg(not(fuzzing))]
+    SOURCE_MAP.with(|sm| {
+        let mut sm = sm.borrow_mut();
+        let span = sm.add_file(src);
+        Cursor {
+            rest: src,
+            off: span.lo,
+        }
+    })
+}
+
+#[cfg(not(span_locations))]
+fn get_cursor(src: &str) -> Cursor {
+    Cursor { rest: src }
+}
+
+impl FromStr for TokenStream {
+    type Err = LexError;
+
+    fn from_str(src: &str) -> Result<TokenStream, LexError> {
+        // Create a dummy file & add it to the source map
+        let mut cursor = get_cursor(src);
+
+        // Strip a byte order mark if present
+        const BYTE_ORDER_MARK: &str = "\u{feff}";
+        if cursor.starts_with(BYTE_ORDER_MARK) {
+            cursor = cursor.advance(BYTE_ORDER_MARK.len());
+        }
+
+        parse::token_stream(cursor)
+    }
+}
+
+impl Display for LexError {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        f.write_str("cannot parse string into token stream")
+    }
+}
+
+impl Display for TokenStream {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        let mut joint = false;
+        for (i, tt) in self.inner.iter().enumerate() {
+            if i != 0 && !joint {
+                write!(f, " ")?;
+            }
+            joint = false;
+            match tt {
+                TokenTree::Group(tt) => Display::fmt(tt, f),
+                TokenTree::Ident(tt) => Display::fmt(tt, f),
+                TokenTree::Punct(tt) => {
+                    joint = tt.spacing() == Spacing::Joint;
+                    Display::fmt(tt, f)
+                }
+                TokenTree::Literal(tt) => Display::fmt(tt, f),
+            }?;
+        }
+
+        Ok(())
+    }
+}
+
+impl Debug for TokenStream {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        f.write_str("TokenStream ")?;
+        f.debug_list().entries(self.clone()).finish()
+    }
+}
+
+#[cfg(feature = "proc-macro")]
+impl From<proc_macro::TokenStream> for TokenStream {
+    fn from(inner: proc_macro::TokenStream) -> Self {
+        inner
+            .to_string()
+            .parse()
+            .expect("compiler token stream parse failed")
+    }
+}
+
+#[cfg(feature = "proc-macro")]
+impl From<TokenStream> for proc_macro::TokenStream {
+    fn from(inner: TokenStream) -> Self {
+        inner
+            .to_string()
+            .parse()
+            .expect("failed to parse to compiler tokens")
+    }
+}
+
+impl From<TokenTree> for TokenStream {
+    fn from(tree: TokenTree) -> Self {
+        let mut stream = RcVecBuilder::new();
+        push_token_from_proc_macro(stream.as_mut(), tree);
+        TokenStream {
+            inner: stream.build(),
+        }
+    }
+}
+
+impl FromIterator<TokenTree> for TokenStream {
+    fn from_iter<I: IntoIterator<Item = TokenTree>>(tokens: I) -> Self {
+        let mut stream = TokenStream::new();
+        stream.extend(tokens);
+        stream
+    }
+}
+
+impl FromIterator<TokenStream> for TokenStream {
+    fn from_iter<I: IntoIterator<Item = TokenStream>>(streams: I) -> Self {
+        let mut v = RcVecBuilder::new();
+
+        for stream in streams {
+            v.extend(stream.take_inner());
+        }
+
+        TokenStream { inner: v.build() }
+    }
+}
+
+impl Extend<TokenTree> for TokenStream {
+    fn extend<I: IntoIterator<Item = TokenTree>>(&mut self, tokens: I) {
+        let mut vec = self.inner.make_mut();
+        tokens
+            .into_iter()
+            .for_each(|token| push_token_from_proc_macro(vec.as_mut(), token));
+    }
+}
+
+impl Extend<TokenStream> for TokenStream {
+    fn extend<I: IntoIterator<Item = TokenStream>>(&mut self, streams: I) {
+        self.inner.make_mut().extend(streams.into_iter().flatten());
+    }
+}
+
+pub(crate) type TokenTreeIter = RcVecIntoIter<TokenTree>;
+
+impl IntoIterator for TokenStream {
+    type Item = TokenTree;
+    type IntoIter = TokenTreeIter;
+
+    fn into_iter(self) -> TokenTreeIter {
+        self.take_inner().into_iter()
+    }
+}
+
+#[cfg(procmacro2_semver_exempt)]
+#[derive(Clone, PartialEq, Eq)]
+pub(crate) struct SourceFile {
+    path: PathBuf,
+}
+
+#[cfg(procmacro2_semver_exempt)]
+impl SourceFile {
+    /// Get the path to this source file as a string.
+    pub fn path(&self) -> PathBuf {
+        self.path.clone()
+    }
+
+    pub fn is_real(&self) -> bool {
+        false
+    }
+}
+
+#[cfg(procmacro2_semver_exempt)]
+impl Debug for SourceFile {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        f.debug_struct("SourceFile")
+            .field("path", &self.path())
+            .field("is_real", &self.is_real())
+            .finish()
+    }
+}
+
+#[cfg(all(span_locations, not(fuzzing)))]
+thread_local! {
+    static SOURCE_MAP: RefCell<SourceMap> = RefCell::new(SourceMap {
+        // Start with a single dummy file which all call_site() and def_site()
+        // spans reference.
+        files: vec![FileInfo {
+            source_text: String::new(),
+            span: Span { lo: 0, hi: 0 },
+            lines: vec![0],
+            char_index_to_byte_offset: BTreeMap::new(),
+        }],
+    });
+}
+
+#[cfg(span_locations)]
+pub(crate) fn invalidate_current_thread_spans() {
+    #[cfg(not(fuzzing))]
+    SOURCE_MAP.with(|sm| sm.borrow_mut().files.truncate(1));
+}
+
+#[cfg(all(span_locations, not(fuzzing)))]
+struct FileInfo {
+    source_text: String,
+    span: Span,
+    lines: Vec<usize>,
+    char_index_to_byte_offset: BTreeMap<usize, usize>,
+}
+
+#[cfg(all(span_locations, not(fuzzing)))]
+impl FileInfo {
+    fn offset_line_column(&self, offset: usize) -> LineColumn {
+        assert!(self.span_within(Span {
+            lo: offset as u32,
+            hi: offset as u32,
+        }));
+        let offset = offset - self.span.lo as usize;
+        match self.lines.binary_search(&offset) {
+            Ok(found) => LineColumn {
+                line: found + 1,
+                column: 0,
+            },
+            Err(idx) => LineColumn {
+                line: idx,
+                column: offset - self.lines[idx - 1],
+            },
+        }
+    }
+
+    fn span_within(&self, span: Span) -> bool {
+        span.lo >= self.span.lo && span.hi <= self.span.hi
+    }
+
+    fn byte_range(&mut self, span: Span) -> Range<usize> {
+        let lo_char = (span.lo - self.span.lo) as usize;
+
+        // Look up offset of the largest already-computed char index that is
+        // less than or equal to the current requested one. We resume counting
+        // chars from that point.
+        let (&last_char_index, &last_byte_offset) = self
+            .char_index_to_byte_offset
+            .range(..=lo_char)
+            .next_back()
+            .unwrap_or((&0, &0));
+
+        let lo_byte = if last_char_index == lo_char {
+            last_byte_offset
+        } else {
+            let total_byte_offset = match self.source_text[last_byte_offset..]
+                .char_indices()
+                .nth(lo_char - last_char_index)
+            {
+                Some((additional_offset, _ch)) => last_byte_offset + additional_offset,
+                None => self.source_text.len(),
+            };
+            self.char_index_to_byte_offset
+                .insert(lo_char, total_byte_offset);
+            total_byte_offset
+        };
+
+        let trunc_lo = &self.source_text[lo_byte..];
+        let char_len = (span.hi - span.lo) as usize;
+        lo_byte..match trunc_lo.char_indices().nth(char_len) {
+            Some((offset, _ch)) => lo_byte + offset,
+            None => self.source_text.len(),
+        }
+    }
+
+    fn source_text(&mut self, span: Span) -> String {
+        let byte_range = self.byte_range(span);
+        self.source_text[byte_range].to_owned()
+    }
+}
+
+/// Computes the offsets of each line in the given source string
+/// and the total number of characters
+#[cfg(all(span_locations, not(fuzzing)))]
+fn lines_offsets(s: &str) -> (usize, Vec<usize>) {
+    let mut lines = vec![0];
+    let mut total = 0;
+
+    for ch in s.chars() {
+        total += 1;
+        if ch == '\n' {
+            lines.push(total);
+        }
+    }
+
+    (total, lines)
+}
+
+#[cfg(all(span_locations, not(fuzzing)))]
+struct SourceMap {
+    files: Vec<FileInfo>,
+}
+
+#[cfg(all(span_locations, not(fuzzing)))]
+impl SourceMap {
+    fn next_start_pos(&self) -> u32 {
+        // Add 1 so there's always space between files.
+        //
+        // We'll always have at least 1 file, as we initialize our files list
+        // with a dummy file.
+        self.files.last().unwrap().span.hi + 1
+    }
+
+    fn add_file(&mut self, src: &str) -> Span {
+        let (len, lines) = lines_offsets(src);
+        let lo = self.next_start_pos();
+        let span = Span {
+            lo,
+            hi: lo + (len as u32),
+        };
+
+        self.files.push(FileInfo {
+            source_text: src.to_owned(),
+            span,
+            lines,
+            // Populated lazily by source_text().
+            char_index_to_byte_offset: BTreeMap::new(),
+        });
+
+        span
+    }
+
+    #[cfg(procmacro2_semver_exempt)]
+    fn filepath(&self, span: Span) -> PathBuf {
+        for (i, file) in self.files.iter().enumerate() {
+            if file.span_within(span) {
+                return PathBuf::from(if i == 0 {
+                    "<unspecified>".to_owned()
+                } else {
+                    format!("<parsed string {}>", i)
+                });
+            }
+        }
+        unreachable!("Invalid span with no related FileInfo!");
+    }
+
+    fn fileinfo(&self, span: Span) -> &FileInfo {
+        for file in &self.files {
+            if file.span_within(span) {
+                return file;
+            }
+        }
+        unreachable!("Invalid span with no related FileInfo!");
+    }
+
+    fn fileinfo_mut(&mut self, span: Span) -> &mut FileInfo {
+        for file in &mut self.files {
+            if file.span_within(span) {
+                return file;
+            }
+        }
+        unreachable!("Invalid span with no related FileInfo!");
+    }
+}
+
+#[derive(Clone, Copy, PartialEq, Eq)]
+pub(crate) struct Span {
+    #[cfg(span_locations)]
+    pub(crate) lo: u32,
+    #[cfg(span_locations)]
+    pub(crate) hi: u32,
+}
+
+impl Span {
+    #[cfg(not(span_locations))]
+    pub fn call_site() -> Self {
+        Span {}
+    }
+
+    #[cfg(span_locations)]
+    pub fn call_site() -> Self {
+        Span { lo: 0, hi: 0 }
+    }
+
+    pub fn mixed_site() -> Self {
+        Span::call_site()
+    }
+
+    #[cfg(procmacro2_semver_exempt)]
+    pub fn def_site() -> Self {
+        Span::call_site()
+    }
+
+    pub fn resolved_at(&self, _other: Span) -> Span {
+        // Stable spans consist only of line/column information, so
+        // `resolved_at` and `located_at` only select which span the
+        // caller wants line/column information from.
+        *self
+    }
+
+    pub fn located_at(&self, other: Span) -> Span {
+        other
+    }
+
+    #[cfg(procmacro2_semver_exempt)]
+    pub fn source_file(&self) -> SourceFile {
+        #[cfg(fuzzing)]
+        return SourceFile {
+            path: PathBuf::from("<unspecified>"),
+        };
+
+        #[cfg(not(fuzzing))]
+        SOURCE_MAP.with(|sm| {
+            let sm = sm.borrow();
+            let path = sm.filepath(*self);
+            SourceFile { path }
+        })
+    }
+
+    #[cfg(span_locations)]
+    pub fn byte_range(&self) -> Range<usize> {
+        #[cfg(fuzzing)]
+        return 0..0;
+
+        #[cfg(not(fuzzing))]
+        {
+            if self.is_call_site() {
+                0..0
+            } else {
+                SOURCE_MAP.with(|sm| sm.borrow_mut().fileinfo_mut(*self).byte_range(*self))
+            }
+        }
+    }
+
+    #[cfg(span_locations)]
+    pub fn start(&self) -> LineColumn {
+        #[cfg(fuzzing)]
+        return LineColumn { line: 0, column: 0 };
+
+        #[cfg(not(fuzzing))]
+        SOURCE_MAP.with(|sm| {
+            let sm = sm.borrow();
+            let fi = sm.fileinfo(*self);
+            fi.offset_line_column(self.lo as usize)
+        })
+    }
+
+    #[cfg(span_locations)]
+    pub fn end(&self) -> LineColumn {
+        #[cfg(fuzzing)]
+        return LineColumn { line: 0, column: 0 };
+
+        #[cfg(not(fuzzing))]
+        SOURCE_MAP.with(|sm| {
+            let sm = sm.borrow();
+            let fi = sm.fileinfo(*self);
+            fi.offset_line_column(self.hi as usize)
+        })
+    }
+
+    #[cfg(not(span_locations))]
+    pub fn join(&self, _other: Span) -> Option<Span> {
+        Some(Span {})
+    }
+
+    #[cfg(span_locations)]
+    pub fn join(&self, other: Span) -> Option<Span> {
+        #[cfg(fuzzing)]
+        return {
+            let _ = other;
+            None
+        };
+
+        #[cfg(not(fuzzing))]
+        SOURCE_MAP.with(|sm| {
+            let sm = sm.borrow();
+            // If `other` is not within the same FileInfo as us, return None.
+            if !sm.fileinfo(*self).span_within(other) {
+                return None;
+            }
+            Some(Span {
+                lo: cmp::min(self.lo, other.lo),
+                hi: cmp::max(self.hi, other.hi),
+            })
+        })
+    }
+
+    #[cfg(not(span_locations))]
+    pub fn source_text(&self) -> Option<String> {
+        None
+    }
+
+    #[cfg(span_locations)]
+    pub fn source_text(&self) -> Option<String> {
+        #[cfg(fuzzing)]
+        return None;
+
+        #[cfg(not(fuzzing))]
+        {
+            if self.is_call_site() {
+                None
+            } else {
+                Some(SOURCE_MAP.with(|sm| sm.borrow_mut().fileinfo_mut(*self).source_text(*self)))
+            }
+        }
+    }
+
+    #[cfg(not(span_locations))]
+    pub(crate) fn first_byte(self) -> Self {
+        self
+    }
+
+    #[cfg(span_locations)]
+    pub(crate) fn first_byte(self) -> Self {
+        Span {
+            lo: self.lo,
+            hi: cmp::min(self.lo.saturating_add(1), self.hi),
+        }
+    }
+
+    #[cfg(not(span_locations))]
+    pub(crate) fn last_byte(self) -> Self {
+        self
+    }
+
+    #[cfg(span_locations)]
+    pub(crate) fn last_byte(self) -> Self {
+        Span {
+            lo: cmp::max(self.hi.saturating_sub(1), self.lo),
+            hi: self.hi,
+        }
+    }
+
+    #[cfg(span_locations)]
+    fn is_call_site(&self) -> bool {
+        self.lo == 0 && self.hi == 0
+    }
+}
+
+impl Debug for Span {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        #[cfg(span_locations)]
+        return write!(f, "bytes({}..{})", self.lo, self.hi);
+
+        #[cfg(not(span_locations))]
+        write!(f, "Span")
+    }
+}
+
+pub(crate) fn debug_span_field_if_nontrivial(debug: &mut fmt::DebugStruct, span: Span) {
+    #[cfg(span_locations)]
+    {
+        if span.is_call_site() {
+            return;
+        }
+    }
+
+    if cfg!(span_locations) {
+        debug.field("span", &span);
+    }
+}
+
+#[derive(Clone)]
+pub(crate) struct Group {
+    delimiter: Delimiter,
+    stream: TokenStream,
+    span: Span,
+}
+
+impl Group {
+    pub fn new(delimiter: Delimiter, stream: TokenStream) -> Self {
+        Group {
+            delimiter,
+            stream,
+            span: Span::call_site(),
+        }
+    }
+
+    pub fn delimiter(&self) -> Delimiter {
+        self.delimiter
+    }
+
+    pub fn stream(&self) -> TokenStream {
+        self.stream.clone()
+    }
+
+    pub fn span(&self) -> Span {
+        self.span
+    }
+
+    pub fn span_open(&self) -> Span {
+        self.span.first_byte()
+    }
+
+    pub fn span_close(&self) -> Span {
+        self.span.last_byte()
+    }
+
+    pub fn set_span(&mut self, span: Span) {
+        self.span = span;
+    }
+}
+
+impl Display for Group {
+    // We attempt to match libproc_macro's formatting.
+    // Empty parens: ()
+    // Nonempty parens: (...)
+    // Empty brackets: []
+    // Nonempty brackets: [...]
+    // Empty braces: { }
+    // Nonempty braces: { ... }
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        let (open, close) = match self.delimiter {
+            Delimiter::Parenthesis => ("(", ")"),
+            Delimiter::Brace => ("{ ", "}"),
+            Delimiter::Bracket => ("[", "]"),
+            Delimiter::None => ("", ""),
+        };
+
+        f.write_str(open)?;
+        Display::fmt(&self.stream, f)?;
+        if self.delimiter == Delimiter::Brace && !self.stream.inner.is_empty() {
+            f.write_str(" ")?;
+        }
+        f.write_str(close)?;
+
+        Ok(())
+    }
+}
+
+impl Debug for Group {
+    fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
+        let mut debug = fmt.debug_struct("Group");
+        debug.field("delimiter", &self.delimiter);
+        debug.field("stream", &self.stream);
+        debug_span_field_if_nontrivial(&mut debug, self.span);
+        debug.finish()
+    }
+}
+
+#[derive(Clone)]
+pub(crate) struct Ident {
+    sym: String,
+    span: Span,
+    raw: bool,
+}
+
+impl Ident {
+    #[track_caller]
+    pub fn new_checked(string: &str, span: Span) -> Self {
+        validate_ident(string);
+        Ident::new_unchecked(string, span)
+    }
+
+    pub fn new_unchecked(string: &str, span: Span) -> Self {
+        Ident {
+            sym: string.to_owned(),
+            span,
+            raw: false,
+        }
+    }
+
+    #[track_caller]
+    pub fn new_raw_checked(string: &str, span: Span) -> Self {
+        validate_ident_raw(string);
+        Ident::new_raw_unchecked(string, span)
+    }
+
+    pub fn new_raw_unchecked(string: &str, span: Span) -> Self {
+        Ident {
+            sym: string.to_owned(),
+            span,
+            raw: true,
+        }
+    }
+
+    pub fn span(&self) -> Span {
+        self.span
+    }
+
+    pub fn set_span(&mut self, span: Span) {
+        self.span = span;
+    }
+}
+
+pub(crate) fn is_ident_start(c: char) -> bool {
+    c == '_' || unicode_ident::is_xid_start(c)
+}
+
+pub(crate) fn is_ident_continue(c: char) -> bool {
+    unicode_ident::is_xid_continue(c)
+}
+
+#[track_caller]
+fn validate_ident(string: &str) {
+    if string.is_empty() {
+        panic!("Ident is not allowed to be empty; use Option<Ident>");
+    }
+
+    if string.bytes().all(|digit| b'0' <= digit && digit <= b'9') {
+        panic!("Ident cannot be a number; use Literal instead");
+    }
+
+    fn ident_ok(string: &str) -> bool {
+        let mut chars = string.chars();
+        let first = chars.next().unwrap();
+        if !is_ident_start(first) {
+            return false;
+        }
+        for ch in chars {
+            if !is_ident_continue(ch) {
+                return false;
+            }
+        }
+        true
+    }
+
+    if !ident_ok(string) {
+        panic!("{:?} is not a valid Ident", string);
+    }
+}
+
+#[track_caller]
+fn validate_ident_raw(string: &str) {
+    validate_ident(string);
+
+    match string {
+        "_" | "super" | "self" | "Self" | "crate" => {
+            panic!("`r#{}` cannot be a raw identifier", string);
+        }
+        _ => {}
+    }
+}
+
+impl PartialEq for Ident {
+    fn eq(&self, other: &Ident) -> bool {
+        self.sym == other.sym && self.raw == other.raw
+    }
+}
+
+impl<T> PartialEq<T> for Ident
+where
+    T: ?Sized + AsRef<str>,
+{
+    fn eq(&self, other: &T) -> bool {
+        let other = other.as_ref();
+        if self.raw {
+            other.starts_with("r#") && self.sym == other[2..]
+        } else {
+            self.sym == other
+        }
+    }
+}
+
+impl Display for Ident {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        if self.raw {
+            f.write_str("r#")?;
+        }
+        Display::fmt(&self.sym, f)
+    }
+}
+
+#[allow(clippy::missing_fields_in_debug)]
+impl Debug for Ident {
+    // Ident(proc_macro), Ident(r#union)
+    #[cfg(not(span_locations))]
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        let mut debug = f.debug_tuple("Ident");
+        debug.field(&format_args!("{}", self));
+        debug.finish()
+    }
+
+    // Ident {
+    //     sym: proc_macro,
+    //     span: bytes(128..138)
+    // }
+    #[cfg(span_locations)]
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        let mut debug = f.debug_struct("Ident");
+        debug.field("sym", &format_args!("{}", self));
+        debug_span_field_if_nontrivial(&mut debug, self.span);
+        debug.finish()
+    }
+}
+
+#[derive(Clone)]
+pub(crate) struct Literal {
+    pub(crate) repr: String,
+    span: Span,
+}
+
+macro_rules! suffixed_numbers {
+    ($($name:ident => $kind:ident,)*) => ($(
+        pub fn $name(n: $kind) -> Literal {
+            Literal::_new(format!(concat!("{}", stringify!($kind)), n))
+        }
+    )*)
+}
+
+macro_rules! unsuffixed_numbers {
+    ($($name:ident => $kind:ident,)*) => ($(
+        pub fn $name(n: $kind) -> Literal {
+            Literal::_new(n.to_string())
+        }
+    )*)
+}
+
+impl Literal {
+    pub(crate) fn _new(repr: String) -> Self {
+        Literal {
+            repr,
+            span: Span::call_site(),
+        }
+    }
+
+    pub(crate) unsafe fn from_str_unchecked(repr: &str) -> Self {
+        Literal::_new(repr.to_owned())
+    }
+
+    suffixed_numbers! {
+        u8_suffixed => u8,
+        u16_suffixed => u16,
+        u32_suffixed => u32,
+        u64_suffixed => u64,
+        u128_suffixed => u128,
+        usize_suffixed => usize,
+        i8_suffixed => i8,
+        i16_suffixed => i16,
+        i32_suffixed => i32,
+        i64_suffixed => i64,
+        i128_suffixed => i128,
+        isize_suffixed => isize,
+
+        f32_suffixed => f32,
+        f64_suffixed => f64,
+    }
+
+    unsuffixed_numbers! {
+        u8_unsuffixed => u8,
+        u16_unsuffixed => u16,
+        u32_unsuffixed => u32,
+        u64_unsuffixed => u64,
+        u128_unsuffixed => u128,
+        usize_unsuffixed => usize,
+        i8_unsuffixed => i8,
+        i16_unsuffixed => i16,
+        i32_unsuffixed => i32,
+        i64_unsuffixed => i64,
+        i128_unsuffixed => i128,
+        isize_unsuffixed => isize,
+    }
+
+    pub fn f32_unsuffixed(f: f32) -> Literal {
+        let mut s = f.to_string();
+        if !s.contains('.') {
+            s.push_str(".0");
+        }
+        Literal::_new(s)
+    }
+
+    pub fn f64_unsuffixed(f: f64) -> Literal {
+        let mut s = f.to_string();
+        if !s.contains('.') {
+            s.push_str(".0");
+        }
+        Literal::_new(s)
+    }
+
+    pub fn string(string: &str) -> Literal {
+        let mut repr = String::with_capacity(string.len() + 2);
+        repr.push('"');
+        escape_utf8(string, &mut repr);
+        repr.push('"');
+        Literal::_new(repr)
+    }
+
+    pub fn character(ch: char) -> Literal {
+        let mut repr = String::new();
+        repr.push('\'');
+        if ch == '"' {
+            // escape_debug turns this into '\"' which is unnecessary.
+            repr.push(ch);
+        } else {
+            repr.extend(ch.escape_debug());
+        }
+        repr.push('\'');
+        Literal::_new(repr)
+    }
+
+    pub fn byte_character(byte: u8) -> Literal {
+        let mut repr = "b'".to_string();
+        #[allow(clippy::match_overlapping_arm)]
+        match byte {
+            b'\0' => repr.push_str(r"\0"),
+            b'\t' => repr.push_str(r"\t"),
+            b'\n' => repr.push_str(r"\n"),
+            b'\r' => repr.push_str(r"\r"),
+            b'\'' => repr.push_str(r"\'"),
+            b'\\' => repr.push_str(r"\\"),
+            b'\x20'..=b'\x7E' => repr.push(byte as char),
+            _ => {
+                let _ = write!(repr, r"\x{:02X}", byte);
+            }
+        }
+        repr.push('\'');
+        Literal::_new(repr)
+    }
+
+    pub fn byte_string(bytes: &[u8]) -> Literal {
+        let mut repr = "b\"".to_string();
+        let mut bytes = bytes.iter();
+        while let Some(&b) = bytes.next() {
+            #[allow(clippy::match_overlapping_arm)]
+            match b {
+                b'\0' => repr.push_str(match bytes.as_slice().first() {
+                    // circumvent clippy::octal_escapes lint
+                    Some(b'0'..=b'7') => r"\x00",
+                    _ => r"\0",
+                }),
+                b'\t' => repr.push_str(r"\t"),
+                b'\n' => repr.push_str(r"\n"),
+                b'\r' => repr.push_str(r"\r"),
+                b'"' => repr.push_str("\\\""),
+                b'\\' => repr.push_str(r"\\"),
+                b'\x20'..=b'\x7E' => repr.push(b as char),
+                _ => {
+                    let _ = write!(repr, r"\x{:02X}", b);
+                }
+            }
+        }
+        repr.push('"');
+        Literal::_new(repr)
+    }
+
+    pub fn c_string(string: &CStr) -> Literal {
+        let mut repr = "c\"".to_string();
+        let mut bytes = string.to_bytes();
+        while !bytes.is_empty() {
+            let (valid, invalid) = match str::from_utf8(bytes) {
+                Ok(all_valid) => {
+                    bytes = b"";
+                    (all_valid, bytes)
+                }
+                Err(utf8_error) => {
+                    let (valid, rest) = bytes.split_at(utf8_error.valid_up_to());
+                    let valid = str::from_utf8(valid).unwrap();
+                    let invalid = utf8_error
+                        .error_len()
+                        .map_or(rest, |error_len| &rest[..error_len]);
+                    bytes = &bytes[valid.len() + invalid.len()..];
+                    (valid, invalid)
+                }
+            };
+            escape_utf8(valid, &mut repr);
+            for &byte in invalid {
+                let _ = write!(repr, r"\x{:02X}", byte);
+            }
+        }
+        repr.push('"');
+        Literal::_new(repr)
+    }
+
+    pub fn span(&self) -> Span {
+        self.span
+    }
+
+    pub fn set_span(&mut self, span: Span) {
+        self.span = span;
+    }
+
+    pub fn subspan<R: RangeBounds<usize>>(&self, range: R) -> Option<Span> {
+        #[cfg(not(span_locations))]
+        {
+            let _ = range;
+            None
+        }
+
+        #[cfg(span_locations)]
+        {
+            use core::ops::Bound;
+
+            let lo = match range.start_bound() {
+                Bound::Included(start) => {
+                    let start = u32::try_from(*start).ok()?;
+                    self.span.lo.checked_add(start)?
+                }
+                Bound::Excluded(start) => {
+                    let start = u32::try_from(*start).ok()?;
+                    self.span.lo.checked_add(start)?.checked_add(1)?
+                }
+                Bound::Unbounded => self.span.lo,
+            };
+            let hi = match range.end_bound() {
+                Bound::Included(end) => {
+                    let end = u32::try_from(*end).ok()?;
+                    self.span.lo.checked_add(end)?.checked_add(1)?
+                }
+                Bound::Excluded(end) => {
+                    let end = u32::try_from(*end).ok()?;
+                    self.span.lo.checked_add(end)?
+                }
+                Bound::Unbounded => self.span.hi,
+            };
+            if lo <= hi && hi <= self.span.hi {
+                Some(Span { lo, hi })
+            } else {
+                None
+            }
+        }
+    }
+}
+
+impl FromStr for Literal {
+    type Err = LexError;
+
+    fn from_str(repr: &str) -> Result<Self, Self::Err> {
+        let mut cursor = get_cursor(repr);
+        #[cfg(span_locations)]
+        let lo = cursor.off;
+
+        let negative = cursor.starts_with_char('-');
+        if negative {
+            cursor = cursor.advance(1);
+            if !cursor.starts_with_fn(|ch| ch.is_ascii_digit()) {
+                return Err(LexError::call_site());
+            }
+        }
+
+        if let Ok((rest, mut literal)) = parse::literal(cursor) {
+            if rest.is_empty() {
+                if negative {
+                    literal.repr.insert(0, '-');
+                }
+                literal.span = Span {
+                    #[cfg(span_locations)]
+                    lo,
+                    #[cfg(span_locations)]
+                    hi: rest.off,
+                };
+                return Ok(literal);
+            }
+        }
+        Err(LexError::call_site())
+    }
+}
+
+impl Display for Literal {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        Display::fmt(&self.repr, f)
+    }
+}
+
+impl Debug for Literal {
+    fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
+        let mut debug = fmt.debug_struct("Literal");
+        debug.field("lit", &format_args!("{}", self.repr));
+        debug_span_field_if_nontrivial(&mut debug, self.span);
+        debug.finish()
+    }
+}
+
+fn escape_utf8(string: &str, repr: &mut String) {
+    let mut chars = string.chars();
+    while let Some(ch) = chars.next() {
+        if ch == '\0' {
+            repr.push_str(
+                if chars
+                    .as_str()
+                    .starts_with(|next| '0' <= next && next <= '7')
+                {
+                    // circumvent clippy::octal_escapes lint
+                    r"\x00"
+                } else {
+                    r"\0"
+                },
+            );
+        } else if ch == '\'' {
+            // escape_debug turns this into "\'" which is unnecessary.
+            repr.push(ch);
+        } else {
+            repr.extend(ch.escape_debug());
+        }
+    }
+}
+
\ No newline at end of file diff --git a/src/proc_macro2/lib.rs.html b/src/proc_macro2/lib.rs.html new file mode 100644 index 0000000..170d69b --- /dev/null +++ b/src/proc_macro2/lib.rs.html @@ -0,0 +1,2715 @@ +lib.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+753
+754
+755
+756
+757
+758
+759
+760
+761
+762
+763
+764
+765
+766
+767
+768
+769
+770
+771
+772
+773
+774
+775
+776
+777
+778
+779
+780
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+794
+795
+796
+797
+798
+799
+800
+801
+802
+803
+804
+805
+806
+807
+808
+809
+810
+811
+812
+813
+814
+815
+816
+817
+818
+819
+820
+821
+822
+823
+824
+825
+826
+827
+828
+829
+830
+831
+832
+833
+834
+835
+836
+837
+838
+839
+840
+841
+842
+843
+844
+845
+846
+847
+848
+849
+850
+851
+852
+853
+854
+855
+856
+857
+858
+859
+860
+861
+862
+863
+864
+865
+866
+867
+868
+869
+870
+871
+872
+873
+874
+875
+876
+877
+878
+879
+880
+881
+882
+883
+884
+885
+886
+887
+888
+889
+890
+891
+892
+893
+894
+895
+896
+897
+898
+899
+900
+901
+902
+903
+904
+905
+906
+907
+908
+909
+910
+911
+912
+913
+914
+915
+916
+917
+918
+919
+920
+921
+922
+923
+924
+925
+926
+927
+928
+929
+930
+931
+932
+933
+934
+935
+936
+937
+938
+939
+940
+941
+942
+943
+944
+945
+946
+947
+948
+949
+950
+951
+952
+953
+954
+955
+956
+957
+958
+959
+960
+961
+962
+963
+964
+965
+966
+967
+968
+969
+970
+971
+972
+973
+974
+975
+976
+977
+978
+979
+980
+981
+982
+983
+984
+985
+986
+987
+988
+989
+990
+991
+992
+993
+994
+995
+996
+997
+998
+999
+1000
+1001
+1002
+1003
+1004
+1005
+1006
+1007
+1008
+1009
+1010
+1011
+1012
+1013
+1014
+1015
+1016
+1017
+1018
+1019
+1020
+1021
+1022
+1023
+1024
+1025
+1026
+1027
+1028
+1029
+1030
+1031
+1032
+1033
+1034
+1035
+1036
+1037
+1038
+1039
+1040
+1041
+1042
+1043
+1044
+1045
+1046
+1047
+1048
+1049
+1050
+1051
+1052
+1053
+1054
+1055
+1056
+1057
+1058
+1059
+1060
+1061
+1062
+1063
+1064
+1065
+1066
+1067
+1068
+1069
+1070
+1071
+1072
+1073
+1074
+1075
+1076
+1077
+1078
+1079
+1080
+1081
+1082
+1083
+1084
+1085
+1086
+1087
+1088
+1089
+1090
+1091
+1092
+1093
+1094
+1095
+1096
+1097
+1098
+1099
+1100
+1101
+1102
+1103
+1104
+1105
+1106
+1107
+1108
+1109
+1110
+1111
+1112
+1113
+1114
+1115
+1116
+1117
+1118
+1119
+1120
+1121
+1122
+1123
+1124
+1125
+1126
+1127
+1128
+1129
+1130
+1131
+1132
+1133
+1134
+1135
+1136
+1137
+1138
+1139
+1140
+1141
+1142
+1143
+1144
+1145
+1146
+1147
+1148
+1149
+1150
+1151
+1152
+1153
+1154
+1155
+1156
+1157
+1158
+1159
+1160
+1161
+1162
+1163
+1164
+1165
+1166
+1167
+1168
+1169
+1170
+1171
+1172
+1173
+1174
+1175
+1176
+1177
+1178
+1179
+1180
+1181
+1182
+1183
+1184
+1185
+1186
+1187
+1188
+1189
+1190
+1191
+1192
+1193
+1194
+1195
+1196
+1197
+1198
+1199
+1200
+1201
+1202
+1203
+1204
+1205
+1206
+1207
+1208
+1209
+1210
+1211
+1212
+1213
+1214
+1215
+1216
+1217
+1218
+1219
+1220
+1221
+1222
+1223
+1224
+1225
+1226
+1227
+1228
+1229
+1230
+1231
+1232
+1233
+1234
+1235
+1236
+1237
+1238
+1239
+1240
+1241
+1242
+1243
+1244
+1245
+1246
+1247
+1248
+1249
+1250
+1251
+1252
+1253
+1254
+1255
+1256
+1257
+1258
+1259
+1260
+1261
+1262
+1263
+1264
+1265
+1266
+1267
+1268
+1269
+1270
+1271
+1272
+1273
+1274
+1275
+1276
+1277
+1278
+1279
+1280
+1281
+1282
+1283
+1284
+1285
+1286
+1287
+1288
+1289
+1290
+1291
+1292
+1293
+1294
+1295
+1296
+1297
+1298
+1299
+1300
+1301
+1302
+1303
+1304
+1305
+1306
+1307
+1308
+1309
+1310
+1311
+1312
+1313
+1314
+1315
+1316
+1317
+1318
+1319
+1320
+1321
+1322
+1323
+1324
+1325
+1326
+1327
+1328
+1329
+1330
+1331
+1332
+1333
+1334
+1335
+1336
+1337
+1338
+1339
+1340
+1341
+1342
+1343
+1344
+1345
+1346
+1347
+1348
+1349
+1350
+1351
+1352
+1353
+1354
+1355
+1356
+1357
+
//! [![github]](https://github.com/dtolnay/proc-macro2)&ensp;[![crates-io]](https://crates.io/crates/proc-macro2)&ensp;[![docs-rs]](crate)
+//!
+//! [github]: https://img.shields.io/badge/github-8da0cb?style=for-the-badge&labelColor=555555&logo=github
+//! [crates-io]: https://img.shields.io/badge/crates.io-fc8d62?style=for-the-badge&labelColor=555555&logo=rust
+//! [docs-rs]: https://img.shields.io/badge/docs.rs-66c2a5?style=for-the-badge&labelColor=555555&logo=docs.rs
+//!
+//! <br>
+//!
+//! A wrapper around the procedural macro API of the compiler's [`proc_macro`]
+//! crate. This library serves two purposes:
+//!
+//! [`proc_macro`]: https://doc.rust-lang.org/proc_macro/
+//!
+//! - **Bring proc-macro-like functionality to other contexts like build.rs and
+//!   main.rs.** Types from `proc_macro` are entirely specific to procedural
+//!   macros and cannot ever exist in code outside of a procedural macro.
+//!   Meanwhile `proc_macro2` types may exist anywhere including non-macro code.
+//!   By developing foundational libraries like [syn] and [quote] against
+//!   `proc_macro2` rather than `proc_macro`, the procedural macro ecosystem
+//!   becomes easily applicable to many other use cases and we avoid
+//!   reimplementing non-macro equivalents of those libraries.
+//!
+//! - **Make procedural macros unit testable.** As a consequence of being
+//!   specific to procedural macros, nothing that uses `proc_macro` can be
+//!   executed from a unit test. In order for helper libraries or components of
+//!   a macro to be testable in isolation, they must be implemented using
+//!   `proc_macro2`.
+//!
+//! [syn]: https://github.com/dtolnay/syn
+//! [quote]: https://github.com/dtolnay/quote
+//!
+//! # Usage
+//!
+//! The skeleton of a typical procedural macro typically looks like this:
+//!
+//! ```
+//! extern crate proc_macro;
+//!
+//! # const IGNORE: &str = stringify! {
+//! #[proc_macro_derive(MyDerive)]
+//! # };
+//! # #[cfg(wrap_proc_macro)]
+//! pub fn my_derive(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
+//!     let input = proc_macro2::TokenStream::from(input);
+//!
+//!     let output: proc_macro2::TokenStream = {
+//!         /* transform input */
+//!         # input
+//!     };
+//!
+//!     proc_macro::TokenStream::from(output)
+//! }
+//! ```
+//!
+//! If parsing with [Syn], you'll use [`parse_macro_input!`] instead to
+//! propagate parse errors correctly back to the compiler when parsing fails.
+//!
+//! [`parse_macro_input!`]: https://docs.rs/syn/2.0/syn/macro.parse_macro_input.html
+//!
+//! # Unstable features
+//!
+//! The default feature set of proc-macro2 tracks the most recent stable
+//! compiler API. Functionality in `proc_macro` that is not yet stable is not
+//! exposed by proc-macro2 by default.
+//!
+//! To opt into the additional APIs available in the most recent nightly
+//! compiler, the `procmacro2_semver_exempt` config flag must be passed to
+//! rustc. We will polyfill those nightly-only APIs back to Rust 1.56.0. As
+//! these are unstable APIs that track the nightly compiler, minor versions of
+//! proc-macro2 may make breaking changes to them at any time.
+//!
+//! ```sh
+//! RUSTFLAGS='--cfg procmacro2_semver_exempt' cargo build
+//! ```
+//!
+//! Note that this must not only be done for your crate, but for any crate that
+//! depends on your crate. This infectious nature is intentional, as it serves
+//! as a reminder that you are outside of the normal semver guarantees.
+//!
+//! Semver exempt methods are marked as such in the proc-macro2 documentation.
+//!
+//! # Thread-Safety
+//!
+//! Most types in this crate are `!Sync` because the underlying compiler
+//! types make use of thread-local memory, meaning they cannot be accessed from
+//! a different thread.
+
+// Proc-macro2 types in rustdoc of other crates get linked to here.
+#![doc(html_root_url = "https://docs.rs/proc-macro2/1.0.82")]
+#![cfg_attr(any(proc_macro_span, super_unstable), feature(proc_macro_span))]
+#![cfg_attr(super_unstable, feature(proc_macro_def_site))]
+#![cfg_attr(doc_cfg, feature(doc_cfg))]
+#![deny(unsafe_op_in_unsafe_fn)]
+#![allow(
+    clippy::cast_lossless,
+    clippy::cast_possible_truncation,
+    clippy::checked_conversions,
+    clippy::doc_markdown,
+    clippy::incompatible_msrv,
+    clippy::items_after_statements,
+    clippy::iter_without_into_iter,
+    clippy::let_underscore_untyped,
+    clippy::manual_assert,
+    clippy::manual_range_contains,
+    clippy::missing_safety_doc,
+    clippy::must_use_candidate,
+    clippy::needless_doctest_main,
+    clippy::new_without_default,
+    clippy::return_self_not_must_use,
+    clippy::shadow_unrelated,
+    clippy::trivially_copy_pass_by_ref,
+    clippy::unnecessary_wraps,
+    clippy::unused_self,
+    clippy::used_underscore_binding,
+    clippy::vec_init_then_push
+)]
+
+#[cfg(all(procmacro2_semver_exempt, wrap_proc_macro, not(super_unstable)))]
+compile_error! {"\
+    Something is not right. If you've tried to turn on \
+    procmacro2_semver_exempt, you need to ensure that it \
+    is turned on for the compilation of the proc-macro2 \
+    build script as well.
+"}
+
+#[cfg(all(
+    procmacro2_nightly_testing,
+    feature = "proc-macro",
+    not(proc_macro_span)
+))]
+compile_error! {"\
+    Build script probe failed to compile.
+"}
+
+extern crate alloc;
+
+#[cfg(feature = "proc-macro")]
+extern crate proc_macro;
+
+mod marker;
+mod parse;
+mod rcvec;
+
+#[cfg(wrap_proc_macro)]
+mod detection;
+
+// Public for proc_macro2::fallback::force() and unforce(), but those are quite
+// a niche use case so we omit it from rustdoc.
+#[doc(hidden)]
+pub mod fallback;
+
+pub mod extra;
+
+#[cfg(not(wrap_proc_macro))]
+use crate::fallback as imp;
+#[path = "wrapper.rs"]
+#[cfg(wrap_proc_macro)]
+mod imp;
+
+#[cfg(span_locations)]
+mod location;
+
+use crate::extra::DelimSpan;
+use crate::marker::{ProcMacroAutoTraits, MARKER};
+use core::cmp::Ordering;
+use core::fmt::{self, Debug, Display};
+use core::hash::{Hash, Hasher};
+#[cfg(span_locations)]
+use core::ops::Range;
+use core::ops::RangeBounds;
+use core::str::FromStr;
+use std::error::Error;
+use std::ffi::CStr;
+#[cfg(procmacro2_semver_exempt)]
+use std::path::PathBuf;
+
+#[cfg(span_locations)]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "span-locations")))]
+pub use crate::location::LineColumn;
+
+/// An abstract stream of tokens, or more concretely a sequence of token trees.
+///
+/// This type provides interfaces for iterating over token trees and for
+/// collecting token trees into one stream.
+///
+/// Token stream is both the input and output of `#[proc_macro]`,
+/// `#[proc_macro_attribute]` and `#[proc_macro_derive]` definitions.
+#[derive(Clone)]
+pub struct TokenStream {
+    inner: imp::TokenStream,
+    _marker: ProcMacroAutoTraits,
+}
+
+/// Error returned from `TokenStream::from_str`.
+pub struct LexError {
+    inner: imp::LexError,
+    _marker: ProcMacroAutoTraits,
+}
+
+impl TokenStream {
+    fn _new(inner: imp::TokenStream) -> Self {
+        TokenStream {
+            inner,
+            _marker: MARKER,
+        }
+    }
+
+    fn _new_fallback(inner: fallback::TokenStream) -> Self {
+        TokenStream {
+            inner: inner.into(),
+            _marker: MARKER,
+        }
+    }
+
+    /// Returns an empty `TokenStream` containing no token trees.
+    pub fn new() -> Self {
+        TokenStream::_new(imp::TokenStream::new())
+    }
+
+    /// Checks if this `TokenStream` is empty.
+    pub fn is_empty(&self) -> bool {
+        self.inner.is_empty()
+    }
+}
+
+/// `TokenStream::default()` returns an empty stream,
+/// i.e. this is equivalent with `TokenStream::new()`.
+impl Default for TokenStream {
+    fn default() -> Self {
+        TokenStream::new()
+    }
+}
+
+/// Attempts to break the string into tokens and parse those tokens into a token
+/// stream.
+///
+/// May fail for a number of reasons, for example, if the string contains
+/// unbalanced delimiters or characters not existing in the language.
+///
+/// NOTE: Some errors may cause panics instead of returning `LexError`. We
+/// reserve the right to change these errors into `LexError`s later.
+impl FromStr for TokenStream {
+    type Err = LexError;
+
+    fn from_str(src: &str) -> Result<TokenStream, LexError> {
+        let e = src.parse().map_err(|e| LexError {
+            inner: e,
+            _marker: MARKER,
+        })?;
+        Ok(TokenStream::_new(e))
+    }
+}
+
+#[cfg(feature = "proc-macro")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "proc-macro")))]
+impl From<proc_macro::TokenStream> for TokenStream {
+    fn from(inner: proc_macro::TokenStream) -> Self {
+        TokenStream::_new(inner.into())
+    }
+}
+
+#[cfg(feature = "proc-macro")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "proc-macro")))]
+impl From<TokenStream> for proc_macro::TokenStream {
+    fn from(inner: TokenStream) -> Self {
+        inner.inner.into()
+    }
+}
+
+impl From<TokenTree> for TokenStream {
+    fn from(token: TokenTree) -> Self {
+        TokenStream::_new(imp::TokenStream::from(token))
+    }
+}
+
+impl Extend<TokenTree> for TokenStream {
+    fn extend<I: IntoIterator<Item = TokenTree>>(&mut self, streams: I) {
+        self.inner.extend(streams);
+    }
+}
+
+impl Extend<TokenStream> for TokenStream {
+    fn extend<I: IntoIterator<Item = TokenStream>>(&mut self, streams: I) {
+        self.inner
+            .extend(streams.into_iter().map(|stream| stream.inner));
+    }
+}
+
+/// Collects a number of token trees into a single stream.
+impl FromIterator<TokenTree> for TokenStream {
+    fn from_iter<I: IntoIterator<Item = TokenTree>>(streams: I) -> Self {
+        TokenStream::_new(streams.into_iter().collect())
+    }
+}
+impl FromIterator<TokenStream> for TokenStream {
+    fn from_iter<I: IntoIterator<Item = TokenStream>>(streams: I) -> Self {
+        TokenStream::_new(streams.into_iter().map(|i| i.inner).collect())
+    }
+}
+
+/// Prints the token stream as a string that is supposed to be losslessly
+/// convertible back into the same token stream (modulo spans), except for
+/// possibly `TokenTree::Group`s with `Delimiter::None` delimiters and negative
+/// numeric literals.
+impl Display for TokenStream {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        Display::fmt(&self.inner, f)
+    }
+}
+
+/// Prints token in a form convenient for debugging.
+impl Debug for TokenStream {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        Debug::fmt(&self.inner, f)
+    }
+}
+
+impl LexError {
+    pub fn span(&self) -> Span {
+        Span::_new(self.inner.span())
+    }
+}
+
+impl Debug for LexError {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        Debug::fmt(&self.inner, f)
+    }
+}
+
+impl Display for LexError {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        Display::fmt(&self.inner, f)
+    }
+}
+
+impl Error for LexError {}
+
+/// The source file of a given `Span`.
+///
+/// This type is semver exempt and not exposed by default.
+#[cfg(all(procmacro2_semver_exempt, any(not(wrap_proc_macro), super_unstable)))]
+#[cfg_attr(doc_cfg, doc(cfg(procmacro2_semver_exempt)))]
+#[derive(Clone, PartialEq, Eq)]
+pub struct SourceFile {
+    inner: imp::SourceFile,
+    _marker: ProcMacroAutoTraits,
+}
+
+#[cfg(all(procmacro2_semver_exempt, any(not(wrap_proc_macro), super_unstable)))]
+impl SourceFile {
+    fn _new(inner: imp::SourceFile) -> Self {
+        SourceFile {
+            inner,
+            _marker: MARKER,
+        }
+    }
+
+    /// Get the path to this source file.
+    ///
+    /// ### Note
+    ///
+    /// If the code span associated with this `SourceFile` was generated by an
+    /// external macro, this may not be an actual path on the filesystem. Use
+    /// [`is_real`] to check.
+    ///
+    /// Also note that even if `is_real` returns `true`, if
+    /// `--remap-path-prefix` was passed on the command line, the path as given
+    /// may not actually be valid.
+    ///
+    /// [`is_real`]: #method.is_real
+    pub fn path(&self) -> PathBuf {
+        self.inner.path()
+    }
+
+    /// Returns `true` if this source file is a real source file, and not
+    /// generated by an external macro's expansion.
+    pub fn is_real(&self) -> bool {
+        self.inner.is_real()
+    }
+}
+
+#[cfg(all(procmacro2_semver_exempt, any(not(wrap_proc_macro), super_unstable)))]
+impl Debug for SourceFile {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        Debug::fmt(&self.inner, f)
+    }
+}
+
+/// A region of source code, along with macro expansion information.
+#[derive(Copy, Clone)]
+pub struct Span {
+    inner: imp::Span,
+    _marker: ProcMacroAutoTraits,
+}
+
+impl Span {
+    fn _new(inner: imp::Span) -> Self {
+        Span {
+            inner,
+            _marker: MARKER,
+        }
+    }
+
+    fn _new_fallback(inner: fallback::Span) -> Self {
+        Span {
+            inner: inner.into(),
+            _marker: MARKER,
+        }
+    }
+
+    /// The span of the invocation of the current procedural macro.
+    ///
+    /// Identifiers created with this span will be resolved as if they were
+    /// written directly at the macro call location (call-site hygiene) and
+    /// other code at the macro call site will be able to refer to them as well.
+    pub fn call_site() -> Self {
+        Span::_new(imp::Span::call_site())
+    }
+
+    /// The span located at the invocation of the procedural macro, but with
+    /// local variables, labels, and `$crate` resolved at the definition site
+    /// of the macro. This is the same hygiene behavior as `macro_rules`.
+    pub fn mixed_site() -> Self {
+        Span::_new(imp::Span::mixed_site())
+    }
+
+    /// A span that resolves at the macro definition site.
+    ///
+    /// This method is semver exempt and not exposed by default.
+    #[cfg(procmacro2_semver_exempt)]
+    #[cfg_attr(doc_cfg, doc(cfg(procmacro2_semver_exempt)))]
+    pub fn def_site() -> Self {
+        Span::_new(imp::Span::def_site())
+    }
+
+    /// Creates a new span with the same line/column information as `self` but
+    /// that resolves symbols as though it were at `other`.
+    pub fn resolved_at(&self, other: Span) -> Span {
+        Span::_new(self.inner.resolved_at(other.inner))
+    }
+
+    /// Creates a new span with the same name resolution behavior as `self` but
+    /// with the line/column information of `other`.
+    pub fn located_at(&self, other: Span) -> Span {
+        Span::_new(self.inner.located_at(other.inner))
+    }
+
+    /// Convert `proc_macro2::Span` to `proc_macro::Span`.
+    ///
+    /// This method is available when building with a nightly compiler, or when
+    /// building with rustc 1.29+ *without* semver exempt features.
+    ///
+    /// # Panics
+    ///
+    /// Panics if called from outside of a procedural macro. Unlike
+    /// `proc_macro2::Span`, the `proc_macro::Span` type can only exist within
+    /// the context of a procedural macro invocation.
+    #[cfg(wrap_proc_macro)]
+    pub fn unwrap(self) -> proc_macro::Span {
+        self.inner.unwrap()
+    }
+
+    // Soft deprecated. Please use Span::unwrap.
+    #[cfg(wrap_proc_macro)]
+    #[doc(hidden)]
+    pub fn unstable(self) -> proc_macro::Span {
+        self.unwrap()
+    }
+
+    /// The original source file into which this span points.
+    ///
+    /// This method is semver exempt and not exposed by default.
+    #[cfg(all(procmacro2_semver_exempt, any(not(wrap_proc_macro), super_unstable)))]
+    #[cfg_attr(doc_cfg, doc(cfg(procmacro2_semver_exempt)))]
+    pub fn source_file(&self) -> SourceFile {
+        SourceFile::_new(self.inner.source_file())
+    }
+
+    /// Returns the span's byte position range in the source file.
+    ///
+    /// This method requires the `"span-locations"` feature to be enabled.
+    ///
+    /// When executing in a procedural macro context, the returned range is only
+    /// accurate if compiled with a nightly toolchain. The stable toolchain does
+    /// not have this information available. When executing outside of a
+    /// procedural macro, such as main.rs or build.rs, the byte range is always
+    /// accurate regardless of toolchain.
+    #[cfg(span_locations)]
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "span-locations")))]
+    pub fn byte_range(&self) -> Range<usize> {
+        self.inner.byte_range()
+    }
+
+    /// Get the starting line/column in the source file for this span.
+    ///
+    /// This method requires the `"span-locations"` feature to be enabled.
+    ///
+    /// When executing in a procedural macro context, the returned line/column
+    /// are only meaningful if compiled with a nightly toolchain. The stable
+    /// toolchain does not have this information available. When executing
+    /// outside of a procedural macro, such as main.rs or build.rs, the
+    /// line/column are always meaningful regardless of toolchain.
+    #[cfg(span_locations)]
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "span-locations")))]
+    pub fn start(&self) -> LineColumn {
+        self.inner.start()
+    }
+
+    /// Get the ending line/column in the source file for this span.
+    ///
+    /// This method requires the `"span-locations"` feature to be enabled.
+    ///
+    /// When executing in a procedural macro context, the returned line/column
+    /// are only meaningful if compiled with a nightly toolchain. The stable
+    /// toolchain does not have this information available. When executing
+    /// outside of a procedural macro, such as main.rs or build.rs, the
+    /// line/column are always meaningful regardless of toolchain.
+    #[cfg(span_locations)]
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "span-locations")))]
+    pub fn end(&self) -> LineColumn {
+        self.inner.end()
+    }
+
+    /// Create a new span encompassing `self` and `other`.
+    ///
+    /// Returns `None` if `self` and `other` are from different files.
+    ///
+    /// Warning: the underlying [`proc_macro::Span::join`] method is
+    /// nightly-only. When called from within a procedural macro not using a
+    /// nightly compiler, this method will always return `None`.
+    ///
+    /// [`proc_macro::Span::join`]: https://doc.rust-lang.org/proc_macro/struct.Span.html#method.join
+    pub fn join(&self, other: Span) -> Option<Span> {
+        self.inner.join(other.inner).map(Span::_new)
+    }
+
+    /// Compares two spans to see if they're equal.
+    ///
+    /// This method is semver exempt and not exposed by default.
+    #[cfg(procmacro2_semver_exempt)]
+    #[cfg_attr(doc_cfg, doc(cfg(procmacro2_semver_exempt)))]
+    pub fn eq(&self, other: &Span) -> bool {
+        self.inner.eq(&other.inner)
+    }
+
+    /// Returns the source text behind a span. This preserves the original
+    /// source code, including spaces and comments. It only returns a result if
+    /// the span corresponds to real source code.
+    ///
+    /// Note: The observable result of a macro should only rely on the tokens
+    /// and not on this source text. The result of this function is a best
+    /// effort to be used for diagnostics only.
+    pub fn source_text(&self) -> Option<String> {
+        self.inner.source_text()
+    }
+}
+
+/// Prints a span in a form convenient for debugging.
+impl Debug for Span {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        Debug::fmt(&self.inner, f)
+    }
+}
+
+/// A single token or a delimited sequence of token trees (e.g. `[1, (), ..]`).
+#[derive(Clone)]
+pub enum TokenTree {
+    /// A token stream surrounded by bracket delimiters.
+    Group(Group),
+    /// An identifier.
+    Ident(Ident),
+    /// A single punctuation character (`+`, `,`, `$`, etc.).
+    Punct(Punct),
+    /// A literal character (`'a'`), string (`"hello"`), number (`2.3`), etc.
+    Literal(Literal),
+}
+
+impl TokenTree {
+    /// Returns the span of this tree, delegating to the `span` method of
+    /// the contained token or a delimited stream.
+    pub fn span(&self) -> Span {
+        match self {
+            TokenTree::Group(t) => t.span(),
+            TokenTree::Ident(t) => t.span(),
+            TokenTree::Punct(t) => t.span(),
+            TokenTree::Literal(t) => t.span(),
+        }
+    }
+
+    /// Configures the span for *only this token*.
+    ///
+    /// Note that if this token is a `Group` then this method will not configure
+    /// the span of each of the internal tokens, this will simply delegate to
+    /// the `set_span` method of each variant.
+    pub fn set_span(&mut self, span: Span) {
+        match self {
+            TokenTree::Group(t) => t.set_span(span),
+            TokenTree::Ident(t) => t.set_span(span),
+            TokenTree::Punct(t) => t.set_span(span),
+            TokenTree::Literal(t) => t.set_span(span),
+        }
+    }
+}
+
+impl From<Group> for TokenTree {
+    fn from(g: Group) -> Self {
+        TokenTree::Group(g)
+    }
+}
+
+impl From<Ident> for TokenTree {
+    fn from(g: Ident) -> Self {
+        TokenTree::Ident(g)
+    }
+}
+
+impl From<Punct> for TokenTree {
+    fn from(g: Punct) -> Self {
+        TokenTree::Punct(g)
+    }
+}
+
+impl From<Literal> for TokenTree {
+    fn from(g: Literal) -> Self {
+        TokenTree::Literal(g)
+    }
+}
+
+/// Prints the token tree as a string that is supposed to be losslessly
+/// convertible back into the same token tree (modulo spans), except for
+/// possibly `TokenTree::Group`s with `Delimiter::None` delimiters and negative
+/// numeric literals.
+impl Display for TokenTree {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        match self {
+            TokenTree::Group(t) => Display::fmt(t, f),
+            TokenTree::Ident(t) => Display::fmt(t, f),
+            TokenTree::Punct(t) => Display::fmt(t, f),
+            TokenTree::Literal(t) => Display::fmt(t, f),
+        }
+    }
+}
+
+/// Prints token tree in a form convenient for debugging.
+impl Debug for TokenTree {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        // Each of these has the name in the struct type in the derived debug,
+        // so don't bother with an extra layer of indirection
+        match self {
+            TokenTree::Group(t) => Debug::fmt(t, f),
+            TokenTree::Ident(t) => {
+                let mut debug = f.debug_struct("Ident");
+                debug.field("sym", &format_args!("{}", t));
+                imp::debug_span_field_if_nontrivial(&mut debug, t.span().inner);
+                debug.finish()
+            }
+            TokenTree::Punct(t) => Debug::fmt(t, f),
+            TokenTree::Literal(t) => Debug::fmt(t, f),
+        }
+    }
+}
+
+/// A delimited token stream.
+///
+/// A `Group` internally contains a `TokenStream` which is surrounded by
+/// `Delimiter`s.
+#[derive(Clone)]
+pub struct Group {
+    inner: imp::Group,
+}
+
+/// Describes how a sequence of token trees is delimited.
+#[derive(Copy, Clone, Debug, Eq, PartialEq)]
+pub enum Delimiter {
+    /// `( ... )`
+    Parenthesis,
+    /// `{ ... }`
+    Brace,
+    /// `[ ... ]`
+    Bracket,
+    /// `∅ ... ∅`
+    ///
+    /// An invisible delimiter, that may, for example, appear around tokens
+    /// coming from a "macro variable" `$var`. It is important to preserve
+    /// operator priorities in cases like `$var * 3` where `$var` is `1 + 2`.
+    /// Invisible delimiters may not survive roundtrip of a token stream through
+    /// a string.
+    None,
+}
+
+impl Group {
+    fn _new(inner: imp::Group) -> Self {
+        Group { inner }
+    }
+
+    fn _new_fallback(inner: fallback::Group) -> Self {
+        Group {
+            inner: inner.into(),
+        }
+    }
+
+    /// Creates a new `Group` with the given delimiter and token stream.
+    ///
+    /// This constructor will set the span for this group to
+    /// `Span::call_site()`. To change the span you can use the `set_span`
+    /// method below.
+    pub fn new(delimiter: Delimiter, stream: TokenStream) -> Self {
+        Group {
+            inner: imp::Group::new(delimiter, stream.inner),
+        }
+    }
+
+    /// Returns the punctuation used as the delimiter for this group: a set of
+    /// parentheses, square brackets, or curly braces.
+    pub fn delimiter(&self) -> Delimiter {
+        self.inner.delimiter()
+    }
+
+    /// Returns the `TokenStream` of tokens that are delimited in this `Group`.
+    ///
+    /// Note that the returned token stream does not include the delimiter
+    /// returned above.
+    pub fn stream(&self) -> TokenStream {
+        TokenStream::_new(self.inner.stream())
+    }
+
+    /// Returns the span for the delimiters of this token stream, spanning the
+    /// entire `Group`.
+    ///
+    /// ```text
+    /// pub fn span(&self) -> Span {
+    ///            ^^^^^^^
+    /// ```
+    pub fn span(&self) -> Span {
+        Span::_new(self.inner.span())
+    }
+
+    /// Returns the span pointing to the opening delimiter of this group.
+    ///
+    /// ```text
+    /// pub fn span_open(&self) -> Span {
+    ///                 ^
+    /// ```
+    pub fn span_open(&self) -> Span {
+        Span::_new(self.inner.span_open())
+    }
+
+    /// Returns the span pointing to the closing delimiter of this group.
+    ///
+    /// ```text
+    /// pub fn span_close(&self) -> Span {
+    ///                        ^
+    /// ```
+    pub fn span_close(&self) -> Span {
+        Span::_new(self.inner.span_close())
+    }
+
+    /// Returns an object that holds this group's `span_open()` and
+    /// `span_close()` together (in a more compact representation than holding
+    /// those 2 spans individually).
+    pub fn delim_span(&self) -> DelimSpan {
+        DelimSpan::new(&self.inner)
+    }
+
+    /// Configures the span for this `Group`'s delimiters, but not its internal
+    /// tokens.
+    ///
+    /// This method will **not** set the span of all the internal tokens spanned
+    /// by this group, but rather it will only set the span of the delimiter
+    /// tokens at the level of the `Group`.
+    pub fn set_span(&mut self, span: Span) {
+        self.inner.set_span(span.inner);
+    }
+}
+
+/// Prints the group as a string that should be losslessly convertible back
+/// into the same group (modulo spans), except for possibly `TokenTree::Group`s
+/// with `Delimiter::None` delimiters.
+impl Display for Group {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        Display::fmt(&self.inner, formatter)
+    }
+}
+
+impl Debug for Group {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        Debug::fmt(&self.inner, formatter)
+    }
+}
+
+/// A `Punct` is a single punctuation character like `+`, `-` or `#`.
+///
+/// Multicharacter operators like `+=` are represented as two instances of
+/// `Punct` with different forms of `Spacing` returned.
+#[derive(Clone)]
+pub struct Punct {
+    ch: char,
+    spacing: Spacing,
+    span: Span,
+}
+
+/// Whether a `Punct` is followed immediately by another `Punct` or followed by
+/// another token or whitespace.
+#[derive(Copy, Clone, Debug, Eq, PartialEq)]
+pub enum Spacing {
+    /// E.g. `+` is `Alone` in `+ =`, `+ident` or `+()`.
+    Alone,
+    /// E.g. `+` is `Joint` in `+=` or `'` is `Joint` in `'#`.
+    ///
+    /// Additionally, single quote `'` can join with identifiers to form
+    /// lifetimes `'ident`.
+    Joint,
+}
+
+impl Punct {
+    /// Creates a new `Punct` from the given character and spacing.
+    ///
+    /// The `ch` argument must be a valid punctuation character permitted by the
+    /// language, otherwise the function will panic.
+    ///
+    /// The returned `Punct` will have the default span of `Span::call_site()`
+    /// which can be further configured with the `set_span` method below.
+    pub fn new(ch: char, spacing: Spacing) -> Self {
+        Punct {
+            ch,
+            spacing,
+            span: Span::call_site(),
+        }
+    }
+
+    /// Returns the value of this punctuation character as `char`.
+    pub fn as_char(&self) -> char {
+        self.ch
+    }
+
+    /// Returns the spacing of this punctuation character, indicating whether
+    /// it's immediately followed by another `Punct` in the token stream, so
+    /// they can potentially be combined into a multicharacter operator
+    /// (`Joint`), or it's followed by some other token or whitespace (`Alone`)
+    /// so the operator has certainly ended.
+    pub fn spacing(&self) -> Spacing {
+        self.spacing
+    }
+
+    /// Returns the span for this punctuation character.
+    pub fn span(&self) -> Span {
+        self.span
+    }
+
+    /// Configure the span for this punctuation character.
+    pub fn set_span(&mut self, span: Span) {
+        self.span = span;
+    }
+}
+
+/// Prints the punctuation character as a string that should be losslessly
+/// convertible back into the same character.
+impl Display for Punct {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        Display::fmt(&self.ch, f)
+    }
+}
+
+impl Debug for Punct {
+    fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
+        let mut debug = fmt.debug_struct("Punct");
+        debug.field("char", &self.ch);
+        debug.field("spacing", &self.spacing);
+        imp::debug_span_field_if_nontrivial(&mut debug, self.span.inner);
+        debug.finish()
+    }
+}
+
+/// A word of Rust code, which may be a keyword or legal variable name.
+///
+/// An identifier consists of at least one Unicode code point, the first of
+/// which has the XID_Start property and the rest of which have the XID_Continue
+/// property.
+///
+/// - The empty string is not an identifier. Use `Option<Ident>`.
+/// - A lifetime is not an identifier. Use `syn::Lifetime` instead.
+///
+/// An identifier constructed with `Ident::new` is permitted to be a Rust
+/// keyword, though parsing one through its [`Parse`] implementation rejects
+/// Rust keywords. Use `input.call(Ident::parse_any)` when parsing to match the
+/// behaviour of `Ident::new`.
+///
+/// [`Parse`]: https://docs.rs/syn/2.0/syn/parse/trait.Parse.html
+///
+/// # Examples
+///
+/// A new ident can be created from a string using the `Ident::new` function.
+/// A span must be provided explicitly which governs the name resolution
+/// behavior of the resulting identifier.
+///
+/// ```
+/// use proc_macro2::{Ident, Span};
+///
+/// fn main() {
+///     let call_ident = Ident::new("calligraphy", Span::call_site());
+///
+///     println!("{}", call_ident);
+/// }
+/// ```
+///
+/// An ident can be interpolated into a token stream using the `quote!` macro.
+///
+/// ```
+/// use proc_macro2::{Ident, Span};
+/// use quote::quote;
+///
+/// fn main() {
+///     let ident = Ident::new("demo", Span::call_site());
+///
+///     // Create a variable binding whose name is this ident.
+///     let expanded = quote! { let #ident = 10; };
+///
+///     // Create a variable binding with a slightly different name.
+///     let temp_ident = Ident::new(&format!("new_{}", ident), Span::call_site());
+///     let expanded = quote! { let #temp_ident = 10; };
+/// }
+/// ```
+///
+/// A string representation of the ident is available through the `to_string()`
+/// method.
+///
+/// ```
+/// # use proc_macro2::{Ident, Span};
+/// #
+/// # let ident = Ident::new("another_identifier", Span::call_site());
+/// #
+/// // Examine the ident as a string.
+/// let ident_string = ident.to_string();
+/// if ident_string.len() > 60 {
+///     println!("Very long identifier: {}", ident_string)
+/// }
+/// ```
+#[derive(Clone)]
+pub struct Ident {
+    inner: imp::Ident,
+    _marker: ProcMacroAutoTraits,
+}
+
+impl Ident {
+    fn _new(inner: imp::Ident) -> Self {
+        Ident {
+            inner,
+            _marker: MARKER,
+        }
+    }
+
+    /// Creates a new `Ident` with the given `string` as well as the specified
+    /// `span`.
+    ///
+    /// The `string` argument must be a valid identifier permitted by the
+    /// language, otherwise the function will panic.
+    ///
+    /// Note that `span`, currently in rustc, configures the hygiene information
+    /// for this identifier.
+    ///
+    /// As of this time `Span::call_site()` explicitly opts-in to "call-site"
+    /// hygiene meaning that identifiers created with this span will be resolved
+    /// as if they were written directly at the location of the macro call, and
+    /// other code at the macro call site will be able to refer to them as well.
+    ///
+    /// Later spans like `Span::def_site()` will allow to opt-in to
+    /// "definition-site" hygiene meaning that identifiers created with this
+    /// span will be resolved at the location of the macro definition and other
+    /// code at the macro call site will not be able to refer to them.
+    ///
+    /// Due to the current importance of hygiene this constructor, unlike other
+    /// tokens, requires a `Span` to be specified at construction.
+    ///
+    /// # Panics
+    ///
+    /// Panics if the input string is neither a keyword nor a legal variable
+    /// name. If you are not sure whether the string contains an identifier and
+    /// need to handle an error case, use
+    /// <a href="https://docs.rs/syn/2.0/syn/fn.parse_str.html"><code
+    ///   style="padding-right:0;">syn::parse_str</code></a><code
+    ///   style="padding-left:0;">::&lt;Ident&gt;</code>
+    /// rather than `Ident::new`.
+    #[track_caller]
+    pub fn new(string: &str, span: Span) -> Self {
+        Ident::_new(imp::Ident::new_checked(string, span.inner))
+    }
+
+    /// Same as `Ident::new`, but creates a raw identifier (`r#ident`). The
+    /// `string` argument must be a valid identifier permitted by the language
+    /// (including keywords, e.g. `fn`). Keywords which are usable in path
+    /// segments (e.g. `self`, `super`) are not supported, and will cause a
+    /// panic.
+    #[track_caller]
+    pub fn new_raw(string: &str, span: Span) -> Self {
+        Ident::_new(imp::Ident::new_raw_checked(string, span.inner))
+    }
+
+    /// Returns the span of this `Ident`.
+    pub fn span(&self) -> Span {
+        Span::_new(self.inner.span())
+    }
+
+    /// Configures the span of this `Ident`, possibly changing its hygiene
+    /// context.
+    pub fn set_span(&mut self, span: Span) {
+        self.inner.set_span(span.inner);
+    }
+}
+
+impl PartialEq for Ident {
+    fn eq(&self, other: &Ident) -> bool {
+        self.inner == other.inner
+    }
+}
+
+impl<T> PartialEq<T> for Ident
+where
+    T: ?Sized + AsRef<str>,
+{
+    fn eq(&self, other: &T) -> bool {
+        self.inner == other
+    }
+}
+
+impl Eq for Ident {}
+
+impl PartialOrd for Ident {
+    fn partial_cmp(&self, other: &Ident) -> Option<Ordering> {
+        Some(self.cmp(other))
+    }
+}
+
+impl Ord for Ident {
+    fn cmp(&self, other: &Ident) -> Ordering {
+        self.to_string().cmp(&other.to_string())
+    }
+}
+
+impl Hash for Ident {
+    fn hash<H: Hasher>(&self, hasher: &mut H) {
+        self.to_string().hash(hasher);
+    }
+}
+
+/// Prints the identifier as a string that should be losslessly convertible back
+/// into the same identifier.
+impl Display for Ident {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        Display::fmt(&self.inner, f)
+    }
+}
+
+impl Debug for Ident {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        Debug::fmt(&self.inner, f)
+    }
+}
+
+/// A literal string (`"hello"`), byte string (`b"hello"`), character (`'a'`),
+/// byte character (`b'a'`), an integer or floating point number with or without
+/// a suffix (`1`, `1u8`, `2.3`, `2.3f32`).
+///
+/// Boolean literals like `true` and `false` do not belong here, they are
+/// `Ident`s.
+#[derive(Clone)]
+pub struct Literal {
+    inner: imp::Literal,
+    _marker: ProcMacroAutoTraits,
+}
+
+macro_rules! suffixed_int_literals {
+    ($($name:ident => $kind:ident,)*) => ($(
+        /// Creates a new suffixed integer literal with the specified value.
+        ///
+        /// This function will create an integer like `1u32` where the integer
+        /// value specified is the first part of the token and the integral is
+        /// also suffixed at the end. Literals created from negative numbers may
+        /// not survive roundtrips through `TokenStream` or strings and may be
+        /// broken into two tokens (`-` and positive literal).
+        ///
+        /// Literals created through this method have the `Span::call_site()`
+        /// span by default, which can be configured with the `set_span` method
+        /// below.
+        pub fn $name(n: $kind) -> Literal {
+            Literal::_new(imp::Literal::$name(n))
+        }
+    )*)
+}
+
+macro_rules! unsuffixed_int_literals {
+    ($($name:ident => $kind:ident,)*) => ($(
+        /// Creates a new unsuffixed integer literal with the specified value.
+        ///
+        /// This function will create an integer like `1` where the integer
+        /// value specified is the first part of the token. No suffix is
+        /// specified on this token, meaning that invocations like
+        /// `Literal::i8_unsuffixed(1)` are equivalent to
+        /// `Literal::u32_unsuffixed(1)`. Literals created from negative numbers
+        /// may not survive roundtrips through `TokenStream` or strings and may
+        /// be broken into two tokens (`-` and positive literal).
+        ///
+        /// Literals created through this method have the `Span::call_site()`
+        /// span by default, which can be configured with the `set_span` method
+        /// below.
+        pub fn $name(n: $kind) -> Literal {
+            Literal::_new(imp::Literal::$name(n))
+        }
+    )*)
+}
+
+impl Literal {
+    fn _new(inner: imp::Literal) -> Self {
+        Literal {
+            inner,
+            _marker: MARKER,
+        }
+    }
+
+    fn _new_fallback(inner: fallback::Literal) -> Self {
+        Literal {
+            inner: inner.into(),
+            _marker: MARKER,
+        }
+    }
+
+    suffixed_int_literals! {
+        u8_suffixed => u8,
+        u16_suffixed => u16,
+        u32_suffixed => u32,
+        u64_suffixed => u64,
+        u128_suffixed => u128,
+        usize_suffixed => usize,
+        i8_suffixed => i8,
+        i16_suffixed => i16,
+        i32_suffixed => i32,
+        i64_suffixed => i64,
+        i128_suffixed => i128,
+        isize_suffixed => isize,
+    }
+
+    unsuffixed_int_literals! {
+        u8_unsuffixed => u8,
+        u16_unsuffixed => u16,
+        u32_unsuffixed => u32,
+        u64_unsuffixed => u64,
+        u128_unsuffixed => u128,
+        usize_unsuffixed => usize,
+        i8_unsuffixed => i8,
+        i16_unsuffixed => i16,
+        i32_unsuffixed => i32,
+        i64_unsuffixed => i64,
+        i128_unsuffixed => i128,
+        isize_unsuffixed => isize,
+    }
+
+    /// Creates a new unsuffixed floating-point literal.
+    ///
+    /// This constructor is similar to those like `Literal::i8_unsuffixed` where
+    /// the float's value is emitted directly into the token but no suffix is
+    /// used, so it may be inferred to be a `f64` later in the compiler.
+    /// Literals created from negative numbers may not survive round-trips
+    /// through `TokenStream` or strings and may be broken into two tokens (`-`
+    /// and positive literal).
+    ///
+    /// # Panics
+    ///
+    /// This function requires that the specified float is finite, for example
+    /// if it is infinity or NaN this function will panic.
+    pub fn f64_unsuffixed(f: f64) -> Literal {
+        assert!(f.is_finite());
+        Literal::_new(imp::Literal::f64_unsuffixed(f))
+    }
+
+    /// Creates a new suffixed floating-point literal.
+    ///
+    /// This constructor will create a literal like `1.0f64` where the value
+    /// specified is the preceding part of the token and `f64` is the suffix of
+    /// the token. This token will always be inferred to be an `f64` in the
+    /// compiler. Literals created from negative numbers may not survive
+    /// round-trips through `TokenStream` or strings and may be broken into two
+    /// tokens (`-` and positive literal).
+    ///
+    /// # Panics
+    ///
+    /// This function requires that the specified float is finite, for example
+    /// if it is infinity or NaN this function will panic.
+    pub fn f64_suffixed(f: f64) -> Literal {
+        assert!(f.is_finite());
+        Literal::_new(imp::Literal::f64_suffixed(f))
+    }
+
+    /// Creates a new unsuffixed floating-point literal.
+    ///
+    /// This constructor is similar to those like `Literal::i8_unsuffixed` where
+    /// the float's value is emitted directly into the token but no suffix is
+    /// used, so it may be inferred to be a `f64` later in the compiler.
+    /// Literals created from negative numbers may not survive round-trips
+    /// through `TokenStream` or strings and may be broken into two tokens (`-`
+    /// and positive literal).
+    ///
+    /// # Panics
+    ///
+    /// This function requires that the specified float is finite, for example
+    /// if it is infinity or NaN this function will panic.
+    pub fn f32_unsuffixed(f: f32) -> Literal {
+        assert!(f.is_finite());
+        Literal::_new(imp::Literal::f32_unsuffixed(f))
+    }
+
+    /// Creates a new suffixed floating-point literal.
+    ///
+    /// This constructor will create a literal like `1.0f32` where the value
+    /// specified is the preceding part of the token and `f32` is the suffix of
+    /// the token. This token will always be inferred to be an `f32` in the
+    /// compiler. Literals created from negative numbers may not survive
+    /// round-trips through `TokenStream` or strings and may be broken into two
+    /// tokens (`-` and positive literal).
+    ///
+    /// # Panics
+    ///
+    /// This function requires that the specified float is finite, for example
+    /// if it is infinity or NaN this function will panic.
+    pub fn f32_suffixed(f: f32) -> Literal {
+        assert!(f.is_finite());
+        Literal::_new(imp::Literal::f32_suffixed(f))
+    }
+
+    /// String literal.
+    pub fn string(string: &str) -> Literal {
+        Literal::_new(imp::Literal::string(string))
+    }
+
+    /// Character literal.
+    pub fn character(ch: char) -> Literal {
+        Literal::_new(imp::Literal::character(ch))
+    }
+
+    /// Byte character literal.
+    pub fn byte_character(byte: u8) -> Literal {
+        Literal::_new(imp::Literal::byte_character(byte))
+    }
+
+    /// Byte string literal.
+    pub fn byte_string(bytes: &[u8]) -> Literal {
+        Literal::_new(imp::Literal::byte_string(bytes))
+    }
+
+    /// C string literal.
+    pub fn c_string(string: &CStr) -> Literal {
+        Literal::_new(imp::Literal::c_string(string))
+    }
+
+    /// Returns the span encompassing this literal.
+    pub fn span(&self) -> Span {
+        Span::_new(self.inner.span())
+    }
+
+    /// Configures the span associated for this literal.
+    pub fn set_span(&mut self, span: Span) {
+        self.inner.set_span(span.inner);
+    }
+
+    /// Returns a `Span` that is a subset of `self.span()` containing only
+    /// the source bytes in range `range`. Returns `None` if the would-be
+    /// trimmed span is outside the bounds of `self`.
+    ///
+    /// Warning: the underlying [`proc_macro::Literal::subspan`] method is
+    /// nightly-only. When called from within a procedural macro not using a
+    /// nightly compiler, this method will always return `None`.
+    ///
+    /// [`proc_macro::Literal::subspan`]: https://doc.rust-lang.org/proc_macro/struct.Literal.html#method.subspan
+    pub fn subspan<R: RangeBounds<usize>>(&self, range: R) -> Option<Span> {
+        self.inner.subspan(range).map(Span::_new)
+    }
+
+    // Intended for the `quote!` macro to use when constructing a proc-macro2
+    // token out of a macro_rules $:literal token, which is already known to be
+    // a valid literal. This avoids reparsing/validating the literal's string
+    // representation. This is not public API other than for quote.
+    #[doc(hidden)]
+    pub unsafe fn from_str_unchecked(repr: &str) -> Self {
+        Literal::_new(unsafe { imp::Literal::from_str_unchecked(repr) })
+    }
+}
+
+impl FromStr for Literal {
+    type Err = LexError;
+
+    fn from_str(repr: &str) -> Result<Self, LexError> {
+        repr.parse().map(Literal::_new).map_err(|inner| LexError {
+            inner,
+            _marker: MARKER,
+        })
+    }
+}
+
+impl Debug for Literal {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        Debug::fmt(&self.inner, f)
+    }
+}
+
+impl Display for Literal {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        Display::fmt(&self.inner, f)
+    }
+}
+
+/// Public implementation details for the `TokenStream` type, such as iterators.
+pub mod token_stream {
+    use crate::marker::{ProcMacroAutoTraits, MARKER};
+    use crate::{imp, TokenTree};
+    use core::fmt::{self, Debug};
+
+    pub use crate::TokenStream;
+
+    /// An iterator over `TokenStream`'s `TokenTree`s.
+    ///
+    /// The iteration is "shallow", e.g. the iterator doesn't recurse into
+    /// delimited groups, and returns whole groups as token trees.
+    #[derive(Clone)]
+    pub struct IntoIter {
+        inner: imp::TokenTreeIter,
+        _marker: ProcMacroAutoTraits,
+    }
+
+    impl Iterator for IntoIter {
+        type Item = TokenTree;
+
+        fn next(&mut self) -> Option<TokenTree> {
+            self.inner.next()
+        }
+
+        fn size_hint(&self) -> (usize, Option<usize>) {
+            self.inner.size_hint()
+        }
+    }
+
+    impl Debug for IntoIter {
+        fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+            f.write_str("TokenStream ")?;
+            f.debug_list().entries(self.clone()).finish()
+        }
+    }
+
+    impl IntoIterator for TokenStream {
+        type Item = TokenTree;
+        type IntoIter = IntoIter;
+
+        fn into_iter(self) -> IntoIter {
+            IntoIter {
+                inner: self.inner.into_iter(),
+                _marker: MARKER,
+            }
+        }
+    }
+}
+
\ No newline at end of file diff --git a/src/proc_macro2/marker.rs.html b/src/proc_macro2/marker.rs.html new file mode 100644 index 0000000..ea4bfe8 --- /dev/null +++ b/src/proc_macro2/marker.rs.html @@ -0,0 +1,35 @@ +marker.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+
use alloc::rc::Rc;
+use core::marker::PhantomData;
+use core::panic::{RefUnwindSafe, UnwindSafe};
+
+// Zero sized marker with the correct set of autotrait impls we want all proc
+// macro types to have.
+#[derive(Copy, Clone)]
+#[cfg_attr(
+    all(procmacro2_semver_exempt, any(not(wrap_proc_macro), super_unstable)),
+    derive(PartialEq, Eq)
+)]
+pub(crate) struct ProcMacroAutoTraits(PhantomData<Rc<()>>);
+
+pub(crate) const MARKER: ProcMacroAutoTraits = ProcMacroAutoTraits(PhantomData);
+
+impl UnwindSafe for ProcMacroAutoTraits {}
+impl RefUnwindSafe for ProcMacroAutoTraits {}
+
\ No newline at end of file diff --git a/src/proc_macro2/parse.rs.html b/src/proc_macro2/parse.rs.html new file mode 100644 index 0000000..4127839 --- /dev/null +++ b/src/proc_macro2/parse.rs.html @@ -0,0 +1,1993 @@ +parse.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+753
+754
+755
+756
+757
+758
+759
+760
+761
+762
+763
+764
+765
+766
+767
+768
+769
+770
+771
+772
+773
+774
+775
+776
+777
+778
+779
+780
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+794
+795
+796
+797
+798
+799
+800
+801
+802
+803
+804
+805
+806
+807
+808
+809
+810
+811
+812
+813
+814
+815
+816
+817
+818
+819
+820
+821
+822
+823
+824
+825
+826
+827
+828
+829
+830
+831
+832
+833
+834
+835
+836
+837
+838
+839
+840
+841
+842
+843
+844
+845
+846
+847
+848
+849
+850
+851
+852
+853
+854
+855
+856
+857
+858
+859
+860
+861
+862
+863
+864
+865
+866
+867
+868
+869
+870
+871
+872
+873
+874
+875
+876
+877
+878
+879
+880
+881
+882
+883
+884
+885
+886
+887
+888
+889
+890
+891
+892
+893
+894
+895
+896
+897
+898
+899
+900
+901
+902
+903
+904
+905
+906
+907
+908
+909
+910
+911
+912
+913
+914
+915
+916
+917
+918
+919
+920
+921
+922
+923
+924
+925
+926
+927
+928
+929
+930
+931
+932
+933
+934
+935
+936
+937
+938
+939
+940
+941
+942
+943
+944
+945
+946
+947
+948
+949
+950
+951
+952
+953
+954
+955
+956
+957
+958
+959
+960
+961
+962
+963
+964
+965
+966
+967
+968
+969
+970
+971
+972
+973
+974
+975
+976
+977
+978
+979
+980
+981
+982
+983
+984
+985
+986
+987
+988
+989
+990
+991
+992
+993
+994
+995
+996
+
use crate::fallback::{
+    self, is_ident_continue, is_ident_start, Group, LexError, Literal, Span, TokenStream,
+    TokenStreamBuilder,
+};
+use crate::{Delimiter, Punct, Spacing, TokenTree};
+use core::char;
+use core::str::{Bytes, CharIndices, Chars};
+
+#[derive(Copy, Clone, Eq, PartialEq)]
+pub(crate) struct Cursor<'a> {
+    pub rest: &'a str,
+    #[cfg(span_locations)]
+    pub off: u32,
+}
+
+impl<'a> Cursor<'a> {
+    pub fn advance(&self, bytes: usize) -> Cursor<'a> {
+        let (_front, rest) = self.rest.split_at(bytes);
+        Cursor {
+            rest,
+            #[cfg(span_locations)]
+            off: self.off + _front.chars().count() as u32,
+        }
+    }
+
+    pub fn starts_with(&self, s: &str) -> bool {
+        self.rest.starts_with(s)
+    }
+
+    pub fn starts_with_char(&self, ch: char) -> bool {
+        self.rest.starts_with(ch)
+    }
+
+    pub fn starts_with_fn<Pattern>(&self, f: Pattern) -> bool
+    where
+        Pattern: FnMut(char) -> bool,
+    {
+        self.rest.starts_with(f)
+    }
+
+    pub fn is_empty(&self) -> bool {
+        self.rest.is_empty()
+    }
+
+    fn len(&self) -> usize {
+        self.rest.len()
+    }
+
+    fn as_bytes(&self) -> &'a [u8] {
+        self.rest.as_bytes()
+    }
+
+    fn bytes(&self) -> Bytes<'a> {
+        self.rest.bytes()
+    }
+
+    fn chars(&self) -> Chars<'a> {
+        self.rest.chars()
+    }
+
+    fn char_indices(&self) -> CharIndices<'a> {
+        self.rest.char_indices()
+    }
+
+    fn parse(&self, tag: &str) -> Result<Cursor<'a>, Reject> {
+        if self.starts_with(tag) {
+            Ok(self.advance(tag.len()))
+        } else {
+            Err(Reject)
+        }
+    }
+}
+
+pub(crate) struct Reject;
+type PResult<'a, O> = Result<(Cursor<'a>, O), Reject>;
+
+fn skip_whitespace(input: Cursor) -> Cursor {
+    let mut s = input;
+
+    while !s.is_empty() {
+        let byte = s.as_bytes()[0];
+        if byte == b'/' {
+            if s.starts_with("//")
+                && (!s.starts_with("///") || s.starts_with("////"))
+                && !s.starts_with("//!")
+            {
+                let (cursor, _) = take_until_newline_or_eof(s);
+                s = cursor;
+                continue;
+            } else if s.starts_with("/**/") {
+                s = s.advance(4);
+                continue;
+            } else if s.starts_with("/*")
+                && (!s.starts_with("/**") || s.starts_with("/***"))
+                && !s.starts_with("/*!")
+            {
+                match block_comment(s) {
+                    Ok((rest, _)) => {
+                        s = rest;
+                        continue;
+                    }
+                    Err(Reject) => return s,
+                }
+            }
+        }
+        match byte {
+            b' ' | 0x09..=0x0d => {
+                s = s.advance(1);
+                continue;
+            }
+            b if b.is_ascii() => {}
+            _ => {
+                let ch = s.chars().next().unwrap();
+                if is_whitespace(ch) {
+                    s = s.advance(ch.len_utf8());
+                    continue;
+                }
+            }
+        }
+        return s;
+    }
+    s
+}
+
+fn block_comment(input: Cursor) -> PResult<&str> {
+    if !input.starts_with("/*") {
+        return Err(Reject);
+    }
+
+    let mut depth = 0usize;
+    let bytes = input.as_bytes();
+    let mut i = 0usize;
+    let upper = bytes.len() - 1;
+
+    while i < upper {
+        if bytes[i] == b'/' && bytes[i + 1] == b'*' {
+            depth += 1;
+            i += 1; // eat '*'
+        } else if bytes[i] == b'*' && bytes[i + 1] == b'/' {
+            depth -= 1;
+            if depth == 0 {
+                return Ok((input.advance(i + 2), &input.rest[..i + 2]));
+            }
+            i += 1; // eat '/'
+        }
+        i += 1;
+    }
+
+    Err(Reject)
+}
+
+fn is_whitespace(ch: char) -> bool {
+    // Rust treats left-to-right mark and right-to-left mark as whitespace
+    ch.is_whitespace() || ch == '\u{200e}' || ch == '\u{200f}'
+}
+
+fn word_break(input: Cursor) -> Result<Cursor, Reject> {
+    match input.chars().next() {
+        Some(ch) if is_ident_continue(ch) => Err(Reject),
+        Some(_) | None => Ok(input),
+    }
+}
+
+// Rustc's representation of a macro expansion error in expression position or
+// type position.
+const ERROR: &str = "(/*ERROR*/)";
+
+pub(crate) fn token_stream(mut input: Cursor) -> Result<TokenStream, LexError> {
+    let mut trees = TokenStreamBuilder::new();
+    let mut stack = Vec::new();
+
+    loop {
+        input = skip_whitespace(input);
+
+        if let Ok((rest, ())) = doc_comment(input, &mut trees) {
+            input = rest;
+            continue;
+        }
+
+        #[cfg(span_locations)]
+        let lo = input.off;
+
+        let first = match input.bytes().next() {
+            Some(first) => first,
+            None => match stack.last() {
+                None => return Ok(trees.build()),
+                #[cfg(span_locations)]
+                Some((lo, _frame)) => {
+                    return Err(LexError {
+                        span: Span { lo: *lo, hi: *lo },
+                    })
+                }
+                #[cfg(not(span_locations))]
+                Some(_frame) => return Err(LexError { span: Span {} }),
+            },
+        };
+
+        if let Some(open_delimiter) = match first {
+            b'(' if !input.starts_with(ERROR) => Some(Delimiter::Parenthesis),
+            b'[' => Some(Delimiter::Bracket),
+            b'{' => Some(Delimiter::Brace),
+            _ => None,
+        } {
+            input = input.advance(1);
+            let frame = (open_delimiter, trees);
+            #[cfg(span_locations)]
+            let frame = (lo, frame);
+            stack.push(frame);
+            trees = TokenStreamBuilder::new();
+        } else if let Some(close_delimiter) = match first {
+            b')' => Some(Delimiter::Parenthesis),
+            b']' => Some(Delimiter::Bracket),
+            b'}' => Some(Delimiter::Brace),
+            _ => None,
+        } {
+            let frame = match stack.pop() {
+                Some(frame) => frame,
+                None => return Err(lex_error(input)),
+            };
+            #[cfg(span_locations)]
+            let (lo, frame) = frame;
+            let (open_delimiter, outer) = frame;
+            if open_delimiter != close_delimiter {
+                return Err(lex_error(input));
+            }
+            input = input.advance(1);
+            let mut g = Group::new(open_delimiter, trees.build());
+            g.set_span(Span {
+                #[cfg(span_locations)]
+                lo,
+                #[cfg(span_locations)]
+                hi: input.off,
+            });
+            trees = outer;
+            trees.push_token_from_parser(TokenTree::Group(crate::Group::_new_fallback(g)));
+        } else {
+            let (rest, mut tt) = match leaf_token(input) {
+                Ok((rest, tt)) => (rest, tt),
+                Err(Reject) => return Err(lex_error(input)),
+            };
+            tt.set_span(crate::Span::_new_fallback(Span {
+                #[cfg(span_locations)]
+                lo,
+                #[cfg(span_locations)]
+                hi: rest.off,
+            }));
+            trees.push_token_from_parser(tt);
+            input = rest;
+        }
+    }
+}
+
+fn lex_error(cursor: Cursor) -> LexError {
+    #[cfg(not(span_locations))]
+    let _ = cursor;
+    LexError {
+        span: Span {
+            #[cfg(span_locations)]
+            lo: cursor.off,
+            #[cfg(span_locations)]
+            hi: cursor.off,
+        },
+    }
+}
+
+fn leaf_token(input: Cursor) -> PResult<TokenTree> {
+    if let Ok((input, l)) = literal(input) {
+        // must be parsed before ident
+        Ok((input, TokenTree::Literal(crate::Literal::_new_fallback(l))))
+    } else if let Ok((input, p)) = punct(input) {
+        Ok((input, TokenTree::Punct(p)))
+    } else if let Ok((input, i)) = ident(input) {
+        Ok((input, TokenTree::Ident(i)))
+    } else if input.starts_with(ERROR) {
+        let rest = input.advance(ERROR.len());
+        let repr = crate::Literal::_new_fallback(Literal::_new(ERROR.to_owned()));
+        Ok((rest, TokenTree::Literal(repr)))
+    } else {
+        Err(Reject)
+    }
+}
+
+fn ident(input: Cursor) -> PResult<crate::Ident> {
+    if [
+        "r\"", "r#\"", "r##", "b\"", "b\'", "br\"", "br#", "c\"", "cr\"", "cr#",
+    ]
+    .iter()
+    .any(|prefix| input.starts_with(prefix))
+    {
+        Err(Reject)
+    } else {
+        ident_any(input)
+    }
+}
+
+fn ident_any(input: Cursor) -> PResult<crate::Ident> {
+    let raw = input.starts_with("r#");
+    let rest = input.advance((raw as usize) << 1);
+
+    let (rest, sym) = ident_not_raw(rest)?;
+
+    if !raw {
+        let ident = crate::Ident::_new(crate::imp::Ident::new_unchecked(
+            sym,
+            fallback::Span::call_site(),
+        ));
+        return Ok((rest, ident));
+    }
+
+    match sym {
+        "_" | "super" | "self" | "Self" | "crate" => return Err(Reject),
+        _ => {}
+    }
+
+    let ident = crate::Ident::_new(crate::imp::Ident::new_raw_unchecked(
+        sym,
+        fallback::Span::call_site(),
+    ));
+    Ok((rest, ident))
+}
+
+fn ident_not_raw(input: Cursor) -> PResult<&str> {
+    let mut chars = input.char_indices();
+
+    match chars.next() {
+        Some((_, ch)) if is_ident_start(ch) => {}
+        _ => return Err(Reject),
+    }
+
+    let mut end = input.len();
+    for (i, ch) in chars {
+        if !is_ident_continue(ch) {
+            end = i;
+            break;
+        }
+    }
+
+    Ok((input.advance(end), &input.rest[..end]))
+}
+
+pub(crate) fn literal(input: Cursor) -> PResult<Literal> {
+    let rest = literal_nocapture(input)?;
+    let end = input.len() - rest.len();
+    Ok((rest, Literal::_new(input.rest[..end].to_string())))
+}
+
+fn literal_nocapture(input: Cursor) -> Result<Cursor, Reject> {
+    if let Ok(ok) = string(input) {
+        Ok(ok)
+    } else if let Ok(ok) = byte_string(input) {
+        Ok(ok)
+    } else if let Ok(ok) = c_string(input) {
+        Ok(ok)
+    } else if let Ok(ok) = byte(input) {
+        Ok(ok)
+    } else if let Ok(ok) = character(input) {
+        Ok(ok)
+    } else if let Ok(ok) = float(input) {
+        Ok(ok)
+    } else if let Ok(ok) = int(input) {
+        Ok(ok)
+    } else {
+        Err(Reject)
+    }
+}
+
+fn literal_suffix(input: Cursor) -> Cursor {
+    match ident_not_raw(input) {
+        Ok((input, _)) => input,
+        Err(Reject) => input,
+    }
+}
+
+fn string(input: Cursor) -> Result<Cursor, Reject> {
+    if let Ok(input) = input.parse("\"") {
+        cooked_string(input)
+    } else if let Ok(input) = input.parse("r") {
+        raw_string(input)
+    } else {
+        Err(Reject)
+    }
+}
+
+fn cooked_string(mut input: Cursor) -> Result<Cursor, Reject> {
+    let mut chars = input.char_indices();
+
+    while let Some((i, ch)) = chars.next() {
+        match ch {
+            '"' => {
+                let input = input.advance(i + 1);
+                return Ok(literal_suffix(input));
+            }
+            '\r' => match chars.next() {
+                Some((_, '\n')) => {}
+                _ => break,
+            },
+            '\\' => match chars.next() {
+                Some((_, 'x')) => {
+                    backslash_x_char(&mut chars)?;
+                }
+                Some((_, 'n' | 'r' | 't' | '\\' | '\'' | '"' | '0')) => {}
+                Some((_, 'u')) => {
+                    backslash_u(&mut chars)?;
+                }
+                Some((newline, ch @ ('\n' | '\r'))) => {
+                    input = input.advance(newline + 1);
+                    trailing_backslash(&mut input, ch as u8)?;
+                    chars = input.char_indices();
+                }
+                _ => break,
+            },
+            _ch => {}
+        }
+    }
+    Err(Reject)
+}
+
+fn raw_string(input: Cursor) -> Result<Cursor, Reject> {
+    let (input, delimiter) = delimiter_of_raw_string(input)?;
+    let mut bytes = input.bytes().enumerate();
+    while let Some((i, byte)) = bytes.next() {
+        match byte {
+            b'"' if input.rest[i + 1..].starts_with(delimiter) => {
+                let rest = input.advance(i + 1 + delimiter.len());
+                return Ok(literal_suffix(rest));
+            }
+            b'\r' => match bytes.next() {
+                Some((_, b'\n')) => {}
+                _ => break,
+            },
+            _ => {}
+        }
+    }
+    Err(Reject)
+}
+
+fn byte_string(input: Cursor) -> Result<Cursor, Reject> {
+    if let Ok(input) = input.parse("b\"") {
+        cooked_byte_string(input)
+    } else if let Ok(input) = input.parse("br") {
+        raw_byte_string(input)
+    } else {
+        Err(Reject)
+    }
+}
+
+fn cooked_byte_string(mut input: Cursor) -> Result<Cursor, Reject> {
+    let mut bytes = input.bytes().enumerate();
+    while let Some((offset, b)) = bytes.next() {
+        match b {
+            b'"' => {
+                let input = input.advance(offset + 1);
+                return Ok(literal_suffix(input));
+            }
+            b'\r' => match bytes.next() {
+                Some((_, b'\n')) => {}
+                _ => break,
+            },
+            b'\\' => match bytes.next() {
+                Some((_, b'x')) => {
+                    backslash_x_byte(&mut bytes)?;
+                }
+                Some((_, b'n' | b'r' | b't' | b'\\' | b'0' | b'\'' | b'"')) => {}
+                Some((newline, b @ (b'\n' | b'\r'))) => {
+                    input = input.advance(newline + 1);
+                    trailing_backslash(&mut input, b)?;
+                    bytes = input.bytes().enumerate();
+                }
+                _ => break,
+            },
+            b if b.is_ascii() => {}
+            _ => break,
+        }
+    }
+    Err(Reject)
+}
+
+fn delimiter_of_raw_string(input: Cursor) -> PResult<&str> {
+    for (i, byte) in input.bytes().enumerate() {
+        match byte {
+            b'"' => {
+                if i > 255 {
+                    // https://github.com/rust-lang/rust/pull/95251
+                    return Err(Reject);
+                }
+                return Ok((input.advance(i + 1), &input.rest[..i]));
+            }
+            b'#' => {}
+            _ => break,
+        }
+    }
+    Err(Reject)
+}
+
+fn raw_byte_string(input: Cursor) -> Result<Cursor, Reject> {
+    let (input, delimiter) = delimiter_of_raw_string(input)?;
+    let mut bytes = input.bytes().enumerate();
+    while let Some((i, byte)) = bytes.next() {
+        match byte {
+            b'"' if input.rest[i + 1..].starts_with(delimiter) => {
+                let rest = input.advance(i + 1 + delimiter.len());
+                return Ok(literal_suffix(rest));
+            }
+            b'\r' => match bytes.next() {
+                Some((_, b'\n')) => {}
+                _ => break,
+            },
+            other => {
+                if !other.is_ascii() {
+                    break;
+                }
+            }
+        }
+    }
+    Err(Reject)
+}
+
+fn c_string(input: Cursor) -> Result<Cursor, Reject> {
+    if let Ok(input) = input.parse("c\"") {
+        cooked_c_string(input)
+    } else if let Ok(input) = input.parse("cr") {
+        raw_c_string(input)
+    } else {
+        Err(Reject)
+    }
+}
+
+fn raw_c_string(input: Cursor) -> Result<Cursor, Reject> {
+    let (input, delimiter) = delimiter_of_raw_string(input)?;
+    let mut bytes = input.bytes().enumerate();
+    while let Some((i, byte)) = bytes.next() {
+        match byte {
+            b'"' if input.rest[i + 1..].starts_with(delimiter) => {
+                let rest = input.advance(i + 1 + delimiter.len());
+                return Ok(literal_suffix(rest));
+            }
+            b'\r' => match bytes.next() {
+                Some((_, b'\n')) => {}
+                _ => break,
+            },
+            b'\0' => break,
+            _ => {}
+        }
+    }
+    Err(Reject)
+}
+
+fn cooked_c_string(mut input: Cursor) -> Result<Cursor, Reject> {
+    let mut chars = input.char_indices();
+
+    while let Some((i, ch)) = chars.next() {
+        match ch {
+            '"' => {
+                let input = input.advance(i + 1);
+                return Ok(literal_suffix(input));
+            }
+            '\r' => match chars.next() {
+                Some((_, '\n')) => {}
+                _ => break,
+            },
+            '\\' => match chars.next() {
+                Some((_, 'x')) => {
+                    backslash_x_nonzero(&mut chars)?;
+                }
+                Some((_, 'n' | 'r' | 't' | '\\' | '\'' | '"')) => {}
+                Some((_, 'u')) => {
+                    if backslash_u(&mut chars)? == '\0' {
+                        break;
+                    }
+                }
+                Some((newline, ch @ ('\n' | '\r'))) => {
+                    input = input.advance(newline + 1);
+                    trailing_backslash(&mut input, ch as u8)?;
+                    chars = input.char_indices();
+                }
+                _ => break,
+            },
+            '\0' => break,
+            _ch => {}
+        }
+    }
+    Err(Reject)
+}
+
+fn byte(input: Cursor) -> Result<Cursor, Reject> {
+    let input = input.parse("b'")?;
+    let mut bytes = input.bytes().enumerate();
+    let ok = match bytes.next().map(|(_, b)| b) {
+        Some(b'\\') => match bytes.next().map(|(_, b)| b) {
+            Some(b'x') => backslash_x_byte(&mut bytes).is_ok(),
+            Some(b'n' | b'r' | b't' | b'\\' | b'0' | b'\'' | b'"') => true,
+            _ => false,
+        },
+        b => b.is_some(),
+    };
+    if !ok {
+        return Err(Reject);
+    }
+    let (offset, _) = bytes.next().ok_or(Reject)?;
+    if !input.chars().as_str().is_char_boundary(offset) {
+        return Err(Reject);
+    }
+    let input = input.advance(offset).parse("'")?;
+    Ok(literal_suffix(input))
+}
+
+fn character(input: Cursor) -> Result<Cursor, Reject> {
+    let input = input.parse("'")?;
+    let mut chars = input.char_indices();
+    let ok = match chars.next().map(|(_, ch)| ch) {
+        Some('\\') => match chars.next().map(|(_, ch)| ch) {
+            Some('x') => backslash_x_char(&mut chars).is_ok(),
+            Some('u') => backslash_u(&mut chars).is_ok(),
+            Some('n' | 'r' | 't' | '\\' | '0' | '\'' | '"') => true,
+            _ => false,
+        },
+        ch => ch.is_some(),
+    };
+    if !ok {
+        return Err(Reject);
+    }
+    let (idx, _) = chars.next().ok_or(Reject)?;
+    let input = input.advance(idx).parse("'")?;
+    Ok(literal_suffix(input))
+}
+
+macro_rules! next_ch {
+    ($chars:ident @ $pat:pat) => {
+        match $chars.next() {
+            Some((_, ch)) => match ch {
+                $pat => ch,
+                _ => return Err(Reject),
+            },
+            None => return Err(Reject),
+        }
+    };
+}
+
+fn backslash_x_char<I>(chars: &mut I) -> Result<(), Reject>
+where
+    I: Iterator<Item = (usize, char)>,
+{
+    next_ch!(chars @ '0'..='7');
+    next_ch!(chars @ '0'..='9' | 'a'..='f' | 'A'..='F');
+    Ok(())
+}
+
+fn backslash_x_byte<I>(chars: &mut I) -> Result<(), Reject>
+where
+    I: Iterator<Item = (usize, u8)>,
+{
+    next_ch!(chars @ b'0'..=b'9' | b'a'..=b'f' | b'A'..=b'F');
+    next_ch!(chars @ b'0'..=b'9' | b'a'..=b'f' | b'A'..=b'F');
+    Ok(())
+}
+
+fn backslash_x_nonzero<I>(chars: &mut I) -> Result<(), Reject>
+where
+    I: Iterator<Item = (usize, char)>,
+{
+    let first = next_ch!(chars @ '0'..='9' | 'a'..='f' | 'A'..='F');
+    let second = next_ch!(chars @ '0'..='9' | 'a'..='f' | 'A'..='F');
+    if first == '0' && second == '0' {
+        Err(Reject)
+    } else {
+        Ok(())
+    }
+}
+
+fn backslash_u<I>(chars: &mut I) -> Result<char, Reject>
+where
+    I: Iterator<Item = (usize, char)>,
+{
+    next_ch!(chars @ '{');
+    let mut value = 0;
+    let mut len = 0;
+    for (_, ch) in chars {
+        let digit = match ch {
+            '0'..='9' => ch as u8 - b'0',
+            'a'..='f' => 10 + ch as u8 - b'a',
+            'A'..='F' => 10 + ch as u8 - b'A',
+            '_' if len > 0 => continue,
+            '}' if len > 0 => return char::from_u32(value).ok_or(Reject),
+            _ => break,
+        };
+        if len == 6 {
+            break;
+        }
+        value *= 0x10;
+        value += u32::from(digit);
+        len += 1;
+    }
+    Err(Reject)
+}
+
+fn trailing_backslash(input: &mut Cursor, mut last: u8) -> Result<(), Reject> {
+    let mut whitespace = input.bytes().enumerate();
+    loop {
+        if last == b'\r' && whitespace.next().map_or(true, |(_, b)| b != b'\n') {
+            return Err(Reject);
+        }
+        match whitespace.next() {
+            Some((_, b @ (b' ' | b'\t' | b'\n' | b'\r'))) => {
+                last = b;
+            }
+            Some((offset, _)) => {
+                *input = input.advance(offset);
+                return Ok(());
+            }
+            None => return Err(Reject),
+        }
+    }
+}
+
+fn float(input: Cursor) -> Result<Cursor, Reject> {
+    let mut rest = float_digits(input)?;
+    if let Some(ch) = rest.chars().next() {
+        if is_ident_start(ch) {
+            rest = ident_not_raw(rest)?.0;
+        }
+    }
+    word_break(rest)
+}
+
+fn float_digits(input: Cursor) -> Result<Cursor, Reject> {
+    let mut chars = input.chars().peekable();
+    match chars.next() {
+        Some(ch) if '0' <= ch && ch <= '9' => {}
+        _ => return Err(Reject),
+    }
+
+    let mut len = 1;
+    let mut has_dot = false;
+    let mut has_exp = false;
+    while let Some(&ch) = chars.peek() {
+        match ch {
+            '0'..='9' | '_' => {
+                chars.next();
+                len += 1;
+            }
+            '.' => {
+                if has_dot {
+                    break;
+                }
+                chars.next();
+                if chars
+                    .peek()
+                    .map_or(false, |&ch| ch == '.' || is_ident_start(ch))
+                {
+                    return Err(Reject);
+                }
+                len += 1;
+                has_dot = true;
+            }
+            'e' | 'E' => {
+                chars.next();
+                len += 1;
+                has_exp = true;
+                break;
+            }
+            _ => break,
+        }
+    }
+
+    if !(has_dot || has_exp) {
+        return Err(Reject);
+    }
+
+    if has_exp {
+        let token_before_exp = if has_dot {
+            Ok(input.advance(len - 1))
+        } else {
+            Err(Reject)
+        };
+        let mut has_sign = false;
+        let mut has_exp_value = false;
+        while let Some(&ch) = chars.peek() {
+            match ch {
+                '+' | '-' => {
+                    if has_exp_value {
+                        break;
+                    }
+                    if has_sign {
+                        return token_before_exp;
+                    }
+                    chars.next();
+                    len += 1;
+                    has_sign = true;
+                }
+                '0'..='9' => {
+                    chars.next();
+                    len += 1;
+                    has_exp_value = true;
+                }
+                '_' => {
+                    chars.next();
+                    len += 1;
+                }
+                _ => break,
+            }
+        }
+        if !has_exp_value {
+            return token_before_exp;
+        }
+    }
+
+    Ok(input.advance(len))
+}
+
+fn int(input: Cursor) -> Result<Cursor, Reject> {
+    let mut rest = digits(input)?;
+    if let Some(ch) = rest.chars().next() {
+        if is_ident_start(ch) {
+            rest = ident_not_raw(rest)?.0;
+        }
+    }
+    word_break(rest)
+}
+
+fn digits(mut input: Cursor) -> Result<Cursor, Reject> {
+    let base = if input.starts_with("0x") {
+        input = input.advance(2);
+        16
+    } else if input.starts_with("0o") {
+        input = input.advance(2);
+        8
+    } else if input.starts_with("0b") {
+        input = input.advance(2);
+        2
+    } else {
+        10
+    };
+
+    let mut len = 0;
+    let mut empty = true;
+    for b in input.bytes() {
+        match b {
+            b'0'..=b'9' => {
+                let digit = (b - b'0') as u64;
+                if digit >= base {
+                    return Err(Reject);
+                }
+            }
+            b'a'..=b'f' => {
+                let digit = 10 + (b - b'a') as u64;
+                if digit >= base {
+                    break;
+                }
+            }
+            b'A'..=b'F' => {
+                let digit = 10 + (b - b'A') as u64;
+                if digit >= base {
+                    break;
+                }
+            }
+            b'_' => {
+                if empty && base == 10 {
+                    return Err(Reject);
+                }
+                len += 1;
+                continue;
+            }
+            _ => break,
+        };
+        len += 1;
+        empty = false;
+    }
+    if empty {
+        Err(Reject)
+    } else {
+        Ok(input.advance(len))
+    }
+}
+
+fn punct(input: Cursor) -> PResult<Punct> {
+    let (rest, ch) = punct_char(input)?;
+    if ch == '\'' {
+        if ident_any(rest)?.0.starts_with_char('\'') {
+            Err(Reject)
+        } else {
+            Ok((rest, Punct::new('\'', Spacing::Joint)))
+        }
+    } else {
+        let kind = match punct_char(rest) {
+            Ok(_) => Spacing::Joint,
+            Err(Reject) => Spacing::Alone,
+        };
+        Ok((rest, Punct::new(ch, kind)))
+    }
+}
+
+fn punct_char(input: Cursor) -> PResult<char> {
+    if input.starts_with("//") || input.starts_with("/*") {
+        // Do not accept `/` of a comment as a punct.
+        return Err(Reject);
+    }
+
+    let mut chars = input.chars();
+    let first = match chars.next() {
+        Some(ch) => ch,
+        None => {
+            return Err(Reject);
+        }
+    };
+    let recognized = "~!@#$%^&*-=+|;:,<.>/?'";
+    if recognized.contains(first) {
+        Ok((input.advance(first.len_utf8()), first))
+    } else {
+        Err(Reject)
+    }
+}
+
+fn doc_comment<'a>(input: Cursor<'a>, trees: &mut TokenStreamBuilder) -> PResult<'a, ()> {
+    #[cfg(span_locations)]
+    let lo = input.off;
+    let (rest, (comment, inner)) = doc_comment_contents(input)?;
+    let fallback_span = Span {
+        #[cfg(span_locations)]
+        lo,
+        #[cfg(span_locations)]
+        hi: rest.off,
+    };
+    let span = crate::Span::_new_fallback(fallback_span);
+
+    let mut scan_for_bare_cr = comment;
+    while let Some(cr) = scan_for_bare_cr.find('\r') {
+        let rest = &scan_for_bare_cr[cr + 1..];
+        if !rest.starts_with('\n') {
+            return Err(Reject);
+        }
+        scan_for_bare_cr = rest;
+    }
+
+    let mut pound = Punct::new('#', Spacing::Alone);
+    pound.set_span(span);
+    trees.push_token_from_parser(TokenTree::Punct(pound));
+
+    if inner {
+        let mut bang = Punct::new('!', Spacing::Alone);
+        bang.set_span(span);
+        trees.push_token_from_parser(TokenTree::Punct(bang));
+    }
+
+    let doc_ident = crate::Ident::_new(crate::imp::Ident::new_unchecked("doc", fallback_span));
+    let mut equal = Punct::new('=', Spacing::Alone);
+    equal.set_span(span);
+    let mut literal = crate::Literal::string(comment);
+    literal.set_span(span);
+    let mut bracketed = TokenStreamBuilder::with_capacity(3);
+    bracketed.push_token_from_parser(TokenTree::Ident(doc_ident));
+    bracketed.push_token_from_parser(TokenTree::Punct(equal));
+    bracketed.push_token_from_parser(TokenTree::Literal(literal));
+    let group = Group::new(Delimiter::Bracket, bracketed.build());
+    let mut group = crate::Group::_new_fallback(group);
+    group.set_span(span);
+    trees.push_token_from_parser(TokenTree::Group(group));
+
+    Ok((rest, ()))
+}
+
+fn doc_comment_contents(input: Cursor) -> PResult<(&str, bool)> {
+    if input.starts_with("//!") {
+        let input = input.advance(3);
+        let (input, s) = take_until_newline_or_eof(input);
+        Ok((input, (s, true)))
+    } else if input.starts_with("/*!") {
+        let (input, s) = block_comment(input)?;
+        Ok((input, (&s[3..s.len() - 2], true)))
+    } else if input.starts_with("///") {
+        let input = input.advance(3);
+        if input.starts_with_char('/') {
+            return Err(Reject);
+        }
+        let (input, s) = take_until_newline_or_eof(input);
+        Ok((input, (s, false)))
+    } else if input.starts_with("/**") && !input.rest[3..].starts_with('*') {
+        let (input, s) = block_comment(input)?;
+        Ok((input, (&s[3..s.len() - 2], false)))
+    } else {
+        Err(Reject)
+    }
+}
+
+fn take_until_newline_or_eof(input: Cursor) -> (Cursor, &str) {
+    let chars = input.char_indices();
+
+    for (i, ch) in chars {
+        if ch == '\n' {
+            return (input.advance(i), &input.rest[..i]);
+        } else if ch == '\r' && input.rest[i + 1..].starts_with('\n') {
+            return (input.advance(i + 1), &input.rest[..i]);
+        }
+    }
+
+    (input.advance(input.len()), input.rest)
+}
+
\ No newline at end of file diff --git a/src/proc_macro2/rcvec.rs.html b/src/proc_macro2/rcvec.rs.html new file mode 100644 index 0000000..8d690de --- /dev/null +++ b/src/proc_macro2/rcvec.rs.html @@ -0,0 +1,291 @@ +rcvec.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+
use alloc::rc::Rc;
+use alloc::vec;
+use core::mem;
+use core::panic::RefUnwindSafe;
+use core::slice;
+
+pub(crate) struct RcVec<T> {
+    inner: Rc<Vec<T>>,
+}
+
+pub(crate) struct RcVecBuilder<T> {
+    inner: Vec<T>,
+}
+
+pub(crate) struct RcVecMut<'a, T> {
+    inner: &'a mut Vec<T>,
+}
+
+#[derive(Clone)]
+pub(crate) struct RcVecIntoIter<T> {
+    inner: vec::IntoIter<T>,
+}
+
+impl<T> RcVec<T> {
+    pub fn is_empty(&self) -> bool {
+        self.inner.is_empty()
+    }
+
+    pub fn len(&self) -> usize {
+        self.inner.len()
+    }
+
+    pub fn iter(&self) -> slice::Iter<T> {
+        self.inner.iter()
+    }
+
+    pub fn make_mut(&mut self) -> RcVecMut<T>
+    where
+        T: Clone,
+    {
+        RcVecMut {
+            inner: Rc::make_mut(&mut self.inner),
+        }
+    }
+
+    pub fn get_mut(&mut self) -> Option<RcVecMut<T>> {
+        let inner = Rc::get_mut(&mut self.inner)?;
+        Some(RcVecMut { inner })
+    }
+
+    pub fn make_owned(mut self) -> RcVecBuilder<T>
+    where
+        T: Clone,
+    {
+        let vec = if let Some(owned) = Rc::get_mut(&mut self.inner) {
+            mem::take(owned)
+        } else {
+            Vec::clone(&self.inner)
+        };
+        RcVecBuilder { inner: vec }
+    }
+}
+
+impl<T> RcVecBuilder<T> {
+    pub fn new() -> Self {
+        RcVecBuilder { inner: Vec::new() }
+    }
+
+    pub fn with_capacity(cap: usize) -> Self {
+        RcVecBuilder {
+            inner: Vec::with_capacity(cap),
+        }
+    }
+
+    pub fn push(&mut self, element: T) {
+        self.inner.push(element);
+    }
+
+    pub fn extend(&mut self, iter: impl IntoIterator<Item = T>) {
+        self.inner.extend(iter);
+    }
+
+    pub fn as_mut(&mut self) -> RcVecMut<T> {
+        RcVecMut {
+            inner: &mut self.inner,
+        }
+    }
+
+    pub fn build(self) -> RcVec<T> {
+        RcVec {
+            inner: Rc::new(self.inner),
+        }
+    }
+}
+
+impl<'a, T> RcVecMut<'a, T> {
+    pub fn push(&mut self, element: T) {
+        self.inner.push(element);
+    }
+
+    pub fn extend(&mut self, iter: impl IntoIterator<Item = T>) {
+        self.inner.extend(iter);
+    }
+
+    pub fn pop(&mut self) -> Option<T> {
+        self.inner.pop()
+    }
+
+    pub fn as_mut(&mut self) -> RcVecMut<T> {
+        RcVecMut { inner: self.inner }
+    }
+}
+
+impl<T> Clone for RcVec<T> {
+    fn clone(&self) -> Self {
+        RcVec {
+            inner: Rc::clone(&self.inner),
+        }
+    }
+}
+
+impl<T> IntoIterator for RcVecBuilder<T> {
+    type Item = T;
+    type IntoIter = RcVecIntoIter<T>;
+
+    fn into_iter(self) -> Self::IntoIter {
+        RcVecIntoIter {
+            inner: self.inner.into_iter(),
+        }
+    }
+}
+
+impl<T> Iterator for RcVecIntoIter<T> {
+    type Item = T;
+
+    fn next(&mut self) -> Option<Self::Item> {
+        self.inner.next()
+    }
+
+    fn size_hint(&self) -> (usize, Option<usize>) {
+        self.inner.size_hint()
+    }
+}
+
+impl<T> RefUnwindSafe for RcVec<T> where T: RefUnwindSafe {}
+
\ No newline at end of file diff --git a/src/proc_macro2/wrapper.rs.html b/src/proc_macro2/wrapper.rs.html new file mode 100644 index 0000000..762ac8b --- /dev/null +++ b/src/proc_macro2/wrapper.rs.html @@ -0,0 +1,1987 @@ +wrapper.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+753
+754
+755
+756
+757
+758
+759
+760
+761
+762
+763
+764
+765
+766
+767
+768
+769
+770
+771
+772
+773
+774
+775
+776
+777
+778
+779
+780
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+794
+795
+796
+797
+798
+799
+800
+801
+802
+803
+804
+805
+806
+807
+808
+809
+810
+811
+812
+813
+814
+815
+816
+817
+818
+819
+820
+821
+822
+823
+824
+825
+826
+827
+828
+829
+830
+831
+832
+833
+834
+835
+836
+837
+838
+839
+840
+841
+842
+843
+844
+845
+846
+847
+848
+849
+850
+851
+852
+853
+854
+855
+856
+857
+858
+859
+860
+861
+862
+863
+864
+865
+866
+867
+868
+869
+870
+871
+872
+873
+874
+875
+876
+877
+878
+879
+880
+881
+882
+883
+884
+885
+886
+887
+888
+889
+890
+891
+892
+893
+894
+895
+896
+897
+898
+899
+900
+901
+902
+903
+904
+905
+906
+907
+908
+909
+910
+911
+912
+913
+914
+915
+916
+917
+918
+919
+920
+921
+922
+923
+924
+925
+926
+927
+928
+929
+930
+931
+932
+933
+934
+935
+936
+937
+938
+939
+940
+941
+942
+943
+944
+945
+946
+947
+948
+949
+950
+951
+952
+953
+954
+955
+956
+957
+958
+959
+960
+961
+962
+963
+964
+965
+966
+967
+968
+969
+970
+971
+972
+973
+974
+975
+976
+977
+978
+979
+980
+981
+982
+983
+984
+985
+986
+987
+988
+989
+990
+991
+992
+993
+
use crate::detection::inside_proc_macro;
+#[cfg(span_locations)]
+use crate::location::LineColumn;
+use crate::{fallback, Delimiter, Punct, Spacing, TokenTree};
+use core::fmt::{self, Debug, Display};
+#[cfg(span_locations)]
+use core::ops::Range;
+use core::ops::RangeBounds;
+use core::str::FromStr;
+use std::ffi::CStr;
+use std::panic;
+#[cfg(super_unstable)]
+use std::path::PathBuf;
+
+#[derive(Clone)]
+pub(crate) enum TokenStream {
+    Compiler(DeferredTokenStream),
+    Fallback(fallback::TokenStream),
+}
+
+// Work around https://github.com/rust-lang/rust/issues/65080.
+// In `impl Extend<TokenTree> for TokenStream` which is used heavily by quote,
+// we hold on to the appended tokens and do proc_macro::TokenStream::extend as
+// late as possible to batch together consecutive uses of the Extend impl.
+#[derive(Clone)]
+pub(crate) struct DeferredTokenStream {
+    stream: proc_macro::TokenStream,
+    extra: Vec<proc_macro::TokenTree>,
+}
+
+pub(crate) enum LexError {
+    Compiler(proc_macro::LexError),
+    Fallback(fallback::LexError),
+
+    // Rustc was supposed to return a LexError, but it panicked instead.
+    // https://github.com/rust-lang/rust/issues/58736
+    CompilerPanic,
+}
+
+#[cold]
+fn mismatch(line: u32) -> ! {
+    #[cfg(procmacro2_backtrace)]
+    {
+        let backtrace = std::backtrace::Backtrace::force_capture();
+        panic!("compiler/fallback mismatch #{}\n\n{}", line, backtrace)
+    }
+    #[cfg(not(procmacro2_backtrace))]
+    {
+        panic!("compiler/fallback mismatch #{}", line)
+    }
+}
+
+impl DeferredTokenStream {
+    fn new(stream: proc_macro::TokenStream) -> Self {
+        DeferredTokenStream {
+            stream,
+            extra: Vec::new(),
+        }
+    }
+
+    fn is_empty(&self) -> bool {
+        self.stream.is_empty() && self.extra.is_empty()
+    }
+
+    fn evaluate_now(&mut self) {
+        // If-check provides a fast short circuit for the common case of `extra`
+        // being empty, which saves a round trip over the proc macro bridge.
+        // Improves macro expansion time in winrt by 6% in debug mode.
+        if !self.extra.is_empty() {
+            self.stream.extend(self.extra.drain(..));
+        }
+    }
+
+    fn into_token_stream(mut self) -> proc_macro::TokenStream {
+        self.evaluate_now();
+        self.stream
+    }
+}
+
+impl TokenStream {
+    pub fn new() -> Self {
+        if inside_proc_macro() {
+            TokenStream::Compiler(DeferredTokenStream::new(proc_macro::TokenStream::new()))
+        } else {
+            TokenStream::Fallback(fallback::TokenStream::new())
+        }
+    }
+
+    pub fn is_empty(&self) -> bool {
+        match self {
+            TokenStream::Compiler(tts) => tts.is_empty(),
+            TokenStream::Fallback(tts) => tts.is_empty(),
+        }
+    }
+
+    fn unwrap_nightly(self) -> proc_macro::TokenStream {
+        match self {
+            TokenStream::Compiler(s) => s.into_token_stream(),
+            TokenStream::Fallback(_) => mismatch(line!()),
+        }
+    }
+
+    fn unwrap_stable(self) -> fallback::TokenStream {
+        match self {
+            TokenStream::Compiler(_) => mismatch(line!()),
+            TokenStream::Fallback(s) => s,
+        }
+    }
+}
+
+impl FromStr for TokenStream {
+    type Err = LexError;
+
+    fn from_str(src: &str) -> Result<TokenStream, LexError> {
+        if inside_proc_macro() {
+            Ok(TokenStream::Compiler(DeferredTokenStream::new(
+                proc_macro_parse(src)?,
+            )))
+        } else {
+            Ok(TokenStream::Fallback(src.parse()?))
+        }
+    }
+}
+
+// Work around https://github.com/rust-lang/rust/issues/58736.
+fn proc_macro_parse(src: &str) -> Result<proc_macro::TokenStream, LexError> {
+    let result = panic::catch_unwind(|| src.parse().map_err(LexError::Compiler));
+    result.unwrap_or_else(|_| Err(LexError::CompilerPanic))
+}
+
+impl Display for TokenStream {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        match self {
+            TokenStream::Compiler(tts) => Display::fmt(&tts.clone().into_token_stream(), f),
+            TokenStream::Fallback(tts) => Display::fmt(tts, f),
+        }
+    }
+}
+
+impl From<proc_macro::TokenStream> for TokenStream {
+    fn from(inner: proc_macro::TokenStream) -> Self {
+        TokenStream::Compiler(DeferredTokenStream::new(inner))
+    }
+}
+
+impl From<TokenStream> for proc_macro::TokenStream {
+    fn from(inner: TokenStream) -> Self {
+        match inner {
+            TokenStream::Compiler(inner) => inner.into_token_stream(),
+            TokenStream::Fallback(inner) => inner.to_string().parse().unwrap(),
+        }
+    }
+}
+
+impl From<fallback::TokenStream> for TokenStream {
+    fn from(inner: fallback::TokenStream) -> Self {
+        TokenStream::Fallback(inner)
+    }
+}
+
+// Assumes inside_proc_macro().
+fn into_compiler_token(token: TokenTree) -> proc_macro::TokenTree {
+    match token {
+        TokenTree::Group(tt) => tt.inner.unwrap_nightly().into(),
+        TokenTree::Punct(tt) => {
+            let spacing = match tt.spacing() {
+                Spacing::Joint => proc_macro::Spacing::Joint,
+                Spacing::Alone => proc_macro::Spacing::Alone,
+            };
+            let mut punct = proc_macro::Punct::new(tt.as_char(), spacing);
+            punct.set_span(tt.span().inner.unwrap_nightly());
+            punct.into()
+        }
+        TokenTree::Ident(tt) => tt.inner.unwrap_nightly().into(),
+        TokenTree::Literal(tt) => tt.inner.unwrap_nightly().into(),
+    }
+}
+
+impl From<TokenTree> for TokenStream {
+    fn from(token: TokenTree) -> Self {
+        if inside_proc_macro() {
+            TokenStream::Compiler(DeferredTokenStream::new(into_compiler_token(token).into()))
+        } else {
+            TokenStream::Fallback(token.into())
+        }
+    }
+}
+
+impl FromIterator<TokenTree> for TokenStream {
+    fn from_iter<I: IntoIterator<Item = TokenTree>>(trees: I) -> Self {
+        if inside_proc_macro() {
+            TokenStream::Compiler(DeferredTokenStream::new(
+                trees.into_iter().map(into_compiler_token).collect(),
+            ))
+        } else {
+            TokenStream::Fallback(trees.into_iter().collect())
+        }
+    }
+}
+
+impl FromIterator<TokenStream> for TokenStream {
+    fn from_iter<I: IntoIterator<Item = TokenStream>>(streams: I) -> Self {
+        let mut streams = streams.into_iter();
+        match streams.next() {
+            Some(TokenStream::Compiler(mut first)) => {
+                first.evaluate_now();
+                first.stream.extend(streams.map(|s| match s {
+                    TokenStream::Compiler(s) => s.into_token_stream(),
+                    TokenStream::Fallback(_) => mismatch(line!()),
+                }));
+                TokenStream::Compiler(first)
+            }
+            Some(TokenStream::Fallback(mut first)) => {
+                first.extend(streams.map(|s| match s {
+                    TokenStream::Fallback(s) => s,
+                    TokenStream::Compiler(_) => mismatch(line!()),
+                }));
+                TokenStream::Fallback(first)
+            }
+            None => TokenStream::new(),
+        }
+    }
+}
+
+impl Extend<TokenTree> for TokenStream {
+    fn extend<I: IntoIterator<Item = TokenTree>>(&mut self, stream: I) {
+        match self {
+            TokenStream::Compiler(tts) => {
+                // Here is the reason for DeferredTokenStream.
+                for token in stream {
+                    tts.extra.push(into_compiler_token(token));
+                }
+            }
+            TokenStream::Fallback(tts) => tts.extend(stream),
+        }
+    }
+}
+
+impl Extend<TokenStream> for TokenStream {
+    fn extend<I: IntoIterator<Item = TokenStream>>(&mut self, streams: I) {
+        match self {
+            TokenStream::Compiler(tts) => {
+                tts.evaluate_now();
+                tts.stream
+                    .extend(streams.into_iter().map(TokenStream::unwrap_nightly));
+            }
+            TokenStream::Fallback(tts) => {
+                tts.extend(streams.into_iter().map(TokenStream::unwrap_stable));
+            }
+        }
+    }
+}
+
+impl Debug for TokenStream {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        match self {
+            TokenStream::Compiler(tts) => Debug::fmt(&tts.clone().into_token_stream(), f),
+            TokenStream::Fallback(tts) => Debug::fmt(tts, f),
+        }
+    }
+}
+
+impl LexError {
+    pub(crate) fn span(&self) -> Span {
+        match self {
+            LexError::Compiler(_) | LexError::CompilerPanic => Span::call_site(),
+            LexError::Fallback(e) => Span::Fallback(e.span()),
+        }
+    }
+}
+
+impl From<proc_macro::LexError> for LexError {
+    fn from(e: proc_macro::LexError) -> Self {
+        LexError::Compiler(e)
+    }
+}
+
+impl From<fallback::LexError> for LexError {
+    fn from(e: fallback::LexError) -> Self {
+        LexError::Fallback(e)
+    }
+}
+
+impl Debug for LexError {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        match self {
+            LexError::Compiler(e) => Debug::fmt(e, f),
+            LexError::Fallback(e) => Debug::fmt(e, f),
+            LexError::CompilerPanic => {
+                let fallback = fallback::LexError::call_site();
+                Debug::fmt(&fallback, f)
+            }
+        }
+    }
+}
+
+impl Display for LexError {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        match self {
+            LexError::Compiler(e) => Display::fmt(e, f),
+            LexError::Fallback(e) => Display::fmt(e, f),
+            LexError::CompilerPanic => {
+                let fallback = fallback::LexError::call_site();
+                Display::fmt(&fallback, f)
+            }
+        }
+    }
+}
+
+#[derive(Clone)]
+pub(crate) enum TokenTreeIter {
+    Compiler(proc_macro::token_stream::IntoIter),
+    Fallback(fallback::TokenTreeIter),
+}
+
+impl IntoIterator for TokenStream {
+    type Item = TokenTree;
+    type IntoIter = TokenTreeIter;
+
+    fn into_iter(self) -> TokenTreeIter {
+        match self {
+            TokenStream::Compiler(tts) => {
+                TokenTreeIter::Compiler(tts.into_token_stream().into_iter())
+            }
+            TokenStream::Fallback(tts) => TokenTreeIter::Fallback(tts.into_iter()),
+        }
+    }
+}
+
+impl Iterator for TokenTreeIter {
+    type Item = TokenTree;
+
+    fn next(&mut self) -> Option<TokenTree> {
+        let token = match self {
+            TokenTreeIter::Compiler(iter) => iter.next()?,
+            TokenTreeIter::Fallback(iter) => return iter.next(),
+        };
+        Some(match token {
+            proc_macro::TokenTree::Group(tt) => crate::Group::_new(Group::Compiler(tt)).into(),
+            proc_macro::TokenTree::Punct(tt) => {
+                let spacing = match tt.spacing() {
+                    proc_macro::Spacing::Joint => Spacing::Joint,
+                    proc_macro::Spacing::Alone => Spacing::Alone,
+                };
+                let mut o = Punct::new(tt.as_char(), spacing);
+                o.set_span(crate::Span::_new(Span::Compiler(tt.span())));
+                o.into()
+            }
+            proc_macro::TokenTree::Ident(s) => crate::Ident::_new(Ident::Compiler(s)).into(),
+            proc_macro::TokenTree::Literal(l) => crate::Literal::_new(Literal::Compiler(l)).into(),
+        })
+    }
+
+    fn size_hint(&self) -> (usize, Option<usize>) {
+        match self {
+            TokenTreeIter::Compiler(tts) => tts.size_hint(),
+            TokenTreeIter::Fallback(tts) => tts.size_hint(),
+        }
+    }
+}
+
+#[derive(Clone, PartialEq, Eq)]
+#[cfg(super_unstable)]
+pub(crate) enum SourceFile {
+    Compiler(proc_macro::SourceFile),
+    Fallback(fallback::SourceFile),
+}
+
+#[cfg(super_unstable)]
+impl SourceFile {
+    fn nightly(sf: proc_macro::SourceFile) -> Self {
+        SourceFile::Compiler(sf)
+    }
+
+    /// Get the path to this source file as a string.
+    pub fn path(&self) -> PathBuf {
+        match self {
+            SourceFile::Compiler(a) => a.path(),
+            SourceFile::Fallback(a) => a.path(),
+        }
+    }
+
+    pub fn is_real(&self) -> bool {
+        match self {
+            SourceFile::Compiler(a) => a.is_real(),
+            SourceFile::Fallback(a) => a.is_real(),
+        }
+    }
+}
+
+#[cfg(super_unstable)]
+impl Debug for SourceFile {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        match self {
+            SourceFile::Compiler(a) => Debug::fmt(a, f),
+            SourceFile::Fallback(a) => Debug::fmt(a, f),
+        }
+    }
+}
+
+#[derive(Copy, Clone)]
+pub(crate) enum Span {
+    Compiler(proc_macro::Span),
+    Fallback(fallback::Span),
+}
+
+impl Span {
+    pub fn call_site() -> Self {
+        if inside_proc_macro() {
+            Span::Compiler(proc_macro::Span::call_site())
+        } else {
+            Span::Fallback(fallback::Span::call_site())
+        }
+    }
+
+    pub fn mixed_site() -> Self {
+        if inside_proc_macro() {
+            Span::Compiler(proc_macro::Span::mixed_site())
+        } else {
+            Span::Fallback(fallback::Span::mixed_site())
+        }
+    }
+
+    #[cfg(super_unstable)]
+    pub fn def_site() -> Self {
+        if inside_proc_macro() {
+            Span::Compiler(proc_macro::Span::def_site())
+        } else {
+            Span::Fallback(fallback::Span::def_site())
+        }
+    }
+
+    pub fn resolved_at(&self, other: Span) -> Span {
+        match (self, other) {
+            (Span::Compiler(a), Span::Compiler(b)) => Span::Compiler(a.resolved_at(b)),
+            (Span::Fallback(a), Span::Fallback(b)) => Span::Fallback(a.resolved_at(b)),
+            (Span::Compiler(_), Span::Fallback(_)) => mismatch(line!()),
+            (Span::Fallback(_), Span::Compiler(_)) => mismatch(line!()),
+        }
+    }
+
+    pub fn located_at(&self, other: Span) -> Span {
+        match (self, other) {
+            (Span::Compiler(a), Span::Compiler(b)) => Span::Compiler(a.located_at(b)),
+            (Span::Fallback(a), Span::Fallback(b)) => Span::Fallback(a.located_at(b)),
+            (Span::Compiler(_), Span::Fallback(_)) => mismatch(line!()),
+            (Span::Fallback(_), Span::Compiler(_)) => mismatch(line!()),
+        }
+    }
+
+    pub fn unwrap(self) -> proc_macro::Span {
+        match self {
+            Span::Compiler(s) => s,
+            Span::Fallback(_) => panic!("proc_macro::Span is only available in procedural macros"),
+        }
+    }
+
+    #[cfg(super_unstable)]
+    pub fn source_file(&self) -> SourceFile {
+        match self {
+            Span::Compiler(s) => SourceFile::nightly(s.source_file()),
+            Span::Fallback(s) => SourceFile::Fallback(s.source_file()),
+        }
+    }
+
+    #[cfg(span_locations)]
+    pub fn byte_range(&self) -> Range<usize> {
+        match self {
+            #[cfg(proc_macro_span)]
+            Span::Compiler(s) => s.byte_range(),
+            #[cfg(not(proc_macro_span))]
+            Span::Compiler(_) => 0..0,
+            Span::Fallback(s) => s.byte_range(),
+        }
+    }
+
+    #[cfg(span_locations)]
+    pub fn start(&self) -> LineColumn {
+        match self {
+            Span::Compiler(_) => LineColumn { line: 0, column: 0 },
+            Span::Fallback(s) => s.start(),
+        }
+    }
+
+    #[cfg(span_locations)]
+    pub fn end(&self) -> LineColumn {
+        match self {
+            Span::Compiler(_) => LineColumn { line: 0, column: 0 },
+            Span::Fallback(s) => s.end(),
+        }
+    }
+
+    pub fn join(&self, other: Span) -> Option<Span> {
+        let ret = match (self, other) {
+            #[cfg(proc_macro_span)]
+            (Span::Compiler(a), Span::Compiler(b)) => Span::Compiler(a.join(b)?),
+            (Span::Fallback(a), Span::Fallback(b)) => Span::Fallback(a.join(b)?),
+            _ => return None,
+        };
+        Some(ret)
+    }
+
+    #[cfg(super_unstable)]
+    pub fn eq(&self, other: &Span) -> bool {
+        match (self, other) {
+            (Span::Compiler(a), Span::Compiler(b)) => a.eq(b),
+            (Span::Fallback(a), Span::Fallback(b)) => a.eq(b),
+            _ => false,
+        }
+    }
+
+    pub fn source_text(&self) -> Option<String> {
+        match self {
+            #[cfg(not(no_source_text))]
+            Span::Compiler(s) => s.source_text(),
+            #[cfg(no_source_text)]
+            Span::Compiler(_) => None,
+            Span::Fallback(s) => s.source_text(),
+        }
+    }
+
+    fn unwrap_nightly(self) -> proc_macro::Span {
+        match self {
+            Span::Compiler(s) => s,
+            Span::Fallback(_) => mismatch(line!()),
+        }
+    }
+}
+
+impl From<proc_macro::Span> for crate::Span {
+    fn from(proc_span: proc_macro::Span) -> Self {
+        crate::Span::_new(Span::Compiler(proc_span))
+    }
+}
+
+impl From<fallback::Span> for Span {
+    fn from(inner: fallback::Span) -> Self {
+        Span::Fallback(inner)
+    }
+}
+
+impl Debug for Span {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        match self {
+            Span::Compiler(s) => Debug::fmt(s, f),
+            Span::Fallback(s) => Debug::fmt(s, f),
+        }
+    }
+}
+
+pub(crate) fn debug_span_field_if_nontrivial(debug: &mut fmt::DebugStruct, span: Span) {
+    match span {
+        Span::Compiler(s) => {
+            debug.field("span", &s);
+        }
+        Span::Fallback(s) => fallback::debug_span_field_if_nontrivial(debug, s),
+    }
+}
+
+#[derive(Clone)]
+pub(crate) enum Group {
+    Compiler(proc_macro::Group),
+    Fallback(fallback::Group),
+}
+
+impl Group {
+    pub fn new(delimiter: Delimiter, stream: TokenStream) -> Self {
+        match stream {
+            TokenStream::Compiler(tts) => {
+                let delimiter = match delimiter {
+                    Delimiter::Parenthesis => proc_macro::Delimiter::Parenthesis,
+                    Delimiter::Bracket => proc_macro::Delimiter::Bracket,
+                    Delimiter::Brace => proc_macro::Delimiter::Brace,
+                    Delimiter::None => proc_macro::Delimiter::None,
+                };
+                Group::Compiler(proc_macro::Group::new(delimiter, tts.into_token_stream()))
+            }
+            TokenStream::Fallback(stream) => {
+                Group::Fallback(fallback::Group::new(delimiter, stream))
+            }
+        }
+    }
+
+    pub fn delimiter(&self) -> Delimiter {
+        match self {
+            Group::Compiler(g) => match g.delimiter() {
+                proc_macro::Delimiter::Parenthesis => Delimiter::Parenthesis,
+                proc_macro::Delimiter::Bracket => Delimiter::Bracket,
+                proc_macro::Delimiter::Brace => Delimiter::Brace,
+                proc_macro::Delimiter::None => Delimiter::None,
+            },
+            Group::Fallback(g) => g.delimiter(),
+        }
+    }
+
+    pub fn stream(&self) -> TokenStream {
+        match self {
+            Group::Compiler(g) => TokenStream::Compiler(DeferredTokenStream::new(g.stream())),
+            Group::Fallback(g) => TokenStream::Fallback(g.stream()),
+        }
+    }
+
+    pub fn span(&self) -> Span {
+        match self {
+            Group::Compiler(g) => Span::Compiler(g.span()),
+            Group::Fallback(g) => Span::Fallback(g.span()),
+        }
+    }
+
+    pub fn span_open(&self) -> Span {
+        match self {
+            Group::Compiler(g) => Span::Compiler(g.span_open()),
+            Group::Fallback(g) => Span::Fallback(g.span_open()),
+        }
+    }
+
+    pub fn span_close(&self) -> Span {
+        match self {
+            Group::Compiler(g) => Span::Compiler(g.span_close()),
+            Group::Fallback(g) => Span::Fallback(g.span_close()),
+        }
+    }
+
+    pub fn set_span(&mut self, span: Span) {
+        match (self, span) {
+            (Group::Compiler(g), Span::Compiler(s)) => g.set_span(s),
+            (Group::Fallback(g), Span::Fallback(s)) => g.set_span(s),
+            (Group::Compiler(_), Span::Fallback(_)) => mismatch(line!()),
+            (Group::Fallback(_), Span::Compiler(_)) => mismatch(line!()),
+        }
+    }
+
+    fn unwrap_nightly(self) -> proc_macro::Group {
+        match self {
+            Group::Compiler(g) => g,
+            Group::Fallback(_) => mismatch(line!()),
+        }
+    }
+}
+
+impl From<fallback::Group> for Group {
+    fn from(g: fallback::Group) -> Self {
+        Group::Fallback(g)
+    }
+}
+
+impl Display for Group {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        match self {
+            Group::Compiler(group) => Display::fmt(group, formatter),
+            Group::Fallback(group) => Display::fmt(group, formatter),
+        }
+    }
+}
+
+impl Debug for Group {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        match self {
+            Group::Compiler(group) => Debug::fmt(group, formatter),
+            Group::Fallback(group) => Debug::fmt(group, formatter),
+        }
+    }
+}
+
+#[derive(Clone)]
+pub(crate) enum Ident {
+    Compiler(proc_macro::Ident),
+    Fallback(fallback::Ident),
+}
+
+impl Ident {
+    #[track_caller]
+    pub fn new_checked(string: &str, span: Span) -> Self {
+        match span {
+            Span::Compiler(s) => Ident::Compiler(proc_macro::Ident::new(string, s)),
+            Span::Fallback(s) => Ident::Fallback(fallback::Ident::new_checked(string, s)),
+        }
+    }
+
+    pub fn new_unchecked(string: &str, span: fallback::Span) -> Self {
+        Ident::Fallback(fallback::Ident::new_unchecked(string, span))
+    }
+
+    #[track_caller]
+    pub fn new_raw_checked(string: &str, span: Span) -> Self {
+        match span {
+            Span::Compiler(s) => Ident::Compiler(proc_macro::Ident::new_raw(string, s)),
+            Span::Fallback(s) => Ident::Fallback(fallback::Ident::new_raw_checked(string, s)),
+        }
+    }
+
+    pub fn new_raw_unchecked(string: &str, span: fallback::Span) -> Self {
+        Ident::Fallback(fallback::Ident::new_raw_unchecked(string, span))
+    }
+
+    pub fn span(&self) -> Span {
+        match self {
+            Ident::Compiler(t) => Span::Compiler(t.span()),
+            Ident::Fallback(t) => Span::Fallback(t.span()),
+        }
+    }
+
+    pub fn set_span(&mut self, span: Span) {
+        match (self, span) {
+            (Ident::Compiler(t), Span::Compiler(s)) => t.set_span(s),
+            (Ident::Fallback(t), Span::Fallback(s)) => t.set_span(s),
+            (Ident::Compiler(_), Span::Fallback(_)) => mismatch(line!()),
+            (Ident::Fallback(_), Span::Compiler(_)) => mismatch(line!()),
+        }
+    }
+
+    fn unwrap_nightly(self) -> proc_macro::Ident {
+        match self {
+            Ident::Compiler(s) => s,
+            Ident::Fallback(_) => mismatch(line!()),
+        }
+    }
+}
+
+impl PartialEq for Ident {
+    fn eq(&self, other: &Ident) -> bool {
+        match (self, other) {
+            (Ident::Compiler(t), Ident::Compiler(o)) => t.to_string() == o.to_string(),
+            (Ident::Fallback(t), Ident::Fallback(o)) => t == o,
+            (Ident::Compiler(_), Ident::Fallback(_)) => mismatch(line!()),
+            (Ident::Fallback(_), Ident::Compiler(_)) => mismatch(line!()),
+        }
+    }
+}
+
+impl<T> PartialEq<T> for Ident
+where
+    T: ?Sized + AsRef<str>,
+{
+    fn eq(&self, other: &T) -> bool {
+        let other = other.as_ref();
+        match self {
+            Ident::Compiler(t) => t.to_string() == other,
+            Ident::Fallback(t) => t == other,
+        }
+    }
+}
+
+impl Display for Ident {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        match self {
+            Ident::Compiler(t) => Display::fmt(t, f),
+            Ident::Fallback(t) => Display::fmt(t, f),
+        }
+    }
+}
+
+impl Debug for Ident {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        match self {
+            Ident::Compiler(t) => Debug::fmt(t, f),
+            Ident::Fallback(t) => Debug::fmt(t, f),
+        }
+    }
+}
+
+#[derive(Clone)]
+pub(crate) enum Literal {
+    Compiler(proc_macro::Literal),
+    Fallback(fallback::Literal),
+}
+
+macro_rules! suffixed_numbers {
+    ($($name:ident => $kind:ident,)*) => ($(
+        pub fn $name(n: $kind) -> Literal {
+            if inside_proc_macro() {
+                Literal::Compiler(proc_macro::Literal::$name(n))
+            } else {
+                Literal::Fallback(fallback::Literal::$name(n))
+            }
+        }
+    )*)
+}
+
+macro_rules! unsuffixed_integers {
+    ($($name:ident => $kind:ident,)*) => ($(
+        pub fn $name(n: $kind) -> Literal {
+            if inside_proc_macro() {
+                Literal::Compiler(proc_macro::Literal::$name(n))
+            } else {
+                Literal::Fallback(fallback::Literal::$name(n))
+            }
+        }
+    )*)
+}
+
+impl Literal {
+    pub unsafe fn from_str_unchecked(repr: &str) -> Self {
+        if inside_proc_macro() {
+            Literal::Compiler(proc_macro::Literal::from_str(repr).expect("invalid literal"))
+        } else {
+            Literal::Fallback(unsafe { fallback::Literal::from_str_unchecked(repr) })
+        }
+    }
+
+    suffixed_numbers! {
+        u8_suffixed => u8,
+        u16_suffixed => u16,
+        u32_suffixed => u32,
+        u64_suffixed => u64,
+        u128_suffixed => u128,
+        usize_suffixed => usize,
+        i8_suffixed => i8,
+        i16_suffixed => i16,
+        i32_suffixed => i32,
+        i64_suffixed => i64,
+        i128_suffixed => i128,
+        isize_suffixed => isize,
+
+        f32_suffixed => f32,
+        f64_suffixed => f64,
+    }
+
+    unsuffixed_integers! {
+        u8_unsuffixed => u8,
+        u16_unsuffixed => u16,
+        u32_unsuffixed => u32,
+        u64_unsuffixed => u64,
+        u128_unsuffixed => u128,
+        usize_unsuffixed => usize,
+        i8_unsuffixed => i8,
+        i16_unsuffixed => i16,
+        i32_unsuffixed => i32,
+        i64_unsuffixed => i64,
+        i128_unsuffixed => i128,
+        isize_unsuffixed => isize,
+    }
+
+    pub fn f32_unsuffixed(f: f32) -> Literal {
+        if inside_proc_macro() {
+            Literal::Compiler(proc_macro::Literal::f32_unsuffixed(f))
+        } else {
+            Literal::Fallback(fallback::Literal::f32_unsuffixed(f))
+        }
+    }
+
+    pub fn f64_unsuffixed(f: f64) -> Literal {
+        if inside_proc_macro() {
+            Literal::Compiler(proc_macro::Literal::f64_unsuffixed(f))
+        } else {
+            Literal::Fallback(fallback::Literal::f64_unsuffixed(f))
+        }
+    }
+
+    pub fn string(string: &str) -> Literal {
+        if inside_proc_macro() {
+            Literal::Compiler(proc_macro::Literal::string(string))
+        } else {
+            Literal::Fallback(fallback::Literal::string(string))
+        }
+    }
+
+    pub fn character(ch: char) -> Literal {
+        if inside_proc_macro() {
+            Literal::Compiler(proc_macro::Literal::character(ch))
+        } else {
+            Literal::Fallback(fallback::Literal::character(ch))
+        }
+    }
+
+    pub fn byte_character(byte: u8) -> Literal {
+        if inside_proc_macro() {
+            Literal::Compiler({
+                #[cfg(not(no_literal_byte_character))]
+                {
+                    proc_macro::Literal::byte_character(byte)
+                }
+
+                #[cfg(no_literal_byte_character)]
+                {
+                    let fallback = fallback::Literal::byte_character(byte);
+                    fallback.repr.parse::<proc_macro::Literal>().unwrap()
+                }
+            })
+        } else {
+            Literal::Fallback(fallback::Literal::byte_character(byte))
+        }
+    }
+
+    pub fn byte_string(bytes: &[u8]) -> Literal {
+        if inside_proc_macro() {
+            Literal::Compiler(proc_macro::Literal::byte_string(bytes))
+        } else {
+            Literal::Fallback(fallback::Literal::byte_string(bytes))
+        }
+    }
+
+    pub fn c_string(string: &CStr) -> Literal {
+        if inside_proc_macro() {
+            Literal::Compiler({
+                #[cfg(not(no_literal_c_string))]
+                {
+                    proc_macro::Literal::c_string(string)
+                }
+
+                #[cfg(no_literal_c_string)]
+                {
+                    let fallback = fallback::Literal::c_string(string);
+                    fallback.repr.parse::<proc_macro::Literal>().unwrap()
+                }
+            })
+        } else {
+            Literal::Fallback(fallback::Literal::c_string(string))
+        }
+    }
+
+    pub fn span(&self) -> Span {
+        match self {
+            Literal::Compiler(lit) => Span::Compiler(lit.span()),
+            Literal::Fallback(lit) => Span::Fallback(lit.span()),
+        }
+    }
+
+    pub fn set_span(&mut self, span: Span) {
+        match (self, span) {
+            (Literal::Compiler(lit), Span::Compiler(s)) => lit.set_span(s),
+            (Literal::Fallback(lit), Span::Fallback(s)) => lit.set_span(s),
+            (Literal::Compiler(_), Span::Fallback(_)) => mismatch(line!()),
+            (Literal::Fallback(_), Span::Compiler(_)) => mismatch(line!()),
+        }
+    }
+
+    pub fn subspan<R: RangeBounds<usize>>(&self, range: R) -> Option<Span> {
+        match self {
+            #[cfg(proc_macro_span)]
+            Literal::Compiler(lit) => lit.subspan(range).map(Span::Compiler),
+            #[cfg(not(proc_macro_span))]
+            Literal::Compiler(_lit) => None,
+            Literal::Fallback(lit) => lit.subspan(range).map(Span::Fallback),
+        }
+    }
+
+    fn unwrap_nightly(self) -> proc_macro::Literal {
+        match self {
+            Literal::Compiler(s) => s,
+            Literal::Fallback(_) => mismatch(line!()),
+        }
+    }
+}
+
+impl From<fallback::Literal> for Literal {
+    fn from(s: fallback::Literal) -> Self {
+        Literal::Fallback(s)
+    }
+}
+
+impl FromStr for Literal {
+    type Err = LexError;
+
+    fn from_str(repr: &str) -> Result<Self, Self::Err> {
+        if inside_proc_macro() {
+            let literal = proc_macro::Literal::from_str(repr)?;
+            Ok(Literal::Compiler(literal))
+        } else {
+            let literal = fallback::Literal::from_str(repr)?;
+            Ok(Literal::Fallback(literal))
+        }
+    }
+}
+
+impl Display for Literal {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        match self {
+            Literal::Compiler(t) => Display::fmt(t, f),
+            Literal::Fallback(t) => Display::fmt(t, f),
+        }
+    }
+}
+
+impl Debug for Literal {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        match self {
+            Literal::Compiler(t) => Debug::fmt(t, f),
+            Literal::Fallback(t) => Debug::fmt(t, f),
+        }
+    }
+}
+
+#[cfg(span_locations)]
+pub(crate) fn invalidate_current_thread_spans() {
+    if inside_proc_macro() {
+        panic!(
+            "proc_macro2::extra::invalidate_current_thread_spans is not available in procedural macros"
+        );
+    } else {
+        crate::fallback::invalidate_current_thread_spans();
+    }
+}
+
\ No newline at end of file diff --git a/src/quote/ext.rs.html b/src/quote/ext.rs.html new file mode 100644 index 0000000..a37cc1b --- /dev/null +++ b/src/quote/ext.rs.html @@ -0,0 +1,221 @@ +ext.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+
use super::ToTokens;
+use core::iter;
+use proc_macro2::{TokenStream, TokenTree};
+
+/// TokenStream extension trait with methods for appending tokens.
+///
+/// This trait is sealed and cannot be implemented outside of the `quote` crate.
+pub trait TokenStreamExt: private::Sealed {
+    /// For use by `ToTokens` implementations.
+    ///
+    /// Appends the token specified to this list of tokens.
+    fn append<U>(&mut self, token: U)
+    where
+        U: Into<TokenTree>;
+
+    /// For use by `ToTokens` implementations.
+    ///
+    /// ```
+    /// # use quote::{quote, TokenStreamExt, ToTokens};
+    /// # use proc_macro2::TokenStream;
+    /// #
+    /// struct X;
+    ///
+    /// impl ToTokens for X {
+    ///     fn to_tokens(&self, tokens: &mut TokenStream) {
+    ///         tokens.append_all(&[true, false]);
+    ///     }
+    /// }
+    ///
+    /// let tokens = quote!(#X);
+    /// assert_eq!(tokens.to_string(), "true false");
+    /// ```
+    fn append_all<I>(&mut self, iter: I)
+    where
+        I: IntoIterator,
+        I::Item: ToTokens;
+
+    /// For use by `ToTokens` implementations.
+    ///
+    /// Appends all of the items in the iterator `I`, separated by the tokens
+    /// `U`.
+    fn append_separated<I, U>(&mut self, iter: I, op: U)
+    where
+        I: IntoIterator,
+        I::Item: ToTokens,
+        U: ToTokens;
+
+    /// For use by `ToTokens` implementations.
+    ///
+    /// Appends all tokens in the iterator `I`, appending `U` after each
+    /// element, including after the last element of the iterator.
+    fn append_terminated<I, U>(&mut self, iter: I, term: U)
+    where
+        I: IntoIterator,
+        I::Item: ToTokens,
+        U: ToTokens;
+}
+
+impl TokenStreamExt for TokenStream {
+    fn append<U>(&mut self, token: U)
+    where
+        U: Into<TokenTree>,
+    {
+        self.extend(iter::once(token.into()));
+    }
+
+    fn append_all<I>(&mut self, iter: I)
+    where
+        I: IntoIterator,
+        I::Item: ToTokens,
+    {
+        for token in iter {
+            token.to_tokens(self);
+        }
+    }
+
+    fn append_separated<I, U>(&mut self, iter: I, op: U)
+    where
+        I: IntoIterator,
+        I::Item: ToTokens,
+        U: ToTokens,
+    {
+        for (i, token) in iter.into_iter().enumerate() {
+            if i > 0 {
+                op.to_tokens(self);
+            }
+            token.to_tokens(self);
+        }
+    }
+
+    fn append_terminated<I, U>(&mut self, iter: I, term: U)
+    where
+        I: IntoIterator,
+        I::Item: ToTokens,
+        U: ToTokens,
+    {
+        for token in iter {
+            token.to_tokens(self);
+            term.to_tokens(self);
+        }
+    }
+}
+
+mod private {
+    use proc_macro2::TokenStream;
+
+    pub trait Sealed {}
+
+    impl Sealed for TokenStream {}
+}
+
\ No newline at end of file diff --git a/src/quote/format.rs.html b/src/quote/format.rs.html new file mode 100644 index 0000000..dd4979c --- /dev/null +++ b/src/quote/format.rs.html @@ -0,0 +1,337 @@ +format.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+
/// Formatting macro for constructing `Ident`s.
+///
+/// <br>
+///
+/// # Syntax
+///
+/// Syntax is copied from the [`format!`] macro, supporting both positional and
+/// named arguments.
+///
+/// Only a limited set of formatting traits are supported. The current mapping
+/// of format types to traits is:
+///
+/// * `{}` ⇒ [`IdentFragment`]
+/// * `{:o}` ⇒ [`Octal`](std::fmt::Octal)
+/// * `{:x}` ⇒ [`LowerHex`](std::fmt::LowerHex)
+/// * `{:X}` ⇒ [`UpperHex`](std::fmt::UpperHex)
+/// * `{:b}` ⇒ [`Binary`](std::fmt::Binary)
+///
+/// See [`std::fmt`] for more information.
+///
+/// <br>
+///
+/// # IdentFragment
+///
+/// Unlike `format!`, this macro uses the [`IdentFragment`] formatting trait by
+/// default. This trait is like `Display`, with a few differences:
+///
+/// * `IdentFragment` is only implemented for a limited set of types, such as
+///    unsigned integers and strings.
+/// * [`Ident`] arguments will have their `r#` prefixes stripped, if present.
+///
+/// [`IdentFragment`]: crate::IdentFragment
+/// [`Ident`]: proc_macro2::Ident
+///
+/// <br>
+///
+/// # Hygiene
+///
+/// The [`Span`] of the first `Ident` argument is used as the span of the final
+/// identifier, falling back to [`Span::call_site`] when no identifiers are
+/// provided.
+///
+/// ```
+/// # use quote::format_ident;
+/// # let ident = format_ident!("Ident");
+/// // If `ident` is an Ident, the span of `my_ident` will be inherited from it.
+/// let my_ident = format_ident!("My{}{}", ident, "IsCool");
+/// assert_eq!(my_ident, "MyIdentIsCool");
+/// ```
+///
+/// Alternatively, the span can be overridden by passing the `span` named
+/// argument.
+///
+/// ```
+/// # use quote::format_ident;
+/// # const IGNORE_TOKENS: &'static str = stringify! {
+/// let my_span = /* ... */;
+/// # };
+/// # let my_span = proc_macro2::Span::call_site();
+/// format_ident!("MyIdent", span = my_span);
+/// ```
+///
+/// [`Span`]: proc_macro2::Span
+/// [`Span::call_site`]: proc_macro2::Span::call_site
+///
+/// <p><br></p>
+///
+/// # Panics
+///
+/// This method will panic if the resulting formatted string is not a valid
+/// identifier.
+///
+/// <br>
+///
+/// # Examples
+///
+/// Composing raw and non-raw identifiers:
+/// ```
+/// # use quote::format_ident;
+/// let my_ident = format_ident!("My{}", "Ident");
+/// assert_eq!(my_ident, "MyIdent");
+///
+/// let raw = format_ident!("r#Raw");
+/// assert_eq!(raw, "r#Raw");
+///
+/// let my_ident_raw = format_ident!("{}Is{}", my_ident, raw);
+/// assert_eq!(my_ident_raw, "MyIdentIsRaw");
+/// ```
+///
+/// Integer formatting options:
+/// ```
+/// # use quote::format_ident;
+/// let num: u32 = 10;
+///
+/// let decimal = format_ident!("Id_{}", num);
+/// assert_eq!(decimal, "Id_10");
+///
+/// let octal = format_ident!("Id_{:o}", num);
+/// assert_eq!(octal, "Id_12");
+///
+/// let binary = format_ident!("Id_{:b}", num);
+/// assert_eq!(binary, "Id_1010");
+///
+/// let lower_hex = format_ident!("Id_{:x}", num);
+/// assert_eq!(lower_hex, "Id_a");
+///
+/// let upper_hex = format_ident!("Id_{:X}", num);
+/// assert_eq!(upper_hex, "Id_A");
+/// ```
+#[macro_export]
+macro_rules! format_ident {
+    ($fmt:expr) => {
+        $crate::format_ident_impl!([
+            $crate::__private::Option::None,
+            $fmt
+        ])
+    };
+
+    ($fmt:expr, $($rest:tt)*) => {
+        $crate::format_ident_impl!([
+            $crate::__private::Option::None,
+            $fmt
+        ] $($rest)*)
+    };
+}
+
+#[macro_export]
+#[doc(hidden)]
+macro_rules! format_ident_impl {
+    // Final state
+    ([$span:expr, $($fmt:tt)*]) => {
+        $crate::__private::mk_ident(
+            &$crate::__private::format!($($fmt)*),
+            $span,
+        )
+    };
+
+    // Span argument
+    ([$old:expr, $($fmt:tt)*] span = $span:expr) => {
+        $crate::format_ident_impl!([$old, $($fmt)*] span = $span,)
+    };
+    ([$old:expr, $($fmt:tt)*] span = $span:expr, $($rest:tt)*) => {
+        $crate::format_ident_impl!([
+            $crate::__private::Option::Some::<$crate::__private::Span>($span),
+            $($fmt)*
+        ] $($rest)*)
+    };
+
+    // Named argument
+    ([$span:expr, $($fmt:tt)*] $name:ident = $arg:expr) => {
+        $crate::format_ident_impl!([$span, $($fmt)*] $name = $arg,)
+    };
+    ([$span:expr, $($fmt:tt)*] $name:ident = $arg:expr, $($rest:tt)*) => {
+        match $crate::__private::IdentFragmentAdapter(&$arg) {
+            arg => $crate::format_ident_impl!([$span.or(arg.span()), $($fmt)*, $name = arg] $($rest)*),
+        }
+    };
+
+    // Positional argument
+    ([$span:expr, $($fmt:tt)*] $arg:expr) => {
+        $crate::format_ident_impl!([$span, $($fmt)*] $arg,)
+    };
+    ([$span:expr, $($fmt:tt)*] $arg:expr, $($rest:tt)*) => {
+        match $crate::__private::IdentFragmentAdapter(&$arg) {
+            arg => $crate::format_ident_impl!([$span.or(arg.span()), $($fmt)*, arg] $($rest)*),
+        }
+    };
+}
+
\ No newline at end of file diff --git a/src/quote/ident_fragment.rs.html b/src/quote/ident_fragment.rs.html new file mode 100644 index 0000000..d7adbdd --- /dev/null +++ b/src/quote/ident_fragment.rs.html @@ -0,0 +1,177 @@ +ident_fragment.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+
use alloc::borrow::Cow;
+use core::fmt;
+use proc_macro2::{Ident, Span};
+
+/// Specialized formatting trait used by `format_ident!`.
+///
+/// [`Ident`] arguments formatted using this trait will have their `r#` prefix
+/// stripped, if present.
+///
+/// See [`format_ident!`] for more information.
+///
+/// [`format_ident!`]: crate::format_ident
+pub trait IdentFragment {
+    /// Format this value as an identifier fragment.
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result;
+
+    /// Span associated with this `IdentFragment`.
+    ///
+    /// If non-`None`, may be inherited by formatted identifiers.
+    fn span(&self) -> Option<Span> {
+        None
+    }
+}
+
+impl<T: IdentFragment + ?Sized> IdentFragment for &T {
+    fn span(&self) -> Option<Span> {
+        <T as IdentFragment>::span(*self)
+    }
+
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        IdentFragment::fmt(*self, f)
+    }
+}
+
+impl<T: IdentFragment + ?Sized> IdentFragment for &mut T {
+    fn span(&self) -> Option<Span> {
+        <T as IdentFragment>::span(*self)
+    }
+
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        IdentFragment::fmt(*self, f)
+    }
+}
+
+impl IdentFragment for Ident {
+    fn span(&self) -> Option<Span> {
+        Some(self.span())
+    }
+
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        let id = self.to_string();
+        if let Some(id) = id.strip_prefix("r#") {
+            fmt::Display::fmt(id, f)
+        } else {
+            fmt::Display::fmt(&id[..], f)
+        }
+    }
+}
+
+impl<T> IdentFragment for Cow<'_, T>
+where
+    T: IdentFragment + ToOwned + ?Sized,
+{
+    fn span(&self) -> Option<Span> {
+        T::span(self)
+    }
+
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        T::fmt(self, f)
+    }
+}
+
+// Limited set of types which this is implemented for, as we want to avoid types
+// which will often include non-identifier characters in their `Display` impl.
+macro_rules! ident_fragment_display {
+    ($($T:ty),*) => {
+        $(
+            impl IdentFragment for $T {
+                fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+                    fmt::Display::fmt(self, f)
+                }
+            }
+        )*
+    };
+}
+
+ident_fragment_display!(bool, str, String, char);
+ident_fragment_display!(u8, u16, u32, u64, u128, usize);
+
\ No newline at end of file diff --git a/src/quote/lib.rs.html b/src/quote/lib.rs.html new file mode 100644 index 0000000..fed19d9 --- /dev/null +++ b/src/quote/lib.rs.html @@ -0,0 +1,2929 @@ +lib.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+753
+754
+755
+756
+757
+758
+759
+760
+761
+762
+763
+764
+765
+766
+767
+768
+769
+770
+771
+772
+773
+774
+775
+776
+777
+778
+779
+780
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+794
+795
+796
+797
+798
+799
+800
+801
+802
+803
+804
+805
+806
+807
+808
+809
+810
+811
+812
+813
+814
+815
+816
+817
+818
+819
+820
+821
+822
+823
+824
+825
+826
+827
+828
+829
+830
+831
+832
+833
+834
+835
+836
+837
+838
+839
+840
+841
+842
+843
+844
+845
+846
+847
+848
+849
+850
+851
+852
+853
+854
+855
+856
+857
+858
+859
+860
+861
+862
+863
+864
+865
+866
+867
+868
+869
+870
+871
+872
+873
+874
+875
+876
+877
+878
+879
+880
+881
+882
+883
+884
+885
+886
+887
+888
+889
+890
+891
+892
+893
+894
+895
+896
+897
+898
+899
+900
+901
+902
+903
+904
+905
+906
+907
+908
+909
+910
+911
+912
+913
+914
+915
+916
+917
+918
+919
+920
+921
+922
+923
+924
+925
+926
+927
+928
+929
+930
+931
+932
+933
+934
+935
+936
+937
+938
+939
+940
+941
+942
+943
+944
+945
+946
+947
+948
+949
+950
+951
+952
+953
+954
+955
+956
+957
+958
+959
+960
+961
+962
+963
+964
+965
+966
+967
+968
+969
+970
+971
+972
+973
+974
+975
+976
+977
+978
+979
+980
+981
+982
+983
+984
+985
+986
+987
+988
+989
+990
+991
+992
+993
+994
+995
+996
+997
+998
+999
+1000
+1001
+1002
+1003
+1004
+1005
+1006
+1007
+1008
+1009
+1010
+1011
+1012
+1013
+1014
+1015
+1016
+1017
+1018
+1019
+1020
+1021
+1022
+1023
+1024
+1025
+1026
+1027
+1028
+1029
+1030
+1031
+1032
+1033
+1034
+1035
+1036
+1037
+1038
+1039
+1040
+1041
+1042
+1043
+1044
+1045
+1046
+1047
+1048
+1049
+1050
+1051
+1052
+1053
+1054
+1055
+1056
+1057
+1058
+1059
+1060
+1061
+1062
+1063
+1064
+1065
+1066
+1067
+1068
+1069
+1070
+1071
+1072
+1073
+1074
+1075
+1076
+1077
+1078
+1079
+1080
+1081
+1082
+1083
+1084
+1085
+1086
+1087
+1088
+1089
+1090
+1091
+1092
+1093
+1094
+1095
+1096
+1097
+1098
+1099
+1100
+1101
+1102
+1103
+1104
+1105
+1106
+1107
+1108
+1109
+1110
+1111
+1112
+1113
+1114
+1115
+1116
+1117
+1118
+1119
+1120
+1121
+1122
+1123
+1124
+1125
+1126
+1127
+1128
+1129
+1130
+1131
+1132
+1133
+1134
+1135
+1136
+1137
+1138
+1139
+1140
+1141
+1142
+1143
+1144
+1145
+1146
+1147
+1148
+1149
+1150
+1151
+1152
+1153
+1154
+1155
+1156
+1157
+1158
+1159
+1160
+1161
+1162
+1163
+1164
+1165
+1166
+1167
+1168
+1169
+1170
+1171
+1172
+1173
+1174
+1175
+1176
+1177
+1178
+1179
+1180
+1181
+1182
+1183
+1184
+1185
+1186
+1187
+1188
+1189
+1190
+1191
+1192
+1193
+1194
+1195
+1196
+1197
+1198
+1199
+1200
+1201
+1202
+1203
+1204
+1205
+1206
+1207
+1208
+1209
+1210
+1211
+1212
+1213
+1214
+1215
+1216
+1217
+1218
+1219
+1220
+1221
+1222
+1223
+1224
+1225
+1226
+1227
+1228
+1229
+1230
+1231
+1232
+1233
+1234
+1235
+1236
+1237
+1238
+1239
+1240
+1241
+1242
+1243
+1244
+1245
+1246
+1247
+1248
+1249
+1250
+1251
+1252
+1253
+1254
+1255
+1256
+1257
+1258
+1259
+1260
+1261
+1262
+1263
+1264
+1265
+1266
+1267
+1268
+1269
+1270
+1271
+1272
+1273
+1274
+1275
+1276
+1277
+1278
+1279
+1280
+1281
+1282
+1283
+1284
+1285
+1286
+1287
+1288
+1289
+1290
+1291
+1292
+1293
+1294
+1295
+1296
+1297
+1298
+1299
+1300
+1301
+1302
+1303
+1304
+1305
+1306
+1307
+1308
+1309
+1310
+1311
+1312
+1313
+1314
+1315
+1316
+1317
+1318
+1319
+1320
+1321
+1322
+1323
+1324
+1325
+1326
+1327
+1328
+1329
+1330
+1331
+1332
+1333
+1334
+1335
+1336
+1337
+1338
+1339
+1340
+1341
+1342
+1343
+1344
+1345
+1346
+1347
+1348
+1349
+1350
+1351
+1352
+1353
+1354
+1355
+1356
+1357
+1358
+1359
+1360
+1361
+1362
+1363
+1364
+1365
+1366
+1367
+1368
+1369
+1370
+1371
+1372
+1373
+1374
+1375
+1376
+1377
+1378
+1379
+1380
+1381
+1382
+1383
+1384
+1385
+1386
+1387
+1388
+1389
+1390
+1391
+1392
+1393
+1394
+1395
+1396
+1397
+1398
+1399
+1400
+1401
+1402
+1403
+1404
+1405
+1406
+1407
+1408
+1409
+1410
+1411
+1412
+1413
+1414
+1415
+1416
+1417
+1418
+1419
+1420
+1421
+1422
+1423
+1424
+1425
+1426
+1427
+1428
+1429
+1430
+1431
+1432
+1433
+1434
+1435
+1436
+1437
+1438
+1439
+1440
+1441
+1442
+1443
+1444
+1445
+1446
+1447
+1448
+1449
+1450
+1451
+1452
+1453
+1454
+1455
+1456
+1457
+1458
+1459
+1460
+1461
+1462
+1463
+1464
+
//! [![github]](https://github.com/dtolnay/quote)&ensp;[![crates-io]](https://crates.io/crates/quote)&ensp;[![docs-rs]](https://docs.rs/quote)
+//!
+//! [github]: https://img.shields.io/badge/github-8da0cb?style=for-the-badge&labelColor=555555&logo=github
+//! [crates-io]: https://img.shields.io/badge/crates.io-fc8d62?style=for-the-badge&labelColor=555555&logo=rust
+//! [docs-rs]: https://img.shields.io/badge/docs.rs-66c2a5?style=for-the-badge&labelColor=555555&logo=docs.rs
+//!
+//! <br>
+//!
+//! This crate provides the [`quote!`] macro for turning Rust syntax tree data
+//! structures into tokens of source code.
+//!
+//! [`quote!`]: macro.quote.html
+//!
+//! Procedural macros in Rust receive a stream of tokens as input, execute
+//! arbitrary Rust code to determine how to manipulate those tokens, and produce
+//! a stream of tokens to hand back to the compiler to compile into the caller's
+//! crate. Quasi-quoting is a solution to one piece of that &mdash; producing
+//! tokens to return to the compiler.
+//!
+//! The idea of quasi-quoting is that we write *code* that we treat as *data*.
+//! Within the `quote!` macro, we can write what looks like code to our text
+//! editor or IDE. We get all the benefits of the editor's brace matching,
+//! syntax highlighting, indentation, and maybe autocompletion. But rather than
+//! compiling that as code into the current crate, we can treat it as data, pass
+//! it around, mutate it, and eventually hand it back to the compiler as tokens
+//! to compile into the macro caller's crate.
+//!
+//! This crate is motivated by the procedural macro use case, but is a
+//! general-purpose Rust quasi-quoting library and is not specific to procedural
+//! macros.
+//!
+//! ```toml
+//! [dependencies]
+//! quote = "1.0"
+//! ```
+//!
+//! <br>
+//!
+//! # Example
+//!
+//! The following quasi-quoted block of code is something you might find in [a]
+//! procedural macro having to do with data structure serialization. The `#var`
+//! syntax performs interpolation of runtime variables into the quoted tokens.
+//! Check out the documentation of the [`quote!`] macro for more detail about
+//! the syntax. See also the [`quote_spanned!`] macro which is important for
+//! implementing hygienic procedural macros.
+//!
+//! [a]: https://serde.rs/
+//! [`quote_spanned!`]: macro.quote_spanned.html
+//!
+//! ```
+//! # use quote::quote;
+//! #
+//! # let generics = "";
+//! # let where_clause = "";
+//! # let field_ty = "";
+//! # let item_ty = "";
+//! # let path = "";
+//! # let value = "";
+//! #
+//! let tokens = quote! {
+//!     struct SerializeWith #generics #where_clause {
+//!         value: &'a #field_ty,
+//!         phantom: core::marker::PhantomData<#item_ty>,
+//!     }
+//!
+//!     impl #generics serde::Serialize for SerializeWith #generics #where_clause {
+//!         fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+//!         where
+//!             S: serde::Serializer,
+//!         {
+//!             #path(self.value, serializer)
+//!         }
+//!     }
+//!
+//!     SerializeWith {
+//!         value: #value,
+//!         phantom: core::marker::PhantomData::<#item_ty>,
+//!     }
+//! };
+//! ```
+//!
+//! <br>
+//!
+//! # Non-macro code generators
+//!
+//! When using `quote` in a build.rs or main.rs and writing the output out to a
+//! file, consider having the code generator pass the tokens through
+//! [prettyplease] before writing. This way if an error occurs in the generated
+//! code it is convenient for a human to read and debug.
+//!
+//! [prettyplease]: https://github.com/dtolnay/prettyplease
+
+// Quote types in rustdoc of other crates get linked to here.
+#![doc(html_root_url = "https://docs.rs/quote/1.0.36")]
+#![allow(
+    clippy::doc_markdown,
+    clippy::missing_errors_doc,
+    clippy::missing_panics_doc,
+    clippy::module_name_repetitions,
+    // false positive https://github.com/rust-lang/rust-clippy/issues/6983
+    clippy::wrong_self_convention,
+)]
+
+extern crate alloc;
+
+#[cfg(feature = "proc-macro")]
+extern crate proc_macro;
+
+mod ext;
+mod format;
+mod ident_fragment;
+mod to_tokens;
+
+// Not public API.
+#[doc(hidden)]
+#[path = "runtime.rs"]
+pub mod __private;
+
+pub use crate::ext::TokenStreamExt;
+pub use crate::ident_fragment::IdentFragment;
+pub use crate::to_tokens::ToTokens;
+
+// Not public API.
+#[doc(hidden)]
+pub mod spanned;
+
+macro_rules! __quote {
+    ($quote:item) => {
+        /// The whole point.
+        ///
+        /// Performs variable interpolation against the input and produces it as
+        /// [`proc_macro2::TokenStream`].
+        ///
+        /// Note: for returning tokens to the compiler in a procedural macro, use
+        /// `.into()` on the result to convert to [`proc_macro::TokenStream`].
+        ///
+        /// [`TokenStream`]: https://docs.rs/proc-macro2/1.0/proc_macro2/struct.TokenStream.html
+        ///
+        /// <br>
+        ///
+        /// # Interpolation
+        ///
+        /// Variable interpolation is done with `#var` (similar to `$var` in
+        /// `macro_rules!` macros). This grabs the `var` variable that is currently in
+        /// scope and inserts it in that location in the output tokens. Any type
+        /// implementing the [`ToTokens`] trait can be interpolated. This includes most
+        /// Rust primitive types as well as most of the syntax tree types from the [Syn]
+        /// crate.
+        ///
+        /// [`ToTokens`]: trait.ToTokens.html
+        /// [Syn]: https://github.com/dtolnay/syn
+        ///
+        /// Repetition is done using `#(...)*` or `#(...),*` again similar to
+        /// `macro_rules!`. This iterates through the elements of any variable
+        /// interpolated within the repetition and inserts a copy of the repetition body
+        /// for each one. The variables in an interpolation may be a `Vec`, slice,
+        /// `BTreeSet`, or any `Iterator`.
+        ///
+        /// - `#(#var)*` — no separators
+        /// - `#(#var),*` — the character before the asterisk is used as a separator
+        /// - `#( struct #var; )*` — the repetition can contain other tokens
+        /// - `#( #k => println!("{}", #v), )*` — even multiple interpolations
+        ///
+        /// <br>
+        ///
+        /// # Hygiene
+        ///
+        /// Any interpolated tokens preserve the `Span` information provided by their
+        /// `ToTokens` implementation. Tokens that originate within the `quote!`
+        /// invocation are spanned with [`Span::call_site()`].
+        ///
+        /// [`Span::call_site()`]: https://docs.rs/proc-macro2/1.0/proc_macro2/struct.Span.html#method.call_site
+        ///
+        /// A different span can be provided through the [`quote_spanned!`] macro.
+        ///
+        /// [`quote_spanned!`]: macro.quote_spanned.html
+        ///
+        /// <br>
+        ///
+        /// # Return type
+        ///
+        /// The macro evaluates to an expression of type `proc_macro2::TokenStream`.
+        /// Meanwhile Rust procedural macros are expected to return the type
+        /// `proc_macro::TokenStream`.
+        ///
+        /// The difference between the two types is that `proc_macro` types are entirely
+        /// specific to procedural macros and cannot ever exist in code outside of a
+        /// procedural macro, while `proc_macro2` types may exist anywhere including
+        /// tests and non-macro code like main.rs and build.rs. This is why even the
+        /// procedural macro ecosystem is largely built around `proc_macro2`, because
+        /// that ensures the libraries are unit testable and accessible in non-macro
+        /// contexts.
+        ///
+        /// There is a [`From`]-conversion in both directions so returning the output of
+        /// `quote!` from a procedural macro usually looks like `tokens.into()` or
+        /// `proc_macro::TokenStream::from(tokens)`.
+        ///
+        /// [`From`]: https://doc.rust-lang.org/std/convert/trait.From.html
+        ///
+        /// <br>
+        ///
+        /// # Examples
+        ///
+        /// ### Procedural macro
+        ///
+        /// The structure of a basic procedural macro is as follows. Refer to the [Syn]
+        /// crate for further useful guidance on using `quote!` as part of a procedural
+        /// macro.
+        ///
+        /// [Syn]: https://github.com/dtolnay/syn
+        ///
+        /// ```
+        /// # #[cfg(any())]
+        /// extern crate proc_macro;
+        /// # extern crate proc_macro2;
+        ///
+        /// # #[cfg(any())]
+        /// use proc_macro::TokenStream;
+        /// # use proc_macro2::TokenStream;
+        /// use quote::quote;
+        ///
+        /// # const IGNORE_TOKENS: &'static str = stringify! {
+        /// #[proc_macro_derive(HeapSize)]
+        /// # };
+        /// pub fn derive_heap_size(input: TokenStream) -> TokenStream {
+        ///     // Parse the input and figure out what implementation to generate...
+        ///     # const IGNORE_TOKENS: &'static str = stringify! {
+        ///     let name = /* ... */;
+        ///     let expr = /* ... */;
+        ///     # };
+        ///     #
+        ///     # let name = 0;
+        ///     # let expr = 0;
+        ///
+        ///     let expanded = quote! {
+        ///         // The generated impl.
+        ///         impl heapsize::HeapSize for #name {
+        ///             fn heap_size_of_children(&self) -> usize {
+        ///                 #expr
+        ///             }
+        ///         }
+        ///     };
+        ///
+        ///     // Hand the output tokens back to the compiler.
+        ///     TokenStream::from(expanded)
+        /// }
+        /// ```
+        ///
+        /// <p><br></p>
+        ///
+        /// ### Combining quoted fragments
+        ///
+        /// Usually you don't end up constructing an entire final `TokenStream` in one
+        /// piece. Different parts may come from different helper functions. The tokens
+        /// produced by `quote!` themselves implement `ToTokens` and so can be
+        /// interpolated into later `quote!` invocations to build up a final result.
+        ///
+        /// ```
+        /// # use quote::quote;
+        /// #
+        /// let type_definition = quote! {...};
+        /// let methods = quote! {...};
+        ///
+        /// let tokens = quote! {
+        ///     #type_definition
+        ///     #methods
+        /// };
+        /// ```
+        ///
+        /// <p><br></p>
+        ///
+        /// ### Constructing identifiers
+        ///
+        /// Suppose we have an identifier `ident` which came from somewhere in a macro
+        /// input and we need to modify it in some way for the macro output. Let's
+        /// consider prepending the identifier with an underscore.
+        ///
+        /// Simply interpolating the identifier next to an underscore will not have the
+        /// behavior of concatenating them. The underscore and the identifier will
+        /// continue to be two separate tokens as if you had written `_ x`.
+        ///
+        /// ```
+        /// # use proc_macro2::{self as syn, Span};
+        /// # use quote::quote;
+        /// #
+        /// # let ident = syn::Ident::new("i", Span::call_site());
+        /// #
+        /// // incorrect
+        /// quote! {
+        ///     let mut _#ident = 0;
+        /// }
+        /// # ;
+        /// ```
+        ///
+        /// The solution is to build a new identifier token with the correct value. As
+        /// this is such a common case, the [`format_ident!`] macro provides a
+        /// convenient utility for doing so correctly.
+        ///
+        /// ```
+        /// # use proc_macro2::{Ident, Span};
+        /// # use quote::{format_ident, quote};
+        /// #
+        /// # let ident = Ident::new("i", Span::call_site());
+        /// #
+        /// let varname = format_ident!("_{}", ident);
+        /// quote! {
+        ///     let mut #varname = 0;
+        /// }
+        /// # ;
+        /// ```
+        ///
+        /// Alternatively, the APIs provided by Syn and proc-macro2 can be used to
+        /// directly build the identifier. This is roughly equivalent to the above, but
+        /// will not handle `ident` being a raw identifier.
+        ///
+        /// ```
+        /// # use proc_macro2::{self as syn, Span};
+        /// # use quote::quote;
+        /// #
+        /// # let ident = syn::Ident::new("i", Span::call_site());
+        /// #
+        /// let concatenated = format!("_{}", ident);
+        /// let varname = syn::Ident::new(&concatenated, ident.span());
+        /// quote! {
+        ///     let mut #varname = 0;
+        /// }
+        /// # ;
+        /// ```
+        ///
+        /// <p><br></p>
+        ///
+        /// ### Making method calls
+        ///
+        /// Let's say our macro requires some type specified in the macro input to have
+        /// a constructor called `new`. We have the type in a variable called
+        /// `field_type` of type `syn::Type` and want to invoke the constructor.
+        ///
+        /// ```
+        /// # use quote::quote;
+        /// #
+        /// # let field_type = quote!(...);
+        /// #
+        /// // incorrect
+        /// quote! {
+        ///     let value = #field_type::new();
+        /// }
+        /// # ;
+        /// ```
+        ///
+        /// This works only sometimes. If `field_type` is `String`, the expanded code
+        /// contains `String::new()` which is fine. But if `field_type` is something
+        /// like `Vec<i32>` then the expanded code is `Vec<i32>::new()` which is invalid
+        /// syntax. Ordinarily in handwritten Rust we would write `Vec::<i32>::new()`
+        /// but for macros often the following is more convenient.
+        ///
+        /// ```
+        /// # use quote::quote;
+        /// #
+        /// # let field_type = quote!(...);
+        /// #
+        /// quote! {
+        ///     let value = <#field_type>::new();
+        /// }
+        /// # ;
+        /// ```
+        ///
+        /// This expands to `<Vec<i32>>::new()` which behaves correctly.
+        ///
+        /// A similar pattern is appropriate for trait methods.
+        ///
+        /// ```
+        /// # use quote::quote;
+        /// #
+        /// # let field_type = quote!(...);
+        /// #
+        /// quote! {
+        ///     let value = <#field_type as core::default::Default>::default();
+        /// }
+        /// # ;
+        /// ```
+        ///
+        /// <p><br></p>
+        ///
+        /// ### Interpolating text inside of doc comments
+        ///
+        /// Neither doc comments nor string literals get interpolation behavior in
+        /// quote:
+        ///
+        /// ```compile_fail
+        /// quote! {
+        ///     /// try to interpolate: #ident
+        ///     ///
+        ///     /// ...
+        /// }
+        /// ```
+        ///
+        /// ```compile_fail
+        /// quote! {
+        ///     #[doc = "try to interpolate: #ident"]
+        /// }
+        /// ```
+        ///
+        /// Instead the best way to build doc comments that involve variables is by
+        /// formatting the doc string literal outside of quote.
+        ///
+        /// ```rust
+        /// # use proc_macro2::{Ident, Span};
+        /// # use quote::quote;
+        /// #
+        /// # const IGNORE: &str = stringify! {
+        /// let msg = format!(...);
+        /// # };
+        /// #
+        /// # let ident = Ident::new("var", Span::call_site());
+        /// # let msg = format!("try to interpolate: {}", ident);
+        /// quote! {
+        ///     #[doc = #msg]
+        ///     ///
+        ///     /// ...
+        /// }
+        /// # ;
+        /// ```
+        ///
+        /// <p><br></p>
+        ///
+        /// ### Indexing into a tuple struct
+        ///
+        /// When interpolating indices of a tuple or tuple struct, we need them not to
+        /// appears suffixed as integer literals by interpolating them as [`syn::Index`]
+        /// instead.
+        ///
+        /// [`syn::Index`]: https://docs.rs/syn/2.0/syn/struct.Index.html
+        ///
+        /// ```compile_fail
+        /// let i = 0usize..self.fields.len();
+        ///
+        /// // expands to 0 + self.0usize.heap_size() + self.1usize.heap_size() + ...
+        /// // which is not valid syntax
+        /// quote! {
+        ///     0 #( + self.#i.heap_size() )*
+        /// }
+        /// ```
+        ///
+        /// ```
+        /// # use proc_macro2::{Ident, TokenStream};
+        /// # use quote::quote;
+        /// #
+        /// # mod syn {
+        /// #     use proc_macro2::{Literal, TokenStream};
+        /// #     use quote::{ToTokens, TokenStreamExt};
+        /// #
+        /// #     pub struct Index(usize);
+        /// #
+        /// #     impl From<usize> for Index {
+        /// #         fn from(i: usize) -> Self {
+        /// #             Index(i)
+        /// #         }
+        /// #     }
+        /// #
+        /// #     impl ToTokens for Index {
+        /// #         fn to_tokens(&self, tokens: &mut TokenStream) {
+        /// #             tokens.append(Literal::usize_unsuffixed(self.0));
+        /// #         }
+        /// #     }
+        /// # }
+        /// #
+        /// # struct Struct {
+        /// #     fields: Vec<Ident>,
+        /// # }
+        /// #
+        /// # impl Struct {
+        /// #     fn example(&self) -> TokenStream {
+        /// let i = (0..self.fields.len()).map(syn::Index::from);
+        ///
+        /// // expands to 0 + self.0.heap_size() + self.1.heap_size() + ...
+        /// quote! {
+        ///     0 #( + self.#i.heap_size() )*
+        /// }
+        /// #     }
+        /// # }
+        /// ```
+        $quote
+    };
+}
+
+#[cfg(doc)]
+__quote![
+    #[macro_export]
+    macro_rules! quote {
+        ($($tt:tt)*) => {
+            ...
+        };
+    }
+];
+
+#[cfg(not(doc))]
+__quote![
+    #[macro_export]
+    macro_rules! quote {
+        () => {
+            $crate::__private::TokenStream::new()
+        };
+
+        // Special case rule for a single tt, for performance.
+        ($tt:tt) => {{
+            let mut _s = $crate::__private::TokenStream::new();
+            $crate::quote_token!{$tt _s}
+            _s
+        }};
+
+        // Special case rules for two tts, for performance.
+        (# $var:ident) => {{
+            let mut _s = $crate::__private::TokenStream::new();
+            $crate::ToTokens::to_tokens(&$var, &mut _s);
+            _s
+        }};
+        ($tt1:tt $tt2:tt) => {{
+            let mut _s = $crate::__private::TokenStream::new();
+            $crate::quote_token!{$tt1 _s}
+            $crate::quote_token!{$tt2 _s}
+            _s
+        }};
+
+        // Rule for any other number of tokens.
+        ($($tt:tt)*) => {{
+            let mut _s = $crate::__private::TokenStream::new();
+            $crate::quote_each_token!{_s $($tt)*}
+            _s
+        }};
+    }
+];
+
+macro_rules! __quote_spanned {
+    ($quote_spanned:item) => {
+        /// Same as `quote!`, but applies a given span to all tokens originating within
+        /// the macro invocation.
+        ///
+        /// <br>
+        ///
+        /// # Syntax
+        ///
+        /// A span expression of type [`Span`], followed by `=>`, followed by the tokens
+        /// to quote. The span expression should be brief &mdash; use a variable for
+        /// anything more than a few characters. There should be no space before the
+        /// `=>` token.
+        ///
+        /// [`Span`]: https://docs.rs/proc-macro2/1.0/proc_macro2/struct.Span.html
+        ///
+        /// ```
+        /// # use proc_macro2::Span;
+        /// # use quote::quote_spanned;
+        /// #
+        /// # const IGNORE_TOKENS: &'static str = stringify! {
+        /// let span = /* ... */;
+        /// # };
+        /// # let span = Span::call_site();
+        /// # let init = 0;
+        ///
+        /// // On one line, use parentheses.
+        /// let tokens = quote_spanned!(span=> Box::into_raw(Box::new(#init)));
+        ///
+        /// // On multiple lines, place the span at the top and use braces.
+        /// let tokens = quote_spanned! {span=>
+        ///     Box::into_raw(Box::new(#init))
+        /// };
+        /// ```
+        ///
+        /// The lack of space before the `=>` should look jarring to Rust programmers
+        /// and this is intentional. The formatting is designed to be visibly
+        /// off-balance and draw the eye a particular way, due to the span expression
+        /// being evaluated in the context of the procedural macro and the remaining
+        /// tokens being evaluated in the generated code.
+        ///
+        /// <br>
+        ///
+        /// # Hygiene
+        ///
+        /// Any interpolated tokens preserve the `Span` information provided by their
+        /// `ToTokens` implementation. Tokens that originate within the `quote_spanned!`
+        /// invocation are spanned with the given span argument.
+        ///
+        /// <br>
+        ///
+        /// # Example
+        ///
+        /// The following procedural macro code uses `quote_spanned!` to assert that a
+        /// particular Rust type implements the [`Sync`] trait so that references can be
+        /// safely shared between threads.
+        ///
+        /// [`Sync`]: https://doc.rust-lang.org/std/marker/trait.Sync.html
+        ///
+        /// ```
+        /// # use quote::{quote_spanned, TokenStreamExt, ToTokens};
+        /// # use proc_macro2::{Span, TokenStream};
+        /// #
+        /// # struct Type;
+        /// #
+        /// # impl Type {
+        /// #     fn span(&self) -> Span {
+        /// #         Span::call_site()
+        /// #     }
+        /// # }
+        /// #
+        /// # impl ToTokens for Type {
+        /// #     fn to_tokens(&self, _tokens: &mut TokenStream) {}
+        /// # }
+        /// #
+        /// # let ty = Type;
+        /// # let call_site = Span::call_site();
+        /// #
+        /// let ty_span = ty.span();
+        /// let assert_sync = quote_spanned! {ty_span=>
+        ///     struct _AssertSync where #ty: Sync;
+        /// };
+        /// ```
+        ///
+        /// If the assertion fails, the user will see an error like the following. The
+        /// input span of their type is highlighted in the error.
+        ///
+        /// ```text
+        /// error[E0277]: the trait bound `*const (): std::marker::Sync` is not satisfied
+        ///   --> src/main.rs:10:21
+        ///    |
+        /// 10 |     static ref PTR: *const () = &();
+        ///    |                     ^^^^^^^^^ `*const ()` cannot be shared between threads safely
+        /// ```
+        ///
+        /// In this example it is important for the where-clause to be spanned with the
+        /// line/column information of the user's input type so that error messages are
+        /// placed appropriately by the compiler.
+        $quote_spanned
+    };
+}
+
+#[cfg(doc)]
+__quote_spanned![
+    #[macro_export]
+    macro_rules! quote_spanned {
+        ($span:expr=> $($tt:tt)*) => {
+            ...
+        };
+    }
+];
+
+#[cfg(not(doc))]
+__quote_spanned![
+    #[macro_export]
+    macro_rules! quote_spanned {
+        ($span:expr=>) => {{
+            let _: $crate::__private::Span = $crate::__private::get_span($span).__into_span();
+            $crate::__private::TokenStream::new()
+        }};
+
+        // Special case rule for a single tt, for performance.
+        ($span:expr=> $tt:tt) => {{
+            let mut _s = $crate::__private::TokenStream::new();
+            let _span: $crate::__private::Span = $crate::__private::get_span($span).__into_span();
+            $crate::quote_token_spanned!{$tt _s _span}
+            _s
+        }};
+
+        // Special case rules for two tts, for performance.
+        ($span:expr=> # $var:ident) => {{
+            let mut _s = $crate::__private::TokenStream::new();
+            let _: $crate::__private::Span = $crate::__private::get_span($span).__into_span();
+            $crate::ToTokens::to_tokens(&$var, &mut _s);
+            _s
+        }};
+        ($span:expr=> $tt1:tt $tt2:tt) => {{
+            let mut _s = $crate::__private::TokenStream::new();
+            let _span: $crate::__private::Span = $crate::__private::get_span($span).__into_span();
+            $crate::quote_token_spanned!{$tt1 _s _span}
+            $crate::quote_token_spanned!{$tt2 _s _span}
+            _s
+        }};
+
+        // Rule for any other number of tokens.
+        ($span:expr=> $($tt:tt)*) => {{
+            let mut _s = $crate::__private::TokenStream::new();
+            let _span: $crate::__private::Span = $crate::__private::get_span($span).__into_span();
+            $crate::quote_each_token_spanned!{_s _span $($tt)*}
+            _s
+        }};
+    }
+];
+
+// Extract the names of all #metavariables and pass them to the $call macro.
+//
+// in:   pounded_var_names!(then!(...) a #b c #( #d )* #e)
+// out:  then!(... b);
+//       then!(... d);
+//       then!(... e);
+#[macro_export]
+#[doc(hidden)]
+macro_rules! pounded_var_names {
+    ($call:ident! $extra:tt $($tts:tt)*) => {
+        $crate::pounded_var_names_with_context!{$call! $extra
+            (@ $($tts)*)
+            ($($tts)* @)
+        }
+    };
+}
+
+#[macro_export]
+#[doc(hidden)]
+macro_rules! pounded_var_names_with_context {
+    ($call:ident! $extra:tt ($($b1:tt)*) ($($curr:tt)*)) => {
+        $(
+            $crate::pounded_var_with_context!{$call! $extra $b1 $curr}
+        )*
+    };
+}
+
+#[macro_export]
+#[doc(hidden)]
+macro_rules! pounded_var_with_context {
+    ($call:ident! $extra:tt $b1:tt ( $($inner:tt)* )) => {
+        $crate::pounded_var_names!{$call! $extra $($inner)*}
+    };
+
+    ($call:ident! $extra:tt $b1:tt [ $($inner:tt)* ]) => {
+        $crate::pounded_var_names!{$call! $extra $($inner)*}
+    };
+
+    ($call:ident! $extra:tt $b1:tt { $($inner:tt)* }) => {
+        $crate::pounded_var_names!{$call! $extra $($inner)*}
+    };
+
+    ($call:ident!($($extra:tt)*) # $var:ident) => {
+        $crate::$call!($($extra)* $var);
+    };
+
+    ($call:ident! $extra:tt $b1:tt $curr:tt) => {};
+}
+
+#[macro_export]
+#[doc(hidden)]
+macro_rules! quote_bind_into_iter {
+    ($has_iter:ident $var:ident) => {
+        // `mut` may be unused if $var occurs multiple times in the list.
+        #[allow(unused_mut)]
+        let (mut $var, i) = $var.quote_into_iter();
+        let $has_iter = $has_iter | i;
+    };
+}
+
+#[macro_export]
+#[doc(hidden)]
+macro_rules! quote_bind_next_or_break {
+    ($var:ident) => {
+        let $var = match $var.next() {
+            Some(_x) => $crate::__private::RepInterp(_x),
+            None => break,
+        };
+    };
+}
+
+// The obvious way to write this macro is as a tt muncher. This implementation
+// does something more complex for two reasons.
+//
+//   - With a tt muncher it's easy to hit Rust's built-in recursion_limit, which
+//     this implementation avoids because it isn't tail recursive.
+//
+//   - Compile times for a tt muncher are quadratic relative to the length of
+//     the input. This implementation is linear, so it will be faster
+//     (potentially much faster) for big inputs. However, the constant factors
+//     of this implementation are higher than that of a tt muncher, so it is
+//     somewhat slower than a tt muncher if there are many invocations with
+//     short inputs.
+//
+// An invocation like this:
+//
+//     quote_each_token!(_s a b c d e f g h i j);
+//
+// expands to this:
+//
+//     quote_tokens_with_context!(_s
+//         (@  @  @  @   @   @   a   b   c   d   e   f   g  h  i  j)
+//         (@  @  @  @   @   a   b   c   d   e   f   g   h  i  j  @)
+//         (@  @  @  @   a   b   c   d   e   f   g   h   i  j  @  @)
+//         (@  @  @ (a) (b) (c) (d) (e) (f) (g) (h) (i) (j) @  @  @)
+//         (@  @  a  b   c   d   e   f   g   h   i   j   @  @  @  @)
+//         (@  a  b  c   d   e   f   g   h   i   j   @   @  @  @  @)
+//         (a  b  c  d   e   f   g   h   i   j   @   @   @  @  @  @)
+//     );
+//
+// which gets transposed and expanded to this:
+//
+//     quote_token_with_context!(_s @ @ @  @  @ @ a);
+//     quote_token_with_context!(_s @ @ @  @  @ a b);
+//     quote_token_with_context!(_s @ @ @  @  a b c);
+//     quote_token_with_context!(_s @ @ @ (a) b c d);
+//     quote_token_with_context!(_s @ @ a (b) c d e);
+//     quote_token_with_context!(_s @ a b (c) d e f);
+//     quote_token_with_context!(_s a b c (d) e f g);
+//     quote_token_with_context!(_s b c d (e) f g h);
+//     quote_token_with_context!(_s c d e (f) g h i);
+//     quote_token_with_context!(_s d e f (g) h i j);
+//     quote_token_with_context!(_s e f g (h) i j @);
+//     quote_token_with_context!(_s f g h (i) j @ @);
+//     quote_token_with_context!(_s g h i (j) @ @ @);
+//     quote_token_with_context!(_s h i j  @  @ @ @);
+//     quote_token_with_context!(_s i j @  @  @ @ @);
+//     quote_token_with_context!(_s j @ @  @  @ @ @);
+//
+// Without having used muncher-style recursion, we get one invocation of
+// quote_token_with_context for each original tt, with three tts of context on
+// either side. This is enough for the longest possible interpolation form (a
+// repetition with separator, as in `# (#var) , *`) to be fully represented with
+// the first or last tt in the middle.
+//
+// The middle tt (surrounded by parentheses) is the tt being processed.
+//
+//   - When it is a `#`, quote_token_with_context can do an interpolation. The
+//     interpolation kind will depend on the three subsequent tts.
+//
+//   - When it is within a later part of an interpolation, it can be ignored
+//     because the interpolation has already been done.
+//
+//   - When it is not part of an interpolation it can be pushed as a single
+//     token into the output.
+//
+//   - When the middle token is an unparenthesized `@`, that call is one of the
+//     first 3 or last 3 calls of quote_token_with_context and does not
+//     correspond to one of the original input tokens, so turns into nothing.
+#[macro_export]
+#[doc(hidden)]
+macro_rules! quote_each_token {
+    ($tokens:ident $($tts:tt)*) => {
+        $crate::quote_tokens_with_context!{$tokens
+            (@ @ @ @ @ @ $($tts)*)
+            (@ @ @ @ @ $($tts)* @)
+            (@ @ @ @ $($tts)* @ @)
+            (@ @ @ $(($tts))* @ @ @)
+            (@ @ $($tts)* @ @ @ @)
+            (@ $($tts)* @ @ @ @ @)
+            ($($tts)* @ @ @ @ @ @)
+        }
+    };
+}
+
+// See the explanation on quote_each_token.
+#[macro_export]
+#[doc(hidden)]
+macro_rules! quote_each_token_spanned {
+    ($tokens:ident $span:ident $($tts:tt)*) => {
+        $crate::quote_tokens_with_context_spanned!{$tokens $span
+            (@ @ @ @ @ @ $($tts)*)
+            (@ @ @ @ @ $($tts)* @)
+            (@ @ @ @ $($tts)* @ @)
+            (@ @ @ $(($tts))* @ @ @)
+            (@ @ $($tts)* @ @ @ @)
+            (@ $($tts)* @ @ @ @ @)
+            ($($tts)* @ @ @ @ @ @)
+        }
+    };
+}
+
+// See the explanation on quote_each_token.
+#[macro_export]
+#[doc(hidden)]
+macro_rules! quote_tokens_with_context {
+    ($tokens:ident
+        ($($b3:tt)*) ($($b2:tt)*) ($($b1:tt)*)
+        ($($curr:tt)*)
+        ($($a1:tt)*) ($($a2:tt)*) ($($a3:tt)*)
+    ) => {
+        $(
+            $crate::quote_token_with_context!{$tokens $b3 $b2 $b1 $curr $a1 $a2 $a3}
+        )*
+    };
+}
+
+// See the explanation on quote_each_token.
+#[macro_export]
+#[doc(hidden)]
+macro_rules! quote_tokens_with_context_spanned {
+    ($tokens:ident $span:ident
+        ($($b3:tt)*) ($($b2:tt)*) ($($b1:tt)*)
+        ($($curr:tt)*)
+        ($($a1:tt)*) ($($a2:tt)*) ($($a3:tt)*)
+    ) => {
+        $(
+            $crate::quote_token_with_context_spanned!{$tokens $span $b3 $b2 $b1 $curr $a1 $a2 $a3}
+        )*
+    };
+}
+
+// See the explanation on quote_each_token.
+#[macro_export]
+#[doc(hidden)]
+macro_rules! quote_token_with_context {
+    // Unparenthesized `@` indicates this call does not correspond to one of the
+    // original input tokens. Ignore it.
+    ($tokens:ident $b3:tt $b2:tt $b1:tt @ $a1:tt $a2:tt $a3:tt) => {};
+
+    // A repetition with no separator.
+    ($tokens:ident $b3:tt $b2:tt $b1:tt (#) ( $($inner:tt)* ) * $a3:tt) => {{
+        use $crate::__private::ext::*;
+        let has_iter = $crate::__private::ThereIsNoIteratorInRepetition;
+        $crate::pounded_var_names!{quote_bind_into_iter!(has_iter) () $($inner)*}
+        let _: $crate::__private::HasIterator = has_iter;
+        // This is `while true` instead of `loop` because if there are no
+        // iterators used inside of this repetition then the body would not
+        // contain any `break`, so the compiler would emit unreachable code
+        // warnings on anything below the loop. We use has_iter to detect and
+        // fail to compile when there are no iterators, so here we just work
+        // around the unneeded extra warning.
+        while true {
+            $crate::pounded_var_names!{quote_bind_next_or_break!() () $($inner)*}
+            $crate::quote_each_token!{$tokens $($inner)*}
+        }
+    }};
+    // ... and one step later.
+    ($tokens:ident $b3:tt $b2:tt # (( $($inner:tt)* )) * $a2:tt $a3:tt) => {};
+    // ... and one step later.
+    ($tokens:ident $b3:tt # ( $($inner:tt)* ) (*) $a1:tt $a2:tt $a3:tt) => {};
+
+    // A repetition with separator.
+    ($tokens:ident $b3:tt $b2:tt $b1:tt (#) ( $($inner:tt)* ) $sep:tt *) => {{
+        use $crate::__private::ext::*;
+        let mut _i = 0usize;
+        let has_iter = $crate::__private::ThereIsNoIteratorInRepetition;
+        $crate::pounded_var_names!{quote_bind_into_iter!(has_iter) () $($inner)*}
+        let _: $crate::__private::HasIterator = has_iter;
+        while true {
+            $crate::pounded_var_names!{quote_bind_next_or_break!() () $($inner)*}
+            if _i > 0 {
+                $crate::quote_token!{$sep $tokens}
+            }
+            _i += 1;
+            $crate::quote_each_token!{$tokens $($inner)*}
+        }
+    }};
+    // ... and one step later.
+    ($tokens:ident $b3:tt $b2:tt # (( $($inner:tt)* )) $sep:tt * $a3:tt) => {};
+    // ... and one step later.
+    ($tokens:ident $b3:tt # ( $($inner:tt)* ) ($sep:tt) * $a2:tt $a3:tt) => {};
+    // (A special case for `#(var)**`, where the first `*` is treated as the
+    // repetition symbol and the second `*` is treated as an ordinary token.)
+    ($tokens:ident # ( $($inner:tt)* ) * (*) $a1:tt $a2:tt $a3:tt) => {
+        // https://github.com/dtolnay/quote/issues/130
+        $crate::quote_token!{* $tokens}
+    };
+    // ... and one step later.
+    ($tokens:ident # ( $($inner:tt)* ) $sep:tt (*) $a1:tt $a2:tt $a3:tt) => {};
+
+    // A non-repetition interpolation.
+    ($tokens:ident $b3:tt $b2:tt $b1:tt (#) $var:ident $a2:tt $a3:tt) => {
+        $crate::ToTokens::to_tokens(&$var, &mut $tokens);
+    };
+    // ... and one step later.
+    ($tokens:ident $b3:tt $b2:tt # ($var:ident) $a1:tt $a2:tt $a3:tt) => {};
+
+    // An ordinary token, not part of any interpolation.
+    ($tokens:ident $b3:tt $b2:tt $b1:tt ($curr:tt) $a1:tt $a2:tt $a3:tt) => {
+        $crate::quote_token!{$curr $tokens}
+    };
+}
+
+// See the explanation on quote_each_token, and on the individual rules of
+// quote_token_with_context.
+#[macro_export]
+#[doc(hidden)]
+macro_rules! quote_token_with_context_spanned {
+    ($tokens:ident $span:ident $b3:tt $b2:tt $b1:tt @ $a1:tt $a2:tt $a3:tt) => {};
+
+    ($tokens:ident $span:ident $b3:tt $b2:tt $b1:tt (#) ( $($inner:tt)* ) * $a3:tt) => {{
+        use $crate::__private::ext::*;
+        let has_iter = $crate::__private::ThereIsNoIteratorInRepetition;
+        $crate::pounded_var_names!{quote_bind_into_iter!(has_iter) () $($inner)*}
+        let _: $crate::__private::HasIterator = has_iter;
+        while true {
+            $crate::pounded_var_names!{quote_bind_next_or_break!() () $($inner)*}
+            $crate::quote_each_token_spanned!{$tokens $span $($inner)*}
+        }
+    }};
+    ($tokens:ident $span:ident $b3:tt $b2:tt # (( $($inner:tt)* )) * $a2:tt $a3:tt) => {};
+    ($tokens:ident $span:ident $b3:tt # ( $($inner:tt)* ) (*) $a1:tt $a2:tt $a3:tt) => {};
+
+    ($tokens:ident $span:ident $b3:tt $b2:tt $b1:tt (#) ( $($inner:tt)* ) $sep:tt *) => {{
+        use $crate::__private::ext::*;
+        let mut _i = 0usize;
+        let has_iter = $crate::__private::ThereIsNoIteratorInRepetition;
+        $crate::pounded_var_names!{quote_bind_into_iter!(has_iter) () $($inner)*}
+        let _: $crate::__private::HasIterator = has_iter;
+        while true {
+            $crate::pounded_var_names!{quote_bind_next_or_break!() () $($inner)*}
+            if _i > 0 {
+                $crate::quote_token_spanned!{$sep $tokens $span}
+            }
+            _i += 1;
+            $crate::quote_each_token_spanned!{$tokens $span $($inner)*}
+        }
+    }};
+    ($tokens:ident $span:ident $b3:tt $b2:tt # (( $($inner:tt)* )) $sep:tt * $a3:tt) => {};
+    ($tokens:ident $span:ident $b3:tt # ( $($inner:tt)* ) ($sep:tt) * $a2:tt $a3:tt) => {};
+    ($tokens:ident $span:ident # ( $($inner:tt)* ) * (*) $a1:tt $a2:tt $a3:tt) => {
+        // https://github.com/dtolnay/quote/issues/130
+        $crate::quote_token_spanned!{* $tokens $span}
+    };
+    ($tokens:ident $span:ident # ( $($inner:tt)* ) $sep:tt (*) $a1:tt $a2:tt $a3:tt) => {};
+
+    ($tokens:ident $span:ident $b3:tt $b2:tt $b1:tt (#) $var:ident $a2:tt $a3:tt) => {
+        $crate::ToTokens::to_tokens(&$var, &mut $tokens);
+    };
+    ($tokens:ident $span:ident $b3:tt $b2:tt # ($var:ident) $a1:tt $a2:tt $a3:tt) => {};
+
+    ($tokens:ident $span:ident $b3:tt $b2:tt $b1:tt ($curr:tt) $a1:tt $a2:tt $a3:tt) => {
+        $crate::quote_token_spanned!{$curr $tokens $span}
+    };
+}
+
+// These rules are ordered by approximate token frequency, at least for the
+// first 10 or so, to improve compile times. Having `ident` first is by far the
+// most important because it's typically 2-3x more common than the next most
+// common token.
+//
+// Separately, we put the token being matched in the very front so that failing
+// rules may fail to match as quickly as possible.
+#[macro_export]
+#[doc(hidden)]
+macro_rules! quote_token {
+    ($ident:ident $tokens:ident) => {
+        $crate::__private::push_ident(&mut $tokens, stringify!($ident));
+    };
+
+    (:: $tokens:ident) => {
+        $crate::__private::push_colon2(&mut $tokens);
+    };
+
+    (( $($inner:tt)* ) $tokens:ident) => {
+        $crate::__private::push_group(
+            &mut $tokens,
+            $crate::__private::Delimiter::Parenthesis,
+            $crate::quote!($($inner)*),
+        );
+    };
+
+    ([ $($inner:tt)* ] $tokens:ident) => {
+        $crate::__private::push_group(
+            &mut $tokens,
+            $crate::__private::Delimiter::Bracket,
+            $crate::quote!($($inner)*),
+        );
+    };
+
+    ({ $($inner:tt)* } $tokens:ident) => {
+        $crate::__private::push_group(
+            &mut $tokens,
+            $crate::__private::Delimiter::Brace,
+            $crate::quote!($($inner)*),
+        );
+    };
+
+    (# $tokens:ident) => {
+        $crate::__private::push_pound(&mut $tokens);
+    };
+
+    (, $tokens:ident) => {
+        $crate::__private::push_comma(&mut $tokens);
+    };
+
+    (. $tokens:ident) => {
+        $crate::__private::push_dot(&mut $tokens);
+    };
+
+    (; $tokens:ident) => {
+        $crate::__private::push_semi(&mut $tokens);
+    };
+
+    (: $tokens:ident) => {
+        $crate::__private::push_colon(&mut $tokens);
+    };
+
+    (+ $tokens:ident) => {
+        $crate::__private::push_add(&mut $tokens);
+    };
+
+    (+= $tokens:ident) => {
+        $crate::__private::push_add_eq(&mut $tokens);
+    };
+
+    (& $tokens:ident) => {
+        $crate::__private::push_and(&mut $tokens);
+    };
+
+    (&& $tokens:ident) => {
+        $crate::__private::push_and_and(&mut $tokens);
+    };
+
+    (&= $tokens:ident) => {
+        $crate::__private::push_and_eq(&mut $tokens);
+    };
+
+    (@ $tokens:ident) => {
+        $crate::__private::push_at(&mut $tokens);
+    };
+
+    (! $tokens:ident) => {
+        $crate::__private::push_bang(&mut $tokens);
+    };
+
+    (^ $tokens:ident) => {
+        $crate::__private::push_caret(&mut $tokens);
+    };
+
+    (^= $tokens:ident) => {
+        $crate::__private::push_caret_eq(&mut $tokens);
+    };
+
+    (/ $tokens:ident) => {
+        $crate::__private::push_div(&mut $tokens);
+    };
+
+    (/= $tokens:ident) => {
+        $crate::__private::push_div_eq(&mut $tokens);
+    };
+
+    (.. $tokens:ident) => {
+        $crate::__private::push_dot2(&mut $tokens);
+    };
+
+    (... $tokens:ident) => {
+        $crate::__private::push_dot3(&mut $tokens);
+    };
+
+    (..= $tokens:ident) => {
+        $crate::__private::push_dot_dot_eq(&mut $tokens);
+    };
+
+    (= $tokens:ident) => {
+        $crate::__private::push_eq(&mut $tokens);
+    };
+
+    (== $tokens:ident) => {
+        $crate::__private::push_eq_eq(&mut $tokens);
+    };
+
+    (>= $tokens:ident) => {
+        $crate::__private::push_ge(&mut $tokens);
+    };
+
+    (> $tokens:ident) => {
+        $crate::__private::push_gt(&mut $tokens);
+    };
+
+    (<= $tokens:ident) => {
+        $crate::__private::push_le(&mut $tokens);
+    };
+
+    (< $tokens:ident) => {
+        $crate::__private::push_lt(&mut $tokens);
+    };
+
+    (*= $tokens:ident) => {
+        $crate::__private::push_mul_eq(&mut $tokens);
+    };
+
+    (!= $tokens:ident) => {
+        $crate::__private::push_ne(&mut $tokens);
+    };
+
+    (| $tokens:ident) => {
+        $crate::__private::push_or(&mut $tokens);
+    };
+
+    (|= $tokens:ident) => {
+        $crate::__private::push_or_eq(&mut $tokens);
+    };
+
+    (|| $tokens:ident) => {
+        $crate::__private::push_or_or(&mut $tokens);
+    };
+
+    (? $tokens:ident) => {
+        $crate::__private::push_question(&mut $tokens);
+    };
+
+    (-> $tokens:ident) => {
+        $crate::__private::push_rarrow(&mut $tokens);
+    };
+
+    (<- $tokens:ident) => {
+        $crate::__private::push_larrow(&mut $tokens);
+    };
+
+    (% $tokens:ident) => {
+        $crate::__private::push_rem(&mut $tokens);
+    };
+
+    (%= $tokens:ident) => {
+        $crate::__private::push_rem_eq(&mut $tokens);
+    };
+
+    (=> $tokens:ident) => {
+        $crate::__private::push_fat_arrow(&mut $tokens);
+    };
+
+    (<< $tokens:ident) => {
+        $crate::__private::push_shl(&mut $tokens);
+    };
+
+    (<<= $tokens:ident) => {
+        $crate::__private::push_shl_eq(&mut $tokens);
+    };
+
+    (>> $tokens:ident) => {
+        $crate::__private::push_shr(&mut $tokens);
+    };
+
+    (>>= $tokens:ident) => {
+        $crate::__private::push_shr_eq(&mut $tokens);
+    };
+
+    (* $tokens:ident) => {
+        $crate::__private::push_star(&mut $tokens);
+    };
+
+    (- $tokens:ident) => {
+        $crate::__private::push_sub(&mut $tokens);
+    };
+
+    (-= $tokens:ident) => {
+        $crate::__private::push_sub_eq(&mut $tokens);
+    };
+
+    ($lifetime:lifetime $tokens:ident) => {
+        $crate::__private::push_lifetime(&mut $tokens, stringify!($lifetime));
+    };
+
+    (_ $tokens:ident) => {
+        $crate::__private::push_underscore(&mut $tokens);
+    };
+
+    ($other:tt $tokens:ident) => {
+        $crate::__private::parse(&mut $tokens, stringify!($other));
+    };
+}
+
+// See the comment above `quote_token!` about the rule ordering.
+#[macro_export]
+#[doc(hidden)]
+macro_rules! quote_token_spanned {
+    ($ident:ident $tokens:ident $span:ident) => {
+        $crate::__private::push_ident_spanned(&mut $tokens, $span, stringify!($ident));
+    };
+
+    (:: $tokens:ident $span:ident) => {
+        $crate::__private::push_colon2_spanned(&mut $tokens, $span);
+    };
+
+    (( $($inner:tt)* ) $tokens:ident $span:ident) => {
+        $crate::__private::push_group_spanned(
+            &mut $tokens,
+            $span,
+            $crate::__private::Delimiter::Parenthesis,
+            $crate::quote_spanned!($span=> $($inner)*),
+        );
+    };
+
+    ([ $($inner:tt)* ] $tokens:ident $span:ident) => {
+        $crate::__private::push_group_spanned(
+            &mut $tokens,
+            $span,
+            $crate::__private::Delimiter::Bracket,
+            $crate::quote_spanned!($span=> $($inner)*),
+        );
+    };
+
+    ({ $($inner:tt)* } $tokens:ident $span:ident) => {
+        $crate::__private::push_group_spanned(
+            &mut $tokens,
+            $span,
+            $crate::__private::Delimiter::Brace,
+            $crate::quote_spanned!($span=> $($inner)*),
+        );
+    };
+
+    (# $tokens:ident $span:ident) => {
+        $crate::__private::push_pound_spanned(&mut $tokens, $span);
+    };
+
+    (, $tokens:ident $span:ident) => {
+        $crate::__private::push_comma_spanned(&mut $tokens, $span);
+    };
+
+    (. $tokens:ident $span:ident) => {
+        $crate::__private::push_dot_spanned(&mut $tokens, $span);
+    };
+
+    (; $tokens:ident $span:ident) => {
+        $crate::__private::push_semi_spanned(&mut $tokens, $span);
+    };
+
+    (: $tokens:ident $span:ident) => {
+        $crate::__private::push_colon_spanned(&mut $tokens, $span);
+    };
+
+    (+ $tokens:ident $span:ident) => {
+        $crate::__private::push_add_spanned(&mut $tokens, $span);
+    };
+
+    (+= $tokens:ident $span:ident) => {
+        $crate::__private::push_add_eq_spanned(&mut $tokens, $span);
+    };
+
+    (& $tokens:ident $span:ident) => {
+        $crate::__private::push_and_spanned(&mut $tokens, $span);
+    };
+
+    (&& $tokens:ident $span:ident) => {
+        $crate::__private::push_and_and_spanned(&mut $tokens, $span);
+    };
+
+    (&= $tokens:ident $span:ident) => {
+        $crate::__private::push_and_eq_spanned(&mut $tokens, $span);
+    };
+
+    (@ $tokens:ident $span:ident) => {
+        $crate::__private::push_at_spanned(&mut $tokens, $span);
+    };
+
+    (! $tokens:ident $span:ident) => {
+        $crate::__private::push_bang_spanned(&mut $tokens, $span);
+    };
+
+    (^ $tokens:ident $span:ident) => {
+        $crate::__private::push_caret_spanned(&mut $tokens, $span);
+    };
+
+    (^= $tokens:ident $span:ident) => {
+        $crate::__private::push_caret_eq_spanned(&mut $tokens, $span);
+    };
+
+    (/ $tokens:ident $span:ident) => {
+        $crate::__private::push_div_spanned(&mut $tokens, $span);
+    };
+
+    (/= $tokens:ident $span:ident) => {
+        $crate::__private::push_div_eq_spanned(&mut $tokens, $span);
+    };
+
+    (.. $tokens:ident $span:ident) => {
+        $crate::__private::push_dot2_spanned(&mut $tokens, $span);
+    };
+
+    (... $tokens:ident $span:ident) => {
+        $crate::__private::push_dot3_spanned(&mut $tokens, $span);
+    };
+
+    (..= $tokens:ident $span:ident) => {
+        $crate::__private::push_dot_dot_eq_spanned(&mut $tokens, $span);
+    };
+
+    (= $tokens:ident $span:ident) => {
+        $crate::__private::push_eq_spanned(&mut $tokens, $span);
+    };
+
+    (== $tokens:ident $span:ident) => {
+        $crate::__private::push_eq_eq_spanned(&mut $tokens, $span);
+    };
+
+    (>= $tokens:ident $span:ident) => {
+        $crate::__private::push_ge_spanned(&mut $tokens, $span);
+    };
+
+    (> $tokens:ident $span:ident) => {
+        $crate::__private::push_gt_spanned(&mut $tokens, $span);
+    };
+
+    (<= $tokens:ident $span:ident) => {
+        $crate::__private::push_le_spanned(&mut $tokens, $span);
+    };
+
+    (< $tokens:ident $span:ident) => {
+        $crate::__private::push_lt_spanned(&mut $tokens, $span);
+    };
+
+    (*= $tokens:ident $span:ident) => {
+        $crate::__private::push_mul_eq_spanned(&mut $tokens, $span);
+    };
+
+    (!= $tokens:ident $span:ident) => {
+        $crate::__private::push_ne_spanned(&mut $tokens, $span);
+    };
+
+    (| $tokens:ident $span:ident) => {
+        $crate::__private::push_or_spanned(&mut $tokens, $span);
+    };
+
+    (|= $tokens:ident $span:ident) => {
+        $crate::__private::push_or_eq_spanned(&mut $tokens, $span);
+    };
+
+    (|| $tokens:ident $span:ident) => {
+        $crate::__private::push_or_or_spanned(&mut $tokens, $span);
+    };
+
+    (? $tokens:ident $span:ident) => {
+        $crate::__private::push_question_spanned(&mut $tokens, $span);
+    };
+
+    (-> $tokens:ident $span:ident) => {
+        $crate::__private::push_rarrow_spanned(&mut $tokens, $span);
+    };
+
+    (<- $tokens:ident $span:ident) => {
+        $crate::__private::push_larrow_spanned(&mut $tokens, $span);
+    };
+
+    (% $tokens:ident $span:ident) => {
+        $crate::__private::push_rem_spanned(&mut $tokens, $span);
+    };
+
+    (%= $tokens:ident $span:ident) => {
+        $crate::__private::push_rem_eq_spanned(&mut $tokens, $span);
+    };
+
+    (=> $tokens:ident $span:ident) => {
+        $crate::__private::push_fat_arrow_spanned(&mut $tokens, $span);
+    };
+
+    (<< $tokens:ident $span:ident) => {
+        $crate::__private::push_shl_spanned(&mut $tokens, $span);
+    };
+
+    (<<= $tokens:ident $span:ident) => {
+        $crate::__private::push_shl_eq_spanned(&mut $tokens, $span);
+    };
+
+    (>> $tokens:ident $span:ident) => {
+        $crate::__private::push_shr_spanned(&mut $tokens, $span);
+    };
+
+    (>>= $tokens:ident $span:ident) => {
+        $crate::__private::push_shr_eq_spanned(&mut $tokens, $span);
+    };
+
+    (* $tokens:ident $span:ident) => {
+        $crate::__private::push_star_spanned(&mut $tokens, $span);
+    };
+
+    (- $tokens:ident $span:ident) => {
+        $crate::__private::push_sub_spanned(&mut $tokens, $span);
+    };
+
+    (-= $tokens:ident $span:ident) => {
+        $crate::__private::push_sub_eq_spanned(&mut $tokens, $span);
+    };
+
+    ($lifetime:lifetime $tokens:ident $span:ident) => {
+        $crate::__private::push_lifetime_spanned(&mut $tokens, $span, stringify!($lifetime));
+    };
+
+    (_ $tokens:ident $span:ident) => {
+        $crate::__private::push_underscore_spanned(&mut $tokens, $span);
+    };
+
+    ($other:tt $tokens:ident $span:ident) => {
+        $crate::__private::parse_spanned(&mut $tokens, $span, stringify!($other));
+    };
+}
+
\ No newline at end of file diff --git a/src/quote/runtime.rs.html b/src/quote/runtime.rs.html new file mode 100644 index 0000000..799e8a7 --- /dev/null +++ b/src/quote/runtime.rs.html @@ -0,0 +1,1061 @@ +runtime.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+
use self::get_span::{GetSpan, GetSpanBase, GetSpanInner};
+use crate::{IdentFragment, ToTokens, TokenStreamExt};
+use core::fmt;
+use core::iter;
+use core::ops::BitOr;
+use proc_macro2::{Group, Ident, Punct, Spacing, TokenTree};
+
+#[doc(hidden)]
+pub use alloc::format;
+#[doc(hidden)]
+pub use core::option::Option;
+
+#[doc(hidden)]
+pub type Delimiter = proc_macro2::Delimiter;
+#[doc(hidden)]
+pub type Span = proc_macro2::Span;
+#[doc(hidden)]
+pub type TokenStream = proc_macro2::TokenStream;
+
+#[doc(hidden)]
+pub struct HasIterator; // True
+#[doc(hidden)]
+pub struct ThereIsNoIteratorInRepetition; // False
+
+impl BitOr<ThereIsNoIteratorInRepetition> for ThereIsNoIteratorInRepetition {
+    type Output = ThereIsNoIteratorInRepetition;
+    fn bitor(self, _rhs: ThereIsNoIteratorInRepetition) -> ThereIsNoIteratorInRepetition {
+        ThereIsNoIteratorInRepetition
+    }
+}
+
+impl BitOr<ThereIsNoIteratorInRepetition> for HasIterator {
+    type Output = HasIterator;
+    fn bitor(self, _rhs: ThereIsNoIteratorInRepetition) -> HasIterator {
+        HasIterator
+    }
+}
+
+impl BitOr<HasIterator> for ThereIsNoIteratorInRepetition {
+    type Output = HasIterator;
+    fn bitor(self, _rhs: HasIterator) -> HasIterator {
+        HasIterator
+    }
+}
+
+impl BitOr<HasIterator> for HasIterator {
+    type Output = HasIterator;
+    fn bitor(self, _rhs: HasIterator) -> HasIterator {
+        HasIterator
+    }
+}
+
+/// Extension traits used by the implementation of `quote!`. These are defined
+/// in separate traits, rather than as a single trait due to ambiguity issues.
+///
+/// These traits expose a `quote_into_iter` method which should allow calling
+/// whichever impl happens to be applicable. Calling that method repeatedly on
+/// the returned value should be idempotent.
+#[doc(hidden)]
+pub mod ext {
+    use super::RepInterp;
+    use super::{HasIterator as HasIter, ThereIsNoIteratorInRepetition as DoesNotHaveIter};
+    use crate::ToTokens;
+    use alloc::collections::btree_set::{self, BTreeSet};
+    use core::slice;
+
+    /// Extension trait providing the `quote_into_iter` method on iterators.
+    #[doc(hidden)]
+    pub trait RepIteratorExt: Iterator + Sized {
+        fn quote_into_iter(self) -> (Self, HasIter) {
+            (self, HasIter)
+        }
+    }
+
+    impl<T: Iterator> RepIteratorExt for T {}
+
+    /// Extension trait providing the `quote_into_iter` method for
+    /// non-iterable types. These types interpolate the same value in each
+    /// iteration of the repetition.
+    #[doc(hidden)]
+    pub trait RepToTokensExt {
+        /// Pretend to be an iterator for the purposes of `quote_into_iter`.
+        /// This allows repeated calls to `quote_into_iter` to continue
+        /// correctly returning DoesNotHaveIter.
+        fn next(&self) -> Option<&Self> {
+            Some(self)
+        }
+
+        fn quote_into_iter(&self) -> (&Self, DoesNotHaveIter) {
+            (self, DoesNotHaveIter)
+        }
+    }
+
+    impl<T: ToTokens + ?Sized> RepToTokensExt for T {}
+
+    /// Extension trait providing the `quote_into_iter` method for types that
+    /// can be referenced as an iterator.
+    #[doc(hidden)]
+    pub trait RepAsIteratorExt<'q> {
+        type Iter: Iterator;
+
+        fn quote_into_iter(&'q self) -> (Self::Iter, HasIter);
+    }
+
+    impl<'q, 'a, T: RepAsIteratorExt<'q> + ?Sized> RepAsIteratorExt<'q> for &'a T {
+        type Iter = T::Iter;
+
+        fn quote_into_iter(&'q self) -> (Self::Iter, HasIter) {
+            <T as RepAsIteratorExt>::quote_into_iter(*self)
+        }
+    }
+
+    impl<'q, 'a, T: RepAsIteratorExt<'q> + ?Sized> RepAsIteratorExt<'q> for &'a mut T {
+        type Iter = T::Iter;
+
+        fn quote_into_iter(&'q self) -> (Self::Iter, HasIter) {
+            <T as RepAsIteratorExt>::quote_into_iter(*self)
+        }
+    }
+
+    impl<'q, T: 'q> RepAsIteratorExt<'q> for [T] {
+        type Iter = slice::Iter<'q, T>;
+
+        fn quote_into_iter(&'q self) -> (Self::Iter, HasIter) {
+            (self.iter(), HasIter)
+        }
+    }
+
+    impl<'q, T: 'q> RepAsIteratorExt<'q> for Vec<T> {
+        type Iter = slice::Iter<'q, T>;
+
+        fn quote_into_iter(&'q self) -> (Self::Iter, HasIter) {
+            (self.iter(), HasIter)
+        }
+    }
+
+    impl<'q, T: 'q> RepAsIteratorExt<'q> for BTreeSet<T> {
+        type Iter = btree_set::Iter<'q, T>;
+
+        fn quote_into_iter(&'q self) -> (Self::Iter, HasIter) {
+            (self.iter(), HasIter)
+        }
+    }
+
+    impl<'q, T: RepAsIteratorExt<'q>> RepAsIteratorExt<'q> for RepInterp<T> {
+        type Iter = T::Iter;
+
+        fn quote_into_iter(&'q self) -> (Self::Iter, HasIter) {
+            self.0.quote_into_iter()
+        }
+    }
+}
+
+// Helper type used within interpolations to allow for repeated binding names.
+// Implements the relevant traits, and exports a dummy `next()` method.
+#[derive(Copy, Clone)]
+#[doc(hidden)]
+pub struct RepInterp<T>(pub T);
+
+impl<T> RepInterp<T> {
+    // This method is intended to look like `Iterator::next`, and is called when
+    // a name is bound multiple times, as the previous binding will shadow the
+    // original `Iterator` object. This allows us to avoid advancing the
+    // iterator multiple times per iteration.
+    pub fn next(self) -> Option<T> {
+        Some(self.0)
+    }
+}
+
+impl<T: Iterator> Iterator for RepInterp<T> {
+    type Item = T::Item;
+
+    fn next(&mut self) -> Option<Self::Item> {
+        self.0.next()
+    }
+}
+
+impl<T: ToTokens> ToTokens for RepInterp<T> {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
+        self.0.to_tokens(tokens);
+    }
+}
+
+#[doc(hidden)]
+#[inline]
+pub fn get_span<T>(span: T) -> GetSpan<T> {
+    GetSpan(GetSpanInner(GetSpanBase(span)))
+}
+
+mod get_span {
+    use core::ops::Deref;
+    use proc_macro2::extra::DelimSpan;
+    use proc_macro2::Span;
+
+    pub struct GetSpan<T>(pub(crate) GetSpanInner<T>);
+
+    pub struct GetSpanInner<T>(pub(crate) GetSpanBase<T>);
+
+    pub struct GetSpanBase<T>(pub(crate) T);
+
+    impl GetSpan<Span> {
+        #[inline]
+        pub fn __into_span(self) -> Span {
+            ((self.0).0).0
+        }
+    }
+
+    impl GetSpanInner<DelimSpan> {
+        #[inline]
+        pub fn __into_span(&self) -> Span {
+            (self.0).0.join()
+        }
+    }
+
+    impl<T> GetSpanBase<T> {
+        #[allow(clippy::unused_self)]
+        pub fn __into_span(&self) -> T {
+            unreachable!()
+        }
+    }
+
+    impl<T> Deref for GetSpan<T> {
+        type Target = GetSpanInner<T>;
+
+        #[inline]
+        fn deref(&self) -> &Self::Target {
+            &self.0
+        }
+    }
+
+    impl<T> Deref for GetSpanInner<T> {
+        type Target = GetSpanBase<T>;
+
+        #[inline]
+        fn deref(&self) -> &Self::Target {
+            &self.0
+        }
+    }
+}
+
+#[doc(hidden)]
+pub fn push_group(tokens: &mut TokenStream, delimiter: Delimiter, inner: TokenStream) {
+    tokens.append(Group::new(delimiter, inner));
+}
+
+#[doc(hidden)]
+pub fn push_group_spanned(
+    tokens: &mut TokenStream,
+    span: Span,
+    delimiter: Delimiter,
+    inner: TokenStream,
+) {
+    let mut g = Group::new(delimiter, inner);
+    g.set_span(span);
+    tokens.append(g);
+}
+
+#[doc(hidden)]
+pub fn parse(tokens: &mut TokenStream, s: &str) {
+    let s: TokenStream = s.parse().expect("invalid token stream");
+    tokens.extend(iter::once(s));
+}
+
+#[doc(hidden)]
+pub fn parse_spanned(tokens: &mut TokenStream, span: Span, s: &str) {
+    let s: TokenStream = s.parse().expect("invalid token stream");
+    tokens.extend(s.into_iter().map(|t| respan_token_tree(t, span)));
+}
+
+// Token tree with every span replaced by the given one.
+fn respan_token_tree(mut token: TokenTree, span: Span) -> TokenTree {
+    match &mut token {
+        TokenTree::Group(g) => {
+            let stream = g
+                .stream()
+                .into_iter()
+                .map(|token| respan_token_tree(token, span))
+                .collect();
+            *g = Group::new(g.delimiter(), stream);
+            g.set_span(span);
+        }
+        other => other.set_span(span),
+    }
+    token
+}
+
+#[doc(hidden)]
+pub fn push_ident(tokens: &mut TokenStream, s: &str) {
+    let span = Span::call_site();
+    push_ident_spanned(tokens, span, s);
+}
+
+#[doc(hidden)]
+pub fn push_ident_spanned(tokens: &mut TokenStream, span: Span, s: &str) {
+    tokens.append(ident_maybe_raw(s, span));
+}
+
+#[doc(hidden)]
+pub fn push_lifetime(tokens: &mut TokenStream, lifetime: &str) {
+    struct Lifetime<'a> {
+        name: &'a str,
+        state: u8,
+    }
+
+    impl<'a> Iterator for Lifetime<'a> {
+        type Item = TokenTree;
+
+        fn next(&mut self) -> Option<Self::Item> {
+            match self.state {
+                0 => {
+                    self.state = 1;
+                    Some(TokenTree::Punct(Punct::new('\'', Spacing::Joint)))
+                }
+                1 => {
+                    self.state = 2;
+                    Some(TokenTree::Ident(Ident::new(self.name, Span::call_site())))
+                }
+                _ => None,
+            }
+        }
+    }
+
+    tokens.extend(Lifetime {
+        name: &lifetime[1..],
+        state: 0,
+    });
+}
+
+#[doc(hidden)]
+pub fn push_lifetime_spanned(tokens: &mut TokenStream, span: Span, lifetime: &str) {
+    struct Lifetime<'a> {
+        name: &'a str,
+        span: Span,
+        state: u8,
+    }
+
+    impl<'a> Iterator for Lifetime<'a> {
+        type Item = TokenTree;
+
+        fn next(&mut self) -> Option<Self::Item> {
+            match self.state {
+                0 => {
+                    self.state = 1;
+                    let mut apostrophe = Punct::new('\'', Spacing::Joint);
+                    apostrophe.set_span(self.span);
+                    Some(TokenTree::Punct(apostrophe))
+                }
+                1 => {
+                    self.state = 2;
+                    Some(TokenTree::Ident(Ident::new(self.name, self.span)))
+                }
+                _ => None,
+            }
+        }
+    }
+
+    tokens.extend(Lifetime {
+        name: &lifetime[1..],
+        span,
+        state: 0,
+    });
+}
+
+macro_rules! push_punct {
+    ($name:ident $spanned:ident $char1:tt) => {
+        #[doc(hidden)]
+        pub fn $name(tokens: &mut TokenStream) {
+            tokens.append(Punct::new($char1, Spacing::Alone));
+        }
+        #[doc(hidden)]
+        pub fn $spanned(tokens: &mut TokenStream, span: Span) {
+            let mut punct = Punct::new($char1, Spacing::Alone);
+            punct.set_span(span);
+            tokens.append(punct);
+        }
+    };
+    ($name:ident $spanned:ident $char1:tt $char2:tt) => {
+        #[doc(hidden)]
+        pub fn $name(tokens: &mut TokenStream) {
+            tokens.append(Punct::new($char1, Spacing::Joint));
+            tokens.append(Punct::new($char2, Spacing::Alone));
+        }
+        #[doc(hidden)]
+        pub fn $spanned(tokens: &mut TokenStream, span: Span) {
+            let mut punct = Punct::new($char1, Spacing::Joint);
+            punct.set_span(span);
+            tokens.append(punct);
+            let mut punct = Punct::new($char2, Spacing::Alone);
+            punct.set_span(span);
+            tokens.append(punct);
+        }
+    };
+    ($name:ident $spanned:ident $char1:tt $char2:tt $char3:tt) => {
+        #[doc(hidden)]
+        pub fn $name(tokens: &mut TokenStream) {
+            tokens.append(Punct::new($char1, Spacing::Joint));
+            tokens.append(Punct::new($char2, Spacing::Joint));
+            tokens.append(Punct::new($char3, Spacing::Alone));
+        }
+        #[doc(hidden)]
+        pub fn $spanned(tokens: &mut TokenStream, span: Span) {
+            let mut punct = Punct::new($char1, Spacing::Joint);
+            punct.set_span(span);
+            tokens.append(punct);
+            let mut punct = Punct::new($char2, Spacing::Joint);
+            punct.set_span(span);
+            tokens.append(punct);
+            let mut punct = Punct::new($char3, Spacing::Alone);
+            punct.set_span(span);
+            tokens.append(punct);
+        }
+    };
+}
+
+push_punct!(push_add push_add_spanned '+');
+push_punct!(push_add_eq push_add_eq_spanned '+' '=');
+push_punct!(push_and push_and_spanned '&');
+push_punct!(push_and_and push_and_and_spanned '&' '&');
+push_punct!(push_and_eq push_and_eq_spanned '&' '=');
+push_punct!(push_at push_at_spanned '@');
+push_punct!(push_bang push_bang_spanned '!');
+push_punct!(push_caret push_caret_spanned '^');
+push_punct!(push_caret_eq push_caret_eq_spanned '^' '=');
+push_punct!(push_colon push_colon_spanned ':');
+push_punct!(push_colon2 push_colon2_spanned ':' ':');
+push_punct!(push_comma push_comma_spanned ',');
+push_punct!(push_div push_div_spanned '/');
+push_punct!(push_div_eq push_div_eq_spanned '/' '=');
+push_punct!(push_dot push_dot_spanned '.');
+push_punct!(push_dot2 push_dot2_spanned '.' '.');
+push_punct!(push_dot3 push_dot3_spanned '.' '.' '.');
+push_punct!(push_dot_dot_eq push_dot_dot_eq_spanned '.' '.' '=');
+push_punct!(push_eq push_eq_spanned '=');
+push_punct!(push_eq_eq push_eq_eq_spanned '=' '=');
+push_punct!(push_ge push_ge_spanned '>' '=');
+push_punct!(push_gt push_gt_spanned '>');
+push_punct!(push_le push_le_spanned '<' '=');
+push_punct!(push_lt push_lt_spanned '<');
+push_punct!(push_mul_eq push_mul_eq_spanned '*' '=');
+push_punct!(push_ne push_ne_spanned '!' '=');
+push_punct!(push_or push_or_spanned '|');
+push_punct!(push_or_eq push_or_eq_spanned '|' '=');
+push_punct!(push_or_or push_or_or_spanned '|' '|');
+push_punct!(push_pound push_pound_spanned '#');
+push_punct!(push_question push_question_spanned '?');
+push_punct!(push_rarrow push_rarrow_spanned '-' '>');
+push_punct!(push_larrow push_larrow_spanned '<' '-');
+push_punct!(push_rem push_rem_spanned '%');
+push_punct!(push_rem_eq push_rem_eq_spanned '%' '=');
+push_punct!(push_fat_arrow push_fat_arrow_spanned '=' '>');
+push_punct!(push_semi push_semi_spanned ';');
+push_punct!(push_shl push_shl_spanned '<' '<');
+push_punct!(push_shl_eq push_shl_eq_spanned '<' '<' '=');
+push_punct!(push_shr push_shr_spanned '>' '>');
+push_punct!(push_shr_eq push_shr_eq_spanned '>' '>' '=');
+push_punct!(push_star push_star_spanned '*');
+push_punct!(push_sub push_sub_spanned '-');
+push_punct!(push_sub_eq push_sub_eq_spanned '-' '=');
+
+#[doc(hidden)]
+pub fn push_underscore(tokens: &mut TokenStream) {
+    push_underscore_spanned(tokens, Span::call_site());
+}
+
+#[doc(hidden)]
+pub fn push_underscore_spanned(tokens: &mut TokenStream, span: Span) {
+    tokens.append(Ident::new("_", span));
+}
+
+// Helper method for constructing identifiers from the `format_ident!` macro,
+// handling `r#` prefixes.
+#[doc(hidden)]
+pub fn mk_ident(id: &str, span: Option<Span>) -> Ident {
+    let span = span.unwrap_or_else(Span::call_site);
+    ident_maybe_raw(id, span)
+}
+
+fn ident_maybe_raw(id: &str, span: Span) -> Ident {
+    if let Some(id) = id.strip_prefix("r#") {
+        Ident::new_raw(id, span)
+    } else {
+        Ident::new(id, span)
+    }
+}
+
+// Adapts from `IdentFragment` to `fmt::Display` for use by the `format_ident!`
+// macro, and exposes span information from these fragments.
+//
+// This struct also has forwarding implementations of the formatting traits
+// `Octal`, `LowerHex`, `UpperHex`, and `Binary` to allow for their use within
+// `format_ident!`.
+#[derive(Copy, Clone)]
+#[doc(hidden)]
+pub struct IdentFragmentAdapter<T: IdentFragment>(pub T);
+
+impl<T: IdentFragment> IdentFragmentAdapter<T> {
+    pub fn span(&self) -> Option<Span> {
+        self.0.span()
+    }
+}
+
+impl<T: IdentFragment> fmt::Display for IdentFragmentAdapter<T> {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        IdentFragment::fmt(&self.0, f)
+    }
+}
+
+impl<T: IdentFragment + fmt::Octal> fmt::Octal for IdentFragmentAdapter<T> {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        fmt::Octal::fmt(&self.0, f)
+    }
+}
+
+impl<T: IdentFragment + fmt::LowerHex> fmt::LowerHex for IdentFragmentAdapter<T> {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        fmt::LowerHex::fmt(&self.0, f)
+    }
+}
+
+impl<T: IdentFragment + fmt::UpperHex> fmt::UpperHex for IdentFragmentAdapter<T> {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        fmt::UpperHex::fmt(&self.0, f)
+    }
+}
+
+impl<T: IdentFragment + fmt::Binary> fmt::Binary for IdentFragmentAdapter<T> {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        fmt::Binary::fmt(&self.0, f)
+    }
+}
+
\ No newline at end of file diff --git a/src/quote/spanned.rs.html b/src/quote/spanned.rs.html new file mode 100644 index 0000000..f56ebdc --- /dev/null +++ b/src/quote/spanned.rs.html @@ -0,0 +1,101 @@ +spanned.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+
use crate::ToTokens;
+use proc_macro2::extra::DelimSpan;
+use proc_macro2::{Span, TokenStream};
+
+// Not public API other than via the syn crate. Use syn::spanned::Spanned.
+pub trait Spanned: private::Sealed {
+    fn __span(&self) -> Span;
+}
+
+impl Spanned for Span {
+    fn __span(&self) -> Span {
+        *self
+    }
+}
+
+impl Spanned for DelimSpan {
+    fn __span(&self) -> Span {
+        self.join()
+    }
+}
+
+impl<T: ?Sized + ToTokens> Spanned for T {
+    fn __span(&self) -> Span {
+        join_spans(self.into_token_stream())
+    }
+}
+
+fn join_spans(tokens: TokenStream) -> Span {
+    let mut iter = tokens.into_iter().map(|tt| tt.span());
+
+    let first = match iter.next() {
+        Some(span) => span,
+        None => return Span::call_site(),
+    };
+
+    iter.fold(None, |_prev, next| Some(next))
+        .and_then(|last| first.join(last))
+        .unwrap_or(first)
+}
+
+mod private {
+    use crate::ToTokens;
+    use proc_macro2::extra::DelimSpan;
+    use proc_macro2::Span;
+
+    pub trait Sealed {}
+    impl Sealed for Span {}
+    impl Sealed for DelimSpan {}
+    impl<T: ?Sized + ToTokens> Sealed for T {}
+}
+
\ No newline at end of file diff --git a/src/quote/to_tokens.rs.html b/src/quote/to_tokens.rs.html new file mode 100644 index 0000000..816fc99 --- /dev/null +++ b/src/quote/to_tokens.rs.html @@ -0,0 +1,419 @@ +to_tokens.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+
use super::TokenStreamExt;
+use alloc::borrow::Cow;
+use alloc::rc::Rc;
+use core::iter;
+use proc_macro2::{Group, Ident, Literal, Punct, Span, TokenStream, TokenTree};
+
+/// Types that can be interpolated inside a `quote!` invocation.
+///
+/// [`quote!`]: macro.quote.html
+pub trait ToTokens {
+    /// Write `self` to the given `TokenStream`.
+    ///
+    /// The token append methods provided by the [`TokenStreamExt`] extension
+    /// trait may be useful for implementing `ToTokens`.
+    ///
+    /// [`TokenStreamExt`]: trait.TokenStreamExt.html
+    ///
+    /// # Example
+    ///
+    /// Example implementation for a struct representing Rust paths like
+    /// `std::cmp::PartialEq`:
+    ///
+    /// ```
+    /// use proc_macro2::{TokenTree, Spacing, Span, Punct, TokenStream};
+    /// use quote::{TokenStreamExt, ToTokens};
+    ///
+    /// pub struct Path {
+    ///     pub global: bool,
+    ///     pub segments: Vec<PathSegment>,
+    /// }
+    ///
+    /// impl ToTokens for Path {
+    ///     fn to_tokens(&self, tokens: &mut TokenStream) {
+    ///         for (i, segment) in self.segments.iter().enumerate() {
+    ///             if i > 0 || self.global {
+    ///                 // Double colon `::`
+    ///                 tokens.append(Punct::new(':', Spacing::Joint));
+    ///                 tokens.append(Punct::new(':', Spacing::Alone));
+    ///             }
+    ///             segment.to_tokens(tokens);
+    ///         }
+    ///     }
+    /// }
+    /// #
+    /// # pub struct PathSegment;
+    /// #
+    /// # impl ToTokens for PathSegment {
+    /// #     fn to_tokens(&self, tokens: &mut TokenStream) {
+    /// #         unimplemented!()
+    /// #     }
+    /// # }
+    /// ```
+    fn to_tokens(&self, tokens: &mut TokenStream);
+
+    /// Convert `self` directly into a `TokenStream` object.
+    ///
+    /// This method is implicitly implemented using `to_tokens`, and acts as a
+    /// convenience method for consumers of the `ToTokens` trait.
+    fn to_token_stream(&self) -> TokenStream {
+        let mut tokens = TokenStream::new();
+        self.to_tokens(&mut tokens);
+        tokens
+    }
+
+    /// Convert `self` directly into a `TokenStream` object.
+    ///
+    /// This method is implicitly implemented using `to_tokens`, and acts as a
+    /// convenience method for consumers of the `ToTokens` trait.
+    fn into_token_stream(self) -> TokenStream
+    where
+        Self: Sized,
+    {
+        self.to_token_stream()
+    }
+}
+
+impl<'a, T: ?Sized + ToTokens> ToTokens for &'a T {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
+        (**self).to_tokens(tokens);
+    }
+}
+
+impl<'a, T: ?Sized + ToTokens> ToTokens for &'a mut T {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
+        (**self).to_tokens(tokens);
+    }
+}
+
+impl<'a, T: ?Sized + ToOwned + ToTokens> ToTokens for Cow<'a, T> {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
+        (**self).to_tokens(tokens);
+    }
+}
+
+impl<T: ?Sized + ToTokens> ToTokens for Box<T> {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
+        (**self).to_tokens(tokens);
+    }
+}
+
+impl<T: ?Sized + ToTokens> ToTokens for Rc<T> {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
+        (**self).to_tokens(tokens);
+    }
+}
+
+impl<T: ToTokens> ToTokens for Option<T> {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
+        if let Some(ref t) = *self {
+            t.to_tokens(tokens);
+        }
+    }
+}
+
+impl ToTokens for str {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
+        tokens.append(Literal::string(self));
+    }
+}
+
+impl ToTokens for String {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
+        self.as_str().to_tokens(tokens);
+    }
+}
+
+macro_rules! primitive {
+    ($($t:ident => $name:ident)*) => {
+        $(
+            impl ToTokens for $t {
+                fn to_tokens(&self, tokens: &mut TokenStream) {
+                    tokens.append(Literal::$name(*self));
+                }
+            }
+        )*
+    };
+}
+
+primitive! {
+    i8 => i8_suffixed
+    i16 => i16_suffixed
+    i32 => i32_suffixed
+    i64 => i64_suffixed
+    i128 => i128_suffixed
+    isize => isize_suffixed
+
+    u8 => u8_suffixed
+    u16 => u16_suffixed
+    u32 => u32_suffixed
+    u64 => u64_suffixed
+    u128 => u128_suffixed
+    usize => usize_suffixed
+
+    f32 => f32_suffixed
+    f64 => f64_suffixed
+}
+
+impl ToTokens for char {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
+        tokens.append(Literal::character(*self));
+    }
+}
+
+impl ToTokens for bool {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
+        let word = if *self { "true" } else { "false" };
+        tokens.append(Ident::new(word, Span::call_site()));
+    }
+}
+
+impl ToTokens for Group {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
+        tokens.append(self.clone());
+    }
+}
+
+impl ToTokens for Ident {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
+        tokens.append(self.clone());
+    }
+}
+
+impl ToTokens for Punct {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
+        tokens.append(self.clone());
+    }
+}
+
+impl ToTokens for Literal {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
+        tokens.append(self.clone());
+    }
+}
+
+impl ToTokens for TokenTree {
+    fn to_tokens(&self, dst: &mut TokenStream) {
+        dst.append(self.clone());
+    }
+}
+
+impl ToTokens for TokenStream {
+    fn to_tokens(&self, dst: &mut TokenStream) {
+        dst.extend(iter::once(self.clone()));
+    }
+
+    fn into_token_stream(self) -> TokenStream {
+        self
+    }
+}
+
\ No newline at end of file diff --git a/src/syn/attr.rs.html b/src/syn/attr.rs.html new file mode 100644 index 0000000..84c1c7f --- /dev/null +++ b/src/syn/attr.rs.html @@ -0,0 +1,1587 @@ +attr.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+753
+754
+755
+756
+757
+758
+759
+760
+761
+762
+763
+764
+765
+766
+767
+768
+769
+770
+771
+772
+773
+774
+775
+776
+777
+778
+779
+780
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+
#[cfg(feature = "parsing")]
+use crate::error::Error;
+#[cfg(feature = "parsing")]
+use crate::error::Result;
+use crate::expr::Expr;
+use crate::mac::MacroDelimiter;
+#[cfg(feature = "parsing")]
+use crate::meta::{self, ParseNestedMeta};
+#[cfg(feature = "parsing")]
+use crate::parse::{Parse, ParseStream, Parser};
+use crate::path::Path;
+use crate::token;
+use proc_macro2::TokenStream;
+#[cfg(feature = "printing")]
+use std::iter;
+#[cfg(feature = "printing")]
+use std::slice;
+
+ast_struct! {
+    /// An attribute, like `#[repr(transparent)]`.
+    ///
+    /// <br>
+    ///
+    /// # Syntax
+    ///
+    /// Rust has six types of attributes.
+    ///
+    /// - Outer attributes like `#[repr(transparent)]`. These appear outside or
+    ///   in front of the item they describe.
+    ///
+    /// - Inner attributes like `#![feature(proc_macro)]`. These appear inside
+    ///   of the item they describe, usually a module.
+    ///
+    /// - Outer one-line doc comments like `/// Example`.
+    ///
+    /// - Inner one-line doc comments like `//! Please file an issue`.
+    ///
+    /// - Outer documentation blocks `/** Example */`.
+    ///
+    /// - Inner documentation blocks `/*! Please file an issue */`.
+    ///
+    /// The `style` field of type `AttrStyle` distinguishes whether an attribute
+    /// is outer or inner.
+    ///
+    /// Every attribute has a `path` that indicates the intended interpretation
+    /// of the rest of the attribute's contents. The path and the optional
+    /// additional contents are represented together in the `meta` field of the
+    /// attribute in three possible varieties:
+    ///
+    /// - Meta::Path &mdash; attributes whose information content conveys just a
+    ///   path, for example the `#[test]` attribute.
+    ///
+    /// - Meta::List &mdash; attributes that carry arbitrary tokens after the
+    ///   path, surrounded by a delimiter (parenthesis, bracket, or brace). For
+    ///   example `#[derive(Copy)]` or `#[precondition(x < 5)]`.
+    ///
+    /// - Meta::NameValue &mdash; attributes with an `=` sign after the path,
+    ///   followed by a Rust expression. For example `#[path =
+    ///   "sys/windows.rs"]`.
+    ///
+    /// All doc comments are represented in the NameValue style with a path of
+    /// "doc", as this is how they are processed by the compiler and by
+    /// `macro_rules!` macros.
+    ///
+    /// ```text
+    /// #[derive(Copy, Clone)]
+    ///   ~~~~~~Path
+    ///   ^^^^^^^^^^^^^^^^^^^Meta::List
+    ///
+    /// #[path = "sys/windows.rs"]
+    ///   ~~~~Path
+    ///   ^^^^^^^^^^^^^^^^^^^^^^^Meta::NameValue
+    ///
+    /// #[test]
+    ///   ^^^^Meta::Path
+    /// ```
+    ///
+    /// <br>
+    ///
+    /// # Parsing from tokens to Attribute
+    ///
+    /// This type does not implement the [`Parse`] trait and thus cannot be
+    /// parsed directly by [`ParseStream::parse`]. Instead use
+    /// [`ParseStream::call`] with one of the two parser functions
+    /// [`Attribute::parse_outer`] or [`Attribute::parse_inner`] depending on
+    /// which you intend to parse.
+    ///
+    /// [`Parse`]: crate::parse::Parse
+    /// [`ParseStream::parse`]: crate::parse::ParseBuffer::parse
+    /// [`ParseStream::call`]: crate::parse::ParseBuffer::call
+    ///
+    /// ```
+    /// use syn::{Attribute, Ident, Result, Token};
+    /// use syn::parse::{Parse, ParseStream};
+    ///
+    /// // Parses a unit struct with attributes.
+    /// //
+    /// //     #[path = "s.tmpl"]
+    /// //     struct S;
+    /// struct UnitStruct {
+    ///     attrs: Vec<Attribute>,
+    ///     struct_token: Token![struct],
+    ///     name: Ident,
+    ///     semi_token: Token![;],
+    /// }
+    ///
+    /// impl Parse for UnitStruct {
+    ///     fn parse(input: ParseStream) -> Result<Self> {
+    ///         Ok(UnitStruct {
+    ///             attrs: input.call(Attribute::parse_outer)?,
+    ///             struct_token: input.parse()?,
+    ///             name: input.parse()?,
+    ///             semi_token: input.parse()?,
+    ///         })
+    ///     }
+    /// }
+    /// ```
+    ///
+    /// <p><br></p>
+    ///
+    /// # Parsing from Attribute to structured arguments
+    ///
+    /// The grammar of attributes in Rust is very flexible, which makes the
+    /// syntax tree not that useful on its own. In particular, arguments of the
+    /// `Meta::List` variety of attribute are held in an arbitrary `tokens:
+    /// TokenStream`. Macros are expected to check the `path` of the attribute,
+    /// decide whether they recognize it, and then parse the remaining tokens
+    /// according to whatever grammar they wish to require for that kind of
+    /// attribute. Use [`parse_args()`] to parse those tokens into the expected
+    /// data structure.
+    ///
+    /// [`parse_args()`]: Attribute::parse_args
+    ///
+    /// <p><br></p>
+    ///
+    /// # Doc comments
+    ///
+    /// The compiler transforms doc comments, such as `/// comment` and `/*!
+    /// comment */`, into attributes before macros are expanded. Each comment is
+    /// expanded into an attribute of the form `#[doc = r"comment"]`.
+    ///
+    /// As an example, the following `mod` items are expanded identically:
+    ///
+    /// ```
+    /// # use syn::{ItemMod, parse_quote};
+    /// let doc: ItemMod = parse_quote! {
+    ///     /// Single line doc comments
+    ///     /// We write so many!
+    ///     /**
+    ///      * Multi-line comments...
+    ///      * May span many lines
+    ///      */
+    ///     mod example {
+    ///         //! Of course, they can be inner too
+    ///         /*! And fit in a single line */
+    ///     }
+    /// };
+    /// let attr: ItemMod = parse_quote! {
+    ///     #[doc = r" Single line doc comments"]
+    ///     #[doc = r" We write so many!"]
+    ///     #[doc = r"
+    ///      * Multi-line comments...
+    ///      * May span many lines
+    ///      "]
+    ///     mod example {
+    ///         #![doc = r" Of course, they can be inner too"]
+    ///         #![doc = r" And fit in a single line "]
+    ///     }
+    /// };
+    /// assert_eq!(doc, attr);
+    /// ```
+    #[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct Attribute {
+        pub pound_token: Token![#],
+        pub style: AttrStyle,
+        pub bracket_token: token::Bracket,
+        pub meta: Meta,
+    }
+}
+
+impl Attribute {
+    /// Returns the path that identifies the interpretation of this attribute.
+    ///
+    /// For example this would return the `test` in `#[test]`, the `derive` in
+    /// `#[derive(Copy)]`, and the `path` in `#[path = "sys/windows.rs"]`.
+    pub fn path(&self) -> &Path {
+        self.meta.path()
+    }
+
+    /// Parse the arguments to the attribute as a syntax tree.
+    ///
+    /// This is similar to pulling out the `TokenStream` from `Meta::List` and
+    /// doing `syn::parse2::<T>(meta_list.tokens)`, except that using
+    /// `parse_args` the error message has a more useful span when `tokens` is
+    /// empty.
+    ///
+    /// The surrounding delimiters are *not* included in the input to the
+    /// parser.
+    ///
+    /// ```text
+    /// #[my_attr(value < 5)]
+    ///           ^^^^^^^^^ what gets parsed
+    /// ```
+    ///
+    /// # Example
+    ///
+    /// ```
+    /// use syn::{parse_quote, Attribute, Expr};
+    ///
+    /// let attr: Attribute = parse_quote! {
+    ///     #[precondition(value < 5)]
+    /// };
+    ///
+    /// if attr.path().is_ident("precondition") {
+    ///     let precondition: Expr = attr.parse_args()?;
+    ///     // ...
+    /// }
+    /// # anyhow::Ok(())
+    /// ```
+    #[cfg(feature = "parsing")]
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    pub fn parse_args<T: Parse>(&self) -> Result<T> {
+        self.parse_args_with(T::parse)
+    }
+
+    /// Parse the arguments to the attribute using the given parser.
+    ///
+    /// # Example
+    ///
+    /// ```
+    /// use syn::{parse_quote, Attribute};
+    ///
+    /// let attr: Attribute = parse_quote! {
+    ///     #[inception { #[brrrrrrraaaaawwwwrwrrrmrmrmmrmrmmmmm] }]
+    /// };
+    ///
+    /// let bwom = attr.parse_args_with(Attribute::parse_outer)?;
+    ///
+    /// // Attribute does not have a Parse impl, so we couldn't directly do:
+    /// // let bwom: Attribute = attr.parse_args()?;
+    /// # anyhow::Ok(())
+    /// ```
+    #[cfg(feature = "parsing")]
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    pub fn parse_args_with<F: Parser>(&self, parser: F) -> Result<F::Output> {
+        match &self.meta {
+            Meta::Path(path) => Err(crate::error::new2(
+                path.segments.first().unwrap().ident.span(),
+                path.segments.last().unwrap().ident.span(),
+                format!(
+                    "expected attribute arguments in parentheses: {}[{}(...)]",
+                    parsing::DisplayAttrStyle(&self.style),
+                    parsing::DisplayPath(path),
+                ),
+            )),
+            Meta::NameValue(meta) => Err(Error::new(
+                meta.eq_token.span,
+                format_args!(
+                    "expected parentheses: {}[{}(...)]",
+                    parsing::DisplayAttrStyle(&self.style),
+                    parsing::DisplayPath(&meta.path),
+                ),
+            )),
+            Meta::List(meta) => meta.parse_args_with(parser),
+        }
+    }
+
+    /// Parse the arguments to the attribute, expecting it to follow the
+    /// conventional structure used by most of Rust's built-in attributes.
+    ///
+    /// The [*Meta Item Attribute Syntax*][syntax] section in the Rust reference
+    /// explains the convention in more detail. Not all attributes follow this
+    /// convention, so [`parse_args()`][Self::parse_args] is available if you
+    /// need to parse arbitrarily goofy attribute syntax.
+    ///
+    /// [syntax]: https://doc.rust-lang.org/reference/attributes.html#meta-item-attribute-syntax
+    ///
+    /// # Example
+    ///
+    /// We'll parse a struct, and then parse some of Rust's `#[repr]` attribute
+    /// syntax.
+    ///
+    /// ```
+    /// use syn::{parenthesized, parse_quote, token, ItemStruct, LitInt};
+    ///
+    /// let input: ItemStruct = parse_quote! {
+    ///     #[repr(C, align(4))]
+    ///     pub struct MyStruct(u16, u32);
+    /// };
+    ///
+    /// let mut repr_c = false;
+    /// let mut repr_transparent = false;
+    /// let mut repr_align = None::<usize>;
+    /// let mut repr_packed = None::<usize>;
+    /// for attr in &input.attrs {
+    ///     if attr.path().is_ident("repr") {
+    ///         attr.parse_nested_meta(|meta| {
+    ///             // #[repr(C)]
+    ///             if meta.path.is_ident("C") {
+    ///                 repr_c = true;
+    ///                 return Ok(());
+    ///             }
+    ///
+    ///             // #[repr(transparent)]
+    ///             if meta.path.is_ident("transparent") {
+    ///                 repr_transparent = true;
+    ///                 return Ok(());
+    ///             }
+    ///
+    ///             // #[repr(align(N))]
+    ///             if meta.path.is_ident("align") {
+    ///                 let content;
+    ///                 parenthesized!(content in meta.input);
+    ///                 let lit: LitInt = content.parse()?;
+    ///                 let n: usize = lit.base10_parse()?;
+    ///                 repr_align = Some(n);
+    ///                 return Ok(());
+    ///             }
+    ///
+    ///             // #[repr(packed)] or #[repr(packed(N))], omitted N means 1
+    ///             if meta.path.is_ident("packed") {
+    ///                 if meta.input.peek(token::Paren) {
+    ///                     let content;
+    ///                     parenthesized!(content in meta.input);
+    ///                     let lit: LitInt = content.parse()?;
+    ///                     let n: usize = lit.base10_parse()?;
+    ///                     repr_packed = Some(n);
+    ///                 } else {
+    ///                     repr_packed = Some(1);
+    ///                 }
+    ///                 return Ok(());
+    ///             }
+    ///
+    ///             Err(meta.error("unrecognized repr"))
+    ///         })?;
+    ///     }
+    /// }
+    /// # anyhow::Ok(())
+    /// ```
+    ///
+    /// # Alternatives
+    ///
+    /// In some cases, for attributes which have nested layers of structured
+    /// content, the following less flexible approach might be more convenient:
+    ///
+    /// ```
+    /// # use syn::{parse_quote, ItemStruct};
+    /// #
+    /// # let input: ItemStruct = parse_quote! {
+    /// #     #[repr(C, align(4))]
+    /// #     pub struct MyStruct(u16, u32);
+    /// # };
+    /// #
+    /// use syn::punctuated::Punctuated;
+    /// use syn::{parenthesized, token, Error, LitInt, Meta, Token};
+    ///
+    /// let mut repr_c = false;
+    /// let mut repr_transparent = false;
+    /// let mut repr_align = None::<usize>;
+    /// let mut repr_packed = None::<usize>;
+    /// for attr in &input.attrs {
+    ///     if attr.path().is_ident("repr") {
+    ///         let nested = attr.parse_args_with(Punctuated::<Meta, Token![,]>::parse_terminated)?;
+    ///         for meta in nested {
+    ///             match meta {
+    ///                 // #[repr(C)]
+    ///                 Meta::Path(path) if path.is_ident("C") => {
+    ///                     repr_c = true;
+    ///                 }
+    ///
+    ///                 // #[repr(align(N))]
+    ///                 Meta::List(meta) if meta.path.is_ident("align") => {
+    ///                     let lit: LitInt = meta.parse_args()?;
+    ///                     let n: usize = lit.base10_parse()?;
+    ///                     repr_align = Some(n);
+    ///                 }
+    ///
+    ///                 /* ... */
+    ///
+    ///                 _ => {
+    ///                     return Err(Error::new_spanned(meta, "unrecognized repr"));
+    ///                 }
+    ///             }
+    ///         }
+    ///     }
+    /// }
+    /// # Ok(())
+    /// ```
+    #[cfg(feature = "parsing")]
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    pub fn parse_nested_meta(
+        &self,
+        logic: impl FnMut(ParseNestedMeta) -> Result<()>,
+    ) -> Result<()> {
+        self.parse_args_with(meta::parser(logic))
+    }
+
+    /// Parses zero or more outer attributes from the stream.
+    ///
+    /// # Example
+    ///
+    /// See
+    /// [*Parsing from tokens to Attribute*](#parsing-from-tokens-to-attribute).
+    #[cfg(feature = "parsing")]
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    pub fn parse_outer(input: ParseStream) -> Result<Vec<Self>> {
+        let mut attrs = Vec::new();
+        while input.peek(Token![#]) {
+            attrs.push(input.call(parsing::single_parse_outer)?);
+        }
+        Ok(attrs)
+    }
+
+    /// Parses zero or more inner attributes from the stream.
+    ///
+    /// # Example
+    ///
+    /// See
+    /// [*Parsing from tokens to Attribute*](#parsing-from-tokens-to-attribute).
+    #[cfg(feature = "parsing")]
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    pub fn parse_inner(input: ParseStream) -> Result<Vec<Self>> {
+        let mut attrs = Vec::new();
+        parsing::parse_inner(input, &mut attrs)?;
+        Ok(attrs)
+    }
+}
+
+ast_enum! {
+    /// Distinguishes between attributes that decorate an item and attributes
+    /// that are contained within an item.
+    ///
+    /// # Outer attributes
+    ///
+    /// - `#[repr(transparent)]`
+    /// - `/// # Example`
+    /// - `/** Please file an issue */`
+    ///
+    /// # Inner attributes
+    ///
+    /// - `#![feature(proc_macro)]`
+    /// - `//! # Example`
+    /// - `/*! Please file an issue */`
+    #[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub enum AttrStyle {
+        Outer,
+        Inner(Token![!]),
+    }
+}
+
+ast_enum_of_structs! {
+    /// Content of a compile-time structured attribute.
+    ///
+    /// ## Path
+    ///
+    /// A meta path is like the `test` in `#[test]`.
+    ///
+    /// ## List
+    ///
+    /// A meta list is like the `derive(Copy)` in `#[derive(Copy)]`.
+    ///
+    /// ## NameValue
+    ///
+    /// A name-value meta is like the `path = "..."` in `#[path =
+    /// "sys/windows.rs"]`.
+    ///
+    /// # Syntax tree enum
+    ///
+    /// This type is a [syntax tree enum].
+    ///
+    /// [syntax tree enum]: crate::expr::Expr#syntax-tree-enums
+    #[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub enum Meta {
+        Path(Path),
+
+        /// A structured list within an attribute, like `derive(Copy, Clone)`.
+        List(MetaList),
+
+        /// A name-value pair within an attribute, like `feature = "nightly"`.
+        NameValue(MetaNameValue),
+    }
+}
+
+ast_struct! {
+    /// A structured list within an attribute, like `derive(Copy, Clone)`.
+    #[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct MetaList {
+        pub path: Path,
+        pub delimiter: MacroDelimiter,
+        pub tokens: TokenStream,
+    }
+}
+
+ast_struct! {
+    /// A name-value pair within an attribute, like `feature = "nightly"`.
+    #[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct MetaNameValue {
+        pub path: Path,
+        pub eq_token: Token![=],
+        pub value: Expr,
+    }
+}
+
+impl Meta {
+    /// Returns the path that begins this structured meta item.
+    ///
+    /// For example this would return the `test` in `#[test]`, the `derive` in
+    /// `#[derive(Copy)]`, and the `path` in `#[path = "sys/windows.rs"]`.
+    pub fn path(&self) -> &Path {
+        match self {
+            Meta::Path(path) => path,
+            Meta::List(meta) => &meta.path,
+            Meta::NameValue(meta) => &meta.path,
+        }
+    }
+
+    /// Error if this is a `Meta::List` or `Meta::NameValue`.
+    #[cfg(feature = "parsing")]
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    pub fn require_path_only(&self) -> Result<&Path> {
+        let error_span = match self {
+            Meta::Path(path) => return Ok(path),
+            Meta::List(meta) => meta.delimiter.span().open(),
+            Meta::NameValue(meta) => meta.eq_token.span,
+        };
+        Err(Error::new(error_span, "unexpected token in attribute"))
+    }
+
+    /// Error if this is a `Meta::Path` or `Meta::NameValue`.
+    #[cfg(feature = "parsing")]
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    pub fn require_list(&self) -> Result<&MetaList> {
+        match self {
+            Meta::List(meta) => Ok(meta),
+            Meta::Path(path) => Err(crate::error::new2(
+                path.segments.first().unwrap().ident.span(),
+                path.segments.last().unwrap().ident.span(),
+                format!(
+                    "expected attribute arguments in parentheses: `{}(...)`",
+                    parsing::DisplayPath(path),
+                ),
+            )),
+            Meta::NameValue(meta) => Err(Error::new(meta.eq_token.span, "expected `(`")),
+        }
+    }
+
+    /// Error if this is a `Meta::Path` or `Meta::List`.
+    #[cfg(feature = "parsing")]
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    pub fn require_name_value(&self) -> Result<&MetaNameValue> {
+        match self {
+            Meta::NameValue(meta) => Ok(meta),
+            Meta::Path(path) => Err(crate::error::new2(
+                path.segments.first().unwrap().ident.span(),
+                path.segments.last().unwrap().ident.span(),
+                format!(
+                    "expected a value for this attribute: `{} = ...`",
+                    parsing::DisplayPath(path),
+                ),
+            )),
+            Meta::List(meta) => Err(Error::new(meta.delimiter.span().open(), "expected `=`")),
+        }
+    }
+}
+
+impl MetaList {
+    /// See [`Attribute::parse_args`].
+    #[cfg(feature = "parsing")]
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    pub fn parse_args<T: Parse>(&self) -> Result<T> {
+        self.parse_args_with(T::parse)
+    }
+
+    /// See [`Attribute::parse_args_with`].
+    #[cfg(feature = "parsing")]
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    pub fn parse_args_with<F: Parser>(&self, parser: F) -> Result<F::Output> {
+        let scope = self.delimiter.span().close();
+        crate::parse::parse_scoped(parser, scope, self.tokens.clone())
+    }
+
+    /// See [`Attribute::parse_nested_meta`].
+    #[cfg(feature = "parsing")]
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    pub fn parse_nested_meta(
+        &self,
+        logic: impl FnMut(ParseNestedMeta) -> Result<()>,
+    ) -> Result<()> {
+        self.parse_args_with(meta::parser(logic))
+    }
+}
+
+#[cfg(feature = "printing")]
+pub(crate) trait FilterAttrs<'a> {
+    type Ret: Iterator<Item = &'a Attribute>;
+
+    fn outer(self) -> Self::Ret;
+    #[cfg(feature = "full")]
+    fn inner(self) -> Self::Ret;
+}
+
+#[cfg(feature = "printing")]
+impl<'a> FilterAttrs<'a> for &'a [Attribute] {
+    type Ret = iter::Filter<slice::Iter<'a, Attribute>, fn(&&Attribute) -> bool>;
+
+    fn outer(self) -> Self::Ret {
+        fn is_outer(attr: &&Attribute) -> bool {
+            match attr.style {
+                AttrStyle::Outer => true,
+                AttrStyle::Inner(_) => false,
+            }
+        }
+        self.iter().filter(is_outer)
+    }
+
+    #[cfg(feature = "full")]
+    fn inner(self) -> Self::Ret {
+        fn is_inner(attr: &&Attribute) -> bool {
+            match attr.style {
+                AttrStyle::Inner(_) => true,
+                AttrStyle::Outer => false,
+            }
+        }
+        self.iter().filter(is_inner)
+    }
+}
+
+#[cfg(feature = "parsing")]
+pub(crate) mod parsing {
+    use crate::attr::{AttrStyle, Attribute, Meta, MetaList, MetaNameValue};
+    use crate::error::Result;
+    use crate::expr::{Expr, ExprLit};
+    use crate::lit::Lit;
+    use crate::parse::discouraged::Speculative as _;
+    use crate::parse::{Parse, ParseStream};
+    use crate::path::Path;
+    use crate::{mac, token};
+    use std::fmt::{self, Display};
+
+    pub(crate) fn parse_inner(input: ParseStream, attrs: &mut Vec<Attribute>) -> Result<()> {
+        while input.peek(Token![#]) && input.peek2(Token![!]) {
+            attrs.push(input.call(single_parse_inner)?);
+        }
+        Ok(())
+    }
+
+    pub(crate) fn single_parse_inner(input: ParseStream) -> Result<Attribute> {
+        let content;
+        Ok(Attribute {
+            pound_token: input.parse()?,
+            style: AttrStyle::Inner(input.parse()?),
+            bracket_token: bracketed!(content in input),
+            meta: content.parse()?,
+        })
+    }
+
+    pub(crate) fn single_parse_outer(input: ParseStream) -> Result<Attribute> {
+        let content;
+        Ok(Attribute {
+            pound_token: input.parse()?,
+            style: AttrStyle::Outer,
+            bracket_token: bracketed!(content in input),
+            meta: content.parse()?,
+        })
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for Meta {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let path = input.call(Path::parse_mod_style)?;
+            parse_meta_after_path(path, input)
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for MetaList {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let path = input.call(Path::parse_mod_style)?;
+            parse_meta_list_after_path(path, input)
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for MetaNameValue {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let path = input.call(Path::parse_mod_style)?;
+            parse_meta_name_value_after_path(path, input)
+        }
+    }
+
+    pub(crate) fn parse_meta_after_path(path: Path, input: ParseStream) -> Result<Meta> {
+        if input.peek(token::Paren) || input.peek(token::Bracket) || input.peek(token::Brace) {
+            parse_meta_list_after_path(path, input).map(Meta::List)
+        } else if input.peek(Token![=]) {
+            parse_meta_name_value_after_path(path, input).map(Meta::NameValue)
+        } else {
+            Ok(Meta::Path(path))
+        }
+    }
+
+    fn parse_meta_list_after_path(path: Path, input: ParseStream) -> Result<MetaList> {
+        let (delimiter, tokens) = mac::parse_delimiter(input)?;
+        Ok(MetaList {
+            path,
+            delimiter,
+            tokens,
+        })
+    }
+
+    fn parse_meta_name_value_after_path(path: Path, input: ParseStream) -> Result<MetaNameValue> {
+        let eq_token: Token![=] = input.parse()?;
+        let ahead = input.fork();
+        let lit: Option<Lit> = ahead.parse()?;
+        let value = if let (Some(lit), true) = (lit, ahead.is_empty()) {
+            input.advance_to(&ahead);
+            Expr::Lit(ExprLit {
+                attrs: Vec::new(),
+                lit,
+            })
+        } else if input.peek(Token![#]) && input.peek2(token::Bracket) {
+            return Err(input.error("unexpected attribute inside of attribute"));
+        } else {
+            input.parse()?
+        };
+        Ok(MetaNameValue {
+            path,
+            eq_token,
+            value,
+        })
+    }
+
+    pub(super) struct DisplayAttrStyle<'a>(pub &'a AttrStyle);
+
+    impl<'a> Display for DisplayAttrStyle<'a> {
+        fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+            formatter.write_str(match self.0 {
+                AttrStyle::Outer => "#",
+                AttrStyle::Inner(_) => "#!",
+            })
+        }
+    }
+
+    pub(super) struct DisplayPath<'a>(pub &'a Path);
+
+    impl<'a> Display for DisplayPath<'a> {
+        fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+            for (i, segment) in self.0.segments.iter().enumerate() {
+                if i > 0 || self.0.leading_colon.is_some() {
+                    formatter.write_str("::")?;
+                }
+                write!(formatter, "{}", segment.ident)?;
+            }
+            Ok(())
+        }
+    }
+}
+
+#[cfg(feature = "printing")]
+mod printing {
+    use crate::attr::{AttrStyle, Attribute, MetaList, MetaNameValue};
+    use proc_macro2::TokenStream;
+    use quote::ToTokens;
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for Attribute {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.pound_token.to_tokens(tokens);
+            if let AttrStyle::Inner(b) = &self.style {
+                b.to_tokens(tokens);
+            }
+            self.bracket_token.surround(tokens, |tokens| {
+                self.meta.to_tokens(tokens);
+            });
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for MetaList {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.path.to_tokens(tokens);
+            self.delimiter.surround(tokens, self.tokens.clone());
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for MetaNameValue {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.path.to_tokens(tokens);
+            self.eq_token.to_tokens(tokens);
+            self.value.to_tokens(tokens);
+        }
+    }
+}
+
\ No newline at end of file diff --git a/src/syn/bigint.rs.html b/src/syn/bigint.rs.html new file mode 100644 index 0000000..bacc78f --- /dev/null +++ b/src/syn/bigint.rs.html @@ -0,0 +1,133 @@ +bigint.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+
use std::ops::{AddAssign, MulAssign};
+
+// For implementing base10_digits() accessor on LitInt.
+pub(crate) struct BigInt {
+    digits: Vec<u8>,
+}
+
+impl BigInt {
+    pub(crate) fn new() -> Self {
+        BigInt { digits: Vec::new() }
+    }
+
+    pub(crate) fn to_string(&self) -> String {
+        let mut repr = String::with_capacity(self.digits.len());
+
+        let mut has_nonzero = false;
+        for digit in self.digits.iter().rev() {
+            has_nonzero |= *digit != 0;
+            if has_nonzero {
+                repr.push((*digit + b'0') as char);
+            }
+        }
+
+        if repr.is_empty() {
+            repr.push('0');
+        }
+
+        repr
+    }
+
+    fn reserve_two_digits(&mut self) {
+        let len = self.digits.len();
+        let desired =
+            len + !self.digits.ends_with(&[0, 0]) as usize + !self.digits.ends_with(&[0]) as usize;
+        self.digits.resize(desired, 0);
+    }
+}
+
+impl AddAssign<u8> for BigInt {
+    // Assumes increment <16.
+    fn add_assign(&mut self, mut increment: u8) {
+        self.reserve_two_digits();
+
+        let mut i = 0;
+        while increment > 0 {
+            let sum = self.digits[i] + increment;
+            self.digits[i] = sum % 10;
+            increment = sum / 10;
+            i += 1;
+        }
+    }
+}
+
+impl MulAssign<u8> for BigInt {
+    // Assumes base <=16.
+    fn mul_assign(&mut self, base: u8) {
+        self.reserve_two_digits();
+
+        let mut carry = 0;
+        for digit in &mut self.digits {
+            let prod = *digit * base + carry;
+            *digit = prod % 10;
+            carry = prod / 10;
+        }
+    }
+}
+
\ No newline at end of file diff --git a/src/syn/buffer.rs.html b/src/syn/buffer.rs.html new file mode 100644 index 0000000..6f0e7a0 --- /dev/null +++ b/src/syn/buffer.rs.html @@ -0,0 +1,869 @@ +buffer.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+
//! A stably addressed token buffer supporting efficient traversal based on a
+//! cheaply copyable cursor.
+
+// This module is heavily commented as it contains most of the unsafe code in
+// Syn, and caution should be used when editing it. The public-facing interface
+// is 100% safe but the implementation is fragile internally.
+
+use crate::Lifetime;
+use proc_macro2::extra::DelimSpan;
+use proc_macro2::{Delimiter, Group, Ident, Literal, Punct, Spacing, Span, TokenStream, TokenTree};
+use std::cmp::Ordering;
+use std::marker::PhantomData;
+
+/// Internal type which is used instead of `TokenTree` to represent a token tree
+/// within a `TokenBuffer`.
+enum Entry {
+    // Mimicking types from proc-macro.
+    // Group entries contain the offset to the matching End entry.
+    Group(Group, usize),
+    Ident(Ident),
+    Punct(Punct),
+    Literal(Literal),
+    // End entries contain the offset (negative) to the start of the buffer.
+    End(isize),
+}
+
+/// A buffer that can be efficiently traversed multiple times, unlike
+/// `TokenStream` which requires a deep copy in order to traverse more than
+/// once.
+pub struct TokenBuffer {
+    // NOTE: Do not implement clone on this - while the current design could be
+    // cloned, other designs which could be desirable may not be cloneable.
+    entries: Box<[Entry]>,
+}
+
+impl TokenBuffer {
+    fn recursive_new(entries: &mut Vec<Entry>, stream: TokenStream) {
+        for tt in stream {
+            match tt {
+                TokenTree::Ident(ident) => entries.push(Entry::Ident(ident)),
+                TokenTree::Punct(punct) => entries.push(Entry::Punct(punct)),
+                TokenTree::Literal(literal) => entries.push(Entry::Literal(literal)),
+                TokenTree::Group(group) => {
+                    let group_start_index = entries.len();
+                    entries.push(Entry::End(0)); // we replace this below
+                    Self::recursive_new(entries, group.stream());
+                    let group_end_index = entries.len();
+                    entries.push(Entry::End(-(group_end_index as isize)));
+                    let group_end_offset = group_end_index - group_start_index;
+                    entries[group_start_index] = Entry::Group(group, group_end_offset);
+                }
+            }
+        }
+    }
+
+    /// Creates a `TokenBuffer` containing all the tokens from the input
+    /// `proc_macro::TokenStream`.
+    #[cfg(feature = "proc-macro")]
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "proc-macro")))]
+    pub fn new(stream: proc_macro::TokenStream) -> Self {
+        Self::new2(stream.into())
+    }
+
+    /// Creates a `TokenBuffer` containing all the tokens from the input
+    /// `proc_macro2::TokenStream`.
+    pub fn new2(stream: TokenStream) -> Self {
+        let mut entries = Vec::new();
+        Self::recursive_new(&mut entries, stream);
+        entries.push(Entry::End(-(entries.len() as isize)));
+        Self {
+            entries: entries.into_boxed_slice(),
+        }
+    }
+
+    /// Creates a cursor referencing the first token in the buffer and able to
+    /// traverse until the end of the buffer.
+    pub fn begin(&self) -> Cursor {
+        let ptr = self.entries.as_ptr();
+        unsafe { Cursor::create(ptr, ptr.add(self.entries.len() - 1)) }
+    }
+}
+
+/// A cheaply copyable cursor into a `TokenBuffer`.
+///
+/// This cursor holds a shared reference into the immutable data which is used
+/// internally to represent a `TokenStream`, and can be efficiently manipulated
+/// and copied around.
+///
+/// An empty `Cursor` can be created directly, or one may create a `TokenBuffer`
+/// object and get a cursor to its first token with `begin()`.
+pub struct Cursor<'a> {
+    // The current entry which the `Cursor` is pointing at.
+    ptr: *const Entry,
+    // This is the only `Entry::End` object which this cursor is allowed to
+    // point at. All other `End` objects are skipped over in `Cursor::create`.
+    scope: *const Entry,
+    // Cursor is covariant in 'a. This field ensures that our pointers are still
+    // valid.
+    marker: PhantomData<&'a Entry>,
+}
+
+impl<'a> Cursor<'a> {
+    /// Creates a cursor referencing a static empty TokenStream.
+    pub fn empty() -> Self {
+        // It's safe in this situation for us to put an `Entry` object in global
+        // storage, despite it not actually being safe to send across threads
+        // (`Ident` is a reference into a thread-local table). This is because
+        // this entry never includes a `Ident` object.
+        //
+        // This wrapper struct allows us to break the rules and put a `Sync`
+        // object in global storage.
+        struct UnsafeSyncEntry(Entry);
+        unsafe impl Sync for UnsafeSyncEntry {}
+        static EMPTY_ENTRY: UnsafeSyncEntry = UnsafeSyncEntry(Entry::End(0));
+
+        Cursor {
+            ptr: &EMPTY_ENTRY.0,
+            scope: &EMPTY_ENTRY.0,
+            marker: PhantomData,
+        }
+    }
+
+    /// This create method intelligently exits non-explicitly-entered
+    /// `None`-delimited scopes when the cursor reaches the end of them,
+    /// allowing for them to be treated transparently.
+    unsafe fn create(mut ptr: *const Entry, scope: *const Entry) -> Self {
+        // NOTE: If we're looking at a `End`, we want to advance the cursor
+        // past it, unless `ptr == scope`, which means that we're at the edge of
+        // our cursor's scope. We should only have `ptr != scope` at the exit
+        // from None-delimited groups entered with `ignore_none`.
+        while let Entry::End(_) = unsafe { &*ptr } {
+            if ptr == scope {
+                break;
+            }
+            ptr = unsafe { ptr.add(1) };
+        }
+
+        Cursor {
+            ptr,
+            scope,
+            marker: PhantomData,
+        }
+    }
+
+    /// Get the current entry.
+    fn entry(self) -> &'a Entry {
+        unsafe { &*self.ptr }
+    }
+
+    /// Bump the cursor to point at the next token after the current one. This
+    /// is undefined behavior if the cursor is currently looking at an
+    /// `Entry::End`.
+    ///
+    /// If the cursor is looking at an `Entry::Group`, the bumped cursor will
+    /// point at the first token in the group (with the same scope end).
+    unsafe fn bump_ignore_group(self) -> Cursor<'a> {
+        unsafe { Cursor::create(self.ptr.offset(1), self.scope) }
+    }
+
+    /// While the cursor is looking at a `None`-delimited group, move it to look
+    /// at the first token inside instead. If the group is empty, this will move
+    /// the cursor past the `None`-delimited group.
+    ///
+    /// WARNING: This mutates its argument.
+    fn ignore_none(&mut self) {
+        while let Entry::Group(group, _) = self.entry() {
+            if group.delimiter() == Delimiter::None {
+                unsafe { *self = self.bump_ignore_group() };
+            } else {
+                break;
+            }
+        }
+    }
+
+    /// Checks whether the cursor is currently pointing at the end of its valid
+    /// scope.
+    pub fn eof(self) -> bool {
+        // We're at eof if we're at the end of our scope.
+        self.ptr == self.scope
+    }
+
+    /// If the cursor is pointing at a `Group` with the given delimiter, returns
+    /// a cursor into that group and one pointing to the next `TokenTree`.
+    pub fn group(mut self, delim: Delimiter) -> Option<(Cursor<'a>, DelimSpan, Cursor<'a>)> {
+        // If we're not trying to enter a none-delimited group, we want to
+        // ignore them. We have to make sure to _not_ ignore them when we want
+        // to enter them, of course. For obvious reasons.
+        if delim != Delimiter::None {
+            self.ignore_none();
+        }
+
+        if let Entry::Group(group, end_offset) = self.entry() {
+            if group.delimiter() == delim {
+                let span = group.delim_span();
+                let end_of_group = unsafe { self.ptr.add(*end_offset) };
+                let inside_of_group = unsafe { Cursor::create(self.ptr.add(1), end_of_group) };
+                let after_group = unsafe { Cursor::create(end_of_group, self.scope) };
+                return Some((inside_of_group, span, after_group));
+            }
+        }
+
+        None
+    }
+
+    pub(crate) fn any_group(self) -> Option<(Cursor<'a>, Delimiter, DelimSpan, Cursor<'a>)> {
+        if let Entry::Group(group, end_offset) = self.entry() {
+            let delimiter = group.delimiter();
+            let span = group.delim_span();
+            let end_of_group = unsafe { self.ptr.add(*end_offset) };
+            let inside_of_group = unsafe { Cursor::create(self.ptr.add(1), end_of_group) };
+            let after_group = unsafe { Cursor::create(end_of_group, self.scope) };
+            return Some((inside_of_group, delimiter, span, after_group));
+        }
+
+        None
+    }
+
+    pub(crate) fn any_group_token(self) -> Option<(Group, Cursor<'a>)> {
+        if let Entry::Group(group, end_offset) = self.entry() {
+            let end_of_group = unsafe { self.ptr.add(*end_offset) };
+            let after_group = unsafe { Cursor::create(end_of_group, self.scope) };
+            return Some((group.clone(), after_group));
+        }
+
+        None
+    }
+
+    /// If the cursor is pointing at a `Ident`, returns it along with a cursor
+    /// pointing at the next `TokenTree`.
+    pub fn ident(mut self) -> Option<(Ident, Cursor<'a>)> {
+        self.ignore_none();
+        match self.entry() {
+            Entry::Ident(ident) => Some((ident.clone(), unsafe { self.bump_ignore_group() })),
+            _ => None,
+        }
+    }
+
+    /// If the cursor is pointing at a `Punct`, returns it along with a cursor
+    /// pointing at the next `TokenTree`.
+    pub fn punct(mut self) -> Option<(Punct, Cursor<'a>)> {
+        self.ignore_none();
+        match self.entry() {
+            Entry::Punct(punct) if punct.as_char() != '\'' => {
+                Some((punct.clone(), unsafe { self.bump_ignore_group() }))
+            }
+            _ => None,
+        }
+    }
+
+    /// If the cursor is pointing at a `Literal`, return it along with a cursor
+    /// pointing at the next `TokenTree`.
+    pub fn literal(mut self) -> Option<(Literal, Cursor<'a>)> {
+        self.ignore_none();
+        match self.entry() {
+            Entry::Literal(literal) => Some((literal.clone(), unsafe { self.bump_ignore_group() })),
+            _ => None,
+        }
+    }
+
+    /// If the cursor is pointing at a `Lifetime`, returns it along with a
+    /// cursor pointing at the next `TokenTree`.
+    pub fn lifetime(mut self) -> Option<(Lifetime, Cursor<'a>)> {
+        self.ignore_none();
+        match self.entry() {
+            Entry::Punct(punct) if punct.as_char() == '\'' && punct.spacing() == Spacing::Joint => {
+                let next = unsafe { self.bump_ignore_group() };
+                let (ident, rest) = next.ident()?;
+                let lifetime = Lifetime {
+                    apostrophe: punct.span(),
+                    ident,
+                };
+                Some((lifetime, rest))
+            }
+            _ => None,
+        }
+    }
+
+    /// Copies all remaining tokens visible from this cursor into a
+    /// `TokenStream`.
+    pub fn token_stream(self) -> TokenStream {
+        let mut tts = Vec::new();
+        let mut cursor = self;
+        while let Some((tt, rest)) = cursor.token_tree() {
+            tts.push(tt);
+            cursor = rest;
+        }
+        tts.into_iter().collect()
+    }
+
+    /// If the cursor is pointing at a `TokenTree`, returns it along with a
+    /// cursor pointing at the next `TokenTree`.
+    ///
+    /// Returns `None` if the cursor has reached the end of its stream.
+    ///
+    /// This method does not treat `None`-delimited groups as transparent, and
+    /// will return a `Group(None, ..)` if the cursor is looking at one.
+    pub fn token_tree(self) -> Option<(TokenTree, Cursor<'a>)> {
+        let (tree, len) = match self.entry() {
+            Entry::Group(group, end_offset) => (group.clone().into(), *end_offset),
+            Entry::Literal(literal) => (literal.clone().into(), 1),
+            Entry::Ident(ident) => (ident.clone().into(), 1),
+            Entry::Punct(punct) => (punct.clone().into(), 1),
+            Entry::End(_) => return None,
+        };
+
+        let rest = unsafe { Cursor::create(self.ptr.add(len), self.scope) };
+        Some((tree, rest))
+    }
+
+    /// Returns the `Span` of the current token, or `Span::call_site()` if this
+    /// cursor points to eof.
+    pub fn span(self) -> Span {
+        match self.entry() {
+            Entry::Group(group, _) => group.span(),
+            Entry::Literal(literal) => literal.span(),
+            Entry::Ident(ident) => ident.span(),
+            Entry::Punct(punct) => punct.span(),
+            Entry::End(_) => Span::call_site(),
+        }
+    }
+
+    /// Returns the `Span` of the token immediately prior to the position of
+    /// this cursor, or of the current token if there is no previous one.
+    #[cfg(any(feature = "full", feature = "derive"))]
+    pub(crate) fn prev_span(mut self) -> Span {
+        if start_of_buffer(self) < self.ptr {
+            self.ptr = unsafe { self.ptr.offset(-1) };
+            if let Entry::End(_) = self.entry() {
+                // Locate the matching Group begin token.
+                let mut depth = 1;
+                loop {
+                    self.ptr = unsafe { self.ptr.offset(-1) };
+                    match self.entry() {
+                        Entry::Group(group, _) => {
+                            depth -= 1;
+                            if depth == 0 {
+                                return group.span();
+                            }
+                        }
+                        Entry::End(_) => depth += 1,
+                        Entry::Literal(_) | Entry::Ident(_) | Entry::Punct(_) => {}
+                    }
+                }
+            }
+        }
+        self.span()
+    }
+
+    /// Skip over the next token that is not a None-delimited group, without
+    /// cloning it. Returns `None` if this cursor points to eof.
+    ///
+    /// This method treats `'lifetimes` as a single token.
+    pub(crate) fn skip(mut self) -> Option<Cursor<'a>> {
+        self.ignore_none();
+
+        let len = match self.entry() {
+            Entry::End(_) => return None,
+
+            // Treat lifetimes as a single tt for the purposes of 'skip'.
+            Entry::Punct(punct) if punct.as_char() == '\'' && punct.spacing() == Spacing::Joint => {
+                match unsafe { &*self.ptr.add(1) } {
+                    Entry::Ident(_) => 2,
+                    _ => 1,
+                }
+            }
+
+            Entry::Group(_, end_offset) => *end_offset,
+            _ => 1,
+        };
+
+        Some(unsafe { Cursor::create(self.ptr.add(len), self.scope) })
+    }
+}
+
+impl<'a> Copy for Cursor<'a> {}
+
+impl<'a> Clone for Cursor<'a> {
+    fn clone(&self) -> Self {
+        *self
+    }
+}
+
+impl<'a> Eq for Cursor<'a> {}
+
+impl<'a> PartialEq for Cursor<'a> {
+    fn eq(&self, other: &Self) -> bool {
+        self.ptr == other.ptr
+    }
+}
+
+impl<'a> PartialOrd for Cursor<'a> {
+    fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
+        if same_buffer(*self, *other) {
+            Some(cmp_assuming_same_buffer(*self, *other))
+        } else {
+            None
+        }
+    }
+}
+
+pub(crate) fn same_scope(a: Cursor, b: Cursor) -> bool {
+    a.scope == b.scope
+}
+
+pub(crate) fn same_buffer(a: Cursor, b: Cursor) -> bool {
+    start_of_buffer(a) == start_of_buffer(b)
+}
+
+fn start_of_buffer(cursor: Cursor) -> *const Entry {
+    unsafe {
+        match &*cursor.scope {
+            Entry::End(offset) => cursor.scope.offset(*offset),
+            _ => unreachable!(),
+        }
+    }
+}
+
+pub(crate) fn cmp_assuming_same_buffer(a: Cursor, b: Cursor) -> Ordering {
+    a.ptr.cmp(&b.ptr)
+}
+
+pub(crate) fn open_span_of_group(cursor: Cursor) -> Span {
+    match cursor.entry() {
+        Entry::Group(group, _) => group.span_open(),
+        _ => cursor.span(),
+    }
+}
+
+pub(crate) fn close_span_of_group(cursor: Cursor) -> Span {
+    match cursor.entry() {
+        Entry::Group(group, _) => group.span_close(),
+        _ => cursor.span(),
+    }
+}
+
\ No newline at end of file diff --git a/src/syn/custom_keyword.rs.html b/src/syn/custom_keyword.rs.html new file mode 100644 index 0000000..85df8f1 --- /dev/null +++ b/src/syn/custom_keyword.rs.html @@ -0,0 +1,521 @@ +custom_keyword.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+
/// Define a type that supports parsing and printing a given identifier as if it
+/// were a keyword.
+///
+/// # Usage
+///
+/// As a convention, it is recommended that this macro be invoked within a
+/// module called `kw` or `keyword` and that the resulting parser be invoked
+/// with a `kw::` or `keyword::` prefix.
+///
+/// ```
+/// mod kw {
+///     syn::custom_keyword!(whatever);
+/// }
+/// ```
+///
+/// The generated syntax tree node supports the following operations just like
+/// any built-in keyword token.
+///
+/// - [Peeking] — `input.peek(kw::whatever)`
+///
+/// - [Parsing] — `input.parse::<kw::whatever>()?`
+///
+/// - [Printing] — `quote!( ... #whatever_token ... )`
+///
+/// - Construction from a [`Span`] — `let whatever_token = kw::whatever(sp)`
+///
+/// - Field access to its span — `let sp = whatever_token.span`
+///
+/// [Peeking]: crate::parse::ParseBuffer::peek
+/// [Parsing]: crate::parse::ParseBuffer::parse
+/// [Printing]: quote::ToTokens
+/// [`Span`]: proc_macro2::Span
+///
+/// # Example
+///
+/// This example parses input that looks like `bool = true` or `str = "value"`.
+/// The key must be either the identifier `bool` or the identifier `str`. If
+/// `bool`, the value may be either `true` or `false`. If `str`, the value may
+/// be any string literal.
+///
+/// The symbols `bool` and `str` are not reserved keywords in Rust so these are
+/// not considered keywords in the `syn::token` module. Like any other
+/// identifier that is not a keyword, these can be declared as custom keywords
+/// by crates that need to use them as such.
+///
+/// ```
+/// use syn::{LitBool, LitStr, Result, Token};
+/// use syn::parse::{Parse, ParseStream};
+///
+/// mod kw {
+///     syn::custom_keyword!(bool);
+///     syn::custom_keyword!(str);
+/// }
+///
+/// enum Argument {
+///     Bool {
+///         bool_token: kw::bool,
+///         eq_token: Token![=],
+///         value: LitBool,
+///     },
+///     Str {
+///         str_token: kw::str,
+///         eq_token: Token![=],
+///         value: LitStr,
+///     },
+/// }
+///
+/// impl Parse for Argument {
+///     fn parse(input: ParseStream) -> Result<Self> {
+///         let lookahead = input.lookahead1();
+///         if lookahead.peek(kw::bool) {
+///             Ok(Argument::Bool {
+///                 bool_token: input.parse::<kw::bool>()?,
+///                 eq_token: input.parse()?,
+///                 value: input.parse()?,
+///             })
+///         } else if lookahead.peek(kw::str) {
+///             Ok(Argument::Str {
+///                 str_token: input.parse::<kw::str>()?,
+///                 eq_token: input.parse()?,
+///                 value: input.parse()?,
+///             })
+///         } else {
+///             Err(lookahead.error())
+///         }
+///     }
+/// }
+/// ```
+#[macro_export]
+macro_rules! custom_keyword {
+    ($ident:ident) => {
+        #[allow(non_camel_case_types)]
+        pub struct $ident {
+            #[allow(dead_code)]
+            pub span: $crate::__private::Span,
+        }
+
+        #[doc(hidden)]
+        #[allow(dead_code, non_snake_case)]
+        pub fn $ident<__S: $crate::__private::IntoSpans<$crate::__private::Span>>(
+            span: __S,
+        ) -> $ident {
+            $ident {
+                span: $crate::__private::IntoSpans::into_spans(span),
+            }
+        }
+
+        const _: () = {
+            impl $crate::__private::Default for $ident {
+                fn default() -> Self {
+                    $ident {
+                        span: $crate::__private::Span::call_site(),
+                    }
+                }
+            }
+
+            $crate::impl_parse_for_custom_keyword!($ident);
+            $crate::impl_to_tokens_for_custom_keyword!($ident);
+            $crate::impl_clone_for_custom_keyword!($ident);
+            $crate::impl_extra_traits_for_custom_keyword!($ident);
+        };
+    };
+}
+
+// Not public API.
+#[cfg(feature = "parsing")]
+#[doc(hidden)]
+#[macro_export]
+macro_rules! impl_parse_for_custom_keyword {
+    ($ident:ident) => {
+        // For peek.
+        impl $crate::__private::CustomToken for $ident {
+            fn peek(cursor: $crate::buffer::Cursor) -> $crate::__private::bool {
+                if let $crate::__private::Some((ident, _rest)) = cursor.ident() {
+                    ident == $crate::__private::stringify!($ident)
+                } else {
+                    false
+                }
+            }
+
+            fn display() -> &'static $crate::__private::str {
+                $crate::__private::concat!("`", $crate::__private::stringify!($ident), "`")
+            }
+        }
+
+        impl $crate::parse::Parse for $ident {
+            fn parse(input: $crate::parse::ParseStream) -> $crate::parse::Result<$ident> {
+                input.step(|cursor| {
+                    if let $crate::__private::Some((ident, rest)) = cursor.ident() {
+                        if ident == $crate::__private::stringify!($ident) {
+                            return $crate::__private::Ok(($ident { span: ident.span() }, rest));
+                        }
+                    }
+                    $crate::__private::Err(cursor.error($crate::__private::concat!(
+                        "expected `",
+                        $crate::__private::stringify!($ident),
+                        "`",
+                    )))
+                })
+            }
+        }
+    };
+}
+
+// Not public API.
+#[cfg(not(feature = "parsing"))]
+#[doc(hidden)]
+#[macro_export]
+macro_rules! impl_parse_for_custom_keyword {
+    ($ident:ident) => {};
+}
+
+// Not public API.
+#[cfg(feature = "printing")]
+#[doc(hidden)]
+#[macro_export]
+macro_rules! impl_to_tokens_for_custom_keyword {
+    ($ident:ident) => {
+        impl $crate::__private::ToTokens for $ident {
+            fn to_tokens(&self, tokens: &mut $crate::__private::TokenStream2) {
+                let ident = $crate::Ident::new($crate::__private::stringify!($ident), self.span);
+                $crate::__private::TokenStreamExt::append(tokens, ident);
+            }
+        }
+    };
+}
+
+// Not public API.
+#[cfg(not(feature = "printing"))]
+#[doc(hidden)]
+#[macro_export]
+macro_rules! impl_to_tokens_for_custom_keyword {
+    ($ident:ident) => {};
+}
+
+// Not public API.
+#[cfg(feature = "clone-impls")]
+#[doc(hidden)]
+#[macro_export]
+macro_rules! impl_clone_for_custom_keyword {
+    ($ident:ident) => {
+        impl $crate::__private::Copy for $ident {}
+
+        #[allow(clippy::expl_impl_clone_on_copy)]
+        impl $crate::__private::Clone for $ident {
+            fn clone(&self) -> Self {
+                *self
+            }
+        }
+    };
+}
+
+// Not public API.
+#[cfg(not(feature = "clone-impls"))]
+#[doc(hidden)]
+#[macro_export]
+macro_rules! impl_clone_for_custom_keyword {
+    ($ident:ident) => {};
+}
+
+// Not public API.
+#[cfg(feature = "extra-traits")]
+#[doc(hidden)]
+#[macro_export]
+macro_rules! impl_extra_traits_for_custom_keyword {
+    ($ident:ident) => {
+        impl $crate::__private::Debug for $ident {
+            fn fmt(&self, f: &mut $crate::__private::Formatter) -> $crate::__private::FmtResult {
+                $crate::__private::Formatter::write_str(
+                    f,
+                    $crate::__private::concat!(
+                        "Keyword [",
+                        $crate::__private::stringify!($ident),
+                        "]",
+                    ),
+                )
+            }
+        }
+
+        impl $crate::__private::Eq for $ident {}
+
+        impl $crate::__private::PartialEq for $ident {
+            fn eq(&self, _other: &Self) -> $crate::__private::bool {
+                true
+            }
+        }
+
+        impl $crate::__private::Hash for $ident {
+            fn hash<__H: $crate::__private::Hasher>(&self, _state: &mut __H) {}
+        }
+    };
+}
+
+// Not public API.
+#[cfg(not(feature = "extra-traits"))]
+#[doc(hidden)]
+#[macro_export]
+macro_rules! impl_extra_traits_for_custom_keyword {
+    ($ident:ident) => {};
+}
+
\ No newline at end of file diff --git a/src/syn/custom_punctuation.rs.html b/src/syn/custom_punctuation.rs.html new file mode 100644 index 0000000..7a0f879 --- /dev/null +++ b/src/syn/custom_punctuation.rs.html @@ -0,0 +1,609 @@ +custom_punctuation.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+
/// Define a type that supports parsing and printing a multi-character symbol
+/// as if it were a punctuation token.
+///
+/// # Usage
+///
+/// ```
+/// syn::custom_punctuation!(LeftRightArrow, <=>);
+/// ```
+///
+/// The generated syntax tree node supports the following operations just like
+/// any built-in punctuation token.
+///
+/// - [Peeking] — `input.peek(LeftRightArrow)`
+///
+/// - [Parsing] — `input.parse::<LeftRightArrow>()?`
+///
+/// - [Printing] — `quote!( ... #lrarrow ... )`
+///
+/// - Construction from a [`Span`] — `let lrarrow = LeftRightArrow(sp)`
+///
+/// - Construction from multiple [`Span`] — `let lrarrow = LeftRightArrow([sp, sp, sp])`
+///
+/// - Field access to its spans — `let spans = lrarrow.spans`
+///
+/// [Peeking]: crate::parse::ParseBuffer::peek
+/// [Parsing]: crate::parse::ParseBuffer::parse
+/// [Printing]: quote::ToTokens
+/// [`Span`]: proc_macro2::Span
+///
+/// # Example
+///
+/// ```
+/// use proc_macro2::{TokenStream, TokenTree};
+/// use syn::parse::{Parse, ParseStream, Peek, Result};
+/// use syn::punctuated::Punctuated;
+/// use syn::Expr;
+///
+/// syn::custom_punctuation!(PathSeparator, </>);
+///
+/// // expr </> expr </> expr ...
+/// struct PathSegments {
+///     segments: Punctuated<Expr, PathSeparator>,
+/// }
+///
+/// impl Parse for PathSegments {
+///     fn parse(input: ParseStream) -> Result<Self> {
+///         let mut segments = Punctuated::new();
+///
+///         let first = parse_until(input, PathSeparator)?;
+///         segments.push_value(syn::parse2(first)?);
+///
+///         while input.peek(PathSeparator) {
+///             segments.push_punct(input.parse()?);
+///
+///             let next = parse_until(input, PathSeparator)?;
+///             segments.push_value(syn::parse2(next)?);
+///         }
+///
+///         Ok(PathSegments { segments })
+///     }
+/// }
+///
+/// fn parse_until<E: Peek>(input: ParseStream, end: E) -> Result<TokenStream> {
+///     let mut tokens = TokenStream::new();
+///     while !input.is_empty() && !input.peek(end) {
+///         let next: TokenTree = input.parse()?;
+///         tokens.extend(Some(next));
+///     }
+///     Ok(tokens)
+/// }
+///
+/// fn main() {
+///     let input = r#" a::b </> c::d::e "#;
+///     let _: PathSegments = syn::parse_str(input).unwrap();
+/// }
+/// ```
+#[macro_export]
+macro_rules! custom_punctuation {
+    ($ident:ident, $($tt:tt)+) => {
+        pub struct $ident {
+            #[allow(dead_code)]
+            pub spans: $crate::custom_punctuation_repr!($($tt)+),
+        }
+
+        #[doc(hidden)]
+        #[allow(dead_code, non_snake_case)]
+        pub fn $ident<__S: $crate::__private::IntoSpans<$crate::custom_punctuation_repr!($($tt)+)>>(
+            spans: __S,
+        ) -> $ident {
+            let _validate_len = 0 $(+ $crate::custom_punctuation_len!(strict, $tt))*;
+            $ident {
+                spans: $crate::__private::IntoSpans::into_spans(spans)
+            }
+        }
+
+        const _: () = {
+            impl $crate::__private::Default for $ident {
+                fn default() -> Self {
+                    $ident($crate::__private::Span::call_site())
+                }
+            }
+
+            $crate::impl_parse_for_custom_punctuation!($ident, $($tt)+);
+            $crate::impl_to_tokens_for_custom_punctuation!($ident, $($tt)+);
+            $crate::impl_clone_for_custom_punctuation!($ident, $($tt)+);
+            $crate::impl_extra_traits_for_custom_punctuation!($ident, $($tt)+);
+        };
+    };
+}
+
+// Not public API.
+#[cfg(feature = "parsing")]
+#[doc(hidden)]
+#[macro_export]
+macro_rules! impl_parse_for_custom_punctuation {
+    ($ident:ident, $($tt:tt)+) => {
+        impl $crate::__private::CustomToken for $ident {
+            fn peek(cursor: $crate::buffer::Cursor) -> $crate::__private::bool {
+                $crate::__private::peek_punct(cursor, $crate::stringify_punct!($($tt)+))
+            }
+
+            fn display() -> &'static $crate::__private::str {
+                $crate::__private::concat!("`", $crate::stringify_punct!($($tt)+), "`")
+            }
+        }
+
+        impl $crate::parse::Parse for $ident {
+            fn parse(input: $crate::parse::ParseStream) -> $crate::parse::Result<$ident> {
+                let spans: $crate::custom_punctuation_repr!($($tt)+) =
+                    $crate::__private::parse_punct(input, $crate::stringify_punct!($($tt)+))?;
+                Ok($ident(spans))
+            }
+        }
+    };
+}
+
+// Not public API.
+#[cfg(not(feature = "parsing"))]
+#[doc(hidden)]
+#[macro_export]
+macro_rules! impl_parse_for_custom_punctuation {
+    ($ident:ident, $($tt:tt)+) => {};
+}
+
+// Not public API.
+#[cfg(feature = "printing")]
+#[doc(hidden)]
+#[macro_export]
+macro_rules! impl_to_tokens_for_custom_punctuation {
+    ($ident:ident, $($tt:tt)+) => {
+        impl $crate::__private::ToTokens for $ident {
+            fn to_tokens(&self, tokens: &mut $crate::__private::TokenStream2) {
+                $crate::__private::print_punct($crate::stringify_punct!($($tt)+), &self.spans, tokens)
+            }
+        }
+    };
+}
+
+// Not public API.
+#[cfg(not(feature = "printing"))]
+#[doc(hidden)]
+#[macro_export]
+macro_rules! impl_to_tokens_for_custom_punctuation {
+    ($ident:ident, $($tt:tt)+) => {};
+}
+
+// Not public API.
+#[cfg(feature = "clone-impls")]
+#[doc(hidden)]
+#[macro_export]
+macro_rules! impl_clone_for_custom_punctuation {
+    ($ident:ident, $($tt:tt)+) => {
+        impl $crate::__private::Copy for $ident {}
+
+        #[allow(clippy::expl_impl_clone_on_copy)]
+        impl $crate::__private::Clone for $ident {
+            fn clone(&self) -> Self {
+                *self
+            }
+        }
+    };
+}
+
+// Not public API.
+#[cfg(not(feature = "clone-impls"))]
+#[doc(hidden)]
+#[macro_export]
+macro_rules! impl_clone_for_custom_punctuation {
+    ($ident:ident, $($tt:tt)+) => {};
+}
+
+// Not public API.
+#[cfg(feature = "extra-traits")]
+#[doc(hidden)]
+#[macro_export]
+macro_rules! impl_extra_traits_for_custom_punctuation {
+    ($ident:ident, $($tt:tt)+) => {
+        impl $crate::__private::Debug for $ident {
+            fn fmt(&self, f: &mut $crate::__private::Formatter) -> $crate::__private::FmtResult {
+                $crate::__private::Formatter::write_str(f, $crate::__private::stringify!($ident))
+            }
+        }
+
+        impl $crate::__private::Eq for $ident {}
+
+        impl $crate::__private::PartialEq for $ident {
+            fn eq(&self, _other: &Self) -> $crate::__private::bool {
+                true
+            }
+        }
+
+        impl $crate::__private::Hash for $ident {
+            fn hash<__H: $crate::__private::Hasher>(&self, _state: &mut __H) {}
+        }
+    };
+}
+
+// Not public API.
+#[cfg(not(feature = "extra-traits"))]
+#[doc(hidden)]
+#[macro_export]
+macro_rules! impl_extra_traits_for_custom_punctuation {
+    ($ident:ident, $($tt:tt)+) => {};
+}
+
+// Not public API.
+#[doc(hidden)]
+#[macro_export]
+macro_rules! custom_punctuation_repr {
+    ($($tt:tt)+) => {
+        [$crate::__private::Span; 0 $(+ $crate::custom_punctuation_len!(lenient, $tt))+]
+    };
+}
+
+// Not public API.
+#[doc(hidden)]
+#[macro_export]
+#[rustfmt::skip]
+macro_rules! custom_punctuation_len {
+    ($mode:ident, &)     => { 1 };
+    ($mode:ident, &&)    => { 2 };
+    ($mode:ident, &=)    => { 2 };
+    ($mode:ident, @)     => { 1 };
+    ($mode:ident, ^)     => { 1 };
+    ($mode:ident, ^=)    => { 2 };
+    ($mode:ident, :)     => { 1 };
+    ($mode:ident, ,)     => { 1 };
+    ($mode:ident, $)     => { 1 };
+    ($mode:ident, .)     => { 1 };
+    ($mode:ident, ..)    => { 2 };
+    ($mode:ident, ...)   => { 3 };
+    ($mode:ident, ..=)   => { 3 };
+    ($mode:ident, =)     => { 1 };
+    ($mode:ident, ==)    => { 2 };
+    ($mode:ident, =>)    => { 2 };
+    ($mode:ident, >=)    => { 2 };
+    ($mode:ident, >)     => { 1 };
+    ($mode:ident, <-)    => { 2 };
+    ($mode:ident, <=)    => { 2 };
+    ($mode:ident, <)     => { 1 };
+    ($mode:ident, -)     => { 1 };
+    ($mode:ident, -=)    => { 2 };
+    ($mode:ident, !=)    => { 2 };
+    ($mode:ident, !)     => { 1 };
+    ($mode:ident, |)     => { 1 };
+    ($mode:ident, |=)    => { 2 };
+    ($mode:ident, ||)    => { 2 };
+    ($mode:ident, ::)    => { 2 };
+    ($mode:ident, %)     => { 1 };
+    ($mode:ident, %=)    => { 2 };
+    ($mode:ident, +)     => { 1 };
+    ($mode:ident, +=)    => { 2 };
+    ($mode:ident, #)     => { 1 };
+    ($mode:ident, ?)     => { 1 };
+    ($mode:ident, ->)    => { 2 };
+    ($mode:ident, ;)     => { 1 };
+    ($mode:ident, <<)    => { 2 };
+    ($mode:ident, <<=)   => { 3 };
+    ($mode:ident, >>)    => { 2 };
+    ($mode:ident, >>=)   => { 3 };
+    ($mode:ident, /)     => { 1 };
+    ($mode:ident, /=)    => { 2 };
+    ($mode:ident, *)     => { 1 };
+    ($mode:ident, *=)    => { 2 };
+    ($mode:ident, ~)     => { 1 };
+    (lenient, $tt:tt)    => { 0 };
+    (strict, $tt:tt)     => {{ $crate::custom_punctuation_unexpected!($tt); 0 }};
+}
+
+// Not public API.
+#[doc(hidden)]
+#[macro_export]
+macro_rules! custom_punctuation_unexpected {
+    () => {};
+}
+
+// Not public API.
+#[doc(hidden)]
+#[macro_export]
+macro_rules! stringify_punct {
+    ($($tt:tt)+) => {
+        $crate::__private::concat!($($crate::__private::stringify!($tt)),+)
+    };
+}
+
\ No newline at end of file diff --git a/src/syn/data.rs.html b/src/syn/data.rs.html new file mode 100644 index 0000000..895b411 --- /dev/null +++ b/src/syn/data.rs.html @@ -0,0 +1,847 @@ +data.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+
use crate::attr::Attribute;
+use crate::expr::Expr;
+use crate::ident::Ident;
+use crate::punctuated::{self, Punctuated};
+use crate::restriction::{FieldMutability, Visibility};
+use crate::token;
+use crate::ty::Type;
+
+ast_struct! {
+    /// An enum variant.
+    #[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct Variant {
+        pub attrs: Vec<Attribute>,
+
+        /// Name of the variant.
+        pub ident: Ident,
+
+        /// Content stored in the variant.
+        pub fields: Fields,
+
+        /// Explicit discriminant: `Variant = 1`
+        pub discriminant: Option<(Token![=], Expr)>,
+    }
+}
+
+ast_enum_of_structs! {
+    /// Data stored within an enum variant or struct.
+    ///
+    /// # Syntax tree enum
+    ///
+    /// This type is a [syntax tree enum].
+    ///
+    /// [syntax tree enum]: crate::expr::Expr#syntax-tree-enums
+    #[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub enum Fields {
+        /// Named fields of a struct or struct variant such as `Point { x: f64,
+        /// y: f64 }`.
+        Named(FieldsNamed),
+
+        /// Unnamed fields of a tuple struct or tuple variant such as `Some(T)`.
+        Unnamed(FieldsUnnamed),
+
+        /// Unit struct or unit variant such as `None`.
+        Unit,
+    }
+}
+
+ast_struct! {
+    /// Named fields of a struct or struct variant such as `Point { x: f64,
+    /// y: f64 }`.
+    #[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct FieldsNamed {
+        pub brace_token: token::Brace,
+        pub named: Punctuated<Field, Token![,]>,
+    }
+}
+
+ast_struct! {
+    /// Unnamed fields of a tuple struct or tuple variant such as `Some(T)`.
+    #[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct FieldsUnnamed {
+        pub paren_token: token::Paren,
+        pub unnamed: Punctuated<Field, Token![,]>,
+    }
+}
+
+impl Fields {
+    /// Get an iterator over the borrowed [`Field`] items in this object. This
+    /// iterator can be used to iterate over a named or unnamed struct or
+    /// variant's fields uniformly.
+    pub fn iter(&self) -> punctuated::Iter<Field> {
+        match self {
+            Fields::Unit => crate::punctuated::empty_punctuated_iter(),
+            Fields::Named(f) => f.named.iter(),
+            Fields::Unnamed(f) => f.unnamed.iter(),
+        }
+    }
+
+    /// Get an iterator over the mutably borrowed [`Field`] items in this
+    /// object. This iterator can be used to iterate over a named or unnamed
+    /// struct or variant's fields uniformly.
+    pub fn iter_mut(&mut self) -> punctuated::IterMut<Field> {
+        match self {
+            Fields::Unit => crate::punctuated::empty_punctuated_iter_mut(),
+            Fields::Named(f) => f.named.iter_mut(),
+            Fields::Unnamed(f) => f.unnamed.iter_mut(),
+        }
+    }
+
+    /// Returns the number of fields.
+    pub fn len(&self) -> usize {
+        match self {
+            Fields::Unit => 0,
+            Fields::Named(f) => f.named.len(),
+            Fields::Unnamed(f) => f.unnamed.len(),
+        }
+    }
+
+    /// Returns `true` if there are zero fields.
+    pub fn is_empty(&self) -> bool {
+        match self {
+            Fields::Unit => true,
+            Fields::Named(f) => f.named.is_empty(),
+            Fields::Unnamed(f) => f.unnamed.is_empty(),
+        }
+    }
+}
+
+impl IntoIterator for Fields {
+    type Item = Field;
+    type IntoIter = punctuated::IntoIter<Field>;
+
+    fn into_iter(self) -> Self::IntoIter {
+        match self {
+            Fields::Unit => Punctuated::<Field, ()>::new().into_iter(),
+            Fields::Named(f) => f.named.into_iter(),
+            Fields::Unnamed(f) => f.unnamed.into_iter(),
+        }
+    }
+}
+
+impl<'a> IntoIterator for &'a Fields {
+    type Item = &'a Field;
+    type IntoIter = punctuated::Iter<'a, Field>;
+
+    fn into_iter(self) -> Self::IntoIter {
+        self.iter()
+    }
+}
+
+impl<'a> IntoIterator for &'a mut Fields {
+    type Item = &'a mut Field;
+    type IntoIter = punctuated::IterMut<'a, Field>;
+
+    fn into_iter(self) -> Self::IntoIter {
+        self.iter_mut()
+    }
+}
+
+ast_struct! {
+    /// A field of a struct or enum variant.
+    #[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct Field {
+        pub attrs: Vec<Attribute>,
+
+        pub vis: Visibility,
+
+        pub mutability: FieldMutability,
+
+        /// Name of the field, if any.
+        ///
+        /// Fields of tuple structs have no names.
+        pub ident: Option<Ident>,
+
+        pub colon_token: Option<Token![:]>,
+
+        pub ty: Type,
+    }
+}
+
+#[cfg(feature = "parsing")]
+pub(crate) mod parsing {
+    use crate::attr::Attribute;
+    use crate::data::{Field, Fields, FieldsNamed, FieldsUnnamed, Variant};
+    use crate::error::Result;
+    use crate::expr::Expr;
+    use crate::ext::IdentExt as _;
+    use crate::ident::Ident;
+    #[cfg(not(feature = "full"))]
+    use crate::parse::discouraged::Speculative as _;
+    use crate::parse::{Parse, ParseStream};
+    use crate::restriction::{FieldMutability, Visibility};
+    use crate::token;
+    use crate::ty::Type;
+    use crate::verbatim;
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for Variant {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let attrs = input.call(Attribute::parse_outer)?;
+            let _visibility: Visibility = input.parse()?;
+            let ident: Ident = input.parse()?;
+            let fields = if input.peek(token::Brace) {
+                Fields::Named(input.parse()?)
+            } else if input.peek(token::Paren) {
+                Fields::Unnamed(input.parse()?)
+            } else {
+                Fields::Unit
+            };
+            let discriminant = if input.peek(Token![=]) {
+                let eq_token: Token![=] = input.parse()?;
+                #[cfg(feature = "full")]
+                let discriminant: Expr = input.parse()?;
+                #[cfg(not(feature = "full"))]
+                let discriminant = {
+                    let begin = input.fork();
+                    let ahead = input.fork();
+                    let mut discriminant: Result<Expr> = ahead.parse();
+                    if discriminant.is_ok() {
+                        input.advance_to(&ahead);
+                    } else if scan_lenient_discriminant(input).is_ok() {
+                        discriminant = Ok(Expr::Verbatim(verbatim::between(&begin, input)));
+                    }
+                    discriminant?
+                };
+                Some((eq_token, discriminant))
+            } else {
+                None
+            };
+            Ok(Variant {
+                attrs,
+                ident,
+                fields,
+                discriminant,
+            })
+        }
+    }
+
+    #[cfg(not(feature = "full"))]
+    pub(crate) fn scan_lenient_discriminant(input: ParseStream) -> Result<()> {
+        use crate::expr::Member;
+        use crate::lifetime::Lifetime;
+        use crate::lit::Lit;
+        use crate::lit::LitFloat;
+        use crate::op::{BinOp, UnOp};
+        use crate::path::{self, AngleBracketedGenericArguments};
+        use proc_macro2::Delimiter::{self, Brace, Bracket, Parenthesis};
+
+        let consume = |delimiter: Delimiter| {
+            Result::unwrap(input.step(|cursor| match cursor.group(delimiter) {
+                Some((_inside, _span, rest)) => Ok((true, rest)),
+                None => Ok((false, *cursor)),
+            }))
+        };
+
+        macro_rules! consume {
+            [$token:tt] => {
+                input.parse::<Option<Token![$token]>>().unwrap().is_some()
+            };
+        }
+
+        let mut initial = true;
+        let mut depth = 0usize;
+        loop {
+            if initial {
+                if consume![&] {
+                    input.parse::<Option<Token![mut]>>()?;
+                } else if consume![if] || consume![match] || consume![while] {
+                    depth += 1;
+                } else if input.parse::<Option<Lit>>()?.is_some()
+                    || (consume(Brace) || consume(Bracket) || consume(Parenthesis))
+                    || (consume![async] || consume![const] || consume![loop] || consume![unsafe])
+                        && (consume(Brace) || break)
+                {
+                    initial = false;
+                } else if consume![let] {
+                    while !consume![=] {
+                        if !((consume![|] || consume![ref] || consume![mut] || consume![@])
+                            || (consume![!] || input.parse::<Option<Lit>>()?.is_some())
+                            || (consume![..=] || consume![..] || consume![&] || consume![_])
+                            || (consume(Brace) || consume(Bracket) || consume(Parenthesis)))
+                        {
+                            path::parsing::qpath(input, true)?;
+                        }
+                    }
+                } else if input.parse::<Option<Lifetime>>()?.is_some() && !consume![:] {
+                    break;
+                } else if input.parse::<UnOp>().is_err() {
+                    path::parsing::qpath(input, true)?;
+                    initial = consume![!] || depth == 0 && input.peek(token::Brace);
+                }
+            } else if input.is_empty() || input.peek(Token![,]) {
+                return Ok(());
+            } else if depth > 0 && consume(Brace) {
+                if consume![else] && !consume(Brace) {
+                    initial = consume![if] || break;
+                } else {
+                    depth -= 1;
+                }
+            } else if input.parse::<BinOp>().is_ok() || (consume![..] | consume![=]) {
+                initial = true;
+            } else if consume![.] {
+                if input.parse::<Option<LitFloat>>()?.is_none()
+                    && (input.parse::<Member>()?.is_named() && consume![::])
+                {
+                    AngleBracketedGenericArguments::do_parse(None, input)?;
+                }
+            } else if consume![as] {
+                input.parse::<Type>()?;
+            } else if !(consume(Brace) || consume(Bracket) || consume(Parenthesis)) {
+                break;
+            }
+        }
+
+        Err(input.error("unsupported expression"))
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for FieldsNamed {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let content;
+            Ok(FieldsNamed {
+                brace_token: braced!(content in input),
+                named: content.parse_terminated(Field::parse_named, Token![,])?,
+            })
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for FieldsUnnamed {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let content;
+            Ok(FieldsUnnamed {
+                paren_token: parenthesized!(content in input),
+                unnamed: content.parse_terminated(Field::parse_unnamed, Token![,])?,
+            })
+        }
+    }
+
+    impl Field {
+        /// Parses a named (braced struct) field.
+        #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+        pub fn parse_named(input: ParseStream) -> Result<Self> {
+            let attrs = input.call(Attribute::parse_outer)?;
+            let vis: Visibility = input.parse()?;
+
+            let unnamed_field = cfg!(feature = "full") && input.peek(Token![_]);
+            let ident = if unnamed_field {
+                input.call(Ident::parse_any)
+            } else {
+                input.parse()
+            }?;
+
+            let colon_token: Token![:] = input.parse()?;
+
+            let ty: Type = if unnamed_field
+                && (input.peek(Token![struct])
+                    || input.peek(Token![union]) && input.peek2(token::Brace))
+            {
+                let begin = input.fork();
+                input.call(Ident::parse_any)?;
+                input.parse::<FieldsNamed>()?;
+                Type::Verbatim(verbatim::between(&begin, input))
+            } else {
+                input.parse()?
+            };
+
+            Ok(Field {
+                attrs,
+                vis,
+                mutability: FieldMutability::None,
+                ident: Some(ident),
+                colon_token: Some(colon_token),
+                ty,
+            })
+        }
+
+        /// Parses an unnamed (tuple struct) field.
+        #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+        pub fn parse_unnamed(input: ParseStream) -> Result<Self> {
+            Ok(Field {
+                attrs: input.call(Attribute::parse_outer)?,
+                vis: input.parse()?,
+                mutability: FieldMutability::None,
+                ident: None,
+                colon_token: None,
+                ty: input.parse()?,
+            })
+        }
+    }
+}
+
+#[cfg(feature = "printing")]
+mod printing {
+    use crate::data::{Field, FieldsNamed, FieldsUnnamed, Variant};
+    use crate::print::TokensOrDefault;
+    use proc_macro2::TokenStream;
+    use quote::{ToTokens, TokenStreamExt};
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for Variant {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(&self.attrs);
+            self.ident.to_tokens(tokens);
+            self.fields.to_tokens(tokens);
+            if let Some((eq_token, disc)) = &self.discriminant {
+                eq_token.to_tokens(tokens);
+                disc.to_tokens(tokens);
+            }
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for FieldsNamed {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.brace_token.surround(tokens, |tokens| {
+                self.named.to_tokens(tokens);
+            });
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for FieldsUnnamed {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.paren_token.surround(tokens, |tokens| {
+                self.unnamed.to_tokens(tokens);
+            });
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for Field {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(&self.attrs);
+            self.vis.to_tokens(tokens);
+            if let Some(ident) = &self.ident {
+                ident.to_tokens(tokens);
+                TokensOrDefault(&self.colon_token).to_tokens(tokens);
+            }
+            self.ty.to_tokens(tokens);
+        }
+    }
+}
+
\ No newline at end of file diff --git a/src/syn/derive.rs.html b/src/syn/derive.rs.html new file mode 100644 index 0000000..a1f666e --- /dev/null +++ b/src/syn/derive.rs.html @@ -0,0 +1,519 @@ +derive.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+
use crate::attr::Attribute;
+use crate::data::{Fields, FieldsNamed, Variant};
+use crate::generics::Generics;
+use crate::ident::Ident;
+use crate::punctuated::Punctuated;
+use crate::restriction::Visibility;
+use crate::token;
+
+ast_struct! {
+    /// Data structure sent to a `proc_macro_derive` macro.
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "derive")))]
+    pub struct DeriveInput {
+        pub attrs: Vec<Attribute>,
+        pub vis: Visibility,
+        pub ident: Ident,
+        pub generics: Generics,
+        pub data: Data,
+    }
+}
+
+ast_enum! {
+    /// The storage of a struct, enum or union data structure.
+    ///
+    /// # Syntax tree enum
+    ///
+    /// This type is a [syntax tree enum].
+    ///
+    /// [syntax tree enum]: crate::expr::Expr#syntax-tree-enums
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "derive")))]
+    pub enum Data {
+        Struct(DataStruct),
+        Enum(DataEnum),
+        Union(DataUnion),
+    }
+}
+
+ast_struct! {
+    /// A struct input to a `proc_macro_derive` macro.
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "derive")))]
+    pub struct DataStruct {
+        pub struct_token: Token![struct],
+        pub fields: Fields,
+        pub semi_token: Option<Token![;]>,
+    }
+}
+
+ast_struct! {
+    /// An enum input to a `proc_macro_derive` macro.
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "derive")))]
+    pub struct DataEnum {
+        pub enum_token: Token![enum],
+        pub brace_token: token::Brace,
+        pub variants: Punctuated<Variant, Token![,]>,
+    }
+}
+
+ast_struct! {
+    /// An untagged union input to a `proc_macro_derive` macro.
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "derive")))]
+    pub struct DataUnion {
+        pub union_token: Token![union],
+        pub fields: FieldsNamed,
+    }
+}
+
+#[cfg(feature = "parsing")]
+pub(crate) mod parsing {
+    use crate::attr::Attribute;
+    use crate::data::{Fields, FieldsNamed, Variant};
+    use crate::derive::{Data, DataEnum, DataStruct, DataUnion, DeriveInput};
+    use crate::error::Result;
+    use crate::generics::{Generics, WhereClause};
+    use crate::ident::Ident;
+    use crate::parse::{Parse, ParseStream};
+    use crate::punctuated::Punctuated;
+    use crate::restriction::Visibility;
+    use crate::token;
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for DeriveInput {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let attrs = input.call(Attribute::parse_outer)?;
+            let vis = input.parse::<Visibility>()?;
+
+            let lookahead = input.lookahead1();
+            if lookahead.peek(Token![struct]) {
+                let struct_token = input.parse::<Token![struct]>()?;
+                let ident = input.parse::<Ident>()?;
+                let generics = input.parse::<Generics>()?;
+                let (where_clause, fields, semi) = data_struct(input)?;
+                Ok(DeriveInput {
+                    attrs,
+                    vis,
+                    ident,
+                    generics: Generics {
+                        where_clause,
+                        ..generics
+                    },
+                    data: Data::Struct(DataStruct {
+                        struct_token,
+                        fields,
+                        semi_token: semi,
+                    }),
+                })
+            } else if lookahead.peek(Token![enum]) {
+                let enum_token = input.parse::<Token![enum]>()?;
+                let ident = input.parse::<Ident>()?;
+                let generics = input.parse::<Generics>()?;
+                let (where_clause, brace, variants) = data_enum(input)?;
+                Ok(DeriveInput {
+                    attrs,
+                    vis,
+                    ident,
+                    generics: Generics {
+                        where_clause,
+                        ..generics
+                    },
+                    data: Data::Enum(DataEnum {
+                        enum_token,
+                        brace_token: brace,
+                        variants,
+                    }),
+                })
+            } else if lookahead.peek(Token![union]) {
+                let union_token = input.parse::<Token![union]>()?;
+                let ident = input.parse::<Ident>()?;
+                let generics = input.parse::<Generics>()?;
+                let (where_clause, fields) = data_union(input)?;
+                Ok(DeriveInput {
+                    attrs,
+                    vis,
+                    ident,
+                    generics: Generics {
+                        where_clause,
+                        ..generics
+                    },
+                    data: Data::Union(DataUnion {
+                        union_token,
+                        fields,
+                    }),
+                })
+            } else {
+                Err(lookahead.error())
+            }
+        }
+    }
+
+    pub(crate) fn data_struct(
+        input: ParseStream,
+    ) -> Result<(Option<WhereClause>, Fields, Option<Token![;]>)> {
+        let mut lookahead = input.lookahead1();
+        let mut where_clause = None;
+        if lookahead.peek(Token![where]) {
+            where_clause = Some(input.parse()?);
+            lookahead = input.lookahead1();
+        }
+
+        if where_clause.is_none() && lookahead.peek(token::Paren) {
+            let fields = input.parse()?;
+
+            lookahead = input.lookahead1();
+            if lookahead.peek(Token![where]) {
+                where_clause = Some(input.parse()?);
+                lookahead = input.lookahead1();
+            }
+
+            if lookahead.peek(Token![;]) {
+                let semi = input.parse()?;
+                Ok((where_clause, Fields::Unnamed(fields), Some(semi)))
+            } else {
+                Err(lookahead.error())
+            }
+        } else if lookahead.peek(token::Brace) {
+            let fields = input.parse()?;
+            Ok((where_clause, Fields::Named(fields), None))
+        } else if lookahead.peek(Token![;]) {
+            let semi = input.parse()?;
+            Ok((where_clause, Fields::Unit, Some(semi)))
+        } else {
+            Err(lookahead.error())
+        }
+    }
+
+    pub(crate) fn data_enum(
+        input: ParseStream,
+    ) -> Result<(
+        Option<WhereClause>,
+        token::Brace,
+        Punctuated<Variant, Token![,]>,
+    )> {
+        let where_clause = input.parse()?;
+
+        let content;
+        let brace = braced!(content in input);
+        let variants = content.parse_terminated(Variant::parse, Token![,])?;
+
+        Ok((where_clause, brace, variants))
+    }
+
+    pub(crate) fn data_union(input: ParseStream) -> Result<(Option<WhereClause>, FieldsNamed)> {
+        let where_clause = input.parse()?;
+        let fields = input.parse()?;
+        Ok((where_clause, fields))
+    }
+}
+
+#[cfg(feature = "printing")]
+mod printing {
+    use crate::attr::FilterAttrs;
+    use crate::data::Fields;
+    use crate::derive::{Data, DeriveInput};
+    use crate::print::TokensOrDefault;
+    use proc_macro2::TokenStream;
+    use quote::ToTokens;
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for DeriveInput {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            for attr in self.attrs.outer() {
+                attr.to_tokens(tokens);
+            }
+            self.vis.to_tokens(tokens);
+            match &self.data {
+                Data::Struct(d) => d.struct_token.to_tokens(tokens),
+                Data::Enum(d) => d.enum_token.to_tokens(tokens),
+                Data::Union(d) => d.union_token.to_tokens(tokens),
+            }
+            self.ident.to_tokens(tokens);
+            self.generics.to_tokens(tokens);
+            match &self.data {
+                Data::Struct(data) => match &data.fields {
+                    Fields::Named(fields) => {
+                        self.generics.where_clause.to_tokens(tokens);
+                        fields.to_tokens(tokens);
+                    }
+                    Fields::Unnamed(fields) => {
+                        fields.to_tokens(tokens);
+                        self.generics.where_clause.to_tokens(tokens);
+                        TokensOrDefault(&data.semi_token).to_tokens(tokens);
+                    }
+                    Fields::Unit => {
+                        self.generics.where_clause.to_tokens(tokens);
+                        TokensOrDefault(&data.semi_token).to_tokens(tokens);
+                    }
+                },
+                Data::Enum(data) => {
+                    self.generics.where_clause.to_tokens(tokens);
+                    data.brace_token.surround(tokens, |tokens| {
+                        data.variants.to_tokens(tokens);
+                    });
+                }
+                Data::Union(data) => {
+                    self.generics.where_clause.to_tokens(tokens);
+                    data.fields.to_tokens(tokens);
+                }
+            }
+        }
+    }
+}
+
\ No newline at end of file diff --git a/src/syn/discouraged.rs.html b/src/syn/discouraged.rs.html new file mode 100644 index 0000000..d2cfc16 --- /dev/null +++ b/src/syn/discouraged.rs.html @@ -0,0 +1,451 @@ +discouraged.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+
//! Extensions to the parsing API with niche applicability.
+
+use crate::buffer::Cursor;
+use crate::error::Result;
+use crate::parse::{inner_unexpected, ParseBuffer, Unexpected};
+use proc_macro2::extra::DelimSpan;
+use proc_macro2::Delimiter;
+use std::cell::Cell;
+use std::mem;
+use std::rc::Rc;
+
+/// Extensions to the `ParseStream` API to support speculative parsing.
+pub trait Speculative {
+    /// Advance this parse stream to the position of a forked parse stream.
+    ///
+    /// This is the opposite operation to [`ParseStream::fork`]. You can fork a
+    /// parse stream, perform some speculative parsing, then join the original
+    /// stream to the fork to "commit" the parsing from the fork to the main
+    /// stream.
+    ///
+    /// If you can avoid doing this, you should, as it limits the ability to
+    /// generate useful errors. That said, it is often the only way to parse
+    /// syntax of the form `A* B*` for arbitrary syntax `A` and `B`. The problem
+    /// is that when the fork fails to parse an `A`, it's impossible to tell
+    /// whether that was because of a syntax error and the user meant to provide
+    /// an `A`, or that the `A`s are finished and it's time to start parsing
+    /// `B`s. Use with care.
+    ///
+    /// Also note that if `A` is a subset of `B`, `A* B*` can be parsed by
+    /// parsing `B*` and removing the leading members of `A` from the
+    /// repetition, bypassing the need to involve the downsides associated with
+    /// speculative parsing.
+    ///
+    /// [`ParseStream::fork`]: ParseBuffer::fork
+    ///
+    /// # Example
+    ///
+    /// There has been chatter about the possibility of making the colons in the
+    /// turbofish syntax like `path::to::<T>` no longer required by accepting
+    /// `path::to<T>` in expression position. Specifically, according to [RFC
+    /// 2544], [`PathSegment`] parsing should always try to consume a following
+    /// `<` token as the start of generic arguments, and reset to the `<` if
+    /// that fails (e.g. the token is acting as a less-than operator).
+    ///
+    /// This is the exact kind of parsing behavior which requires the "fork,
+    /// try, commit" behavior that [`ParseStream::fork`] discourages. With
+    /// `advance_to`, we can avoid having to parse the speculatively parsed
+    /// content a second time.
+    ///
+    /// This change in behavior can be implemented in syn by replacing just the
+    /// `Parse` implementation for `PathSegment`:
+    ///
+    /// ```
+    /// # use syn::ext::IdentExt;
+    /// use syn::parse::discouraged::Speculative;
+    /// # use syn::parse::{Parse, ParseStream};
+    /// # use syn::{Ident, PathArguments, Result, Token};
+    ///
+    /// pub struct PathSegment {
+    ///     pub ident: Ident,
+    ///     pub arguments: PathArguments,
+    /// }
+    /// #
+    /// # impl<T> From<T> for PathSegment
+    /// # where
+    /// #     T: Into<Ident>,
+    /// # {
+    /// #     fn from(ident: T) -> Self {
+    /// #         PathSegment {
+    /// #             ident: ident.into(),
+    /// #             arguments: PathArguments::None,
+    /// #         }
+    /// #     }
+    /// # }
+    ///
+    /// impl Parse for PathSegment {
+    ///     fn parse(input: ParseStream) -> Result<Self> {
+    ///         if input.peek(Token![super])
+    ///             || input.peek(Token![self])
+    ///             || input.peek(Token![Self])
+    ///             || input.peek(Token![crate])
+    ///         {
+    ///             let ident = input.call(Ident::parse_any)?;
+    ///             return Ok(PathSegment::from(ident));
+    ///         }
+    ///
+    ///         let ident = input.parse()?;
+    ///         if input.peek(Token![::]) && input.peek3(Token![<]) {
+    ///             return Ok(PathSegment {
+    ///                 ident,
+    ///                 arguments: PathArguments::AngleBracketed(input.parse()?),
+    ///             });
+    ///         }
+    ///         if input.peek(Token![<]) && !input.peek(Token![<=]) {
+    ///             let fork = input.fork();
+    ///             if let Ok(arguments) = fork.parse() {
+    ///                 input.advance_to(&fork);
+    ///                 return Ok(PathSegment {
+    ///                     ident,
+    ///                     arguments: PathArguments::AngleBracketed(arguments),
+    ///                 });
+    ///             }
+    ///         }
+    ///         Ok(PathSegment::from(ident))
+    ///     }
+    /// }
+    ///
+    /// # syn::parse_str::<PathSegment>("a<b,c>").unwrap();
+    /// ```
+    ///
+    /// # Drawbacks
+    ///
+    /// The main drawback of this style of speculative parsing is in error
+    /// presentation. Even if the lookahead is the "correct" parse, the error
+    /// that is shown is that of the "fallback" parse. To use the same example
+    /// as the turbofish above, take the following unfinished "turbofish":
+    ///
+    /// ```text
+    /// let _ = f<&'a fn(), for<'a> serde::>();
+    /// ```
+    ///
+    /// If this is parsed as generic arguments, we can provide the error message
+    ///
+    /// ```text
+    /// error: expected identifier
+    ///  --> src.rs:L:C
+    ///   |
+    /// L | let _ = f<&'a fn(), for<'a> serde::>();
+    ///   |                                    ^
+    /// ```
+    ///
+    /// but if parsed using the above speculative parsing, it falls back to
+    /// assuming that the `<` is a less-than when it fails to parse the generic
+    /// arguments, and tries to interpret the `&'a` as the start of a labelled
+    /// loop, resulting in the much less helpful error
+    ///
+    /// ```text
+    /// error: expected `:`
+    ///  --> src.rs:L:C
+    ///   |
+    /// L | let _ = f<&'a fn(), for<'a> serde::>();
+    ///   |               ^^
+    /// ```
+    ///
+    /// This can be mitigated with various heuristics (two examples: show both
+    /// forks' parse errors, or show the one that consumed more tokens), but
+    /// when you can control the grammar, sticking to something that can be
+    /// parsed LL(3) and without the LL(*) speculative parsing this makes
+    /// possible, displaying reasonable errors becomes much more simple.
+    ///
+    /// [RFC 2544]: https://github.com/rust-lang/rfcs/pull/2544
+    /// [`PathSegment`]: crate::PathSegment
+    ///
+    /// # Performance
+    ///
+    /// This method performs a cheap fixed amount of work that does not depend
+    /// on how far apart the two streams are positioned.
+    ///
+    /// # Panics
+    ///
+    /// The forked stream in the argument of `advance_to` must have been
+    /// obtained by forking `self`. Attempting to advance to any other stream
+    /// will cause a panic.
+    fn advance_to(&self, fork: &Self);
+}
+
+impl<'a> Speculative for ParseBuffer<'a> {
+    fn advance_to(&self, fork: &Self) {
+        if !crate::buffer::same_scope(self.cursor(), fork.cursor()) {
+            panic!("fork was not derived from the advancing parse stream");
+        }
+
+        let (self_unexp, self_sp) = inner_unexpected(self);
+        let (fork_unexp, fork_sp) = inner_unexpected(fork);
+        if !Rc::ptr_eq(&self_unexp, &fork_unexp) {
+            match (fork_sp, self_sp) {
+                // Unexpected set on the fork, but not on `self`, copy it over.
+                (Some(span), None) => {
+                    self_unexp.set(Unexpected::Some(span));
+                }
+                // Unexpected unset. Use chain to propagate errors from fork.
+                (None, None) => {
+                    fork_unexp.set(Unexpected::Chain(self_unexp));
+
+                    // Ensure toplevel 'unexpected' tokens from the fork don't
+                    // bubble up the chain by replacing the root `unexpected`
+                    // pointer, only 'unexpected' tokens from existing group
+                    // parsers should bubble.
+                    fork.unexpected
+                        .set(Some(Rc::new(Cell::new(Unexpected::None))));
+                }
+                // Unexpected has been set on `self`. No changes needed.
+                (_, Some(_)) => {}
+            }
+        }
+
+        // See comment on `cell` in the struct definition.
+        self.cell
+            .set(unsafe { mem::transmute::<Cursor, Cursor<'static>>(fork.cursor()) });
+    }
+}
+
+/// Extensions to the `ParseStream` API to support manipulating invisible
+/// delimiters the same as if they were visible.
+pub trait AnyDelimiter {
+    /// Returns the delimiter, the span of the delimiter token, and the nested
+    /// contents for further parsing.
+    fn parse_any_delimiter(&self) -> Result<(Delimiter, DelimSpan, ParseBuffer)>;
+}
+
+impl<'a> AnyDelimiter for ParseBuffer<'a> {
+    fn parse_any_delimiter(&self) -> Result<(Delimiter, DelimSpan, ParseBuffer)> {
+        self.step(|cursor| {
+            if let Some((content, delimiter, span, rest)) = cursor.any_group() {
+                let scope = crate::buffer::close_span_of_group(*cursor);
+                let nested = crate::parse::advance_step_cursor(cursor, content);
+                let unexpected = crate::parse::get_unexpected(self);
+                let content = crate::parse::new_parse_buffer(scope, nested, unexpected);
+                Ok(((delimiter, span, content), rest))
+            } else {
+                Err(cursor.error("expected any delimiter"))
+            }
+        })
+    }
+}
+
\ No newline at end of file diff --git a/src/syn/drops.rs.html b/src/syn/drops.rs.html new file mode 100644 index 0000000..4e0e977 --- /dev/null +++ b/src/syn/drops.rs.html @@ -0,0 +1,117 @@ +drops.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+
use std::iter;
+use std::mem::ManuallyDrop;
+use std::ops::{Deref, DerefMut};
+use std::option;
+use std::slice;
+
+#[repr(transparent)]
+pub(crate) struct NoDrop<T: ?Sized>(ManuallyDrop<T>);
+
+impl<T> NoDrop<T> {
+    pub(crate) fn new(value: T) -> Self
+    where
+        T: TrivialDrop,
+    {
+        NoDrop(ManuallyDrop::new(value))
+    }
+}
+
+impl<T: ?Sized> Deref for NoDrop<T> {
+    type Target = T;
+    fn deref(&self) -> &Self::Target {
+        &self.0
+    }
+}
+
+impl<T: ?Sized> DerefMut for NoDrop<T> {
+    fn deref_mut(&mut self) -> &mut Self::Target {
+        &mut self.0
+    }
+}
+
+pub(crate) trait TrivialDrop {}
+
+impl<T> TrivialDrop for iter::Empty<T> {}
+impl<'a, T> TrivialDrop for slice::Iter<'a, T> {}
+impl<'a, T> TrivialDrop for slice::IterMut<'a, T> {}
+impl<'a, T> TrivialDrop for option::IntoIter<&'a T> {}
+impl<'a, T> TrivialDrop for option::IntoIter<&'a mut T> {}
+
+#[test]
+fn test_needs_drop() {
+    use std::mem::needs_drop;
+
+    struct NeedsDrop;
+
+    impl Drop for NeedsDrop {
+        fn drop(&mut self) {}
+    }
+
+    assert!(needs_drop::<NeedsDrop>());
+
+    // Test each of the types with a handwritten TrivialDrop impl above.
+    assert!(!needs_drop::<iter::Empty<NeedsDrop>>());
+    assert!(!needs_drop::<slice::Iter<NeedsDrop>>());
+    assert!(!needs_drop::<slice::IterMut<NeedsDrop>>());
+    assert!(!needs_drop::<option::IntoIter<&NeedsDrop>>());
+    assert!(!needs_drop::<option::IntoIter<&mut NeedsDrop>>());
+}
+
\ No newline at end of file diff --git a/src/syn/error.rs.html b/src/syn/error.rs.html new file mode 100644 index 0000000..714fc6a --- /dev/null +++ b/src/syn/error.rs.html @@ -0,0 +1,935 @@ +error.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+
#[cfg(feature = "parsing")]
+use crate::buffer::Cursor;
+use crate::thread::ThreadBound;
+use proc_macro2::{
+    Delimiter, Group, Ident, LexError, Literal, Punct, Spacing, Span, TokenStream, TokenTree,
+};
+#[cfg(feature = "printing")]
+use quote::ToTokens;
+use std::fmt::{self, Debug, Display};
+use std::slice;
+use std::vec;
+
+/// The result of a Syn parser.
+pub type Result<T> = std::result::Result<T, Error>;
+
+/// Error returned when a Syn parser cannot parse the input tokens.
+///
+/// # Error reporting in proc macros
+///
+/// The correct way to report errors back to the compiler from a procedural
+/// macro is by emitting an appropriately spanned invocation of
+/// [`compile_error!`] in the generated code. This produces a better diagnostic
+/// message than simply panicking the macro.
+///
+/// [`compile_error!`]: std::compile_error!
+///
+/// When parsing macro input, the [`parse_macro_input!`] macro handles the
+/// conversion to `compile_error!` automatically.
+///
+/// [`parse_macro_input!`]: crate::parse_macro_input!
+///
+/// ```
+/// # extern crate proc_macro;
+/// #
+/// use proc_macro::TokenStream;
+/// use syn::parse::{Parse, ParseStream, Result};
+/// use syn::{parse_macro_input, ItemFn};
+///
+/// # const IGNORE: &str = stringify! {
+/// #[proc_macro_attribute]
+/// # };
+/// pub fn my_attr(args: TokenStream, input: TokenStream) -> TokenStream {
+///     let args = parse_macro_input!(args as MyAttrArgs);
+///     let input = parse_macro_input!(input as ItemFn);
+///
+///     /* ... */
+///     # TokenStream::new()
+/// }
+///
+/// struct MyAttrArgs {
+///     # _k: [(); { stringify! {
+///     ...
+///     # }; 0 }]
+/// }
+///
+/// impl Parse for MyAttrArgs {
+///     fn parse(input: ParseStream) -> Result<Self> {
+///         # stringify! {
+///         ...
+///         # };
+///         # unimplemented!()
+///     }
+/// }
+/// ```
+///
+/// For errors that arise later than the initial parsing stage, the
+/// [`.to_compile_error()`] or [`.into_compile_error()`] methods can be used to
+/// perform an explicit conversion to `compile_error!`.
+///
+/// [`.to_compile_error()`]: Error::to_compile_error
+/// [`.into_compile_error()`]: Error::into_compile_error
+///
+/// ```
+/// # extern crate proc_macro;
+/// #
+/// # use proc_macro::TokenStream;
+/// # use syn::{parse_macro_input, DeriveInput};
+/// #
+/// # const IGNORE: &str = stringify! {
+/// #[proc_macro_derive(MyDerive)]
+/// # };
+/// pub fn my_derive(input: TokenStream) -> TokenStream {
+///     let input = parse_macro_input!(input as DeriveInput);
+///
+///     // fn(DeriveInput) -> syn::Result<proc_macro2::TokenStream>
+///     expand::my_derive(input)
+///         .unwrap_or_else(syn::Error::into_compile_error)
+///         .into()
+/// }
+/// #
+/// # mod expand {
+/// #     use proc_macro2::TokenStream;
+/// #     use syn::{DeriveInput, Result};
+/// #
+/// #     pub fn my_derive(input: DeriveInput) -> Result<TokenStream> {
+/// #         unimplemented!()
+/// #     }
+/// # }
+/// ```
+pub struct Error {
+    messages: Vec<ErrorMessage>,
+}
+
+struct ErrorMessage {
+    // Span is implemented as an index into a thread-local interner to keep the
+    // size small. It is not safe to access from a different thread. We want
+    // errors to be Send and Sync to play nicely with ecosystem crates for error
+    // handling, so pin the span we're given to its original thread and assume
+    // it is Span::call_site if accessed from any other thread.
+    span: ThreadBound<SpanRange>,
+    message: String,
+}
+
+// Cannot use std::ops::Range<Span> because that does not implement Copy,
+// whereas ThreadBound<T> requires a Copy impl as a way to ensure no Drop impls
+// are involved.
+struct SpanRange {
+    start: Span,
+    end: Span,
+}
+
+#[cfg(test)]
+struct _Test
+where
+    Error: Send + Sync;
+
+impl Error {
+    /// Usually the [`ParseStream::error`] method will be used instead, which
+    /// automatically uses the correct span from the current position of the
+    /// parse stream.
+    ///
+    /// Use `Error::new` when the error needs to be triggered on some span other
+    /// than where the parse stream is currently positioned.
+    ///
+    /// [`ParseStream::error`]: crate::parse::ParseBuffer::error
+    ///
+    /// # Example
+    ///
+    /// ```
+    /// use syn::{Error, Ident, LitStr, Result, Token};
+    /// use syn::parse::ParseStream;
+    ///
+    /// // Parses input that looks like `name = "string"` where the key must be
+    /// // the identifier `name` and the value may be any string literal.
+    /// // Returns the string literal.
+    /// fn parse_name(input: ParseStream) -> Result<LitStr> {
+    ///     let name_token: Ident = input.parse()?;
+    ///     if name_token != "name" {
+    ///         // Trigger an error not on the current position of the stream,
+    ///         // but on the position of the unexpected identifier.
+    ///         return Err(Error::new(name_token.span(), "expected `name`"));
+    ///     }
+    ///     input.parse::<Token![=]>()?;
+    ///     let s: LitStr = input.parse()?;
+    ///     Ok(s)
+    /// }
+    /// ```
+    pub fn new<T: Display>(span: Span, message: T) -> Self {
+        return new(span, message.to_string());
+
+        fn new(span: Span, message: String) -> Error {
+            Error {
+                messages: vec![ErrorMessage {
+                    span: ThreadBound::new(SpanRange {
+                        start: span,
+                        end: span,
+                    }),
+                    message,
+                }],
+            }
+        }
+    }
+
+    /// Creates an error with the specified message spanning the given syntax
+    /// tree node.
+    ///
+    /// Unlike the `Error::new` constructor, this constructor takes an argument
+    /// `tokens` which is a syntax tree node. This allows the resulting `Error`
+    /// to attempt to span all tokens inside of `tokens`. While you would
+    /// typically be able to use the `Spanned` trait with the above `Error::new`
+    /// constructor, implementation limitations today mean that
+    /// `Error::new_spanned` may provide a higher-quality error message on
+    /// stable Rust.
+    ///
+    /// When in doubt it's recommended to stick to `Error::new` (or
+    /// `ParseStream::error`)!
+    #[cfg(feature = "printing")]
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    pub fn new_spanned<T: ToTokens, U: Display>(tokens: T, message: U) -> Self {
+        return new_spanned(tokens.into_token_stream(), message.to_string());
+
+        fn new_spanned(tokens: TokenStream, message: String) -> Error {
+            let mut iter = tokens.into_iter();
+            let start = iter.next().map_or_else(Span::call_site, |t| t.span());
+            let end = iter.last().map_or(start, |t| t.span());
+            Error {
+                messages: vec![ErrorMessage {
+                    span: ThreadBound::new(SpanRange { start, end }),
+                    message,
+                }],
+            }
+        }
+    }
+
+    /// The source location of the error.
+    ///
+    /// Spans are not thread-safe so this function returns `Span::call_site()`
+    /// if called from a different thread than the one on which the `Error` was
+    /// originally created.
+    pub fn span(&self) -> Span {
+        let SpanRange { start, end } = match self.messages[0].span.get() {
+            Some(span) => *span,
+            None => return Span::call_site(),
+        };
+        start.join(end).unwrap_or(start)
+    }
+
+    /// Render the error as an invocation of [`compile_error!`].
+    ///
+    /// The [`parse_macro_input!`] macro provides a convenient way to invoke
+    /// this method correctly in a procedural macro.
+    ///
+    /// [`compile_error!`]: std::compile_error!
+    /// [`parse_macro_input!`]: crate::parse_macro_input!
+    pub fn to_compile_error(&self) -> TokenStream {
+        self.messages
+            .iter()
+            .map(ErrorMessage::to_compile_error)
+            .collect()
+    }
+
+    /// Render the error as an invocation of [`compile_error!`].
+    ///
+    /// [`compile_error!`]: std::compile_error!
+    ///
+    /// # Example
+    ///
+    /// ```
+    /// # extern crate proc_macro;
+    /// #
+    /// use proc_macro::TokenStream;
+    /// use syn::{parse_macro_input, DeriveInput, Error};
+    ///
+    /// # const _: &str = stringify! {
+    /// #[proc_macro_derive(MyTrait)]
+    /// # };
+    /// pub fn derive_my_trait(input: TokenStream) -> TokenStream {
+    ///     let input = parse_macro_input!(input as DeriveInput);
+    ///     my_trait::expand(input)
+    ///         .unwrap_or_else(Error::into_compile_error)
+    ///         .into()
+    /// }
+    ///
+    /// mod my_trait {
+    ///     use proc_macro2::TokenStream;
+    ///     use syn::{DeriveInput, Result};
+    ///
+    ///     pub(crate) fn expand(input: DeriveInput) -> Result<TokenStream> {
+    ///         /* ... */
+    ///         # unimplemented!()
+    ///     }
+    /// }
+    /// ```
+    pub fn into_compile_error(self) -> TokenStream {
+        self.to_compile_error()
+    }
+
+    /// Add another error message to self such that when `to_compile_error()` is
+    /// called, both errors will be emitted together.
+    pub fn combine(&mut self, another: Error) {
+        self.messages.extend(another.messages);
+    }
+}
+
+impl ErrorMessage {
+    fn to_compile_error(&self) -> TokenStream {
+        let (start, end) = match self.span.get() {
+            Some(range) => (range.start, range.end),
+            None => (Span::call_site(), Span::call_site()),
+        };
+
+        // ::core::compile_error!($message)
+        TokenStream::from_iter([
+            TokenTree::Punct({
+                let mut punct = Punct::new(':', Spacing::Joint);
+                punct.set_span(start);
+                punct
+            }),
+            TokenTree::Punct({
+                let mut punct = Punct::new(':', Spacing::Alone);
+                punct.set_span(start);
+                punct
+            }),
+            TokenTree::Ident(Ident::new("core", start)),
+            TokenTree::Punct({
+                let mut punct = Punct::new(':', Spacing::Joint);
+                punct.set_span(start);
+                punct
+            }),
+            TokenTree::Punct({
+                let mut punct = Punct::new(':', Spacing::Alone);
+                punct.set_span(start);
+                punct
+            }),
+            TokenTree::Ident(Ident::new("compile_error", start)),
+            TokenTree::Punct({
+                let mut punct = Punct::new('!', Spacing::Alone);
+                punct.set_span(start);
+                punct
+            }),
+            TokenTree::Group({
+                let mut group = Group::new(Delimiter::Brace, {
+                    TokenStream::from_iter([TokenTree::Literal({
+                        let mut string = Literal::string(&self.message);
+                        string.set_span(end);
+                        string
+                    })])
+                });
+                group.set_span(end);
+                group
+            }),
+        ])
+    }
+}
+
+#[cfg(feature = "parsing")]
+pub(crate) fn new_at<T: Display>(scope: Span, cursor: Cursor, message: T) -> Error {
+    if cursor.eof() {
+        Error::new(scope, format!("unexpected end of input, {}", message))
+    } else {
+        let span = crate::buffer::open_span_of_group(cursor);
+        Error::new(span, message)
+    }
+}
+
+#[cfg(all(feature = "parsing", any(feature = "full", feature = "derive")))]
+pub(crate) fn new2<T: Display>(start: Span, end: Span, message: T) -> Error {
+    return new2(start, end, message.to_string());
+
+    fn new2(start: Span, end: Span, message: String) -> Error {
+        Error {
+            messages: vec![ErrorMessage {
+                span: ThreadBound::new(SpanRange { start, end }),
+                message,
+            }],
+        }
+    }
+}
+
+impl Debug for Error {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        if self.messages.len() == 1 {
+            formatter
+                .debug_tuple("Error")
+                .field(&self.messages[0])
+                .finish()
+        } else {
+            formatter
+                .debug_tuple("Error")
+                .field(&self.messages)
+                .finish()
+        }
+    }
+}
+
+impl Debug for ErrorMessage {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        Debug::fmt(&self.message, formatter)
+    }
+}
+
+impl Display for Error {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        formatter.write_str(&self.messages[0].message)
+    }
+}
+
+impl Clone for Error {
+    fn clone(&self) -> Self {
+        Error {
+            messages: self.messages.clone(),
+        }
+    }
+}
+
+impl Clone for ErrorMessage {
+    fn clone(&self) -> Self {
+        ErrorMessage {
+            span: self.span,
+            message: self.message.clone(),
+        }
+    }
+}
+
+impl Clone for SpanRange {
+    fn clone(&self) -> Self {
+        *self
+    }
+}
+
+impl Copy for SpanRange {}
+
+impl std::error::Error for Error {}
+
+impl From<LexError> for Error {
+    fn from(err: LexError) -> Self {
+        Error::new(err.span(), err)
+    }
+}
+
+impl IntoIterator for Error {
+    type Item = Error;
+    type IntoIter = IntoIter;
+
+    fn into_iter(self) -> Self::IntoIter {
+        IntoIter {
+            messages: self.messages.into_iter(),
+        }
+    }
+}
+
+pub struct IntoIter {
+    messages: vec::IntoIter<ErrorMessage>,
+}
+
+impl Iterator for IntoIter {
+    type Item = Error;
+
+    fn next(&mut self) -> Option<Self::Item> {
+        Some(Error {
+            messages: vec![self.messages.next()?],
+        })
+    }
+}
+
+impl<'a> IntoIterator for &'a Error {
+    type Item = Error;
+    type IntoIter = Iter<'a>;
+
+    fn into_iter(self) -> Self::IntoIter {
+        Iter {
+            messages: self.messages.iter(),
+        }
+    }
+}
+
+pub struct Iter<'a> {
+    messages: slice::Iter<'a, ErrorMessage>,
+}
+
+impl<'a> Iterator for Iter<'a> {
+    type Item = Error;
+
+    fn next(&mut self) -> Option<Self::Item> {
+        Some(Error {
+            messages: vec![self.messages.next()?.clone()],
+        })
+    }
+}
+
+impl Extend<Error> for Error {
+    fn extend<T: IntoIterator<Item = Error>>(&mut self, iter: T) {
+        for err in iter {
+            self.combine(err);
+        }
+    }
+}
+
\ No newline at end of file diff --git a/src/syn/export.rs.html b/src/syn/export.rs.html new file mode 100644 index 0000000..daa5aa8 --- /dev/null +++ b/src/syn/export.rs.html @@ -0,0 +1,147 @@ +export.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+
#[doc(hidden)]
+pub use std::clone::Clone;
+#[doc(hidden)]
+pub use std::cmp::{Eq, PartialEq};
+#[doc(hidden)]
+pub use std::concat;
+#[doc(hidden)]
+pub use std::default::Default;
+#[doc(hidden)]
+pub use std::fmt::Debug;
+#[doc(hidden)]
+pub use std::hash::{Hash, Hasher};
+#[doc(hidden)]
+pub use std::marker::Copy;
+#[doc(hidden)]
+pub use std::option::Option::{None, Some};
+#[doc(hidden)]
+pub use std::result::Result::{Err, Ok};
+#[doc(hidden)]
+pub use std::stringify;
+
+#[doc(hidden)]
+pub type Formatter<'a> = std::fmt::Formatter<'a>;
+#[doc(hidden)]
+pub type FmtResult = std::fmt::Result;
+
+#[doc(hidden)]
+pub type bool = std::primitive::bool;
+#[doc(hidden)]
+pub type str = std::primitive::str;
+
+#[cfg(feature = "printing")]
+#[doc(hidden)]
+pub use quote;
+
+#[doc(hidden)]
+pub type Span = proc_macro2::Span;
+#[doc(hidden)]
+pub type TokenStream2 = proc_macro2::TokenStream;
+
+#[cfg(feature = "parsing")]
+#[doc(hidden)]
+pub use crate::group::{parse_braces, parse_brackets, parse_parens};
+
+#[doc(hidden)]
+pub use crate::span::IntoSpans;
+
+#[cfg(all(feature = "parsing", feature = "printing"))]
+#[doc(hidden)]
+pub use crate::parse_quote::parse as parse_quote;
+
+#[cfg(feature = "parsing")]
+#[doc(hidden)]
+pub use crate::token::parsing::{peek_punct, punct as parse_punct};
+
+#[cfg(feature = "printing")]
+#[doc(hidden)]
+pub use crate::token::printing::punct as print_punct;
+
+#[cfg(feature = "parsing")]
+#[doc(hidden)]
+pub use crate::token::private::CustomToken;
+
+#[cfg(feature = "proc-macro")]
+#[doc(hidden)]
+pub type TokenStream = proc_macro::TokenStream;
+
+#[cfg(feature = "printing")]
+#[doc(hidden)]
+pub use quote::{ToTokens, TokenStreamExt};
+
+#[doc(hidden)]
+pub struct private(pub(crate) ());
+
\ No newline at end of file diff --git a/src/syn/expr.rs.html b/src/syn/expr.rs.html new file mode 100644 index 0000000..3488656 --- /dev/null +++ b/src/syn/expr.rs.html @@ -0,0 +1,7391 @@ +expr.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+753
+754
+755
+756
+757
+758
+759
+760
+761
+762
+763
+764
+765
+766
+767
+768
+769
+770
+771
+772
+773
+774
+775
+776
+777
+778
+779
+780
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+794
+795
+796
+797
+798
+799
+800
+801
+802
+803
+804
+805
+806
+807
+808
+809
+810
+811
+812
+813
+814
+815
+816
+817
+818
+819
+820
+821
+822
+823
+824
+825
+826
+827
+828
+829
+830
+831
+832
+833
+834
+835
+836
+837
+838
+839
+840
+841
+842
+843
+844
+845
+846
+847
+848
+849
+850
+851
+852
+853
+854
+855
+856
+857
+858
+859
+860
+861
+862
+863
+864
+865
+866
+867
+868
+869
+870
+871
+872
+873
+874
+875
+876
+877
+878
+879
+880
+881
+882
+883
+884
+885
+886
+887
+888
+889
+890
+891
+892
+893
+894
+895
+896
+897
+898
+899
+900
+901
+902
+903
+904
+905
+906
+907
+908
+909
+910
+911
+912
+913
+914
+915
+916
+917
+918
+919
+920
+921
+922
+923
+924
+925
+926
+927
+928
+929
+930
+931
+932
+933
+934
+935
+936
+937
+938
+939
+940
+941
+942
+943
+944
+945
+946
+947
+948
+949
+950
+951
+952
+953
+954
+955
+956
+957
+958
+959
+960
+961
+962
+963
+964
+965
+966
+967
+968
+969
+970
+971
+972
+973
+974
+975
+976
+977
+978
+979
+980
+981
+982
+983
+984
+985
+986
+987
+988
+989
+990
+991
+992
+993
+994
+995
+996
+997
+998
+999
+1000
+1001
+1002
+1003
+1004
+1005
+1006
+1007
+1008
+1009
+1010
+1011
+1012
+1013
+1014
+1015
+1016
+1017
+1018
+1019
+1020
+1021
+1022
+1023
+1024
+1025
+1026
+1027
+1028
+1029
+1030
+1031
+1032
+1033
+1034
+1035
+1036
+1037
+1038
+1039
+1040
+1041
+1042
+1043
+1044
+1045
+1046
+1047
+1048
+1049
+1050
+1051
+1052
+1053
+1054
+1055
+1056
+1057
+1058
+1059
+1060
+1061
+1062
+1063
+1064
+1065
+1066
+1067
+1068
+1069
+1070
+1071
+1072
+1073
+1074
+1075
+1076
+1077
+1078
+1079
+1080
+1081
+1082
+1083
+1084
+1085
+1086
+1087
+1088
+1089
+1090
+1091
+1092
+1093
+1094
+1095
+1096
+1097
+1098
+1099
+1100
+1101
+1102
+1103
+1104
+1105
+1106
+1107
+1108
+1109
+1110
+1111
+1112
+1113
+1114
+1115
+1116
+1117
+1118
+1119
+1120
+1121
+1122
+1123
+1124
+1125
+1126
+1127
+1128
+1129
+1130
+1131
+1132
+1133
+1134
+1135
+1136
+1137
+1138
+1139
+1140
+1141
+1142
+1143
+1144
+1145
+1146
+1147
+1148
+1149
+1150
+1151
+1152
+1153
+1154
+1155
+1156
+1157
+1158
+1159
+1160
+1161
+1162
+1163
+1164
+1165
+1166
+1167
+1168
+1169
+1170
+1171
+1172
+1173
+1174
+1175
+1176
+1177
+1178
+1179
+1180
+1181
+1182
+1183
+1184
+1185
+1186
+1187
+1188
+1189
+1190
+1191
+1192
+1193
+1194
+1195
+1196
+1197
+1198
+1199
+1200
+1201
+1202
+1203
+1204
+1205
+1206
+1207
+1208
+1209
+1210
+1211
+1212
+1213
+1214
+1215
+1216
+1217
+1218
+1219
+1220
+1221
+1222
+1223
+1224
+1225
+1226
+1227
+1228
+1229
+1230
+1231
+1232
+1233
+1234
+1235
+1236
+1237
+1238
+1239
+1240
+1241
+1242
+1243
+1244
+1245
+1246
+1247
+1248
+1249
+1250
+1251
+1252
+1253
+1254
+1255
+1256
+1257
+1258
+1259
+1260
+1261
+1262
+1263
+1264
+1265
+1266
+1267
+1268
+1269
+1270
+1271
+1272
+1273
+1274
+1275
+1276
+1277
+1278
+1279
+1280
+1281
+1282
+1283
+1284
+1285
+1286
+1287
+1288
+1289
+1290
+1291
+1292
+1293
+1294
+1295
+1296
+1297
+1298
+1299
+1300
+1301
+1302
+1303
+1304
+1305
+1306
+1307
+1308
+1309
+1310
+1311
+1312
+1313
+1314
+1315
+1316
+1317
+1318
+1319
+1320
+1321
+1322
+1323
+1324
+1325
+1326
+1327
+1328
+1329
+1330
+1331
+1332
+1333
+1334
+1335
+1336
+1337
+1338
+1339
+1340
+1341
+1342
+1343
+1344
+1345
+1346
+1347
+1348
+1349
+1350
+1351
+1352
+1353
+1354
+1355
+1356
+1357
+1358
+1359
+1360
+1361
+1362
+1363
+1364
+1365
+1366
+1367
+1368
+1369
+1370
+1371
+1372
+1373
+1374
+1375
+1376
+1377
+1378
+1379
+1380
+1381
+1382
+1383
+1384
+1385
+1386
+1387
+1388
+1389
+1390
+1391
+1392
+1393
+1394
+1395
+1396
+1397
+1398
+1399
+1400
+1401
+1402
+1403
+1404
+1405
+1406
+1407
+1408
+1409
+1410
+1411
+1412
+1413
+1414
+1415
+1416
+1417
+1418
+1419
+1420
+1421
+1422
+1423
+1424
+1425
+1426
+1427
+1428
+1429
+1430
+1431
+1432
+1433
+1434
+1435
+1436
+1437
+1438
+1439
+1440
+1441
+1442
+1443
+1444
+1445
+1446
+1447
+1448
+1449
+1450
+1451
+1452
+1453
+1454
+1455
+1456
+1457
+1458
+1459
+1460
+1461
+1462
+1463
+1464
+1465
+1466
+1467
+1468
+1469
+1470
+1471
+1472
+1473
+1474
+1475
+1476
+1477
+1478
+1479
+1480
+1481
+1482
+1483
+1484
+1485
+1486
+1487
+1488
+1489
+1490
+1491
+1492
+1493
+1494
+1495
+1496
+1497
+1498
+1499
+1500
+1501
+1502
+1503
+1504
+1505
+1506
+1507
+1508
+1509
+1510
+1511
+1512
+1513
+1514
+1515
+1516
+1517
+1518
+1519
+1520
+1521
+1522
+1523
+1524
+1525
+1526
+1527
+1528
+1529
+1530
+1531
+1532
+1533
+1534
+1535
+1536
+1537
+1538
+1539
+1540
+1541
+1542
+1543
+1544
+1545
+1546
+1547
+1548
+1549
+1550
+1551
+1552
+1553
+1554
+1555
+1556
+1557
+1558
+1559
+1560
+1561
+1562
+1563
+1564
+1565
+1566
+1567
+1568
+1569
+1570
+1571
+1572
+1573
+1574
+1575
+1576
+1577
+1578
+1579
+1580
+1581
+1582
+1583
+1584
+1585
+1586
+1587
+1588
+1589
+1590
+1591
+1592
+1593
+1594
+1595
+1596
+1597
+1598
+1599
+1600
+1601
+1602
+1603
+1604
+1605
+1606
+1607
+1608
+1609
+1610
+1611
+1612
+1613
+1614
+1615
+1616
+1617
+1618
+1619
+1620
+1621
+1622
+1623
+1624
+1625
+1626
+1627
+1628
+1629
+1630
+1631
+1632
+1633
+1634
+1635
+1636
+1637
+1638
+1639
+1640
+1641
+1642
+1643
+1644
+1645
+1646
+1647
+1648
+1649
+1650
+1651
+1652
+1653
+1654
+1655
+1656
+1657
+1658
+1659
+1660
+1661
+1662
+1663
+1664
+1665
+1666
+1667
+1668
+1669
+1670
+1671
+1672
+1673
+1674
+1675
+1676
+1677
+1678
+1679
+1680
+1681
+1682
+1683
+1684
+1685
+1686
+1687
+1688
+1689
+1690
+1691
+1692
+1693
+1694
+1695
+1696
+1697
+1698
+1699
+1700
+1701
+1702
+1703
+1704
+1705
+1706
+1707
+1708
+1709
+1710
+1711
+1712
+1713
+1714
+1715
+1716
+1717
+1718
+1719
+1720
+1721
+1722
+1723
+1724
+1725
+1726
+1727
+1728
+1729
+1730
+1731
+1732
+1733
+1734
+1735
+1736
+1737
+1738
+1739
+1740
+1741
+1742
+1743
+1744
+1745
+1746
+1747
+1748
+1749
+1750
+1751
+1752
+1753
+1754
+1755
+1756
+1757
+1758
+1759
+1760
+1761
+1762
+1763
+1764
+1765
+1766
+1767
+1768
+1769
+1770
+1771
+1772
+1773
+1774
+1775
+1776
+1777
+1778
+1779
+1780
+1781
+1782
+1783
+1784
+1785
+1786
+1787
+1788
+1789
+1790
+1791
+1792
+1793
+1794
+1795
+1796
+1797
+1798
+1799
+1800
+1801
+1802
+1803
+1804
+1805
+1806
+1807
+1808
+1809
+1810
+1811
+1812
+1813
+1814
+1815
+1816
+1817
+1818
+1819
+1820
+1821
+1822
+1823
+1824
+1825
+1826
+1827
+1828
+1829
+1830
+1831
+1832
+1833
+1834
+1835
+1836
+1837
+1838
+1839
+1840
+1841
+1842
+1843
+1844
+1845
+1846
+1847
+1848
+1849
+1850
+1851
+1852
+1853
+1854
+1855
+1856
+1857
+1858
+1859
+1860
+1861
+1862
+1863
+1864
+1865
+1866
+1867
+1868
+1869
+1870
+1871
+1872
+1873
+1874
+1875
+1876
+1877
+1878
+1879
+1880
+1881
+1882
+1883
+1884
+1885
+1886
+1887
+1888
+1889
+1890
+1891
+1892
+1893
+1894
+1895
+1896
+1897
+1898
+1899
+1900
+1901
+1902
+1903
+1904
+1905
+1906
+1907
+1908
+1909
+1910
+1911
+1912
+1913
+1914
+1915
+1916
+1917
+1918
+1919
+1920
+1921
+1922
+1923
+1924
+1925
+1926
+1927
+1928
+1929
+1930
+1931
+1932
+1933
+1934
+1935
+1936
+1937
+1938
+1939
+1940
+1941
+1942
+1943
+1944
+1945
+1946
+1947
+1948
+1949
+1950
+1951
+1952
+1953
+1954
+1955
+1956
+1957
+1958
+1959
+1960
+1961
+1962
+1963
+1964
+1965
+1966
+1967
+1968
+1969
+1970
+1971
+1972
+1973
+1974
+1975
+1976
+1977
+1978
+1979
+1980
+1981
+1982
+1983
+1984
+1985
+1986
+1987
+1988
+1989
+1990
+1991
+1992
+1993
+1994
+1995
+1996
+1997
+1998
+1999
+2000
+2001
+2002
+2003
+2004
+2005
+2006
+2007
+2008
+2009
+2010
+2011
+2012
+2013
+2014
+2015
+2016
+2017
+2018
+2019
+2020
+2021
+2022
+2023
+2024
+2025
+2026
+2027
+2028
+2029
+2030
+2031
+2032
+2033
+2034
+2035
+2036
+2037
+2038
+2039
+2040
+2041
+2042
+2043
+2044
+2045
+2046
+2047
+2048
+2049
+2050
+2051
+2052
+2053
+2054
+2055
+2056
+2057
+2058
+2059
+2060
+2061
+2062
+2063
+2064
+2065
+2066
+2067
+2068
+2069
+2070
+2071
+2072
+2073
+2074
+2075
+2076
+2077
+2078
+2079
+2080
+2081
+2082
+2083
+2084
+2085
+2086
+2087
+2088
+2089
+2090
+2091
+2092
+2093
+2094
+2095
+2096
+2097
+2098
+2099
+2100
+2101
+2102
+2103
+2104
+2105
+2106
+2107
+2108
+2109
+2110
+2111
+2112
+2113
+2114
+2115
+2116
+2117
+2118
+2119
+2120
+2121
+2122
+2123
+2124
+2125
+2126
+2127
+2128
+2129
+2130
+2131
+2132
+2133
+2134
+2135
+2136
+2137
+2138
+2139
+2140
+2141
+2142
+2143
+2144
+2145
+2146
+2147
+2148
+2149
+2150
+2151
+2152
+2153
+2154
+2155
+2156
+2157
+2158
+2159
+2160
+2161
+2162
+2163
+2164
+2165
+2166
+2167
+2168
+2169
+2170
+2171
+2172
+2173
+2174
+2175
+2176
+2177
+2178
+2179
+2180
+2181
+2182
+2183
+2184
+2185
+2186
+2187
+2188
+2189
+2190
+2191
+2192
+2193
+2194
+2195
+2196
+2197
+2198
+2199
+2200
+2201
+2202
+2203
+2204
+2205
+2206
+2207
+2208
+2209
+2210
+2211
+2212
+2213
+2214
+2215
+2216
+2217
+2218
+2219
+2220
+2221
+2222
+2223
+2224
+2225
+2226
+2227
+2228
+2229
+2230
+2231
+2232
+2233
+2234
+2235
+2236
+2237
+2238
+2239
+2240
+2241
+2242
+2243
+2244
+2245
+2246
+2247
+2248
+2249
+2250
+2251
+2252
+2253
+2254
+2255
+2256
+2257
+2258
+2259
+2260
+2261
+2262
+2263
+2264
+2265
+2266
+2267
+2268
+2269
+2270
+2271
+2272
+2273
+2274
+2275
+2276
+2277
+2278
+2279
+2280
+2281
+2282
+2283
+2284
+2285
+2286
+2287
+2288
+2289
+2290
+2291
+2292
+2293
+2294
+2295
+2296
+2297
+2298
+2299
+2300
+2301
+2302
+2303
+2304
+2305
+2306
+2307
+2308
+2309
+2310
+2311
+2312
+2313
+2314
+2315
+2316
+2317
+2318
+2319
+2320
+2321
+2322
+2323
+2324
+2325
+2326
+2327
+2328
+2329
+2330
+2331
+2332
+2333
+2334
+2335
+2336
+2337
+2338
+2339
+2340
+2341
+2342
+2343
+2344
+2345
+2346
+2347
+2348
+2349
+2350
+2351
+2352
+2353
+2354
+2355
+2356
+2357
+2358
+2359
+2360
+2361
+2362
+2363
+2364
+2365
+2366
+2367
+2368
+2369
+2370
+2371
+2372
+2373
+2374
+2375
+2376
+2377
+2378
+2379
+2380
+2381
+2382
+2383
+2384
+2385
+2386
+2387
+2388
+2389
+2390
+2391
+2392
+2393
+2394
+2395
+2396
+2397
+2398
+2399
+2400
+2401
+2402
+2403
+2404
+2405
+2406
+2407
+2408
+2409
+2410
+2411
+2412
+2413
+2414
+2415
+2416
+2417
+2418
+2419
+2420
+2421
+2422
+2423
+2424
+2425
+2426
+2427
+2428
+2429
+2430
+2431
+2432
+2433
+2434
+2435
+2436
+2437
+2438
+2439
+2440
+2441
+2442
+2443
+2444
+2445
+2446
+2447
+2448
+2449
+2450
+2451
+2452
+2453
+2454
+2455
+2456
+2457
+2458
+2459
+2460
+2461
+2462
+2463
+2464
+2465
+2466
+2467
+2468
+2469
+2470
+2471
+2472
+2473
+2474
+2475
+2476
+2477
+2478
+2479
+2480
+2481
+2482
+2483
+2484
+2485
+2486
+2487
+2488
+2489
+2490
+2491
+2492
+2493
+2494
+2495
+2496
+2497
+2498
+2499
+2500
+2501
+2502
+2503
+2504
+2505
+2506
+2507
+2508
+2509
+2510
+2511
+2512
+2513
+2514
+2515
+2516
+2517
+2518
+2519
+2520
+2521
+2522
+2523
+2524
+2525
+2526
+2527
+2528
+2529
+2530
+2531
+2532
+2533
+2534
+2535
+2536
+2537
+2538
+2539
+2540
+2541
+2542
+2543
+2544
+2545
+2546
+2547
+2548
+2549
+2550
+2551
+2552
+2553
+2554
+2555
+2556
+2557
+2558
+2559
+2560
+2561
+2562
+2563
+2564
+2565
+2566
+2567
+2568
+2569
+2570
+2571
+2572
+2573
+2574
+2575
+2576
+2577
+2578
+2579
+2580
+2581
+2582
+2583
+2584
+2585
+2586
+2587
+2588
+2589
+2590
+2591
+2592
+2593
+2594
+2595
+2596
+2597
+2598
+2599
+2600
+2601
+2602
+2603
+2604
+2605
+2606
+2607
+2608
+2609
+2610
+2611
+2612
+2613
+2614
+2615
+2616
+2617
+2618
+2619
+2620
+2621
+2622
+2623
+2624
+2625
+2626
+2627
+2628
+2629
+2630
+2631
+2632
+2633
+2634
+2635
+2636
+2637
+2638
+2639
+2640
+2641
+2642
+2643
+2644
+2645
+2646
+2647
+2648
+2649
+2650
+2651
+2652
+2653
+2654
+2655
+2656
+2657
+2658
+2659
+2660
+2661
+2662
+2663
+2664
+2665
+2666
+2667
+2668
+2669
+2670
+2671
+2672
+2673
+2674
+2675
+2676
+2677
+2678
+2679
+2680
+2681
+2682
+2683
+2684
+2685
+2686
+2687
+2688
+2689
+2690
+2691
+2692
+2693
+2694
+2695
+2696
+2697
+2698
+2699
+2700
+2701
+2702
+2703
+2704
+2705
+2706
+2707
+2708
+2709
+2710
+2711
+2712
+2713
+2714
+2715
+2716
+2717
+2718
+2719
+2720
+2721
+2722
+2723
+2724
+2725
+2726
+2727
+2728
+2729
+2730
+2731
+2732
+2733
+2734
+2735
+2736
+2737
+2738
+2739
+2740
+2741
+2742
+2743
+2744
+2745
+2746
+2747
+2748
+2749
+2750
+2751
+2752
+2753
+2754
+2755
+2756
+2757
+2758
+2759
+2760
+2761
+2762
+2763
+2764
+2765
+2766
+2767
+2768
+2769
+2770
+2771
+2772
+2773
+2774
+2775
+2776
+2777
+2778
+2779
+2780
+2781
+2782
+2783
+2784
+2785
+2786
+2787
+2788
+2789
+2790
+2791
+2792
+2793
+2794
+2795
+2796
+2797
+2798
+2799
+2800
+2801
+2802
+2803
+2804
+2805
+2806
+2807
+2808
+2809
+2810
+2811
+2812
+2813
+2814
+2815
+2816
+2817
+2818
+2819
+2820
+2821
+2822
+2823
+2824
+2825
+2826
+2827
+2828
+2829
+2830
+2831
+2832
+2833
+2834
+2835
+2836
+2837
+2838
+2839
+2840
+2841
+2842
+2843
+2844
+2845
+2846
+2847
+2848
+2849
+2850
+2851
+2852
+2853
+2854
+2855
+2856
+2857
+2858
+2859
+2860
+2861
+2862
+2863
+2864
+2865
+2866
+2867
+2868
+2869
+2870
+2871
+2872
+2873
+2874
+2875
+2876
+2877
+2878
+2879
+2880
+2881
+2882
+2883
+2884
+2885
+2886
+2887
+2888
+2889
+2890
+2891
+2892
+2893
+2894
+2895
+2896
+2897
+2898
+2899
+2900
+2901
+2902
+2903
+2904
+2905
+2906
+2907
+2908
+2909
+2910
+2911
+2912
+2913
+2914
+2915
+2916
+2917
+2918
+2919
+2920
+2921
+2922
+2923
+2924
+2925
+2926
+2927
+2928
+2929
+2930
+2931
+2932
+2933
+2934
+2935
+2936
+2937
+2938
+2939
+2940
+2941
+2942
+2943
+2944
+2945
+2946
+2947
+2948
+2949
+2950
+2951
+2952
+2953
+2954
+2955
+2956
+2957
+2958
+2959
+2960
+2961
+2962
+2963
+2964
+2965
+2966
+2967
+2968
+2969
+2970
+2971
+2972
+2973
+2974
+2975
+2976
+2977
+2978
+2979
+2980
+2981
+2982
+2983
+2984
+2985
+2986
+2987
+2988
+2989
+2990
+2991
+2992
+2993
+2994
+2995
+2996
+2997
+2998
+2999
+3000
+3001
+3002
+3003
+3004
+3005
+3006
+3007
+3008
+3009
+3010
+3011
+3012
+3013
+3014
+3015
+3016
+3017
+3018
+3019
+3020
+3021
+3022
+3023
+3024
+3025
+3026
+3027
+3028
+3029
+3030
+3031
+3032
+3033
+3034
+3035
+3036
+3037
+3038
+3039
+3040
+3041
+3042
+3043
+3044
+3045
+3046
+3047
+3048
+3049
+3050
+3051
+3052
+3053
+3054
+3055
+3056
+3057
+3058
+3059
+3060
+3061
+3062
+3063
+3064
+3065
+3066
+3067
+3068
+3069
+3070
+3071
+3072
+3073
+3074
+3075
+3076
+3077
+3078
+3079
+3080
+3081
+3082
+3083
+3084
+3085
+3086
+3087
+3088
+3089
+3090
+3091
+3092
+3093
+3094
+3095
+3096
+3097
+3098
+3099
+3100
+3101
+3102
+3103
+3104
+3105
+3106
+3107
+3108
+3109
+3110
+3111
+3112
+3113
+3114
+3115
+3116
+3117
+3118
+3119
+3120
+3121
+3122
+3123
+3124
+3125
+3126
+3127
+3128
+3129
+3130
+3131
+3132
+3133
+3134
+3135
+3136
+3137
+3138
+3139
+3140
+3141
+3142
+3143
+3144
+3145
+3146
+3147
+3148
+3149
+3150
+3151
+3152
+3153
+3154
+3155
+3156
+3157
+3158
+3159
+3160
+3161
+3162
+3163
+3164
+3165
+3166
+3167
+3168
+3169
+3170
+3171
+3172
+3173
+3174
+3175
+3176
+3177
+3178
+3179
+3180
+3181
+3182
+3183
+3184
+3185
+3186
+3187
+3188
+3189
+3190
+3191
+3192
+3193
+3194
+3195
+3196
+3197
+3198
+3199
+3200
+3201
+3202
+3203
+3204
+3205
+3206
+3207
+3208
+3209
+3210
+3211
+3212
+3213
+3214
+3215
+3216
+3217
+3218
+3219
+3220
+3221
+3222
+3223
+3224
+3225
+3226
+3227
+3228
+3229
+3230
+3231
+3232
+3233
+3234
+3235
+3236
+3237
+3238
+3239
+3240
+3241
+3242
+3243
+3244
+3245
+3246
+3247
+3248
+3249
+3250
+3251
+3252
+3253
+3254
+3255
+3256
+3257
+3258
+3259
+3260
+3261
+3262
+3263
+3264
+3265
+3266
+3267
+3268
+3269
+3270
+3271
+3272
+3273
+3274
+3275
+3276
+3277
+3278
+3279
+3280
+3281
+3282
+3283
+3284
+3285
+3286
+3287
+3288
+3289
+3290
+3291
+3292
+3293
+3294
+3295
+3296
+3297
+3298
+3299
+3300
+3301
+3302
+3303
+3304
+3305
+3306
+3307
+3308
+3309
+3310
+3311
+3312
+3313
+3314
+3315
+3316
+3317
+3318
+3319
+3320
+3321
+3322
+3323
+3324
+3325
+3326
+3327
+3328
+3329
+3330
+3331
+3332
+3333
+3334
+3335
+3336
+3337
+3338
+3339
+3340
+3341
+3342
+3343
+3344
+3345
+3346
+3347
+3348
+3349
+3350
+3351
+3352
+3353
+3354
+3355
+3356
+3357
+3358
+3359
+3360
+3361
+3362
+3363
+3364
+3365
+3366
+3367
+3368
+3369
+3370
+3371
+3372
+3373
+3374
+3375
+3376
+3377
+3378
+3379
+3380
+3381
+3382
+3383
+3384
+3385
+3386
+3387
+3388
+3389
+3390
+3391
+3392
+3393
+3394
+3395
+3396
+3397
+3398
+3399
+3400
+3401
+3402
+3403
+3404
+3405
+3406
+3407
+3408
+3409
+3410
+3411
+3412
+3413
+3414
+3415
+3416
+3417
+3418
+3419
+3420
+3421
+3422
+3423
+3424
+3425
+3426
+3427
+3428
+3429
+3430
+3431
+3432
+3433
+3434
+3435
+3436
+3437
+3438
+3439
+3440
+3441
+3442
+3443
+3444
+3445
+3446
+3447
+3448
+3449
+3450
+3451
+3452
+3453
+3454
+3455
+3456
+3457
+3458
+3459
+3460
+3461
+3462
+3463
+3464
+3465
+3466
+3467
+3468
+3469
+3470
+3471
+3472
+3473
+3474
+3475
+3476
+3477
+3478
+3479
+3480
+3481
+3482
+3483
+3484
+3485
+3486
+3487
+3488
+3489
+3490
+3491
+3492
+3493
+3494
+3495
+3496
+3497
+3498
+3499
+3500
+3501
+3502
+3503
+3504
+3505
+3506
+3507
+3508
+3509
+3510
+3511
+3512
+3513
+3514
+3515
+3516
+3517
+3518
+3519
+3520
+3521
+3522
+3523
+3524
+3525
+3526
+3527
+3528
+3529
+3530
+3531
+3532
+3533
+3534
+3535
+3536
+3537
+3538
+3539
+3540
+3541
+3542
+3543
+3544
+3545
+3546
+3547
+3548
+3549
+3550
+3551
+3552
+3553
+3554
+3555
+3556
+3557
+3558
+3559
+3560
+3561
+3562
+3563
+3564
+3565
+3566
+3567
+3568
+3569
+3570
+3571
+3572
+3573
+3574
+3575
+3576
+3577
+3578
+3579
+3580
+3581
+3582
+3583
+3584
+3585
+3586
+3587
+3588
+3589
+3590
+3591
+3592
+3593
+3594
+3595
+3596
+3597
+3598
+3599
+3600
+3601
+3602
+3603
+3604
+3605
+3606
+3607
+3608
+3609
+3610
+3611
+3612
+3613
+3614
+3615
+3616
+3617
+3618
+3619
+3620
+3621
+3622
+3623
+3624
+3625
+3626
+3627
+3628
+3629
+3630
+3631
+3632
+3633
+3634
+3635
+3636
+3637
+3638
+3639
+3640
+3641
+3642
+3643
+3644
+3645
+3646
+3647
+3648
+3649
+3650
+3651
+3652
+3653
+3654
+3655
+3656
+3657
+3658
+3659
+3660
+3661
+3662
+3663
+3664
+3665
+3666
+3667
+3668
+3669
+3670
+3671
+3672
+3673
+3674
+3675
+3676
+3677
+3678
+3679
+3680
+3681
+3682
+3683
+3684
+3685
+3686
+3687
+3688
+3689
+3690
+3691
+3692
+3693
+3694
+3695
+
use crate::attr::Attribute;
+#[cfg(all(feature = "parsing", feature = "full"))]
+use crate::error::Result;
+#[cfg(feature = "full")]
+use crate::generics::BoundLifetimes;
+use crate::ident::Ident;
+#[cfg(feature = "full")]
+use crate::lifetime::Lifetime;
+use crate::lit::Lit;
+use crate::mac::Macro;
+use crate::op::{BinOp, UnOp};
+#[cfg(all(feature = "parsing", feature = "full"))]
+use crate::parse::ParseStream;
+#[cfg(feature = "full")]
+use crate::pat::Pat;
+use crate::path::{AngleBracketedGenericArguments, Path, QSelf};
+use crate::punctuated::Punctuated;
+#[cfg(feature = "full")]
+use crate::stmt::Block;
+use crate::token;
+#[cfg(feature = "full")]
+use crate::ty::ReturnType;
+use crate::ty::Type;
+use proc_macro2::{Span, TokenStream};
+#[cfg(feature = "printing")]
+use quote::IdentFragment;
+#[cfg(feature = "printing")]
+use std::fmt::{self, Display};
+use std::hash::{Hash, Hasher};
+#[cfg(all(feature = "parsing", feature = "full"))]
+use std::mem;
+
+ast_enum_of_structs! {
+    /// A Rust expression.
+    ///
+    /// *This type is available only if Syn is built with the `"derive"` or `"full"`
+    /// feature, but most of the variants are not available unless "full" is enabled.*
+    ///
+    /// # Syntax tree enums
+    ///
+    /// This type is a syntax tree enum. In Syn this and other syntax tree enums
+    /// are designed to be traversed using the following rebinding idiom.
+    ///
+    /// ```
+    /// # use syn::Expr;
+    /// #
+    /// # fn example(expr: Expr) {
+    /// # const IGNORE: &str = stringify! {
+    /// let expr: Expr = /* ... */;
+    /// # };
+    /// match expr {
+    ///     Expr::MethodCall(expr) => {
+    ///         /* ... */
+    ///     }
+    ///     Expr::Cast(expr) => {
+    ///         /* ... */
+    ///     }
+    ///     Expr::If(expr) => {
+    ///         /* ... */
+    ///     }
+    ///
+    ///     /* ... */
+    ///     # _ => {}
+    /// # }
+    /// # }
+    /// ```
+    ///
+    /// We begin with a variable `expr` of type `Expr` that has no fields
+    /// (because it is an enum), and by matching on it and rebinding a variable
+    /// with the same name `expr` we effectively imbue our variable with all of
+    /// the data fields provided by the variant that it turned out to be. So for
+    /// example above if we ended up in the `MethodCall` case then we get to use
+    /// `expr.receiver`, `expr.args` etc; if we ended up in the `If` case we get
+    /// to use `expr.cond`, `expr.then_branch`, `expr.else_branch`.
+    ///
+    /// This approach avoids repeating the variant names twice on every line.
+    ///
+    /// ```
+    /// # use syn::{Expr, ExprMethodCall};
+    /// #
+    /// # fn example(expr: Expr) {
+    /// // Repetitive; recommend not doing this.
+    /// match expr {
+    ///     Expr::MethodCall(ExprMethodCall { method, args, .. }) => {
+    /// # }
+    /// # _ => {}
+    /// # }
+    /// # }
+    /// ```
+    ///
+    /// In general, the name to which a syntax tree enum variant is bound should
+    /// be a suitable name for the complete syntax tree enum type.
+    ///
+    /// ```
+    /// # use syn::{Expr, ExprField};
+    /// #
+    /// # fn example(discriminant: ExprField) {
+    /// // Binding is called `base` which is the name I would use if I were
+    /// // assigning `*discriminant.base` without an `if let`.
+    /// if let Expr::Tuple(base) = *discriminant.base {
+    /// # }
+    /// # }
+    /// ```
+    ///
+    /// A sign that you may not be choosing the right variable names is if you
+    /// see names getting repeated in your code, like accessing
+    /// `receiver.receiver` or `pat.pat` or `cond.cond`.
+    #[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
+    #[non_exhaustive]
+    pub enum Expr {
+        /// A slice literal expression: `[a, b, c, d]`.
+        Array(ExprArray),
+
+        /// An assignment expression: `a = compute()`.
+        Assign(ExprAssign),
+
+        /// An async block: `async { ... }`.
+        Async(ExprAsync),
+
+        /// An await expression: `fut.await`.
+        Await(ExprAwait),
+
+        /// A binary operation: `a + b`, `a += b`.
+        Binary(ExprBinary),
+
+        /// A blocked scope: `{ ... }`.
+        Block(ExprBlock),
+
+        /// A `break`, with an optional label to break and an optional
+        /// expression.
+        Break(ExprBreak),
+
+        /// A function call expression: `invoke(a, b)`.
+        Call(ExprCall),
+
+        /// A cast expression: `foo as f64`.
+        Cast(ExprCast),
+
+        /// A closure expression: `|a, b| a + b`.
+        Closure(ExprClosure),
+
+        /// A const block: `const { ... }`.
+        Const(ExprConst),
+
+        /// A `continue`, with an optional label.
+        Continue(ExprContinue),
+
+        /// Access of a named struct field (`obj.k`) or unnamed tuple struct
+        /// field (`obj.0`).
+        Field(ExprField),
+
+        /// A for loop: `for pat in expr { ... }`.
+        ForLoop(ExprForLoop),
+
+        /// An expression contained within invisible delimiters.
+        ///
+        /// This variant is important for faithfully representing the precedence
+        /// of expressions and is related to `None`-delimited spans in a
+        /// `TokenStream`.
+        Group(ExprGroup),
+
+        /// An `if` expression with an optional `else` block: `if expr { ... }
+        /// else { ... }`.
+        ///
+        /// The `else` branch expression may only be an `If` or `Block`
+        /// expression, not any of the other types of expression.
+        If(ExprIf),
+
+        /// A square bracketed indexing expression: `vector[2]`.
+        Index(ExprIndex),
+
+        /// The inferred value of a const generic argument, denoted `_`.
+        Infer(ExprInfer),
+
+        /// A `let` guard: `let Some(x) = opt`.
+        Let(ExprLet),
+
+        /// A literal in place of an expression: `1`, `"foo"`.
+        Lit(ExprLit),
+
+        /// Conditionless loop: `loop { ... }`.
+        Loop(ExprLoop),
+
+        /// A macro invocation expression: `format!("{}", q)`.
+        Macro(ExprMacro),
+
+        /// A `match` expression: `match n { Some(n) => {}, None => {} }`.
+        Match(ExprMatch),
+
+        /// A method call expression: `x.foo::<T>(a, b)`.
+        MethodCall(ExprMethodCall),
+
+        /// A parenthesized expression: `(a + b)`.
+        Paren(ExprParen),
+
+        /// A path like `std::mem::replace` possibly containing generic
+        /// parameters and a qualified self-type.
+        ///
+        /// A plain identifier like `x` is a path of length 1.
+        Path(ExprPath),
+
+        /// A range expression: `1..2`, `1..`, `..2`, `1..=2`, `..=2`.
+        Range(ExprRange),
+
+        /// A referencing operation: `&a` or `&mut a`.
+        Reference(ExprReference),
+
+        /// An array literal constructed from one repeated element: `[0u8; N]`.
+        Repeat(ExprRepeat),
+
+        /// A `return`, with an optional value to be returned.
+        Return(ExprReturn),
+
+        /// A struct literal expression: `Point { x: 1, y: 1 }`.
+        ///
+        /// The `rest` provides the value of the remaining fields as in `S { a:
+        /// 1, b: 1, ..rest }`.
+        Struct(ExprStruct),
+
+        /// A try-expression: `expr?`.
+        Try(ExprTry),
+
+        /// A try block: `try { ... }`.
+        TryBlock(ExprTryBlock),
+
+        /// A tuple expression: `(a, b, c, d)`.
+        Tuple(ExprTuple),
+
+        /// A unary operation: `!x`, `*x`.
+        Unary(ExprUnary),
+
+        /// An unsafe block: `unsafe { ... }`.
+        Unsafe(ExprUnsafe),
+
+        /// Tokens in expression position not interpreted by Syn.
+        Verbatim(TokenStream),
+
+        /// A while loop: `while expr { ... }`.
+        While(ExprWhile),
+
+        /// A yield expression: `yield expr`.
+        Yield(ExprYield),
+
+        // For testing exhaustiveness in downstream code, use the following idiom:
+        //
+        //     match expr {
+        //         #![cfg_attr(test, deny(non_exhaustive_omitted_patterns))]
+        //
+        //         Expr::Array(expr) => {...}
+        //         Expr::Assign(expr) => {...}
+        //         ...
+        //         Expr::Yield(expr) => {...}
+        //
+        //         _ => { /* some sane fallback */ }
+        //     }
+        //
+        // This way we fail your tests but don't break your library when adding
+        // a variant. You will be notified by a test failure when a variant is
+        // added, so that you can add code to handle it, but your library will
+        // continue to compile and work for downstream users in the interim.
+    }
+}
+
+ast_struct! {
+    /// A slice literal expression: `[a, b, c, d]`.
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    pub struct ExprArray #full {
+        pub attrs: Vec<Attribute>,
+        pub bracket_token: token::Bracket,
+        pub elems: Punctuated<Expr, Token![,]>,
+    }
+}
+
+ast_struct! {
+    /// An assignment expression: `a = compute()`.
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    pub struct ExprAssign #full {
+        pub attrs: Vec<Attribute>,
+        pub left: Box<Expr>,
+        pub eq_token: Token![=],
+        pub right: Box<Expr>,
+    }
+}
+
+ast_struct! {
+    /// An async block: `async { ... }`.
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    pub struct ExprAsync #full {
+        pub attrs: Vec<Attribute>,
+        pub async_token: Token![async],
+        pub capture: Option<Token![move]>,
+        pub block: Block,
+    }
+}
+
+ast_struct! {
+    /// An await expression: `fut.await`.
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    pub struct ExprAwait #full {
+        pub attrs: Vec<Attribute>,
+        pub base: Box<Expr>,
+        pub dot_token: Token![.],
+        pub await_token: Token![await],
+    }
+}
+
+ast_struct! {
+    /// A binary operation: `a + b`, `a += b`.
+    #[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct ExprBinary {
+        pub attrs: Vec<Attribute>,
+        pub left: Box<Expr>,
+        pub op: BinOp,
+        pub right: Box<Expr>,
+    }
+}
+
+ast_struct! {
+    /// A blocked scope: `{ ... }`.
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    pub struct ExprBlock #full {
+        pub attrs: Vec<Attribute>,
+        pub label: Option<Label>,
+        pub block: Block,
+    }
+}
+
+ast_struct! {
+    /// A `break`, with an optional label to break and an optional
+    /// expression.
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    pub struct ExprBreak #full {
+        pub attrs: Vec<Attribute>,
+        pub break_token: Token![break],
+        pub label: Option<Lifetime>,
+        pub expr: Option<Box<Expr>>,
+    }
+}
+
+ast_struct! {
+    /// A function call expression: `invoke(a, b)`.
+    #[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct ExprCall {
+        pub attrs: Vec<Attribute>,
+        pub func: Box<Expr>,
+        pub paren_token: token::Paren,
+        pub args: Punctuated<Expr, Token![,]>,
+    }
+}
+
+ast_struct! {
+    /// A cast expression: `foo as f64`.
+    #[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct ExprCast {
+        pub attrs: Vec<Attribute>,
+        pub expr: Box<Expr>,
+        pub as_token: Token![as],
+        pub ty: Box<Type>,
+    }
+}
+
+ast_struct! {
+    /// A closure expression: `|a, b| a + b`.
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    pub struct ExprClosure #full {
+        pub attrs: Vec<Attribute>,
+        pub lifetimes: Option<BoundLifetimes>,
+        pub constness: Option<Token![const]>,
+        pub movability: Option<Token![static]>,
+        pub asyncness: Option<Token![async]>,
+        pub capture: Option<Token![move]>,
+        pub or1_token: Token![|],
+        pub inputs: Punctuated<Pat, Token![,]>,
+        pub or2_token: Token![|],
+        pub output: ReturnType,
+        pub body: Box<Expr>,
+    }
+}
+
+ast_struct! {
+    /// A const block: `const { ... }`.
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    pub struct ExprConst #full {
+        pub attrs: Vec<Attribute>,
+        pub const_token: Token![const],
+        pub block: Block,
+    }
+}
+
+ast_struct! {
+    /// A `continue`, with an optional label.
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    pub struct ExprContinue #full {
+        pub attrs: Vec<Attribute>,
+        pub continue_token: Token![continue],
+        pub label: Option<Lifetime>,
+    }
+}
+
+ast_struct! {
+    /// Access of a named struct field (`obj.k`) or unnamed tuple struct
+    /// field (`obj.0`).
+    #[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct ExprField {
+        pub attrs: Vec<Attribute>,
+        pub base: Box<Expr>,
+        pub dot_token: Token![.],
+        pub member: Member,
+    }
+}
+
+ast_struct! {
+    /// A for loop: `for pat in expr { ... }`.
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    pub struct ExprForLoop #full {
+        pub attrs: Vec<Attribute>,
+        pub label: Option<Label>,
+        pub for_token: Token![for],
+        pub pat: Box<Pat>,
+        pub in_token: Token![in],
+        pub expr: Box<Expr>,
+        pub body: Block,
+    }
+}
+
+ast_struct! {
+    /// An expression contained within invisible delimiters.
+    ///
+    /// This variant is important for faithfully representing the precedence
+    /// of expressions and is related to `None`-delimited spans in a
+    /// `TokenStream`.
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    pub struct ExprGroup {
+        pub attrs: Vec<Attribute>,
+        pub group_token: token::Group,
+        pub expr: Box<Expr>,
+    }
+}
+
+ast_struct! {
+    /// An `if` expression with an optional `else` block: `if expr { ... }
+    /// else { ... }`.
+    ///
+    /// The `else` branch expression may only be an `If` or `Block`
+    /// expression, not any of the other types of expression.
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    pub struct ExprIf #full {
+        pub attrs: Vec<Attribute>,
+        pub if_token: Token![if],
+        pub cond: Box<Expr>,
+        pub then_branch: Block,
+        pub else_branch: Option<(Token![else], Box<Expr>)>,
+    }
+}
+
+ast_struct! {
+    /// A square bracketed indexing expression: `vector[2]`.
+    #[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct ExprIndex {
+        pub attrs: Vec<Attribute>,
+        pub expr: Box<Expr>,
+        pub bracket_token: token::Bracket,
+        pub index: Box<Expr>,
+    }
+}
+
+ast_struct! {
+    /// The inferred value of a const generic argument, denoted `_`.
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    pub struct ExprInfer #full {
+        pub attrs: Vec<Attribute>,
+        pub underscore_token: Token![_],
+    }
+}
+
+ast_struct! {
+    /// A `let` guard: `let Some(x) = opt`.
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    pub struct ExprLet #full {
+        pub attrs: Vec<Attribute>,
+        pub let_token: Token![let],
+        pub pat: Box<Pat>,
+        pub eq_token: Token![=],
+        pub expr: Box<Expr>,
+    }
+}
+
+ast_struct! {
+    /// A literal in place of an expression: `1`, `"foo"`.
+    #[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct ExprLit {
+        pub attrs: Vec<Attribute>,
+        pub lit: Lit,
+    }
+}
+
+ast_struct! {
+    /// Conditionless loop: `loop { ... }`.
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    pub struct ExprLoop #full {
+        pub attrs: Vec<Attribute>,
+        pub label: Option<Label>,
+        pub loop_token: Token![loop],
+        pub body: Block,
+    }
+}
+
+ast_struct! {
+    /// A macro invocation expression: `format!("{}", q)`.
+    #[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct ExprMacro {
+        pub attrs: Vec<Attribute>,
+        pub mac: Macro,
+    }
+}
+
+ast_struct! {
+    /// A `match` expression: `match n { Some(n) => {}, None => {} }`.
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    pub struct ExprMatch #full {
+        pub attrs: Vec<Attribute>,
+        pub match_token: Token![match],
+        pub expr: Box<Expr>,
+        pub brace_token: token::Brace,
+        pub arms: Vec<Arm>,
+    }
+}
+
+ast_struct! {
+    /// A method call expression: `x.foo::<T>(a, b)`.
+    #[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct ExprMethodCall {
+        pub attrs: Vec<Attribute>,
+        pub receiver: Box<Expr>,
+        pub dot_token: Token![.],
+        pub method: Ident,
+        pub turbofish: Option<AngleBracketedGenericArguments>,
+        pub paren_token: token::Paren,
+        pub args: Punctuated<Expr, Token![,]>,
+    }
+}
+
+ast_struct! {
+    /// A parenthesized expression: `(a + b)`.
+    #[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct ExprParen {
+        pub attrs: Vec<Attribute>,
+        pub paren_token: token::Paren,
+        pub expr: Box<Expr>,
+    }
+}
+
+ast_struct! {
+    /// A path like `std::mem::replace` possibly containing generic
+    /// parameters and a qualified self-type.
+    ///
+    /// A plain identifier like `x` is a path of length 1.
+    #[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct ExprPath {
+        pub attrs: Vec<Attribute>,
+        pub qself: Option<QSelf>,
+        pub path: Path,
+    }
+}
+
+ast_struct! {
+    /// A range expression: `1..2`, `1..`, `..2`, `1..=2`, `..=2`.
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    pub struct ExprRange #full {
+        pub attrs: Vec<Attribute>,
+        pub start: Option<Box<Expr>>,
+        pub limits: RangeLimits,
+        pub end: Option<Box<Expr>>,
+    }
+}
+
+ast_struct! {
+    /// A referencing operation: `&a` or `&mut a`.
+    #[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct ExprReference {
+        pub attrs: Vec<Attribute>,
+        pub and_token: Token![&],
+        pub mutability: Option<Token![mut]>,
+        pub expr: Box<Expr>,
+    }
+}
+
+ast_struct! {
+    /// An array literal constructed from one repeated element: `[0u8; N]`.
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    pub struct ExprRepeat #full {
+        pub attrs: Vec<Attribute>,
+        pub bracket_token: token::Bracket,
+        pub expr: Box<Expr>,
+        pub semi_token: Token![;],
+        pub len: Box<Expr>,
+    }
+}
+
+ast_struct! {
+    /// A `return`, with an optional value to be returned.
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    pub struct ExprReturn #full {
+        pub attrs: Vec<Attribute>,
+        pub return_token: Token![return],
+        pub expr: Option<Box<Expr>>,
+    }
+}
+
+ast_struct! {
+    /// A struct literal expression: `Point { x: 1, y: 1 }`.
+    ///
+    /// The `rest` provides the value of the remaining fields as in `S { a:
+    /// 1, b: 1, ..rest }`.
+    #[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct ExprStruct {
+        pub attrs: Vec<Attribute>,
+        pub qself: Option<QSelf>,
+        pub path: Path,
+        pub brace_token: token::Brace,
+        pub fields: Punctuated<FieldValue, Token![,]>,
+        pub dot2_token: Option<Token![..]>,
+        pub rest: Option<Box<Expr>>,
+    }
+}
+
+ast_struct! {
+    /// A try-expression: `expr?`.
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    pub struct ExprTry #full {
+        pub attrs: Vec<Attribute>,
+        pub expr: Box<Expr>,
+        pub question_token: Token![?],
+    }
+}
+
+ast_struct! {
+    /// A try block: `try { ... }`.
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    pub struct ExprTryBlock #full {
+        pub attrs: Vec<Attribute>,
+        pub try_token: Token![try],
+        pub block: Block,
+    }
+}
+
+ast_struct! {
+    /// A tuple expression: `(a, b, c, d)`.
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    pub struct ExprTuple #full {
+        pub attrs: Vec<Attribute>,
+        pub paren_token: token::Paren,
+        pub elems: Punctuated<Expr, Token![,]>,
+    }
+}
+
+ast_struct! {
+    /// A unary operation: `!x`, `*x`.
+    #[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct ExprUnary {
+        pub attrs: Vec<Attribute>,
+        pub op: UnOp,
+        pub expr: Box<Expr>,
+    }
+}
+
+ast_struct! {
+    /// An unsafe block: `unsafe { ... }`.
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    pub struct ExprUnsafe #full {
+        pub attrs: Vec<Attribute>,
+        pub unsafe_token: Token![unsafe],
+        pub block: Block,
+    }
+}
+
+ast_struct! {
+    /// A while loop: `while expr { ... }`.
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    pub struct ExprWhile #full {
+        pub attrs: Vec<Attribute>,
+        pub label: Option<Label>,
+        pub while_token: Token![while],
+        pub cond: Box<Expr>,
+        pub body: Block,
+    }
+}
+
+ast_struct! {
+    /// A yield expression: `yield expr`.
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    pub struct ExprYield #full {
+        pub attrs: Vec<Attribute>,
+        pub yield_token: Token![yield],
+        pub expr: Option<Box<Expr>>,
+    }
+}
+
+impl Expr {
+    /// An unspecified invalid expression.
+    ///
+    /// ```
+    /// use quote::ToTokens;
+    /// use std::mem;
+    /// use syn::{parse_quote, Expr};
+    ///
+    /// fn unparenthesize(e: &mut Expr) {
+    ///     while let Expr::Paren(paren) = e {
+    ///         *e = mem::replace(&mut *paren.expr, Expr::PLACEHOLDER);
+    ///     }
+    /// }
+    ///
+    /// fn main() {
+    ///     let mut e: Expr = parse_quote! { ((1 + 1)) };
+    ///     unparenthesize(&mut e);
+    ///     assert_eq!("1 + 1", e.to_token_stream().to_string());
+    /// }
+    /// ```
+    pub const PLACEHOLDER: Self = Expr::Path(ExprPath {
+        attrs: Vec::new(),
+        qself: None,
+        path: Path {
+            leading_colon: None,
+            segments: Punctuated::new(),
+        },
+    });
+
+    /// An alternative to the primary `Expr::parse` parser (from the [`Parse`]
+    /// trait) for ambiguous syntactic positions in which a trailing brace
+    /// should not be taken as part of the expression.
+    ///
+    /// [`Parse`]: crate::parse::Parse
+    ///
+    /// Rust grammar has an ambiguity where braces sometimes turn a path
+    /// expression into a struct initialization and sometimes do not. In the
+    /// following code, the expression `S {}` is one expression. Presumably
+    /// there is an empty struct `struct S {}` defined somewhere which it is
+    /// instantiating.
+    ///
+    /// ```
+    /// # struct S;
+    /// # impl std::ops::Deref for S {
+    /// #     type Target = bool;
+    /// #     fn deref(&self) -> &Self::Target {
+    /// #         &true
+    /// #     }
+    /// # }
+    /// let _ = *S {};
+    ///
+    /// // parsed by rustc as: `*(S {})`
+    /// ```
+    ///
+    /// We would want to parse the above using `Expr::parse` after the `=`
+    /// token.
+    ///
+    /// But in the following, `S {}` is *not* a struct init expression.
+    ///
+    /// ```
+    /// # const S: &bool = &true;
+    /// if *S {} {}
+    ///
+    /// // parsed by rustc as:
+    /// //
+    /// //    if (*S) {
+    /// //        /* empty block */
+    /// //    }
+    /// //    {
+    /// //        /* another empty block */
+    /// //    }
+    /// ```
+    ///
+    /// For that reason we would want to parse if-conditions using
+    /// `Expr::parse_without_eager_brace` after the `if` token. Same for similar
+    /// syntactic positions such as the condition expr after a `while` token or
+    /// the expr at the top of a `match`.
+    ///
+    /// The Rust grammar's choices around which way this ambiguity is resolved
+    /// at various syntactic positions is fairly arbitrary. Really either parse
+    /// behavior could work in most positions, and language designers just
+    /// decide each case based on which is more likely to be what the programmer
+    /// had in mind most of the time.
+    ///
+    /// ```
+    /// # struct S;
+    /// # fn doc() -> S {
+    /// if return S {} {}
+    /// # unreachable!()
+    /// # }
+    ///
+    /// // parsed by rustc as:
+    /// //
+    /// //    if (return (S {})) {
+    /// //    }
+    /// //
+    /// // but could equally well have been this other arbitrary choice:
+    /// //
+    /// //    if (return S) {
+    /// //    }
+    /// //    {}
+    /// ```
+    ///
+    /// Note the grammar ambiguity on trailing braces is distinct from
+    /// precedence and is not captured by assigning a precedence level to the
+    /// braced struct init expr in relation to other operators. This can be
+    /// illustrated by `return 0..S {}` vs `match 0..S {}`. The former parses as
+    /// `return (0..(S {}))` implying tighter precedence for struct init than
+    /// `..`, while the latter parses as `match (0..S) {}` implying tighter
+    /// precedence for `..` than struct init, a contradiction.
+    #[cfg(all(feature = "full", feature = "parsing"))]
+    #[cfg_attr(doc_cfg, doc(cfg(all(feature = "full", feature = "parsing"))))]
+    pub fn parse_without_eager_brace(input: ParseStream) -> Result<Expr> {
+        parsing::ambiguous_expr(input, parsing::AllowStruct(false))
+    }
+
+    /// An alternative to the primary `Expr::parse` parser (from the [`Parse`]
+    /// trait) for syntactic positions in which expression boundaries are placed
+    /// more eagerly than done by the typical expression grammar. This includes
+    /// expressions at the head of a statement or in the right-hand side of a
+    /// `match` arm.
+    ///
+    /// [`Parse`]: crate::parse::Parse
+    ///
+    /// Compare the following cases:
+    ///
+    /// 1.
+    ///   ```
+    ///   # let result = ();
+    ///   # let guard = false;
+    ///   # let cond = true;
+    ///   # let f = true;
+    ///   # let g = f;
+    ///   #
+    ///   let _ = match result {
+    ///       () if guard => if cond { f } else { g }
+    ///       () => false,
+    ///   };
+    ///   ```
+    ///
+    /// 2.
+    ///   ```
+    ///   # let cond = true;
+    ///   # let f = ();
+    ///   # let g = f;
+    ///   #
+    ///   let _ = || {
+    ///       if cond { f } else { g }
+    ///       ()
+    ///   };
+    ///   ```
+    ///
+    /// 3.
+    ///   ```
+    ///   # let cond = true;
+    ///   # let f = || ();
+    ///   # let g = f;
+    ///   #
+    ///   let _ = [if cond { f } else { g } ()];
+    ///   ```
+    ///
+    /// The same sequence of tokens `if cond { f } else { g } ()` appears in
+    /// expression position 3 times. The first two syntactic positions use eager
+    /// placement of expression boundaries, and parse as `Expr::If`, with the
+    /// adjacent `()` becoming `Pat::Tuple` or `Expr::Tuple`. In contrast, the
+    /// third case uses standard expression boundaries and parses as
+    /// `Expr::Call`.
+    ///
+    /// As with [`parse_without_eager_brace`], this ambiguity in the Rust
+    /// grammar is independent of precedence.
+    ///
+    /// [`parse_without_eager_brace`]: Self::parse_without_eager_brace
+    #[cfg(all(feature = "full", feature = "parsing"))]
+    #[cfg_attr(doc_cfg, doc(cfg(all(feature = "full", feature = "parsing"))))]
+    pub fn parse_with_earlier_boundary_rule(input: ParseStream) -> Result<Expr> {
+        parsing::parse_with_earlier_boundary_rule(input)
+    }
+
+    #[cfg(all(feature = "parsing", feature = "full"))]
+    pub(crate) fn replace_attrs(&mut self, new: Vec<Attribute>) -> Vec<Attribute> {
+        match self {
+            Expr::Array(ExprArray { attrs, .. })
+            | Expr::Assign(ExprAssign { attrs, .. })
+            | Expr::Async(ExprAsync { attrs, .. })
+            | Expr::Await(ExprAwait { attrs, .. })
+            | Expr::Binary(ExprBinary { attrs, .. })
+            | Expr::Block(ExprBlock { attrs, .. })
+            | Expr::Break(ExprBreak { attrs, .. })
+            | Expr::Call(ExprCall { attrs, .. })
+            | Expr::Cast(ExprCast { attrs, .. })
+            | Expr::Closure(ExprClosure { attrs, .. })
+            | Expr::Const(ExprConst { attrs, .. })
+            | Expr::Continue(ExprContinue { attrs, .. })
+            | Expr::Field(ExprField { attrs, .. })
+            | Expr::ForLoop(ExprForLoop { attrs, .. })
+            | Expr::Group(ExprGroup { attrs, .. })
+            | Expr::If(ExprIf { attrs, .. })
+            | Expr::Index(ExprIndex { attrs, .. })
+            | Expr::Infer(ExprInfer { attrs, .. })
+            | Expr::Let(ExprLet { attrs, .. })
+            | Expr::Lit(ExprLit { attrs, .. })
+            | Expr::Loop(ExprLoop { attrs, .. })
+            | Expr::Macro(ExprMacro { attrs, .. })
+            | Expr::Match(ExprMatch { attrs, .. })
+            | Expr::MethodCall(ExprMethodCall { attrs, .. })
+            | Expr::Paren(ExprParen { attrs, .. })
+            | Expr::Path(ExprPath { attrs, .. })
+            | Expr::Range(ExprRange { attrs, .. })
+            | Expr::Reference(ExprReference { attrs, .. })
+            | Expr::Repeat(ExprRepeat { attrs, .. })
+            | Expr::Return(ExprReturn { attrs, .. })
+            | Expr::Struct(ExprStruct { attrs, .. })
+            | Expr::Try(ExprTry { attrs, .. })
+            | Expr::TryBlock(ExprTryBlock { attrs, .. })
+            | Expr::Tuple(ExprTuple { attrs, .. })
+            | Expr::Unary(ExprUnary { attrs, .. })
+            | Expr::Unsafe(ExprUnsafe { attrs, .. })
+            | Expr::While(ExprWhile { attrs, .. })
+            | Expr::Yield(ExprYield { attrs, .. }) => mem::replace(attrs, new),
+            Expr::Verbatim(_) => Vec::new(),
+        }
+    }
+}
+
+ast_enum! {
+    /// A struct or tuple struct field accessed in a struct literal or field
+    /// expression.
+    #[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub enum Member {
+        /// A named field like `self.x`.
+        Named(Ident),
+        /// An unnamed field like `self.0`.
+        Unnamed(Index),
+    }
+}
+
+impl From<Ident> for Member {
+    fn from(ident: Ident) -> Member {
+        Member::Named(ident)
+    }
+}
+
+impl From<Index> for Member {
+    fn from(index: Index) -> Member {
+        Member::Unnamed(index)
+    }
+}
+
+impl From<usize> for Member {
+    fn from(index: usize) -> Member {
+        Member::Unnamed(Index::from(index))
+    }
+}
+
+impl Eq for Member {}
+
+impl PartialEq for Member {
+    fn eq(&self, other: &Self) -> bool {
+        match (self, other) {
+            (Member::Named(this), Member::Named(other)) => this == other,
+            (Member::Unnamed(this), Member::Unnamed(other)) => this == other,
+            _ => false,
+        }
+    }
+}
+
+impl Hash for Member {
+    fn hash<H: Hasher>(&self, state: &mut H) {
+        match self {
+            Member::Named(m) => m.hash(state),
+            Member::Unnamed(m) => m.hash(state),
+        }
+    }
+}
+
+#[cfg(feature = "printing")]
+impl IdentFragment for Member {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        match self {
+            Member::Named(m) => Display::fmt(m, formatter),
+            Member::Unnamed(m) => Display::fmt(&m.index, formatter),
+        }
+    }
+
+    fn span(&self) -> Option<Span> {
+        match self {
+            Member::Named(m) => Some(m.span()),
+            Member::Unnamed(m) => Some(m.span),
+        }
+    }
+}
+
+ast_struct! {
+    /// The index of an unnamed tuple struct field.
+    #[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct Index {
+        pub index: u32,
+        pub span: Span,
+    }
+}
+
+impl From<usize> for Index {
+    fn from(index: usize) -> Index {
+        assert!(index < u32::MAX as usize);
+        Index {
+            index: index as u32,
+            span: Span::call_site(),
+        }
+    }
+}
+
+impl Eq for Index {}
+
+impl PartialEq for Index {
+    fn eq(&self, other: &Self) -> bool {
+        self.index == other.index
+    }
+}
+
+impl Hash for Index {
+    fn hash<H: Hasher>(&self, state: &mut H) {
+        self.index.hash(state);
+    }
+}
+
+#[cfg(feature = "printing")]
+impl IdentFragment for Index {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        Display::fmt(&self.index, formatter)
+    }
+
+    fn span(&self) -> Option<Span> {
+        Some(self.span)
+    }
+}
+
+ast_struct! {
+    /// A field-value pair in a struct literal.
+    #[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct FieldValue {
+        pub attrs: Vec<Attribute>,
+        pub member: Member,
+
+        /// The colon in `Struct { x: x }`. If written in shorthand like
+        /// `Struct { x }`, there is no colon.
+        pub colon_token: Option<Token![:]>,
+
+        pub expr: Expr,
+    }
+}
+
+#[cfg(feature = "full")]
+ast_struct! {
+    /// A lifetime labeling a `for`, `while`, or `loop`.
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    pub struct Label {
+        pub name: Lifetime,
+        pub colon_token: Token![:],
+    }
+}
+
+#[cfg(feature = "full")]
+ast_struct! {
+    /// One arm of a `match` expression: `0..=10 => { return true; }`.
+    ///
+    /// As in:
+    ///
+    /// ```
+    /// # fn f() -> bool {
+    /// #     let n = 0;
+    /// match n {
+    ///     0..=10 => {
+    ///         return true;
+    ///     }
+    ///     // ...
+    ///     # _ => {}
+    /// }
+    /// #   false
+    /// # }
+    /// ```
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    pub struct Arm {
+        pub attrs: Vec<Attribute>,
+        pub pat: Pat,
+        pub guard: Option<(Token![if], Box<Expr>)>,
+        pub fat_arrow_token: Token![=>],
+        pub body: Box<Expr>,
+        pub comma: Option<Token![,]>,
+    }
+}
+
+#[cfg(feature = "full")]
+ast_enum! {
+    /// Limit types of a range, inclusive or exclusive.
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    pub enum RangeLimits {
+        /// Inclusive at the beginning, exclusive at the end.
+        HalfOpen(Token![..]),
+        /// Inclusive at the beginning and end.
+        Closed(Token![..=]),
+    }
+}
+
+#[cfg(any(feature = "parsing", feature = "printing"))]
+#[cfg(feature = "full")]
+pub(crate) fn requires_terminator(expr: &Expr) -> bool {
+    // see https://github.com/rust-lang/rust/blob/9a19e7604/compiler/rustc_ast/src/util/classify.rs#L7-L26
+    match expr {
+        Expr::If(_)
+        | Expr::Match(_)
+        | Expr::Block(_) | Expr::Unsafe(_) // both under ExprKind::Block in rustc
+        | Expr::While(_)
+        | Expr::Loop(_)
+        | Expr::ForLoop(_)
+        | Expr::TryBlock(_)
+        | Expr::Const(_) => false,
+        Expr::Array(_)
+        | Expr::Assign(_)
+        | Expr::Async(_)
+        | Expr::Await(_)
+        | Expr::Binary(_)
+        | Expr::Break(_)
+        | Expr::Call(_)
+        | Expr::Cast(_)
+        | Expr::Closure(_)
+        | Expr::Continue(_)
+        | Expr::Field(_)
+        | Expr::Group(_)
+        | Expr::Index(_)
+        | Expr::Infer(_)
+        | Expr::Let(_)
+        | Expr::Lit(_)
+        | Expr::Macro(_)
+        | Expr::MethodCall(_)
+        | Expr::Paren(_)
+        | Expr::Path(_)
+        | Expr::Range(_)
+        | Expr::Reference(_)
+        | Expr::Repeat(_)
+        | Expr::Return(_)
+        | Expr::Struct(_)
+        | Expr::Try(_)
+        | Expr::Tuple(_)
+        | Expr::Unary(_)
+        | Expr::Yield(_)
+        | Expr::Verbatim(_) => true
+    }
+}
+
+#[cfg(feature = "parsing")]
+mod precedence {
+    use super::BinOp;
+    use std::cmp::Ordering;
+
+    pub(super) enum Precedence {
+        Any,
+        Assign,
+        Range,
+        Or,
+        And,
+        Compare,
+        BitOr,
+        BitXor,
+        BitAnd,
+        Shift,
+        Arithmetic,
+        Term,
+        Cast,
+    }
+
+    impl Precedence {
+        pub(super) fn of(op: &BinOp) -> Self {
+            match op {
+                BinOp::Add(_) | BinOp::Sub(_) => Precedence::Arithmetic,
+                BinOp::Mul(_) | BinOp::Div(_) | BinOp::Rem(_) => Precedence::Term,
+                BinOp::And(_) => Precedence::And,
+                BinOp::Or(_) => Precedence::Or,
+                BinOp::BitXor(_) => Precedence::BitXor,
+                BinOp::BitAnd(_) => Precedence::BitAnd,
+                BinOp::BitOr(_) => Precedence::BitOr,
+                BinOp::Shl(_) | BinOp::Shr(_) => Precedence::Shift,
+                BinOp::Eq(_)
+                | BinOp::Lt(_)
+                | BinOp::Le(_)
+                | BinOp::Ne(_)
+                | BinOp::Ge(_)
+                | BinOp::Gt(_) => Precedence::Compare,
+                BinOp::AddAssign(_)
+                | BinOp::SubAssign(_)
+                | BinOp::MulAssign(_)
+                | BinOp::DivAssign(_)
+                | BinOp::RemAssign(_)
+                | BinOp::BitXorAssign(_)
+                | BinOp::BitAndAssign(_)
+                | BinOp::BitOrAssign(_)
+                | BinOp::ShlAssign(_)
+                | BinOp::ShrAssign(_) => Precedence::Assign,
+            }
+        }
+    }
+
+    impl Copy for Precedence {}
+
+    impl Clone for Precedence {
+        fn clone(&self) -> Self {
+            *self
+        }
+    }
+
+    impl PartialEq for Precedence {
+        fn eq(&self, other: &Self) -> bool {
+            *self as u8 == *other as u8
+        }
+    }
+
+    impl PartialOrd for Precedence {
+        fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
+            let this = *self as u8;
+            let other = *other as u8;
+            Some(this.cmp(&other))
+        }
+    }
+}
+
+#[cfg(feature = "parsing")]
+pub(crate) mod parsing {
+    #[cfg(feature = "full")]
+    use crate::attr;
+    use crate::attr::Attribute;
+    use crate::error::{Error, Result};
+    use crate::expr::precedence::Precedence;
+    #[cfg(feature = "full")]
+    use crate::expr::{
+        requires_terminator, Arm, ExprArray, ExprAssign, ExprAsync, ExprAwait, ExprBlock,
+        ExprBreak, ExprClosure, ExprConst, ExprContinue, ExprForLoop, ExprIf, ExprInfer, ExprLet,
+        ExprLoop, ExprMatch, ExprRange, ExprRepeat, ExprReturn, ExprTry, ExprTryBlock, ExprTuple,
+        ExprUnsafe, ExprWhile, ExprYield, Label, RangeLimits,
+    };
+    use crate::expr::{
+        Expr, ExprBinary, ExprCall, ExprCast, ExprField, ExprGroup, ExprIndex, ExprLit, ExprMacro,
+        ExprMethodCall, ExprParen, ExprPath, ExprReference, ExprStruct, ExprUnary, FieldValue,
+        Index, Member,
+    };
+    #[cfg(feature = "full")]
+    use crate::ext::IdentExt as _;
+    #[cfg(feature = "full")]
+    use crate::generics::BoundLifetimes;
+    use crate::ident::Ident;
+    #[cfg(feature = "full")]
+    use crate::lifetime::Lifetime;
+    use crate::lit::{Lit, LitFloat, LitInt};
+    use crate::mac::{self, Macro};
+    use crate::op::BinOp;
+    use crate::parse::discouraged::Speculative as _;
+    #[cfg(feature = "full")]
+    use crate::parse::ParseBuffer;
+    use crate::parse::{Parse, ParseStream};
+    #[cfg(feature = "full")]
+    use crate::pat::{Pat, PatType};
+    use crate::path::{self, AngleBracketedGenericArguments, Path, QSelf};
+    use crate::punctuated::Punctuated;
+    #[cfg(feature = "full")]
+    use crate::stmt::Block;
+    use crate::token;
+    use crate::ty;
+    #[cfg(feature = "full")]
+    use crate::ty::{ReturnType, Type};
+    use crate::verbatim;
+    #[cfg(feature = "full")]
+    use proc_macro2::TokenStream;
+    use std::mem;
+
+    mod kw {
+        crate::custom_keyword!(builtin);
+        crate::custom_keyword!(raw);
+    }
+
+    // When we're parsing expressions which occur before blocks, like in an if
+    // statement's condition, we cannot parse a struct literal.
+    //
+    // Struct literals are ambiguous in certain positions
+    // https://github.com/rust-lang/rfcs/pull/92
+    #[cfg(feature = "full")]
+    pub(super) struct AllowStruct(pub bool);
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for Expr {
+        fn parse(input: ParseStream) -> Result<Self> {
+            ambiguous_expr(
+                input,
+                #[cfg(feature = "full")]
+                AllowStruct(true),
+            )
+        }
+    }
+
+    #[cfg(feature = "full")]
+    pub(super) fn parse_with_earlier_boundary_rule(input: ParseStream) -> Result<Expr> {
+        let mut attrs = input.call(expr_attrs)?;
+        let mut expr = if input.peek(token::Group) {
+            let allow_struct = AllowStruct(true);
+            let atom = expr_group(input, allow_struct)?;
+            if continue_parsing_early(&atom) {
+                trailer_helper(input, atom)?
+            } else {
+                atom
+            }
+        } else if input.peek(Token![if]) {
+            Expr::If(input.parse()?)
+        } else if input.peek(Token![while]) {
+            Expr::While(input.parse()?)
+        } else if input.peek(Token![for])
+            && !(input.peek2(Token![<]) && (input.peek3(Lifetime) || input.peek3(Token![>])))
+        {
+            Expr::ForLoop(input.parse()?)
+        } else if input.peek(Token![loop]) {
+            Expr::Loop(input.parse()?)
+        } else if input.peek(Token![match]) {
+            Expr::Match(input.parse()?)
+        } else if input.peek(Token![try]) && input.peek2(token::Brace) {
+            Expr::TryBlock(input.parse()?)
+        } else if input.peek(Token![unsafe]) {
+            Expr::Unsafe(input.parse()?)
+        } else if input.peek(Token![const]) && input.peek2(token::Brace) {
+            Expr::Const(input.parse()?)
+        } else if input.peek(token::Brace) {
+            Expr::Block(input.parse()?)
+        } else if input.peek(Lifetime) {
+            atom_labeled(input)?
+        } else {
+            let allow_struct = AllowStruct(true);
+            unary_expr(input, allow_struct)?
+        };
+
+        if continue_parsing_early(&expr) {
+            attrs.extend(expr.replace_attrs(Vec::new()));
+            expr.replace_attrs(attrs);
+
+            let allow_struct = AllowStruct(true);
+            return parse_expr(input, expr, allow_struct, Precedence::Any);
+        }
+
+        if input.peek(Token![.]) && !input.peek(Token![..]) || input.peek(Token![?]) {
+            expr = trailer_helper(input, expr)?;
+
+            attrs.extend(expr.replace_attrs(Vec::new()));
+            expr.replace_attrs(attrs);
+
+            let allow_struct = AllowStruct(true);
+            return parse_expr(input, expr, allow_struct, Precedence::Any);
+        }
+
+        attrs.extend(expr.replace_attrs(Vec::new()));
+        expr.replace_attrs(attrs);
+        Ok(expr)
+    }
+
+    #[cfg(feature = "full")]
+    impl Copy for AllowStruct {}
+
+    #[cfg(feature = "full")]
+    impl Clone for AllowStruct {
+        fn clone(&self) -> Self {
+            *self
+        }
+    }
+
+    #[cfg(feature = "full")]
+    fn can_begin_expr(input: ParseStream) -> bool {
+        input.peek(Ident::peek_any) // value name or keyword
+            || input.peek(token::Paren) // tuple
+            || input.peek(token::Bracket) // array
+            || input.peek(token::Brace) // block
+            || input.peek(Lit) // literal
+            || input.peek(Token![!]) && !input.peek(Token![!=]) // operator not
+            || input.peek(Token![-]) && !input.peek(Token![-=]) && !input.peek(Token![->]) // unary minus
+            || input.peek(Token![*]) && !input.peek(Token![*=]) // dereference
+            || input.peek(Token![|]) && !input.peek(Token![|=]) // closure
+            || input.peek(Token![&]) && !input.peek(Token![&=]) // reference
+            || input.peek(Token![..]) // range notation
+            || input.peek(Token![<]) && !input.peek(Token![<=]) && !input.peek(Token![<<=]) // associated path
+            || input.peek(Token![::]) // global path
+            || input.peek(Lifetime) // labeled loop
+            || input.peek(Token![#]) // expression attributes
+    }
+
+    #[cfg(feature = "full")]
+    fn parse_expr(
+        input: ParseStream,
+        mut lhs: Expr,
+        allow_struct: AllowStruct,
+        base: Precedence,
+    ) -> Result<Expr> {
+        loop {
+            let ahead = input.fork();
+            if let Expr::Range(ExprRange { end: Some(_), .. }) = lhs {
+                // A range with an upper bound cannot be the left-hand side of
+                // another binary operator.
+                break;
+            } else if let Ok(op) = ahead.parse::<BinOp>() {
+                let precedence = Precedence::of(&op);
+                if precedence < base {
+                    break;
+                }
+                if precedence == Precedence::Compare {
+                    if let Expr::Binary(lhs) = &lhs {
+                        if Precedence::of(&lhs.op) == Precedence::Compare {
+                            break;
+                        }
+                    }
+                }
+                input.advance_to(&ahead);
+                let right = parse_binop_rhs(input, allow_struct, precedence)?;
+                lhs = Expr::Binary(ExprBinary {
+                    attrs: Vec::new(),
+                    left: Box::new(lhs),
+                    op,
+                    right,
+                });
+            } else if Precedence::Assign >= base && input.peek(Token![=]) && !input.peek(Token![=>])
+            {
+                let eq_token: Token![=] = input.parse()?;
+                let right = parse_binop_rhs(input, allow_struct, Precedence::Assign)?;
+                lhs = Expr::Assign(ExprAssign {
+                    attrs: Vec::new(),
+                    left: Box::new(lhs),
+                    eq_token,
+                    right,
+                });
+            } else if Precedence::Range >= base && input.peek(Token![..]) {
+                let limits: RangeLimits = input.parse()?;
+                let end = parse_range_end(input, &limits, allow_struct)?;
+                lhs = Expr::Range(ExprRange {
+                    attrs: Vec::new(),
+                    start: Some(Box::new(lhs)),
+                    limits,
+                    end,
+                });
+            } else if Precedence::Cast >= base && input.peek(Token![as]) {
+                let as_token: Token![as] = input.parse()?;
+                let allow_plus = false;
+                let allow_group_generic = false;
+                let ty = ty::parsing::ambig_ty(input, allow_plus, allow_group_generic)?;
+                check_cast(input)?;
+                lhs = Expr::Cast(ExprCast {
+                    attrs: Vec::new(),
+                    expr: Box::new(lhs),
+                    as_token,
+                    ty: Box::new(ty),
+                });
+            } else {
+                break;
+            }
+        }
+        Ok(lhs)
+    }
+
+    #[cfg(not(feature = "full"))]
+    fn parse_expr(input: ParseStream, mut lhs: Expr, base: Precedence) -> Result<Expr> {
+        loop {
+            let ahead = input.fork();
+            if let Ok(op) = ahead.parse::<BinOp>() {
+                let precedence = Precedence::of(&op);
+                if precedence < base {
+                    break;
+                }
+                if precedence == Precedence::Compare {
+                    if let Expr::Binary(lhs) = &lhs {
+                        if Precedence::of(&lhs.op) == Precedence::Compare {
+                            break;
+                        }
+                    }
+                }
+                input.advance_to(&ahead);
+                let right = parse_binop_rhs(input, precedence)?;
+                lhs = Expr::Binary(ExprBinary {
+                    attrs: Vec::new(),
+                    left: Box::new(lhs),
+                    op,
+                    right,
+                });
+            } else if Precedence::Cast >= base && input.peek(Token![as]) {
+                let as_token: Token![as] = input.parse()?;
+                let allow_plus = false;
+                let allow_group_generic = false;
+                let ty = ty::parsing::ambig_ty(input, allow_plus, allow_group_generic)?;
+                check_cast(input)?;
+                lhs = Expr::Cast(ExprCast {
+                    attrs: Vec::new(),
+                    expr: Box::new(lhs),
+                    as_token,
+                    ty: Box::new(ty),
+                });
+            } else {
+                break;
+            }
+        }
+        Ok(lhs)
+    }
+
+    fn parse_binop_rhs(
+        input: ParseStream,
+        #[cfg(feature = "full")] allow_struct: AllowStruct,
+        precedence: Precedence,
+    ) -> Result<Box<Expr>> {
+        let mut rhs = unary_expr(
+            input,
+            #[cfg(feature = "full")]
+            allow_struct,
+        )?;
+        loop {
+            let next = peek_precedence(input);
+            if next > precedence || next == precedence && precedence == Precedence::Assign {
+                rhs = parse_expr(
+                    input,
+                    rhs,
+                    #[cfg(feature = "full")]
+                    allow_struct,
+                    next,
+                )?;
+            } else {
+                return Ok(Box::new(rhs));
+            }
+        }
+    }
+
+    fn peek_precedence(input: ParseStream) -> Precedence {
+        if let Ok(op) = input.fork().parse() {
+            Precedence::of(&op)
+        } else if input.peek(Token![=]) && !input.peek(Token![=>]) {
+            Precedence::Assign
+        } else if input.peek(Token![..]) {
+            Precedence::Range
+        } else if input.peek(Token![as]) {
+            Precedence::Cast
+        } else {
+            Precedence::Any
+        }
+    }
+
+    // Parse an arbitrary expression.
+    pub(super) fn ambiguous_expr(
+        input: ParseStream,
+        #[cfg(feature = "full")] allow_struct: AllowStruct,
+    ) -> Result<Expr> {
+        let lhs = unary_expr(
+            input,
+            #[cfg(feature = "full")]
+            allow_struct,
+        )?;
+        parse_expr(
+            input,
+            lhs,
+            #[cfg(feature = "full")]
+            allow_struct,
+            Precedence::Any,
+        )
+    }
+
+    #[cfg(feature = "full")]
+    fn expr_attrs(input: ParseStream) -> Result<Vec<Attribute>> {
+        let mut attrs = Vec::new();
+        while !input.peek(token::Group) && input.peek(Token![#]) {
+            attrs.push(input.call(attr::parsing::single_parse_outer)?);
+        }
+        Ok(attrs)
+    }
+
+    // <UnOp> <trailer>
+    // & <trailer>
+    // &mut <trailer>
+    // box <trailer>
+    #[cfg(feature = "full")]
+    fn unary_expr(input: ParseStream, allow_struct: AllowStruct) -> Result<Expr> {
+        let begin = input.fork();
+        let attrs = input.call(expr_attrs)?;
+        if input.peek(token::Group) {
+            return trailer_expr(begin, attrs, input, allow_struct);
+        }
+
+        if input.peek(Token![&]) {
+            let and_token: Token![&] = input.parse()?;
+            let raw: Option<kw::raw> = if input.peek(kw::raw)
+                && (input.peek2(Token![mut]) || input.peek2(Token![const]))
+            {
+                Some(input.parse()?)
+            } else {
+                None
+            };
+            let mutability: Option<Token![mut]> = input.parse()?;
+            if raw.is_some() && mutability.is_none() {
+                input.parse::<Token![const]>()?;
+            }
+            let expr = Box::new(unary_expr(input, allow_struct)?);
+            if raw.is_some() {
+                Ok(Expr::Verbatim(verbatim::between(&begin, input)))
+            } else {
+                Ok(Expr::Reference(ExprReference {
+                    attrs,
+                    and_token,
+                    mutability,
+                    expr,
+                }))
+            }
+        } else if input.peek(Token![*]) || input.peek(Token![!]) || input.peek(Token![-]) {
+            expr_unary(input, attrs, allow_struct).map(Expr::Unary)
+        } else {
+            trailer_expr(begin, attrs, input, allow_struct)
+        }
+    }
+
+    #[cfg(not(feature = "full"))]
+    fn unary_expr(input: ParseStream) -> Result<Expr> {
+        if input.peek(Token![&]) {
+            Ok(Expr::Reference(ExprReference {
+                attrs: Vec::new(),
+                and_token: input.parse()?,
+                mutability: input.parse()?,
+                expr: Box::new(unary_expr(input)?),
+            }))
+        } else if input.peek(Token![*]) || input.peek(Token![!]) || input.peek(Token![-]) {
+            Ok(Expr::Unary(ExprUnary {
+                attrs: Vec::new(),
+                op: input.parse()?,
+                expr: Box::new(unary_expr(input)?),
+            }))
+        } else {
+            trailer_expr(input)
+        }
+    }
+
+    // <atom> (..<args>) ...
+    // <atom> . <ident> (..<args>) ...
+    // <atom> . <ident> ...
+    // <atom> . <lit> ...
+    // <atom> [ <expr> ] ...
+    // <atom> ? ...
+    #[cfg(feature = "full")]
+    fn trailer_expr(
+        begin: ParseBuffer,
+        mut attrs: Vec<Attribute>,
+        input: ParseStream,
+        allow_struct: AllowStruct,
+    ) -> Result<Expr> {
+        let atom = atom_expr(input, allow_struct)?;
+        let mut e = trailer_helper(input, atom)?;
+
+        if let Expr::Verbatim(tokens) = &mut e {
+            *tokens = verbatim::between(&begin, input);
+        } else {
+            let inner_attrs = e.replace_attrs(Vec::new());
+            attrs.extend(inner_attrs);
+            e.replace_attrs(attrs);
+        }
+
+        Ok(e)
+    }
+
+    #[cfg(feature = "full")]
+    fn trailer_helper(input: ParseStream, mut e: Expr) -> Result<Expr> {
+        loop {
+            if input.peek(token::Paren) {
+                let content;
+                e = Expr::Call(ExprCall {
+                    attrs: Vec::new(),
+                    func: Box::new(e),
+                    paren_token: parenthesized!(content in input),
+                    args: content.parse_terminated(Expr::parse, Token![,])?,
+                });
+            } else if input.peek(Token![.])
+                && !input.peek(Token![..])
+                && match e {
+                    Expr::Range(_) => false,
+                    _ => true,
+                }
+            {
+                let mut dot_token: Token![.] = input.parse()?;
+
+                let float_token: Option<LitFloat> = input.parse()?;
+                if let Some(float_token) = float_token {
+                    if multi_index(&mut e, &mut dot_token, float_token)? {
+                        continue;
+                    }
+                }
+
+                let await_token: Option<Token![await]> = input.parse()?;
+                if let Some(await_token) = await_token {
+                    e = Expr::Await(ExprAwait {
+                        attrs: Vec::new(),
+                        base: Box::new(e),
+                        dot_token,
+                        await_token,
+                    });
+                    continue;
+                }
+
+                let member: Member = input.parse()?;
+                let turbofish = if member.is_named() && input.peek(Token![::]) {
+                    Some(AngleBracketedGenericArguments::parse_turbofish(input)?)
+                } else {
+                    None
+                };
+
+                if turbofish.is_some() || input.peek(token::Paren) {
+                    if let Member::Named(method) = member {
+                        let content;
+                        e = Expr::MethodCall(ExprMethodCall {
+                            attrs: Vec::new(),
+                            receiver: Box::new(e),
+                            dot_token,
+                            method,
+                            turbofish,
+                            paren_token: parenthesized!(content in input),
+                            args: content.parse_terminated(Expr::parse, Token![,])?,
+                        });
+                        continue;
+                    }
+                }
+
+                e = Expr::Field(ExprField {
+                    attrs: Vec::new(),
+                    base: Box::new(e),
+                    dot_token,
+                    member,
+                });
+            } else if input.peek(token::Bracket) {
+                let content;
+                e = Expr::Index(ExprIndex {
+                    attrs: Vec::new(),
+                    expr: Box::new(e),
+                    bracket_token: bracketed!(content in input),
+                    index: content.parse()?,
+                });
+            } else if input.peek(Token![?]) {
+                e = Expr::Try(ExprTry {
+                    attrs: Vec::new(),
+                    expr: Box::new(e),
+                    question_token: input.parse()?,
+                });
+            } else {
+                break;
+            }
+        }
+        Ok(e)
+    }
+
+    #[cfg(not(feature = "full"))]
+    fn trailer_expr(input: ParseStream) -> Result<Expr> {
+        let mut e = atom_expr(input)?;
+
+        loop {
+            if input.peek(token::Paren) {
+                let content;
+                e = Expr::Call(ExprCall {
+                    attrs: Vec::new(),
+                    func: Box::new(e),
+                    paren_token: parenthesized!(content in input),
+                    args: content.parse_terminated(Expr::parse, Token![,])?,
+                });
+            } else if input.peek(Token![.])
+                && !input.peek(Token![..])
+                && !input.peek2(Token![await])
+            {
+                let mut dot_token: Token![.] = input.parse()?;
+
+                let float_token: Option<LitFloat> = input.parse()?;
+                if let Some(float_token) = float_token {
+                    if multi_index(&mut e, &mut dot_token, float_token)? {
+                        continue;
+                    }
+                }
+
+                let member: Member = input.parse()?;
+                let turbofish = if member.is_named() && input.peek(Token![::]) {
+                    let colon2_token: Token![::] = input.parse()?;
+                    let turbofish =
+                        AngleBracketedGenericArguments::do_parse(Some(colon2_token), input)?;
+                    Some(turbofish)
+                } else {
+                    None
+                };
+
+                if turbofish.is_some() || input.peek(token::Paren) {
+                    if let Member::Named(method) = member {
+                        let content;
+                        e = Expr::MethodCall(ExprMethodCall {
+                            attrs: Vec::new(),
+                            receiver: Box::new(e),
+                            dot_token,
+                            method,
+                            turbofish,
+                            paren_token: parenthesized!(content in input),
+                            args: content.parse_terminated(Expr::parse, Token![,])?,
+                        });
+                        continue;
+                    }
+                }
+
+                e = Expr::Field(ExprField {
+                    attrs: Vec::new(),
+                    base: Box::new(e),
+                    dot_token,
+                    member,
+                });
+            } else if input.peek(token::Bracket) {
+                let content;
+                e = Expr::Index(ExprIndex {
+                    attrs: Vec::new(),
+                    expr: Box::new(e),
+                    bracket_token: bracketed!(content in input),
+                    index: content.parse()?,
+                });
+            } else {
+                break;
+            }
+        }
+
+        Ok(e)
+    }
+
+    // Parse all atomic expressions which don't have to worry about precedence
+    // interactions, as they are fully contained.
+    #[cfg(feature = "full")]
+    fn atom_expr(input: ParseStream, allow_struct: AllowStruct) -> Result<Expr> {
+        if input.peek(token::Group) {
+            expr_group(input, allow_struct)
+        } else if input.peek(Lit) {
+            input.parse().map(Expr::Lit)
+        } else if input.peek(Token![async])
+            && (input.peek2(token::Brace) || input.peek2(Token![move]) && input.peek3(token::Brace))
+        {
+            input.parse().map(Expr::Async)
+        } else if input.peek(Token![try]) && input.peek2(token::Brace) {
+            input.parse().map(Expr::TryBlock)
+        } else if input.peek(Token![|])
+            || input.peek(Token![move])
+            || input.peek(Token![for])
+                && input.peek2(Token![<])
+                && (input.peek3(Lifetime) || input.peek3(Token![>]))
+            || input.peek(Token![const]) && !input.peek2(token::Brace)
+            || input.peek(Token![static])
+            || input.peek(Token![async]) && (input.peek2(Token![|]) || input.peek2(Token![move]))
+        {
+            expr_closure(input, allow_struct).map(Expr::Closure)
+        } else if input.peek(kw::builtin) && input.peek2(Token![#]) {
+            expr_builtin(input)
+        } else if input.peek(Ident)
+            || input.peek(Token![::])
+            || input.peek(Token![<])
+            || input.peek(Token![self])
+            || input.peek(Token![Self])
+            || input.peek(Token![super])
+            || input.peek(Token![crate])
+            || input.peek(Token![try]) && (input.peek2(Token![!]) || input.peek2(Token![::]))
+        {
+            path_or_macro_or_struct(input, allow_struct)
+        } else if input.peek(token::Paren) {
+            paren_or_tuple(input)
+        } else if input.peek(Token![break]) {
+            expr_break(input, allow_struct).map(Expr::Break)
+        } else if input.peek(Token![continue]) {
+            input.parse().map(Expr::Continue)
+        } else if input.peek(Token![return]) {
+            expr_return(input, allow_struct).map(Expr::Return)
+        } else if input.peek(token::Bracket) {
+            array_or_repeat(input)
+        } else if input.peek(Token![let]) {
+            input.parse().map(Expr::Let)
+        } else if input.peek(Token![if]) {
+            input.parse().map(Expr::If)
+        } else if input.peek(Token![while]) {
+            input.parse().map(Expr::While)
+        } else if input.peek(Token![for]) {
+            input.parse().map(Expr::ForLoop)
+        } else if input.peek(Token![loop]) {
+            input.parse().map(Expr::Loop)
+        } else if input.peek(Token![match]) {
+            input.parse().map(Expr::Match)
+        } else if input.peek(Token![yield]) {
+            input.parse().map(Expr::Yield)
+        } else if input.peek(Token![unsafe]) {
+            input.parse().map(Expr::Unsafe)
+        } else if input.peek(Token![const]) {
+            input.parse().map(Expr::Const)
+        } else if input.peek(token::Brace) {
+            input.parse().map(Expr::Block)
+        } else if input.peek(Token![..]) {
+            expr_range(input, allow_struct).map(Expr::Range)
+        } else if input.peek(Token![_]) {
+            input.parse().map(Expr::Infer)
+        } else if input.peek(Lifetime) {
+            atom_labeled(input)
+        } else {
+            Err(input.error("expected an expression"))
+        }
+    }
+
+    #[cfg(feature = "full")]
+    fn atom_labeled(input: ParseStream) -> Result<Expr> {
+        let the_label: Label = input.parse()?;
+        let mut expr = if input.peek(Token![while]) {
+            Expr::While(input.parse()?)
+        } else if input.peek(Token![for]) {
+            Expr::ForLoop(input.parse()?)
+        } else if input.peek(Token![loop]) {
+            Expr::Loop(input.parse()?)
+        } else if input.peek(token::Brace) {
+            Expr::Block(input.parse()?)
+        } else {
+            return Err(input.error("expected loop or block expression"));
+        };
+        match &mut expr {
+            Expr::While(ExprWhile { label, .. })
+            | Expr::ForLoop(ExprForLoop { label, .. })
+            | Expr::Loop(ExprLoop { label, .. })
+            | Expr::Block(ExprBlock { label, .. }) => *label = Some(the_label),
+            _ => unreachable!(),
+        }
+        Ok(expr)
+    }
+
+    #[cfg(not(feature = "full"))]
+    fn atom_expr(input: ParseStream) -> Result<Expr> {
+        if input.peek(token::Group) {
+            expr_group(input)
+        } else if input.peek(Lit) {
+            input.parse().map(Expr::Lit)
+        } else if input.peek(token::Paren) {
+            input.call(expr_paren).map(Expr::Paren)
+        } else if input.peek(Ident)
+            || input.peek(Token![::])
+            || input.peek(Token![<])
+            || input.peek(Token![self])
+            || input.peek(Token![Self])
+            || input.peek(Token![super])
+            || input.peek(Token![crate])
+        {
+            path_or_macro_or_struct(input)
+        } else if input.is_empty() {
+            Err(input.error("expected an expression"))
+        } else {
+            if input.peek(token::Brace) {
+                let scan = input.fork();
+                let content;
+                braced!(content in scan);
+                if content.parse::<Expr>().is_ok() && content.is_empty() {
+                    let expr_block = verbatim::between(input, &scan);
+                    input.advance_to(&scan);
+                    return Ok(Expr::Verbatim(expr_block));
+                }
+            }
+            Err(input.error("unsupported expression; enable syn's features=[\"full\"]"))
+        }
+    }
+
+    #[cfg(feature = "full")]
+    fn expr_builtin(input: ParseStream) -> Result<Expr> {
+        let begin = input.fork();
+
+        input.parse::<kw::builtin>()?;
+        input.parse::<Token![#]>()?;
+        input.parse::<Ident>()?;
+
+        let args;
+        parenthesized!(args in input);
+        args.parse::<TokenStream>()?;
+
+        Ok(Expr::Verbatim(verbatim::between(&begin, input)))
+    }
+
+    fn path_or_macro_or_struct(
+        input: ParseStream,
+        #[cfg(feature = "full")] allow_struct: AllowStruct,
+    ) -> Result<Expr> {
+        let (qself, path) = path::parsing::qpath(input, true)?;
+        rest_of_path_or_macro_or_struct(
+            qself,
+            path,
+            input,
+            #[cfg(feature = "full")]
+            allow_struct,
+        )
+    }
+
+    fn rest_of_path_or_macro_or_struct(
+        qself: Option<QSelf>,
+        path: Path,
+        input: ParseStream,
+        #[cfg(feature = "full")] allow_struct: AllowStruct,
+    ) -> Result<Expr> {
+        if qself.is_none()
+            && input.peek(Token![!])
+            && !input.peek(Token![!=])
+            && path.is_mod_style()
+        {
+            let bang_token: Token![!] = input.parse()?;
+            let (delimiter, tokens) = mac::parse_delimiter(input)?;
+            return Ok(Expr::Macro(ExprMacro {
+                attrs: Vec::new(),
+                mac: Macro {
+                    path,
+                    bang_token,
+                    delimiter,
+                    tokens,
+                },
+            }));
+        }
+
+        #[cfg(not(feature = "full"))]
+        let allow_struct = (true,);
+        if allow_struct.0 && input.peek(token::Brace) {
+            return expr_struct_helper(input, qself, path).map(Expr::Struct);
+        }
+
+        Ok(Expr::Path(ExprPath {
+            attrs: Vec::new(),
+            qself,
+            path,
+        }))
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for ExprMacro {
+        fn parse(input: ParseStream) -> Result<Self> {
+            Ok(ExprMacro {
+                attrs: Vec::new(),
+                mac: input.parse()?,
+            })
+        }
+    }
+
+    #[cfg(feature = "full")]
+    fn paren_or_tuple(input: ParseStream) -> Result<Expr> {
+        let content;
+        let paren_token = parenthesized!(content in input);
+        if content.is_empty() {
+            return Ok(Expr::Tuple(ExprTuple {
+                attrs: Vec::new(),
+                paren_token,
+                elems: Punctuated::new(),
+            }));
+        }
+
+        let first: Expr = content.parse()?;
+        if content.is_empty() {
+            return Ok(Expr::Paren(ExprParen {
+                attrs: Vec::new(),
+                paren_token,
+                expr: Box::new(first),
+            }));
+        }
+
+        let mut elems = Punctuated::new();
+        elems.push_value(first);
+        while !content.is_empty() {
+            let punct = content.parse()?;
+            elems.push_punct(punct);
+            if content.is_empty() {
+                break;
+            }
+            let value = content.parse()?;
+            elems.push_value(value);
+        }
+        Ok(Expr::Tuple(ExprTuple {
+            attrs: Vec::new(),
+            paren_token,
+            elems,
+        }))
+    }
+
+    #[cfg(feature = "full")]
+    fn array_or_repeat(input: ParseStream) -> Result<Expr> {
+        let content;
+        let bracket_token = bracketed!(content in input);
+        if content.is_empty() {
+            return Ok(Expr::Array(ExprArray {
+                attrs: Vec::new(),
+                bracket_token,
+                elems: Punctuated::new(),
+            }));
+        }
+
+        let first: Expr = content.parse()?;
+        if content.is_empty() || content.peek(Token![,]) {
+            let mut elems = Punctuated::new();
+            elems.push_value(first);
+            while !content.is_empty() {
+                let punct = content.parse()?;
+                elems.push_punct(punct);
+                if content.is_empty() {
+                    break;
+                }
+                let value = content.parse()?;
+                elems.push_value(value);
+            }
+            Ok(Expr::Array(ExprArray {
+                attrs: Vec::new(),
+                bracket_token,
+                elems,
+            }))
+        } else if content.peek(Token![;]) {
+            let semi_token: Token![;] = content.parse()?;
+            let len: Expr = content.parse()?;
+            Ok(Expr::Repeat(ExprRepeat {
+                attrs: Vec::new(),
+                bracket_token,
+                expr: Box::new(first),
+                semi_token,
+                len: Box::new(len),
+            }))
+        } else {
+            Err(content.error("expected `,` or `;`"))
+        }
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for ExprArray {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let content;
+            let bracket_token = bracketed!(content in input);
+            let mut elems = Punctuated::new();
+
+            while !content.is_empty() {
+                let first: Expr = content.parse()?;
+                elems.push_value(first);
+                if content.is_empty() {
+                    break;
+                }
+                let punct = content.parse()?;
+                elems.push_punct(punct);
+            }
+
+            Ok(ExprArray {
+                attrs: Vec::new(),
+                bracket_token,
+                elems,
+            })
+        }
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for ExprRepeat {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let content;
+            Ok(ExprRepeat {
+                bracket_token: bracketed!(content in input),
+                attrs: Vec::new(),
+                expr: content.parse()?,
+                semi_token: content.parse()?,
+                len: content.parse()?,
+            })
+        }
+    }
+
+    #[cfg(feature = "full")]
+    fn continue_parsing_early(mut expr: &Expr) -> bool {
+        while let Expr::Group(group) = expr {
+            expr = &group.expr;
+        }
+        match expr {
+            Expr::If(_)
+            | Expr::While(_)
+            | Expr::ForLoop(_)
+            | Expr::Loop(_)
+            | Expr::Match(_)
+            | Expr::TryBlock(_)
+            | Expr::Unsafe(_)
+            | Expr::Const(_)
+            | Expr::Block(_) => false,
+            _ => true,
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for ExprLit {
+        fn parse(input: ParseStream) -> Result<Self> {
+            Ok(ExprLit {
+                attrs: Vec::new(),
+                lit: input.parse()?,
+            })
+        }
+    }
+
+    fn expr_group(
+        input: ParseStream,
+        #[cfg(feature = "full")] allow_struct: AllowStruct,
+    ) -> Result<Expr> {
+        let group = crate::group::parse_group(input)?;
+        let mut inner: Expr = group.content.parse()?;
+
+        match inner {
+            Expr::Path(mut expr) if expr.attrs.is_empty() => {
+                let grouped_len = expr.path.segments.len();
+                Path::parse_rest(input, &mut expr.path, true)?;
+                match rest_of_path_or_macro_or_struct(
+                    expr.qself,
+                    expr.path,
+                    input,
+                    #[cfg(feature = "full")]
+                    allow_struct,
+                )? {
+                    Expr::Path(expr) if expr.path.segments.len() == grouped_len => {
+                        inner = Expr::Path(expr);
+                    }
+                    extended => return Ok(extended),
+                }
+            }
+            _ => {}
+        }
+
+        Ok(Expr::Group(ExprGroup {
+            attrs: Vec::new(),
+            group_token: group.token,
+            expr: Box::new(inner),
+        }))
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for ExprParen {
+        fn parse(input: ParseStream) -> Result<Self> {
+            expr_paren(input)
+        }
+    }
+
+    fn expr_paren(input: ParseStream) -> Result<ExprParen> {
+        let content;
+        Ok(ExprParen {
+            attrs: Vec::new(),
+            paren_token: parenthesized!(content in input),
+            expr: content.parse()?,
+        })
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for ExprLet {
+        fn parse(input: ParseStream) -> Result<Self> {
+            Ok(ExprLet {
+                attrs: Vec::new(),
+                let_token: input.parse()?,
+                pat: Box::new(Pat::parse_multi_with_leading_vert(input)?),
+                eq_token: input.parse()?,
+                expr: Box::new({
+                    let allow_struct = AllowStruct(false);
+                    let lhs = unary_expr(input, allow_struct)?;
+                    parse_expr(input, lhs, allow_struct, Precedence::Compare)?
+                }),
+            })
+        }
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for ExprIf {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let attrs = input.call(Attribute::parse_outer)?;
+
+            let mut clauses = Vec::new();
+            let mut expr;
+            loop {
+                let if_token: Token![if] = input.parse()?;
+                let cond = input.call(Expr::parse_without_eager_brace)?;
+                let then_branch: Block = input.parse()?;
+
+                expr = ExprIf {
+                    attrs: Vec::new(),
+                    if_token,
+                    cond: Box::new(cond),
+                    then_branch,
+                    else_branch: None,
+                };
+
+                if !input.peek(Token![else]) {
+                    break;
+                }
+
+                let else_token: Token![else] = input.parse()?;
+                let lookahead = input.lookahead1();
+                if lookahead.peek(Token![if]) {
+                    expr.else_branch = Some((else_token, Box::new(Expr::PLACEHOLDER)));
+                    clauses.push(expr);
+                    continue;
+                } else if lookahead.peek(token::Brace) {
+                    expr.else_branch = Some((
+                        else_token,
+                        Box::new(Expr::Block(ExprBlock {
+                            attrs: Vec::new(),
+                            label: None,
+                            block: input.parse()?,
+                        })),
+                    ));
+                    break;
+                } else {
+                    return Err(lookahead.error());
+                }
+            }
+
+            while let Some(mut prev) = clauses.pop() {
+                *prev.else_branch.as_mut().unwrap().1 = Expr::If(expr);
+                expr = prev;
+            }
+            expr.attrs = attrs;
+            Ok(expr)
+        }
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for ExprInfer {
+        fn parse(input: ParseStream) -> Result<Self> {
+            Ok(ExprInfer {
+                attrs: input.call(Attribute::parse_outer)?,
+                underscore_token: input.parse()?,
+            })
+        }
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for ExprForLoop {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let mut attrs = input.call(Attribute::parse_outer)?;
+            let label: Option<Label> = input.parse()?;
+            let for_token: Token![for] = input.parse()?;
+
+            let pat = Pat::parse_multi_with_leading_vert(input)?;
+
+            let in_token: Token![in] = input.parse()?;
+            let expr: Expr = input.call(Expr::parse_without_eager_brace)?;
+
+            let content;
+            let brace_token = braced!(content in input);
+            attr::parsing::parse_inner(&content, &mut attrs)?;
+            let stmts = content.call(Block::parse_within)?;
+
+            Ok(ExprForLoop {
+                attrs,
+                label,
+                for_token,
+                pat: Box::new(pat),
+                in_token,
+                expr: Box::new(expr),
+                body: Block { brace_token, stmts },
+            })
+        }
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for ExprLoop {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let mut attrs = input.call(Attribute::parse_outer)?;
+            let label: Option<Label> = input.parse()?;
+            let loop_token: Token![loop] = input.parse()?;
+
+            let content;
+            let brace_token = braced!(content in input);
+            attr::parsing::parse_inner(&content, &mut attrs)?;
+            let stmts = content.call(Block::parse_within)?;
+
+            Ok(ExprLoop {
+                attrs,
+                label,
+                loop_token,
+                body: Block { brace_token, stmts },
+            })
+        }
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for ExprMatch {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let mut attrs = input.call(Attribute::parse_outer)?;
+            let match_token: Token![match] = input.parse()?;
+            let expr = Expr::parse_without_eager_brace(input)?;
+
+            let content;
+            let brace_token = braced!(content in input);
+            attr::parsing::parse_inner(&content, &mut attrs)?;
+
+            let mut arms = Vec::new();
+            while !content.is_empty() {
+                arms.push(content.call(Arm::parse)?);
+            }
+
+            Ok(ExprMatch {
+                attrs,
+                match_token,
+                expr: Box::new(expr),
+                brace_token,
+                arms,
+            })
+        }
+    }
+
+    macro_rules! impl_by_parsing_expr {
+        (
+            $(
+                $expr_type:ty, $variant:ident, $msg:expr,
+            )*
+        ) => {
+            $(
+                #[cfg(all(feature = "full", feature = "printing"))]
+                #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+                impl Parse for $expr_type {
+                    fn parse(input: ParseStream) -> Result<Self> {
+                        let mut expr: Expr = input.parse()?;
+                        loop {
+                            match expr {
+                                Expr::$variant(inner) => return Ok(inner),
+                                Expr::Group(next) => expr = *next.expr,
+                                _ => return Err(Error::new_spanned(expr, $msg)),
+                            }
+                        }
+                    }
+                }
+            )*
+        };
+    }
+
+    impl_by_parsing_expr! {
+        ExprAssign, Assign, "expected assignment expression",
+        ExprAwait, Await, "expected await expression",
+        ExprBinary, Binary, "expected binary operation",
+        ExprCall, Call, "expected function call expression",
+        ExprCast, Cast, "expected cast expression",
+        ExprField, Field, "expected struct field access",
+        ExprIndex, Index, "expected indexing expression",
+        ExprMethodCall, MethodCall, "expected method call expression",
+        ExprRange, Range, "expected range expression",
+        ExprTry, Try, "expected try expression",
+        ExprTuple, Tuple, "expected tuple expression",
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for ExprUnary {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let attrs = Vec::new();
+            let allow_struct = AllowStruct(true);
+            expr_unary(input, attrs, allow_struct)
+        }
+    }
+
+    #[cfg(feature = "full")]
+    fn expr_unary(
+        input: ParseStream,
+        attrs: Vec<Attribute>,
+        allow_struct: AllowStruct,
+    ) -> Result<ExprUnary> {
+        Ok(ExprUnary {
+            attrs,
+            op: input.parse()?,
+            expr: Box::new(unary_expr(input, allow_struct)?),
+        })
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for ExprClosure {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let allow_struct = AllowStruct(true);
+            expr_closure(input, allow_struct)
+        }
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for ExprReference {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let allow_struct = AllowStruct(true);
+            Ok(ExprReference {
+                attrs: Vec::new(),
+                and_token: input.parse()?,
+                mutability: input.parse()?,
+                expr: Box::new(unary_expr(input, allow_struct)?),
+            })
+        }
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for ExprBreak {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let allow_struct = AllowStruct(true);
+            expr_break(input, allow_struct)
+        }
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for ExprReturn {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let allow_struct = AllowStruct(true);
+            expr_return(input, allow_struct)
+        }
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for ExprTryBlock {
+        fn parse(input: ParseStream) -> Result<Self> {
+            Ok(ExprTryBlock {
+                attrs: Vec::new(),
+                try_token: input.parse()?,
+                block: input.parse()?,
+            })
+        }
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for ExprYield {
+        fn parse(input: ParseStream) -> Result<Self> {
+            Ok(ExprYield {
+                attrs: Vec::new(),
+                yield_token: input.parse()?,
+                expr: {
+                    if can_begin_expr(input) {
+                        Some(input.parse()?)
+                    } else {
+                        None
+                    }
+                },
+            })
+        }
+    }
+
+    #[cfg(feature = "full")]
+    fn expr_closure(input: ParseStream, allow_struct: AllowStruct) -> Result<ExprClosure> {
+        let lifetimes: Option<BoundLifetimes> = input.parse()?;
+        let constness: Option<Token![const]> = input.parse()?;
+        let movability: Option<Token![static]> = input.parse()?;
+        let asyncness: Option<Token![async]> = input.parse()?;
+        let capture: Option<Token![move]> = input.parse()?;
+        let or1_token: Token![|] = input.parse()?;
+
+        let mut inputs = Punctuated::new();
+        loop {
+            if input.peek(Token![|]) {
+                break;
+            }
+            let value = closure_arg(input)?;
+            inputs.push_value(value);
+            if input.peek(Token![|]) {
+                break;
+            }
+            let punct: Token![,] = input.parse()?;
+            inputs.push_punct(punct);
+        }
+
+        let or2_token: Token![|] = input.parse()?;
+
+        let (output, body) = if input.peek(Token![->]) {
+            let arrow_token: Token![->] = input.parse()?;
+            let ty: Type = input.parse()?;
+            let body: Block = input.parse()?;
+            let output = ReturnType::Type(arrow_token, Box::new(ty));
+            let block = Expr::Block(ExprBlock {
+                attrs: Vec::new(),
+                label: None,
+                block: body,
+            });
+            (output, block)
+        } else {
+            let body = ambiguous_expr(input, allow_struct)?;
+            (ReturnType::Default, body)
+        };
+
+        Ok(ExprClosure {
+            attrs: Vec::new(),
+            lifetimes,
+            constness,
+            movability,
+            asyncness,
+            capture,
+            or1_token,
+            inputs,
+            or2_token,
+            output,
+            body: Box::new(body),
+        })
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for ExprAsync {
+        fn parse(input: ParseStream) -> Result<Self> {
+            Ok(ExprAsync {
+                attrs: Vec::new(),
+                async_token: input.parse()?,
+                capture: input.parse()?,
+                block: input.parse()?,
+            })
+        }
+    }
+
+    #[cfg(feature = "full")]
+    fn closure_arg(input: ParseStream) -> Result<Pat> {
+        let attrs = input.call(Attribute::parse_outer)?;
+        let mut pat = Pat::parse_single(input)?;
+
+        if input.peek(Token![:]) {
+            Ok(Pat::Type(PatType {
+                attrs,
+                pat: Box::new(pat),
+                colon_token: input.parse()?,
+                ty: input.parse()?,
+            }))
+        } else {
+            match &mut pat {
+                Pat::Const(pat) => pat.attrs = attrs,
+                Pat::Ident(pat) => pat.attrs = attrs,
+                Pat::Lit(pat) => pat.attrs = attrs,
+                Pat::Macro(pat) => pat.attrs = attrs,
+                Pat::Or(pat) => pat.attrs = attrs,
+                Pat::Paren(pat) => pat.attrs = attrs,
+                Pat::Path(pat) => pat.attrs = attrs,
+                Pat::Range(pat) => pat.attrs = attrs,
+                Pat::Reference(pat) => pat.attrs = attrs,
+                Pat::Rest(pat) => pat.attrs = attrs,
+                Pat::Slice(pat) => pat.attrs = attrs,
+                Pat::Struct(pat) => pat.attrs = attrs,
+                Pat::Tuple(pat) => pat.attrs = attrs,
+                Pat::TupleStruct(pat) => pat.attrs = attrs,
+                Pat::Type(_) => unreachable!(),
+                Pat::Verbatim(_) => {}
+                Pat::Wild(pat) => pat.attrs = attrs,
+            }
+            Ok(pat)
+        }
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for ExprWhile {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let mut attrs = input.call(Attribute::parse_outer)?;
+            let label: Option<Label> = input.parse()?;
+            let while_token: Token![while] = input.parse()?;
+            let cond = Expr::parse_without_eager_brace(input)?;
+
+            let content;
+            let brace_token = braced!(content in input);
+            attr::parsing::parse_inner(&content, &mut attrs)?;
+            let stmts = content.call(Block::parse_within)?;
+
+            Ok(ExprWhile {
+                attrs,
+                label,
+                while_token,
+                cond: Box::new(cond),
+                body: Block { brace_token, stmts },
+            })
+        }
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for ExprConst {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let const_token: Token![const] = input.parse()?;
+
+            let content;
+            let brace_token = braced!(content in input);
+            let inner_attrs = content.call(Attribute::parse_inner)?;
+            let stmts = content.call(Block::parse_within)?;
+
+            Ok(ExprConst {
+                attrs: inner_attrs,
+                const_token,
+                block: Block { brace_token, stmts },
+            })
+        }
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for Label {
+        fn parse(input: ParseStream) -> Result<Self> {
+            Ok(Label {
+                name: input.parse()?,
+                colon_token: input.parse()?,
+            })
+        }
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for Option<Label> {
+        fn parse(input: ParseStream) -> Result<Self> {
+            if input.peek(Lifetime) {
+                input.parse().map(Some)
+            } else {
+                Ok(None)
+            }
+        }
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for ExprContinue {
+        fn parse(input: ParseStream) -> Result<Self> {
+            Ok(ExprContinue {
+                attrs: Vec::new(),
+                continue_token: input.parse()?,
+                label: input.parse()?,
+            })
+        }
+    }
+
+    #[cfg(feature = "full")]
+    fn expr_break(input: ParseStream, allow_struct: AllowStruct) -> Result<ExprBreak> {
+        let break_token: Token![break] = input.parse()?;
+
+        let ahead = input.fork();
+        let label: Option<Lifetime> = ahead.parse()?;
+        if label.is_some() && ahead.peek(Token![:]) {
+            // Not allowed: `break 'label: loop {...}`
+            // Parentheses are required. `break ('label: loop {...})`
+            let _ = ambiguous_expr(input, allow_struct)?;
+            let start_span = label.unwrap().apostrophe;
+            let end_span = input.cursor().prev_span();
+            return Err(crate::error::new2(
+                start_span,
+                end_span,
+                "parentheses required",
+            ));
+        }
+
+        input.advance_to(&ahead);
+        let expr = if can_begin_expr(input) && (allow_struct.0 || !input.peek(token::Brace)) {
+            let expr = ambiguous_expr(input, allow_struct)?;
+            Some(Box::new(expr))
+        } else {
+            None
+        };
+
+        Ok(ExprBreak {
+            attrs: Vec::new(),
+            break_token,
+            label,
+            expr,
+        })
+    }
+
+    #[cfg(feature = "full")]
+    fn expr_return(input: ParseStream, allow_struct: AllowStruct) -> Result<ExprReturn> {
+        Ok(ExprReturn {
+            attrs: Vec::new(),
+            return_token: input.parse()?,
+            expr: {
+                if can_begin_expr(input) {
+                    // NOTE: return is greedy and eats blocks after it even when in a
+                    // position where structs are not allowed, such as in if statement
+                    // conditions. For example:
+                    //
+                    // if return { println!("A") } {} // Prints "A"
+                    let expr = ambiguous_expr(input, allow_struct)?;
+                    Some(Box::new(expr))
+                } else {
+                    None
+                }
+            },
+        })
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for FieldValue {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let attrs = input.call(Attribute::parse_outer)?;
+            let member: Member = input.parse()?;
+            let (colon_token, value) = if input.peek(Token![:]) || !member.is_named() {
+                let colon_token: Token![:] = input.parse()?;
+                let value: Expr = input.parse()?;
+                (Some(colon_token), value)
+            } else if let Member::Named(ident) = &member {
+                let value = Expr::Path(ExprPath {
+                    attrs: Vec::new(),
+                    qself: None,
+                    path: Path::from(ident.clone()),
+                });
+                (None, value)
+            } else {
+                unreachable!()
+            };
+
+            Ok(FieldValue {
+                attrs,
+                member,
+                colon_token,
+                expr: value,
+            })
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for ExprStruct {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let (qself, path) = path::parsing::qpath(input, true)?;
+            expr_struct_helper(input, qself, path)
+        }
+    }
+
+    fn expr_struct_helper(
+        input: ParseStream,
+        qself: Option<QSelf>,
+        path: Path,
+    ) -> Result<ExprStruct> {
+        let content;
+        let brace_token = braced!(content in input);
+
+        let mut fields = Punctuated::new();
+        while !content.is_empty() {
+            if content.peek(Token![..]) {
+                return Ok(ExprStruct {
+                    attrs: Vec::new(),
+                    qself,
+                    path,
+                    brace_token,
+                    fields,
+                    dot2_token: Some(content.parse()?),
+                    rest: if content.is_empty() {
+                        None
+                    } else {
+                        Some(Box::new(content.parse()?))
+                    },
+                });
+            }
+
+            fields.push(content.parse()?);
+            if content.is_empty() {
+                break;
+            }
+            let punct: Token![,] = content.parse()?;
+            fields.push_punct(punct);
+        }
+
+        Ok(ExprStruct {
+            attrs: Vec::new(),
+            qself,
+            path,
+            brace_token,
+            fields,
+            dot2_token: None,
+            rest: None,
+        })
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for ExprUnsafe {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let unsafe_token: Token![unsafe] = input.parse()?;
+
+            let content;
+            let brace_token = braced!(content in input);
+            let inner_attrs = content.call(Attribute::parse_inner)?;
+            let stmts = content.call(Block::parse_within)?;
+
+            Ok(ExprUnsafe {
+                attrs: inner_attrs,
+                unsafe_token,
+                block: Block { brace_token, stmts },
+            })
+        }
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for ExprBlock {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let mut attrs = input.call(Attribute::parse_outer)?;
+            let label: Option<Label> = input.parse()?;
+
+            let content;
+            let brace_token = braced!(content in input);
+            attr::parsing::parse_inner(&content, &mut attrs)?;
+            let stmts = content.call(Block::parse_within)?;
+
+            Ok(ExprBlock {
+                attrs,
+                label,
+                block: Block { brace_token, stmts },
+            })
+        }
+    }
+
+    #[cfg(feature = "full")]
+    fn expr_range(input: ParseStream, allow_struct: AllowStruct) -> Result<ExprRange> {
+        let limits: RangeLimits = input.parse()?;
+        let end = parse_range_end(input, &limits, allow_struct)?;
+        Ok(ExprRange {
+            attrs: Vec::new(),
+            start: None,
+            limits,
+            end,
+        })
+    }
+
+    #[cfg(feature = "full")]
+    fn parse_range_end(
+        input: ParseStream,
+        limits: &RangeLimits,
+        allow_struct: AllowStruct,
+    ) -> Result<Option<Box<Expr>>> {
+        if matches!(limits, RangeLimits::HalfOpen(_))
+            && (input.is_empty()
+                || input.peek(Token![,])
+                || input.peek(Token![;])
+                || input.peek(Token![.]) && !input.peek(Token![..])
+                || !allow_struct.0 && input.peek(token::Brace))
+        {
+            Ok(None)
+        } else {
+            let end = parse_binop_rhs(input, allow_struct, Precedence::Range)?;
+            Ok(Some(end))
+        }
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for RangeLimits {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let lookahead = input.lookahead1();
+            let dot_dot = lookahead.peek(Token![..]);
+            let dot_dot_eq = dot_dot && lookahead.peek(Token![..=]);
+            let dot_dot_dot = dot_dot && input.peek(Token![...]);
+            if dot_dot_eq {
+                input.parse().map(RangeLimits::Closed)
+            } else if dot_dot && !dot_dot_dot {
+                input.parse().map(RangeLimits::HalfOpen)
+            } else {
+                Err(lookahead.error())
+            }
+        }
+    }
+
+    #[cfg(feature = "full")]
+    impl RangeLimits {
+        pub(crate) fn parse_obsolete(input: ParseStream) -> Result<Self> {
+            let lookahead = input.lookahead1();
+            let dot_dot = lookahead.peek(Token![..]);
+            let dot_dot_eq = dot_dot && lookahead.peek(Token![..=]);
+            let dot_dot_dot = dot_dot && input.peek(Token![...]);
+            if dot_dot_eq {
+                input.parse().map(RangeLimits::Closed)
+            } else if dot_dot_dot {
+                let dot3: Token![...] = input.parse()?;
+                Ok(RangeLimits::Closed(Token![..=](dot3.spans)))
+            } else if dot_dot {
+                input.parse().map(RangeLimits::HalfOpen)
+            } else {
+                Err(lookahead.error())
+            }
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for ExprPath {
+        fn parse(input: ParseStream) -> Result<Self> {
+            #[cfg(not(feature = "full"))]
+            let attrs = Vec::new();
+            #[cfg(feature = "full")]
+            let attrs = input.call(Attribute::parse_outer)?;
+
+            let (qself, path) = path::parsing::qpath(input, true)?;
+
+            Ok(ExprPath { attrs, qself, path })
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for Member {
+        fn parse(input: ParseStream) -> Result<Self> {
+            if input.peek(Ident) {
+                input.parse().map(Member::Named)
+            } else if input.peek(LitInt) {
+                input.parse().map(Member::Unnamed)
+            } else {
+                Err(input.error("expected identifier or integer"))
+            }
+        }
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for Arm {
+        fn parse(input: ParseStream) -> Result<Arm> {
+            let requires_comma;
+            Ok(Arm {
+                attrs: input.call(Attribute::parse_outer)?,
+                pat: Pat::parse_multi_with_leading_vert(input)?,
+                guard: {
+                    if input.peek(Token![if]) {
+                        let if_token: Token![if] = input.parse()?;
+                        let guard: Expr = input.parse()?;
+                        Some((if_token, Box::new(guard)))
+                    } else {
+                        None
+                    }
+                },
+                fat_arrow_token: input.parse()?,
+                body: {
+                    let body = Expr::parse_with_earlier_boundary_rule(input)?;
+                    requires_comma = requires_terminator(&body);
+                    Box::new(body)
+                },
+                comma: {
+                    if requires_comma && !input.is_empty() {
+                        Some(input.parse()?)
+                    } else {
+                        input.parse()?
+                    }
+                },
+            })
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for Index {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let lit: LitInt = input.parse()?;
+            if lit.suffix().is_empty() {
+                Ok(Index {
+                    index: lit
+                        .base10_digits()
+                        .parse()
+                        .map_err(|err| Error::new(lit.span(), err))?,
+                    span: lit.span(),
+                })
+            } else {
+                Err(Error::new(lit.span(), "expected unsuffixed integer"))
+            }
+        }
+    }
+
+    fn multi_index(e: &mut Expr, dot_token: &mut Token![.], float: LitFloat) -> Result<bool> {
+        let float_token = float.token();
+        let float_span = float_token.span();
+        let mut float_repr = float_token.to_string();
+        let trailing_dot = float_repr.ends_with('.');
+        if trailing_dot {
+            float_repr.truncate(float_repr.len() - 1);
+        }
+
+        let mut offset = 0;
+        for part in float_repr.split('.') {
+            let mut index: Index =
+                crate::parse_str(part).map_err(|err| Error::new(float_span, err))?;
+            let part_end = offset + part.len();
+            index.span = float_token.subspan(offset..part_end).unwrap_or(float_span);
+
+            let base = mem::replace(e, Expr::PLACEHOLDER);
+            *e = Expr::Field(ExprField {
+                attrs: Vec::new(),
+                base: Box::new(base),
+                dot_token: Token![.](dot_token.span),
+                member: Member::Unnamed(index),
+            });
+
+            let dot_span = float_token
+                .subspan(part_end..part_end + 1)
+                .unwrap_or(float_span);
+            *dot_token = Token![.](dot_span);
+            offset = part_end + 1;
+        }
+
+        Ok(!trailing_dot)
+    }
+
+    impl Member {
+        pub(crate) fn is_named(&self) -> bool {
+            match self {
+                Member::Named(_) => true,
+                Member::Unnamed(_) => false,
+            }
+        }
+    }
+
+    fn check_cast(input: ParseStream) -> Result<()> {
+        let kind = if input.peek(Token![.]) && !input.peek(Token![..]) {
+            if input.peek2(Token![await]) {
+                "`.await`"
+            } else if input.peek2(Ident) && (input.peek3(token::Paren) || input.peek3(Token![::])) {
+                "a method call"
+            } else {
+                "a field access"
+            }
+        } else if input.peek(Token![?]) {
+            "`?`"
+        } else if input.peek(token::Bracket) {
+            "indexing"
+        } else if input.peek(token::Paren) {
+            "a function call"
+        } else {
+            return Ok(());
+        };
+        let msg = format!("casts cannot be followed by {}", kind);
+        Err(input.error(msg))
+    }
+}
+
+#[cfg(feature = "printing")]
+pub(crate) mod printing {
+    use crate::attr::Attribute;
+    #[cfg(feature = "full")]
+    use crate::attr::FilterAttrs;
+    #[cfg(feature = "full")]
+    use crate::expr::{
+        requires_terminator, Arm, Expr, ExprArray, ExprAssign, ExprAsync, ExprAwait, ExprBlock,
+        ExprBreak, ExprClosure, ExprConst, ExprContinue, ExprForLoop, ExprIf, ExprInfer, ExprLet,
+        ExprLoop, ExprMatch, ExprRange, ExprRepeat, ExprReturn, ExprTry, ExprTryBlock, ExprTuple,
+        ExprUnsafe, ExprWhile, ExprYield, Label, RangeLimits,
+    };
+    use crate::expr::{
+        ExprBinary, ExprCall, ExprCast, ExprField, ExprGroup, ExprIndex, ExprLit, ExprMacro,
+        ExprMethodCall, ExprParen, ExprPath, ExprReference, ExprStruct, ExprUnary, FieldValue,
+        Index, Member,
+    };
+    use crate::path;
+    #[cfg(feature = "full")]
+    use crate::token;
+    use proc_macro2::{Literal, Span, TokenStream};
+    use quote::{ToTokens, TokenStreamExt};
+
+    // If the given expression is a bare `ExprStruct`, wraps it in parenthesis
+    // before appending it to `TokenStream`.
+    #[cfg(feature = "full")]
+    fn wrap_bare_struct(tokens: &mut TokenStream, e: &Expr) {
+        if let Expr::Struct(_) = *e {
+            token::Paren::default().surround(tokens, |tokens| {
+                e.to_tokens(tokens);
+            });
+        } else {
+            e.to_tokens(tokens);
+        }
+    }
+
+    #[cfg(feature = "full")]
+    pub(crate) fn outer_attrs_to_tokens(attrs: &[Attribute], tokens: &mut TokenStream) {
+        tokens.append_all(attrs.outer());
+    }
+
+    #[cfg(feature = "full")]
+    fn inner_attrs_to_tokens(attrs: &[Attribute], tokens: &mut TokenStream) {
+        tokens.append_all(attrs.inner());
+    }
+
+    #[cfg(not(feature = "full"))]
+    pub(crate) fn outer_attrs_to_tokens(_attrs: &[Attribute], _tokens: &mut TokenStream) {}
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for ExprArray {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.bracket_token.surround(tokens, |tokens| {
+                self.elems.to_tokens(tokens);
+            });
+        }
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for ExprAssign {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.left.to_tokens(tokens);
+            self.eq_token.to_tokens(tokens);
+            self.right.to_tokens(tokens);
+        }
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for ExprAsync {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.async_token.to_tokens(tokens);
+            self.capture.to_tokens(tokens);
+            self.block.to_tokens(tokens);
+        }
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for ExprAwait {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.base.to_tokens(tokens);
+            self.dot_token.to_tokens(tokens);
+            self.await_token.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for ExprBinary {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.left.to_tokens(tokens);
+            self.op.to_tokens(tokens);
+            self.right.to_tokens(tokens);
+        }
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for ExprBlock {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.label.to_tokens(tokens);
+            self.block.brace_token.surround(tokens, |tokens| {
+                inner_attrs_to_tokens(&self.attrs, tokens);
+                tokens.append_all(&self.block.stmts);
+            });
+        }
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for ExprBreak {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.break_token.to_tokens(tokens);
+            self.label.to_tokens(tokens);
+            self.expr.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for ExprCall {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.func.to_tokens(tokens);
+            self.paren_token.surround(tokens, |tokens| {
+                self.args.to_tokens(tokens);
+            });
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for ExprCast {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.expr.to_tokens(tokens);
+            self.as_token.to_tokens(tokens);
+            self.ty.to_tokens(tokens);
+        }
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for ExprClosure {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.lifetimes.to_tokens(tokens);
+            self.constness.to_tokens(tokens);
+            self.movability.to_tokens(tokens);
+            self.asyncness.to_tokens(tokens);
+            self.capture.to_tokens(tokens);
+            self.or1_token.to_tokens(tokens);
+            self.inputs.to_tokens(tokens);
+            self.or2_token.to_tokens(tokens);
+            self.output.to_tokens(tokens);
+            self.body.to_tokens(tokens);
+        }
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for ExprConst {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.const_token.to_tokens(tokens);
+            self.block.brace_token.surround(tokens, |tokens| {
+                inner_attrs_to_tokens(&self.attrs, tokens);
+                tokens.append_all(&self.block.stmts);
+            });
+        }
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for ExprContinue {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.continue_token.to_tokens(tokens);
+            self.label.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for ExprField {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.base.to_tokens(tokens);
+            self.dot_token.to_tokens(tokens);
+            self.member.to_tokens(tokens);
+        }
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for ExprForLoop {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.label.to_tokens(tokens);
+            self.for_token.to_tokens(tokens);
+            self.pat.to_tokens(tokens);
+            self.in_token.to_tokens(tokens);
+            wrap_bare_struct(tokens, &self.expr);
+            self.body.brace_token.surround(tokens, |tokens| {
+                inner_attrs_to_tokens(&self.attrs, tokens);
+                tokens.append_all(&self.body.stmts);
+            });
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for ExprGroup {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.group_token.surround(tokens, |tokens| {
+                self.expr.to_tokens(tokens);
+            });
+        }
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for ExprIf {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+
+            let mut expr = self;
+            loop {
+                expr.if_token.to_tokens(tokens);
+                wrap_bare_struct(tokens, &expr.cond);
+                expr.then_branch.to_tokens(tokens);
+
+                let (else_token, else_) = match &expr.else_branch {
+                    Some(else_branch) => else_branch,
+                    None => break,
+                };
+
+                else_token.to_tokens(tokens);
+                match &**else_ {
+                    Expr::If(next) => {
+                        expr = next;
+                    }
+                    Expr::Block(last) => {
+                        last.to_tokens(tokens);
+                        break;
+                    }
+                    // If this is not one of the valid expressions to exist in
+                    // an else clause, wrap it in a block.
+                    other => {
+                        token::Brace::default().surround(tokens, |tokens| other.to_tokens(tokens));
+                        break;
+                    }
+                }
+            }
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for ExprIndex {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.expr.to_tokens(tokens);
+            self.bracket_token.surround(tokens, |tokens| {
+                self.index.to_tokens(tokens);
+            });
+        }
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for ExprInfer {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.underscore_token.to_tokens(tokens);
+        }
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for ExprLet {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.let_token.to_tokens(tokens);
+            self.pat.to_tokens(tokens);
+            self.eq_token.to_tokens(tokens);
+            wrap_bare_struct(tokens, &self.expr);
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for ExprLit {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.lit.to_tokens(tokens);
+        }
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for ExprLoop {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.label.to_tokens(tokens);
+            self.loop_token.to_tokens(tokens);
+            self.body.brace_token.surround(tokens, |tokens| {
+                inner_attrs_to_tokens(&self.attrs, tokens);
+                tokens.append_all(&self.body.stmts);
+            });
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for ExprMacro {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.mac.to_tokens(tokens);
+        }
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for ExprMatch {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.match_token.to_tokens(tokens);
+            wrap_bare_struct(tokens, &self.expr);
+            self.brace_token.surround(tokens, |tokens| {
+                inner_attrs_to_tokens(&self.attrs, tokens);
+                for (i, arm) in self.arms.iter().enumerate() {
+                    arm.to_tokens(tokens);
+                    // Ensure that we have a comma after a non-block arm, except
+                    // for the last one.
+                    let is_last = i == self.arms.len() - 1;
+                    if !is_last && requires_terminator(&arm.body) && arm.comma.is_none() {
+                        <Token![,]>::default().to_tokens(tokens);
+                    }
+                }
+            });
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for ExprMethodCall {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.receiver.to_tokens(tokens);
+            self.dot_token.to_tokens(tokens);
+            self.method.to_tokens(tokens);
+            self.turbofish.to_tokens(tokens);
+            self.paren_token.surround(tokens, |tokens| {
+                self.args.to_tokens(tokens);
+            });
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for ExprParen {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.paren_token.surround(tokens, |tokens| {
+                self.expr.to_tokens(tokens);
+            });
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for ExprPath {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            path::printing::print_path(tokens, &self.qself, &self.path);
+        }
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for ExprRange {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.start.to_tokens(tokens);
+            self.limits.to_tokens(tokens);
+            self.end.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for ExprReference {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.and_token.to_tokens(tokens);
+            self.mutability.to_tokens(tokens);
+            self.expr.to_tokens(tokens);
+        }
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for ExprRepeat {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.bracket_token.surround(tokens, |tokens| {
+                self.expr.to_tokens(tokens);
+                self.semi_token.to_tokens(tokens);
+                self.len.to_tokens(tokens);
+            });
+        }
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for ExprReturn {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.return_token.to_tokens(tokens);
+            self.expr.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for ExprStruct {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            path::printing::print_path(tokens, &self.qself, &self.path);
+            self.brace_token.surround(tokens, |tokens| {
+                self.fields.to_tokens(tokens);
+                if let Some(dot2_token) = &self.dot2_token {
+                    dot2_token.to_tokens(tokens);
+                } else if self.rest.is_some() {
+                    Token![..](Span::call_site()).to_tokens(tokens);
+                }
+                self.rest.to_tokens(tokens);
+            });
+        }
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for ExprTry {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.expr.to_tokens(tokens);
+            self.question_token.to_tokens(tokens);
+        }
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for ExprTryBlock {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.try_token.to_tokens(tokens);
+            self.block.to_tokens(tokens);
+        }
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for ExprTuple {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.paren_token.surround(tokens, |tokens| {
+                self.elems.to_tokens(tokens);
+                // If we only have one argument, we need a trailing comma to
+                // distinguish ExprTuple from ExprParen.
+                if self.elems.len() == 1 && !self.elems.trailing_punct() {
+                    <Token![,]>::default().to_tokens(tokens);
+                }
+            });
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for ExprUnary {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.op.to_tokens(tokens);
+            self.expr.to_tokens(tokens);
+        }
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for ExprUnsafe {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.unsafe_token.to_tokens(tokens);
+            self.block.brace_token.surround(tokens, |tokens| {
+                inner_attrs_to_tokens(&self.attrs, tokens);
+                tokens.append_all(&self.block.stmts);
+            });
+        }
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for ExprWhile {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.label.to_tokens(tokens);
+            self.while_token.to_tokens(tokens);
+            wrap_bare_struct(tokens, &self.cond);
+            self.body.brace_token.surround(tokens, |tokens| {
+                inner_attrs_to_tokens(&self.attrs, tokens);
+                tokens.append_all(&self.body.stmts);
+            });
+        }
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for ExprYield {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.yield_token.to_tokens(tokens);
+            self.expr.to_tokens(tokens);
+        }
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for Arm {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(&self.attrs);
+            self.pat.to_tokens(tokens);
+            if let Some((if_token, guard)) = &self.guard {
+                if_token.to_tokens(tokens);
+                guard.to_tokens(tokens);
+            }
+            self.fat_arrow_token.to_tokens(tokens);
+            self.body.to_tokens(tokens);
+            self.comma.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for FieldValue {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            outer_attrs_to_tokens(&self.attrs, tokens);
+            self.member.to_tokens(tokens);
+            if let Some(colon_token) = &self.colon_token {
+                colon_token.to_tokens(tokens);
+                self.expr.to_tokens(tokens);
+            }
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for Index {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            let mut lit = Literal::i64_unsuffixed(i64::from(self.index));
+            lit.set_span(self.span);
+            tokens.append(lit);
+        }
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for Label {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.name.to_tokens(tokens);
+            self.colon_token.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for Member {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            match self {
+                Member::Named(ident) => ident.to_tokens(tokens),
+                Member::Unnamed(index) => index.to_tokens(tokens),
+            }
+        }
+    }
+
+    #[cfg(feature = "full")]
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for RangeLimits {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            match self {
+                RangeLimits::HalfOpen(t) => t.to_tokens(tokens),
+                RangeLimits::Closed(t) => t.to_tokens(tokens),
+            }
+        }
+    }
+}
+
\ No newline at end of file diff --git a/src/syn/ext.rs.html b/src/syn/ext.rs.html new file mode 100644 index 0000000..7f55462 --- /dev/null +++ b/src/syn/ext.rs.html @@ -0,0 +1,273 @@ +ext.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+
//! Extension traits to provide parsing methods on foreign types.
+
+use crate::buffer::Cursor;
+use crate::error::Result;
+use crate::parse::ParseStream;
+use crate::parse::Peek;
+use crate::sealed::lookahead;
+use crate::token::CustomToken;
+use proc_macro2::Ident;
+
+/// Additional methods for `Ident` not provided by proc-macro2 or libproc_macro.
+///
+/// This trait is sealed and cannot be implemented for types outside of Syn. It
+/// is implemented only for `proc_macro2::Ident`.
+pub trait IdentExt: Sized + private::Sealed {
+    /// Parses any identifier including keywords.
+    ///
+    /// This is useful when parsing macro input which allows Rust keywords as
+    /// identifiers.
+    ///
+    /// # Example
+    ///
+    /// ```
+    /// use syn::{Error, Ident, Result, Token};
+    /// use syn::ext::IdentExt;
+    /// use syn::parse::ParseStream;
+    ///
+    /// mod kw {
+    ///     syn::custom_keyword!(name);
+    /// }
+    ///
+    /// // Parses input that looks like `name = NAME` where `NAME` can be
+    /// // any identifier.
+    /// //
+    /// // Examples:
+    /// //
+    /// //     name = anything
+    /// //     name = impl
+    /// fn parse_dsl(input: ParseStream) -> Result<Ident> {
+    ///     input.parse::<kw::name>()?;
+    ///     input.parse::<Token![=]>()?;
+    ///     let name = input.call(Ident::parse_any)?;
+    ///     Ok(name)
+    /// }
+    /// ```
+    fn parse_any(input: ParseStream) -> Result<Self>;
+
+    /// Peeks any identifier including keywords. Usage:
+    /// `input.peek(Ident::peek_any)`
+    ///
+    /// This is different from `input.peek(Ident)` which only returns true in
+    /// the case of an ident which is not a Rust keyword.
+    #[allow(non_upper_case_globals)]
+    const peek_any: private::PeekFn = private::PeekFn;
+
+    /// Strips the raw marker `r#`, if any, from the beginning of an ident.
+    ///
+    ///   - unraw(`x`) = `x`
+    ///   - unraw(`move`) = `move`
+    ///   - unraw(`r#move`) = `move`
+    ///
+    /// # Example
+    ///
+    /// In the case of interop with other languages like Python that have a
+    /// different set of keywords than Rust, we might come across macro input
+    /// that involves raw identifiers to refer to ordinary variables in the
+    /// other language with a name that happens to be a Rust keyword.
+    ///
+    /// The function below appends an identifier from the caller's input onto a
+    /// fixed prefix. Without using `unraw()`, this would tend to produce
+    /// invalid identifiers like `__pyo3_get_r#move`.
+    ///
+    /// ```
+    /// use proc_macro2::Span;
+    /// use syn::Ident;
+    /// use syn::ext::IdentExt;
+    ///
+    /// fn ident_for_getter(variable: &Ident) -> Ident {
+    ///     let getter = format!("__pyo3_get_{}", variable.unraw());
+    ///     Ident::new(&getter, Span::call_site())
+    /// }
+    /// ```
+    fn unraw(&self) -> Ident;
+}
+
+impl IdentExt for Ident {
+    fn parse_any(input: ParseStream) -> Result<Self> {
+        input.step(|cursor| match cursor.ident() {
+            Some((ident, rest)) => Ok((ident, rest)),
+            None => Err(cursor.error("expected ident")),
+        })
+    }
+
+    fn unraw(&self) -> Ident {
+        let string = self.to_string();
+        if let Some(string) = string.strip_prefix("r#") {
+            Ident::new(string, self.span())
+        } else {
+            self.clone()
+        }
+    }
+}
+
+impl Peek for private::PeekFn {
+    type Token = private::IdentAny;
+}
+
+impl CustomToken for private::IdentAny {
+    fn peek(cursor: Cursor) -> bool {
+        cursor.ident().is_some()
+    }
+
+    fn display() -> &'static str {
+        "identifier"
+    }
+}
+
+impl lookahead::Sealed for private::PeekFn {}
+
+mod private {
+    use proc_macro2::Ident;
+
+    pub trait Sealed {}
+
+    impl Sealed for Ident {}
+
+    pub struct PeekFn;
+    pub struct IdentAny;
+
+    impl Copy for PeekFn {}
+    impl Clone for PeekFn {
+        fn clone(&self) -> Self {
+            *self
+        }
+    }
+}
+
\ No newline at end of file diff --git a/src/syn/file.rs.html b/src/syn/file.rs.html new file mode 100644 index 0000000..2d9a3ef --- /dev/null +++ b/src/syn/file.rs.html @@ -0,0 +1,261 @@ +file.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+
use crate::attr::Attribute;
+use crate::item::Item;
+
+ast_struct! {
+    /// A complete file of Rust source code.
+    ///
+    /// Typically `File` objects are created with [`parse_file`].
+    ///
+    /// [`parse_file`]: crate::parse_file
+    ///
+    /// # Example
+    ///
+    /// Parse a Rust source file into a `syn::File` and print out a debug
+    /// representation of the syntax tree.
+    ///
+    /// ```
+    /// use std::env;
+    /// use std::fs::File;
+    /// use std::io::Read;
+    /// use std::process;
+    ///
+    /// fn main() {
+    /// # }
+    /// #
+    /// # fn fake_main() {
+    ///     let mut args = env::args();
+    ///     let _ = args.next(); // executable name
+    ///
+    ///     let filename = match (args.next(), args.next()) {
+    ///         (Some(filename), None) => filename,
+    ///         _ => {
+    ///             eprintln!("Usage: dump-syntax path/to/filename.rs");
+    ///             process::exit(1);
+    ///         }
+    ///     };
+    ///
+    ///     let mut file = File::open(&filename).expect("unable to open file");
+    ///
+    ///     let mut src = String::new();
+    ///     file.read_to_string(&mut src).expect("unable to read file");
+    ///
+    ///     let syntax = syn::parse_file(&src).expect("unable to parse file");
+    ///
+    ///     // Debug impl is available if Syn is built with "extra-traits" feature.
+    ///     println!("{:#?}", syntax);
+    /// }
+    /// ```
+    ///
+    /// Running with its own source code as input, this program prints output
+    /// that begins with:
+    ///
+    /// ```text
+    /// File {
+    ///     shebang: None,
+    ///     attrs: [],
+    ///     items: [
+    ///         Use(
+    ///             ItemUse {
+    ///                 attrs: [],
+    ///                 vis: Inherited,
+    ///                 use_token: Use,
+    ///                 leading_colon: None,
+    ///                 tree: Path(
+    ///                     UsePath {
+    ///                         ident: Ident(
+    ///                             std,
+    ///                         ),
+    ///                         colon2_token: Colon2,
+    ///                         tree: Name(
+    ///                             UseName {
+    ///                                 ident: Ident(
+    ///                                     env,
+    ///                                 ),
+    ///                             },
+    ///                         ),
+    ///                     },
+    ///                 ),
+    ///                 semi_token: Semi,
+    ///             },
+    ///         ),
+    /// ...
+    /// ```
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    pub struct File {
+        pub shebang: Option<String>,
+        pub attrs: Vec<Attribute>,
+        pub items: Vec<Item>,
+    }
+}
+
+#[cfg(feature = "parsing")]
+pub(crate) mod parsing {
+    use crate::attr::Attribute;
+    use crate::error::Result;
+    use crate::file::File;
+    use crate::parse::{Parse, ParseStream};
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for File {
+        fn parse(input: ParseStream) -> Result<Self> {
+            Ok(File {
+                shebang: None,
+                attrs: input.call(Attribute::parse_inner)?,
+                items: {
+                    let mut items = Vec::new();
+                    while !input.is_empty() {
+                        items.push(input.parse()?);
+                    }
+                    items
+                },
+            })
+        }
+    }
+}
+
+#[cfg(feature = "printing")]
+mod printing {
+    use crate::attr::FilterAttrs;
+    use crate::file::File;
+    use proc_macro2::TokenStream;
+    use quote::{ToTokens, TokenStreamExt};
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for File {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.inner());
+            tokens.append_all(&self.items);
+        }
+    }
+}
+
\ No newline at end of file diff --git a/src/syn/gen/clone.rs.html b/src/syn/gen/clone.rs.html new file mode 100644 index 0000000..e4d1ee5 --- /dev/null +++ b/src/syn/gen/clone.rs.html @@ -0,0 +1,4419 @@ +clone.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+753
+754
+755
+756
+757
+758
+759
+760
+761
+762
+763
+764
+765
+766
+767
+768
+769
+770
+771
+772
+773
+774
+775
+776
+777
+778
+779
+780
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+794
+795
+796
+797
+798
+799
+800
+801
+802
+803
+804
+805
+806
+807
+808
+809
+810
+811
+812
+813
+814
+815
+816
+817
+818
+819
+820
+821
+822
+823
+824
+825
+826
+827
+828
+829
+830
+831
+832
+833
+834
+835
+836
+837
+838
+839
+840
+841
+842
+843
+844
+845
+846
+847
+848
+849
+850
+851
+852
+853
+854
+855
+856
+857
+858
+859
+860
+861
+862
+863
+864
+865
+866
+867
+868
+869
+870
+871
+872
+873
+874
+875
+876
+877
+878
+879
+880
+881
+882
+883
+884
+885
+886
+887
+888
+889
+890
+891
+892
+893
+894
+895
+896
+897
+898
+899
+900
+901
+902
+903
+904
+905
+906
+907
+908
+909
+910
+911
+912
+913
+914
+915
+916
+917
+918
+919
+920
+921
+922
+923
+924
+925
+926
+927
+928
+929
+930
+931
+932
+933
+934
+935
+936
+937
+938
+939
+940
+941
+942
+943
+944
+945
+946
+947
+948
+949
+950
+951
+952
+953
+954
+955
+956
+957
+958
+959
+960
+961
+962
+963
+964
+965
+966
+967
+968
+969
+970
+971
+972
+973
+974
+975
+976
+977
+978
+979
+980
+981
+982
+983
+984
+985
+986
+987
+988
+989
+990
+991
+992
+993
+994
+995
+996
+997
+998
+999
+1000
+1001
+1002
+1003
+1004
+1005
+1006
+1007
+1008
+1009
+1010
+1011
+1012
+1013
+1014
+1015
+1016
+1017
+1018
+1019
+1020
+1021
+1022
+1023
+1024
+1025
+1026
+1027
+1028
+1029
+1030
+1031
+1032
+1033
+1034
+1035
+1036
+1037
+1038
+1039
+1040
+1041
+1042
+1043
+1044
+1045
+1046
+1047
+1048
+1049
+1050
+1051
+1052
+1053
+1054
+1055
+1056
+1057
+1058
+1059
+1060
+1061
+1062
+1063
+1064
+1065
+1066
+1067
+1068
+1069
+1070
+1071
+1072
+1073
+1074
+1075
+1076
+1077
+1078
+1079
+1080
+1081
+1082
+1083
+1084
+1085
+1086
+1087
+1088
+1089
+1090
+1091
+1092
+1093
+1094
+1095
+1096
+1097
+1098
+1099
+1100
+1101
+1102
+1103
+1104
+1105
+1106
+1107
+1108
+1109
+1110
+1111
+1112
+1113
+1114
+1115
+1116
+1117
+1118
+1119
+1120
+1121
+1122
+1123
+1124
+1125
+1126
+1127
+1128
+1129
+1130
+1131
+1132
+1133
+1134
+1135
+1136
+1137
+1138
+1139
+1140
+1141
+1142
+1143
+1144
+1145
+1146
+1147
+1148
+1149
+1150
+1151
+1152
+1153
+1154
+1155
+1156
+1157
+1158
+1159
+1160
+1161
+1162
+1163
+1164
+1165
+1166
+1167
+1168
+1169
+1170
+1171
+1172
+1173
+1174
+1175
+1176
+1177
+1178
+1179
+1180
+1181
+1182
+1183
+1184
+1185
+1186
+1187
+1188
+1189
+1190
+1191
+1192
+1193
+1194
+1195
+1196
+1197
+1198
+1199
+1200
+1201
+1202
+1203
+1204
+1205
+1206
+1207
+1208
+1209
+1210
+1211
+1212
+1213
+1214
+1215
+1216
+1217
+1218
+1219
+1220
+1221
+1222
+1223
+1224
+1225
+1226
+1227
+1228
+1229
+1230
+1231
+1232
+1233
+1234
+1235
+1236
+1237
+1238
+1239
+1240
+1241
+1242
+1243
+1244
+1245
+1246
+1247
+1248
+1249
+1250
+1251
+1252
+1253
+1254
+1255
+1256
+1257
+1258
+1259
+1260
+1261
+1262
+1263
+1264
+1265
+1266
+1267
+1268
+1269
+1270
+1271
+1272
+1273
+1274
+1275
+1276
+1277
+1278
+1279
+1280
+1281
+1282
+1283
+1284
+1285
+1286
+1287
+1288
+1289
+1290
+1291
+1292
+1293
+1294
+1295
+1296
+1297
+1298
+1299
+1300
+1301
+1302
+1303
+1304
+1305
+1306
+1307
+1308
+1309
+1310
+1311
+1312
+1313
+1314
+1315
+1316
+1317
+1318
+1319
+1320
+1321
+1322
+1323
+1324
+1325
+1326
+1327
+1328
+1329
+1330
+1331
+1332
+1333
+1334
+1335
+1336
+1337
+1338
+1339
+1340
+1341
+1342
+1343
+1344
+1345
+1346
+1347
+1348
+1349
+1350
+1351
+1352
+1353
+1354
+1355
+1356
+1357
+1358
+1359
+1360
+1361
+1362
+1363
+1364
+1365
+1366
+1367
+1368
+1369
+1370
+1371
+1372
+1373
+1374
+1375
+1376
+1377
+1378
+1379
+1380
+1381
+1382
+1383
+1384
+1385
+1386
+1387
+1388
+1389
+1390
+1391
+1392
+1393
+1394
+1395
+1396
+1397
+1398
+1399
+1400
+1401
+1402
+1403
+1404
+1405
+1406
+1407
+1408
+1409
+1410
+1411
+1412
+1413
+1414
+1415
+1416
+1417
+1418
+1419
+1420
+1421
+1422
+1423
+1424
+1425
+1426
+1427
+1428
+1429
+1430
+1431
+1432
+1433
+1434
+1435
+1436
+1437
+1438
+1439
+1440
+1441
+1442
+1443
+1444
+1445
+1446
+1447
+1448
+1449
+1450
+1451
+1452
+1453
+1454
+1455
+1456
+1457
+1458
+1459
+1460
+1461
+1462
+1463
+1464
+1465
+1466
+1467
+1468
+1469
+1470
+1471
+1472
+1473
+1474
+1475
+1476
+1477
+1478
+1479
+1480
+1481
+1482
+1483
+1484
+1485
+1486
+1487
+1488
+1489
+1490
+1491
+1492
+1493
+1494
+1495
+1496
+1497
+1498
+1499
+1500
+1501
+1502
+1503
+1504
+1505
+1506
+1507
+1508
+1509
+1510
+1511
+1512
+1513
+1514
+1515
+1516
+1517
+1518
+1519
+1520
+1521
+1522
+1523
+1524
+1525
+1526
+1527
+1528
+1529
+1530
+1531
+1532
+1533
+1534
+1535
+1536
+1537
+1538
+1539
+1540
+1541
+1542
+1543
+1544
+1545
+1546
+1547
+1548
+1549
+1550
+1551
+1552
+1553
+1554
+1555
+1556
+1557
+1558
+1559
+1560
+1561
+1562
+1563
+1564
+1565
+1566
+1567
+1568
+1569
+1570
+1571
+1572
+1573
+1574
+1575
+1576
+1577
+1578
+1579
+1580
+1581
+1582
+1583
+1584
+1585
+1586
+1587
+1588
+1589
+1590
+1591
+1592
+1593
+1594
+1595
+1596
+1597
+1598
+1599
+1600
+1601
+1602
+1603
+1604
+1605
+1606
+1607
+1608
+1609
+1610
+1611
+1612
+1613
+1614
+1615
+1616
+1617
+1618
+1619
+1620
+1621
+1622
+1623
+1624
+1625
+1626
+1627
+1628
+1629
+1630
+1631
+1632
+1633
+1634
+1635
+1636
+1637
+1638
+1639
+1640
+1641
+1642
+1643
+1644
+1645
+1646
+1647
+1648
+1649
+1650
+1651
+1652
+1653
+1654
+1655
+1656
+1657
+1658
+1659
+1660
+1661
+1662
+1663
+1664
+1665
+1666
+1667
+1668
+1669
+1670
+1671
+1672
+1673
+1674
+1675
+1676
+1677
+1678
+1679
+1680
+1681
+1682
+1683
+1684
+1685
+1686
+1687
+1688
+1689
+1690
+1691
+1692
+1693
+1694
+1695
+1696
+1697
+1698
+1699
+1700
+1701
+1702
+1703
+1704
+1705
+1706
+1707
+1708
+1709
+1710
+1711
+1712
+1713
+1714
+1715
+1716
+1717
+1718
+1719
+1720
+1721
+1722
+1723
+1724
+1725
+1726
+1727
+1728
+1729
+1730
+1731
+1732
+1733
+1734
+1735
+1736
+1737
+1738
+1739
+1740
+1741
+1742
+1743
+1744
+1745
+1746
+1747
+1748
+1749
+1750
+1751
+1752
+1753
+1754
+1755
+1756
+1757
+1758
+1759
+1760
+1761
+1762
+1763
+1764
+1765
+1766
+1767
+1768
+1769
+1770
+1771
+1772
+1773
+1774
+1775
+1776
+1777
+1778
+1779
+1780
+1781
+1782
+1783
+1784
+1785
+1786
+1787
+1788
+1789
+1790
+1791
+1792
+1793
+1794
+1795
+1796
+1797
+1798
+1799
+1800
+1801
+1802
+1803
+1804
+1805
+1806
+1807
+1808
+1809
+1810
+1811
+1812
+1813
+1814
+1815
+1816
+1817
+1818
+1819
+1820
+1821
+1822
+1823
+1824
+1825
+1826
+1827
+1828
+1829
+1830
+1831
+1832
+1833
+1834
+1835
+1836
+1837
+1838
+1839
+1840
+1841
+1842
+1843
+1844
+1845
+1846
+1847
+1848
+1849
+1850
+1851
+1852
+1853
+1854
+1855
+1856
+1857
+1858
+1859
+1860
+1861
+1862
+1863
+1864
+1865
+1866
+1867
+1868
+1869
+1870
+1871
+1872
+1873
+1874
+1875
+1876
+1877
+1878
+1879
+1880
+1881
+1882
+1883
+1884
+1885
+1886
+1887
+1888
+1889
+1890
+1891
+1892
+1893
+1894
+1895
+1896
+1897
+1898
+1899
+1900
+1901
+1902
+1903
+1904
+1905
+1906
+1907
+1908
+1909
+1910
+1911
+1912
+1913
+1914
+1915
+1916
+1917
+1918
+1919
+1920
+1921
+1922
+1923
+1924
+1925
+1926
+1927
+1928
+1929
+1930
+1931
+1932
+1933
+1934
+1935
+1936
+1937
+1938
+1939
+1940
+1941
+1942
+1943
+1944
+1945
+1946
+1947
+1948
+1949
+1950
+1951
+1952
+1953
+1954
+1955
+1956
+1957
+1958
+1959
+1960
+1961
+1962
+1963
+1964
+1965
+1966
+1967
+1968
+1969
+1970
+1971
+1972
+1973
+1974
+1975
+1976
+1977
+1978
+1979
+1980
+1981
+1982
+1983
+1984
+1985
+1986
+1987
+1988
+1989
+1990
+1991
+1992
+1993
+1994
+1995
+1996
+1997
+1998
+1999
+2000
+2001
+2002
+2003
+2004
+2005
+2006
+2007
+2008
+2009
+2010
+2011
+2012
+2013
+2014
+2015
+2016
+2017
+2018
+2019
+2020
+2021
+2022
+2023
+2024
+2025
+2026
+2027
+2028
+2029
+2030
+2031
+2032
+2033
+2034
+2035
+2036
+2037
+2038
+2039
+2040
+2041
+2042
+2043
+2044
+2045
+2046
+2047
+2048
+2049
+2050
+2051
+2052
+2053
+2054
+2055
+2056
+2057
+2058
+2059
+2060
+2061
+2062
+2063
+2064
+2065
+2066
+2067
+2068
+2069
+2070
+2071
+2072
+2073
+2074
+2075
+2076
+2077
+2078
+2079
+2080
+2081
+2082
+2083
+2084
+2085
+2086
+2087
+2088
+2089
+2090
+2091
+2092
+2093
+2094
+2095
+2096
+2097
+2098
+2099
+2100
+2101
+2102
+2103
+2104
+2105
+2106
+2107
+2108
+2109
+2110
+2111
+2112
+2113
+2114
+2115
+2116
+2117
+2118
+2119
+2120
+2121
+2122
+2123
+2124
+2125
+2126
+2127
+2128
+2129
+2130
+2131
+2132
+2133
+2134
+2135
+2136
+2137
+2138
+2139
+2140
+2141
+2142
+2143
+2144
+2145
+2146
+2147
+2148
+2149
+2150
+2151
+2152
+2153
+2154
+2155
+2156
+2157
+2158
+2159
+2160
+2161
+2162
+2163
+2164
+2165
+2166
+2167
+2168
+2169
+2170
+2171
+2172
+2173
+2174
+2175
+2176
+2177
+2178
+2179
+2180
+2181
+2182
+2183
+2184
+2185
+2186
+2187
+2188
+2189
+2190
+2191
+2192
+2193
+2194
+2195
+2196
+2197
+2198
+2199
+2200
+2201
+2202
+2203
+2204
+2205
+2206
+2207
+2208
+2209
+
// This file is @generated by syn-internal-codegen.
+// It is not intended for manual editing.
+
+#![allow(clippy::clone_on_copy, clippy::expl_impl_clone_on_copy)]
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::Abi {
+    fn clone(&self) -> Self {
+        crate::Abi {
+            extern_token: self.extern_token.clone(),
+            name: self.name.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::AngleBracketedGenericArguments {
+    fn clone(&self) -> Self {
+        crate::AngleBracketedGenericArguments {
+            colon2_token: self.colon2_token.clone(),
+            lt_token: self.lt_token.clone(),
+            args: self.args.clone(),
+            gt_token: self.gt_token.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::Arm {
+    fn clone(&self) -> Self {
+        crate::Arm {
+            attrs: self.attrs.clone(),
+            pat: self.pat.clone(),
+            guard: self.guard.clone(),
+            fat_arrow_token: self.fat_arrow_token.clone(),
+            body: self.body.clone(),
+            comma: self.comma.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::AssocConst {
+    fn clone(&self) -> Self {
+        crate::AssocConst {
+            ident: self.ident.clone(),
+            generics: self.generics.clone(),
+            eq_token: self.eq_token.clone(),
+            value: self.value.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::AssocType {
+    fn clone(&self) -> Self {
+        crate::AssocType {
+            ident: self.ident.clone(),
+            generics: self.generics.clone(),
+            eq_token: self.eq_token.clone(),
+            ty: self.ty.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Copy for crate::AttrStyle {}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::AttrStyle {
+    fn clone(&self) -> Self {
+        *self
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::Attribute {
+    fn clone(&self) -> Self {
+        crate::Attribute {
+            pound_token: self.pound_token.clone(),
+            style: self.style.clone(),
+            bracket_token: self.bracket_token.clone(),
+            meta: self.meta.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::BareFnArg {
+    fn clone(&self) -> Self {
+        crate::BareFnArg {
+            attrs: self.attrs.clone(),
+            name: self.name.clone(),
+            ty: self.ty.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::BareVariadic {
+    fn clone(&self) -> Self {
+        crate::BareVariadic {
+            attrs: self.attrs.clone(),
+            name: self.name.clone(),
+            dots: self.dots.clone(),
+            comma: self.comma.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Copy for crate::BinOp {}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::BinOp {
+    fn clone(&self) -> Self {
+        *self
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::Block {
+    fn clone(&self) -> Self {
+        crate::Block {
+            brace_token: self.brace_token.clone(),
+            stmts: self.stmts.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::BoundLifetimes {
+    fn clone(&self) -> Self {
+        crate::BoundLifetimes {
+            for_token: self.for_token.clone(),
+            lt_token: self.lt_token.clone(),
+            lifetimes: self.lifetimes.clone(),
+            gt_token: self.gt_token.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ConstParam {
+    fn clone(&self) -> Self {
+        crate::ConstParam {
+            attrs: self.attrs.clone(),
+            const_token: self.const_token.clone(),
+            ident: self.ident.clone(),
+            colon_token: self.colon_token.clone(),
+            ty: self.ty.clone(),
+            eq_token: self.eq_token.clone(),
+            default: self.default.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::Constraint {
+    fn clone(&self) -> Self {
+        crate::Constraint {
+            ident: self.ident.clone(),
+            generics: self.generics.clone(),
+            colon_token: self.colon_token.clone(),
+            bounds: self.bounds.clone(),
+        }
+    }
+}
+#[cfg(feature = "derive")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::Data {
+    fn clone(&self) -> Self {
+        match self {
+            crate::Data::Struct(v0) => crate::Data::Struct(v0.clone()),
+            crate::Data::Enum(v0) => crate::Data::Enum(v0.clone()),
+            crate::Data::Union(v0) => crate::Data::Union(v0.clone()),
+        }
+    }
+}
+#[cfg(feature = "derive")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::DataEnum {
+    fn clone(&self) -> Self {
+        crate::DataEnum {
+            enum_token: self.enum_token.clone(),
+            brace_token: self.brace_token.clone(),
+            variants: self.variants.clone(),
+        }
+    }
+}
+#[cfg(feature = "derive")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::DataStruct {
+    fn clone(&self) -> Self {
+        crate::DataStruct {
+            struct_token: self.struct_token.clone(),
+            fields: self.fields.clone(),
+            semi_token: self.semi_token.clone(),
+        }
+    }
+}
+#[cfg(feature = "derive")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::DataUnion {
+    fn clone(&self) -> Self {
+        crate::DataUnion {
+            union_token: self.union_token.clone(),
+            fields: self.fields.clone(),
+        }
+    }
+}
+#[cfg(feature = "derive")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::DeriveInput {
+    fn clone(&self) -> Self {
+        crate::DeriveInput {
+            attrs: self.attrs.clone(),
+            vis: self.vis.clone(),
+            ident: self.ident.clone(),
+            generics: self.generics.clone(),
+            data: self.data.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::Expr {
+    fn clone(&self) -> Self {
+        match self {
+            #[cfg(feature = "full")]
+            crate::Expr::Array(v0) => crate::Expr::Array(v0.clone()),
+            #[cfg(feature = "full")]
+            crate::Expr::Assign(v0) => crate::Expr::Assign(v0.clone()),
+            #[cfg(feature = "full")]
+            crate::Expr::Async(v0) => crate::Expr::Async(v0.clone()),
+            #[cfg(feature = "full")]
+            crate::Expr::Await(v0) => crate::Expr::Await(v0.clone()),
+            crate::Expr::Binary(v0) => crate::Expr::Binary(v0.clone()),
+            #[cfg(feature = "full")]
+            crate::Expr::Block(v0) => crate::Expr::Block(v0.clone()),
+            #[cfg(feature = "full")]
+            crate::Expr::Break(v0) => crate::Expr::Break(v0.clone()),
+            crate::Expr::Call(v0) => crate::Expr::Call(v0.clone()),
+            crate::Expr::Cast(v0) => crate::Expr::Cast(v0.clone()),
+            #[cfg(feature = "full")]
+            crate::Expr::Closure(v0) => crate::Expr::Closure(v0.clone()),
+            #[cfg(feature = "full")]
+            crate::Expr::Const(v0) => crate::Expr::Const(v0.clone()),
+            #[cfg(feature = "full")]
+            crate::Expr::Continue(v0) => crate::Expr::Continue(v0.clone()),
+            crate::Expr::Field(v0) => crate::Expr::Field(v0.clone()),
+            #[cfg(feature = "full")]
+            crate::Expr::ForLoop(v0) => crate::Expr::ForLoop(v0.clone()),
+            crate::Expr::Group(v0) => crate::Expr::Group(v0.clone()),
+            #[cfg(feature = "full")]
+            crate::Expr::If(v0) => crate::Expr::If(v0.clone()),
+            crate::Expr::Index(v0) => crate::Expr::Index(v0.clone()),
+            #[cfg(feature = "full")]
+            crate::Expr::Infer(v0) => crate::Expr::Infer(v0.clone()),
+            #[cfg(feature = "full")]
+            crate::Expr::Let(v0) => crate::Expr::Let(v0.clone()),
+            crate::Expr::Lit(v0) => crate::Expr::Lit(v0.clone()),
+            #[cfg(feature = "full")]
+            crate::Expr::Loop(v0) => crate::Expr::Loop(v0.clone()),
+            crate::Expr::Macro(v0) => crate::Expr::Macro(v0.clone()),
+            #[cfg(feature = "full")]
+            crate::Expr::Match(v0) => crate::Expr::Match(v0.clone()),
+            crate::Expr::MethodCall(v0) => crate::Expr::MethodCall(v0.clone()),
+            crate::Expr::Paren(v0) => crate::Expr::Paren(v0.clone()),
+            crate::Expr::Path(v0) => crate::Expr::Path(v0.clone()),
+            #[cfg(feature = "full")]
+            crate::Expr::Range(v0) => crate::Expr::Range(v0.clone()),
+            crate::Expr::Reference(v0) => crate::Expr::Reference(v0.clone()),
+            #[cfg(feature = "full")]
+            crate::Expr::Repeat(v0) => crate::Expr::Repeat(v0.clone()),
+            #[cfg(feature = "full")]
+            crate::Expr::Return(v0) => crate::Expr::Return(v0.clone()),
+            crate::Expr::Struct(v0) => crate::Expr::Struct(v0.clone()),
+            #[cfg(feature = "full")]
+            crate::Expr::Try(v0) => crate::Expr::Try(v0.clone()),
+            #[cfg(feature = "full")]
+            crate::Expr::TryBlock(v0) => crate::Expr::TryBlock(v0.clone()),
+            #[cfg(feature = "full")]
+            crate::Expr::Tuple(v0) => crate::Expr::Tuple(v0.clone()),
+            crate::Expr::Unary(v0) => crate::Expr::Unary(v0.clone()),
+            #[cfg(feature = "full")]
+            crate::Expr::Unsafe(v0) => crate::Expr::Unsafe(v0.clone()),
+            crate::Expr::Verbatim(v0) => crate::Expr::Verbatim(v0.clone()),
+            #[cfg(feature = "full")]
+            crate::Expr::While(v0) => crate::Expr::While(v0.clone()),
+            #[cfg(feature = "full")]
+            crate::Expr::Yield(v0) => crate::Expr::Yield(v0.clone()),
+            #[cfg(not(feature = "full"))]
+            _ => unreachable!(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ExprArray {
+    fn clone(&self) -> Self {
+        crate::ExprArray {
+            attrs: self.attrs.clone(),
+            bracket_token: self.bracket_token.clone(),
+            elems: self.elems.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ExprAssign {
+    fn clone(&self) -> Self {
+        crate::ExprAssign {
+            attrs: self.attrs.clone(),
+            left: self.left.clone(),
+            eq_token: self.eq_token.clone(),
+            right: self.right.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ExprAsync {
+    fn clone(&self) -> Self {
+        crate::ExprAsync {
+            attrs: self.attrs.clone(),
+            async_token: self.async_token.clone(),
+            capture: self.capture.clone(),
+            block: self.block.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ExprAwait {
+    fn clone(&self) -> Self {
+        crate::ExprAwait {
+            attrs: self.attrs.clone(),
+            base: self.base.clone(),
+            dot_token: self.dot_token.clone(),
+            await_token: self.await_token.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ExprBinary {
+    fn clone(&self) -> Self {
+        crate::ExprBinary {
+            attrs: self.attrs.clone(),
+            left: self.left.clone(),
+            op: self.op.clone(),
+            right: self.right.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ExprBlock {
+    fn clone(&self) -> Self {
+        crate::ExprBlock {
+            attrs: self.attrs.clone(),
+            label: self.label.clone(),
+            block: self.block.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ExprBreak {
+    fn clone(&self) -> Self {
+        crate::ExprBreak {
+            attrs: self.attrs.clone(),
+            break_token: self.break_token.clone(),
+            label: self.label.clone(),
+            expr: self.expr.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ExprCall {
+    fn clone(&self) -> Self {
+        crate::ExprCall {
+            attrs: self.attrs.clone(),
+            func: self.func.clone(),
+            paren_token: self.paren_token.clone(),
+            args: self.args.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ExprCast {
+    fn clone(&self) -> Self {
+        crate::ExprCast {
+            attrs: self.attrs.clone(),
+            expr: self.expr.clone(),
+            as_token: self.as_token.clone(),
+            ty: self.ty.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ExprClosure {
+    fn clone(&self) -> Self {
+        crate::ExprClosure {
+            attrs: self.attrs.clone(),
+            lifetimes: self.lifetimes.clone(),
+            constness: self.constness.clone(),
+            movability: self.movability.clone(),
+            asyncness: self.asyncness.clone(),
+            capture: self.capture.clone(),
+            or1_token: self.or1_token.clone(),
+            inputs: self.inputs.clone(),
+            or2_token: self.or2_token.clone(),
+            output: self.output.clone(),
+            body: self.body.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ExprConst {
+    fn clone(&self) -> Self {
+        crate::ExprConst {
+            attrs: self.attrs.clone(),
+            const_token: self.const_token.clone(),
+            block: self.block.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ExprContinue {
+    fn clone(&self) -> Self {
+        crate::ExprContinue {
+            attrs: self.attrs.clone(),
+            continue_token: self.continue_token.clone(),
+            label: self.label.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ExprField {
+    fn clone(&self) -> Self {
+        crate::ExprField {
+            attrs: self.attrs.clone(),
+            base: self.base.clone(),
+            dot_token: self.dot_token.clone(),
+            member: self.member.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ExprForLoop {
+    fn clone(&self) -> Self {
+        crate::ExprForLoop {
+            attrs: self.attrs.clone(),
+            label: self.label.clone(),
+            for_token: self.for_token.clone(),
+            pat: self.pat.clone(),
+            in_token: self.in_token.clone(),
+            expr: self.expr.clone(),
+            body: self.body.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ExprGroup {
+    fn clone(&self) -> Self {
+        crate::ExprGroup {
+            attrs: self.attrs.clone(),
+            group_token: self.group_token.clone(),
+            expr: self.expr.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ExprIf {
+    fn clone(&self) -> Self {
+        crate::ExprIf {
+            attrs: self.attrs.clone(),
+            if_token: self.if_token.clone(),
+            cond: self.cond.clone(),
+            then_branch: self.then_branch.clone(),
+            else_branch: self.else_branch.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ExprIndex {
+    fn clone(&self) -> Self {
+        crate::ExprIndex {
+            attrs: self.attrs.clone(),
+            expr: self.expr.clone(),
+            bracket_token: self.bracket_token.clone(),
+            index: self.index.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ExprInfer {
+    fn clone(&self) -> Self {
+        crate::ExprInfer {
+            attrs: self.attrs.clone(),
+            underscore_token: self.underscore_token.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ExprLet {
+    fn clone(&self) -> Self {
+        crate::ExprLet {
+            attrs: self.attrs.clone(),
+            let_token: self.let_token.clone(),
+            pat: self.pat.clone(),
+            eq_token: self.eq_token.clone(),
+            expr: self.expr.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ExprLit {
+    fn clone(&self) -> Self {
+        crate::ExprLit {
+            attrs: self.attrs.clone(),
+            lit: self.lit.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ExprLoop {
+    fn clone(&self) -> Self {
+        crate::ExprLoop {
+            attrs: self.attrs.clone(),
+            label: self.label.clone(),
+            loop_token: self.loop_token.clone(),
+            body: self.body.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ExprMacro {
+    fn clone(&self) -> Self {
+        crate::ExprMacro {
+            attrs: self.attrs.clone(),
+            mac: self.mac.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ExprMatch {
+    fn clone(&self) -> Self {
+        crate::ExprMatch {
+            attrs: self.attrs.clone(),
+            match_token: self.match_token.clone(),
+            expr: self.expr.clone(),
+            brace_token: self.brace_token.clone(),
+            arms: self.arms.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ExprMethodCall {
+    fn clone(&self) -> Self {
+        crate::ExprMethodCall {
+            attrs: self.attrs.clone(),
+            receiver: self.receiver.clone(),
+            dot_token: self.dot_token.clone(),
+            method: self.method.clone(),
+            turbofish: self.turbofish.clone(),
+            paren_token: self.paren_token.clone(),
+            args: self.args.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ExprParen {
+    fn clone(&self) -> Self {
+        crate::ExprParen {
+            attrs: self.attrs.clone(),
+            paren_token: self.paren_token.clone(),
+            expr: self.expr.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ExprPath {
+    fn clone(&self) -> Self {
+        crate::ExprPath {
+            attrs: self.attrs.clone(),
+            qself: self.qself.clone(),
+            path: self.path.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ExprRange {
+    fn clone(&self) -> Self {
+        crate::ExprRange {
+            attrs: self.attrs.clone(),
+            start: self.start.clone(),
+            limits: self.limits.clone(),
+            end: self.end.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ExprReference {
+    fn clone(&self) -> Self {
+        crate::ExprReference {
+            attrs: self.attrs.clone(),
+            and_token: self.and_token.clone(),
+            mutability: self.mutability.clone(),
+            expr: self.expr.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ExprRepeat {
+    fn clone(&self) -> Self {
+        crate::ExprRepeat {
+            attrs: self.attrs.clone(),
+            bracket_token: self.bracket_token.clone(),
+            expr: self.expr.clone(),
+            semi_token: self.semi_token.clone(),
+            len: self.len.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ExprReturn {
+    fn clone(&self) -> Self {
+        crate::ExprReturn {
+            attrs: self.attrs.clone(),
+            return_token: self.return_token.clone(),
+            expr: self.expr.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ExprStruct {
+    fn clone(&self) -> Self {
+        crate::ExprStruct {
+            attrs: self.attrs.clone(),
+            qself: self.qself.clone(),
+            path: self.path.clone(),
+            brace_token: self.brace_token.clone(),
+            fields: self.fields.clone(),
+            dot2_token: self.dot2_token.clone(),
+            rest: self.rest.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ExprTry {
+    fn clone(&self) -> Self {
+        crate::ExprTry {
+            attrs: self.attrs.clone(),
+            expr: self.expr.clone(),
+            question_token: self.question_token.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ExprTryBlock {
+    fn clone(&self) -> Self {
+        crate::ExprTryBlock {
+            attrs: self.attrs.clone(),
+            try_token: self.try_token.clone(),
+            block: self.block.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ExprTuple {
+    fn clone(&self) -> Self {
+        crate::ExprTuple {
+            attrs: self.attrs.clone(),
+            paren_token: self.paren_token.clone(),
+            elems: self.elems.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ExprUnary {
+    fn clone(&self) -> Self {
+        crate::ExprUnary {
+            attrs: self.attrs.clone(),
+            op: self.op.clone(),
+            expr: self.expr.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ExprUnsafe {
+    fn clone(&self) -> Self {
+        crate::ExprUnsafe {
+            attrs: self.attrs.clone(),
+            unsafe_token: self.unsafe_token.clone(),
+            block: self.block.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ExprWhile {
+    fn clone(&self) -> Self {
+        crate::ExprWhile {
+            attrs: self.attrs.clone(),
+            label: self.label.clone(),
+            while_token: self.while_token.clone(),
+            cond: self.cond.clone(),
+            body: self.body.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ExprYield {
+    fn clone(&self) -> Self {
+        crate::ExprYield {
+            attrs: self.attrs.clone(),
+            yield_token: self.yield_token.clone(),
+            expr: self.expr.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::Field {
+    fn clone(&self) -> Self {
+        crate::Field {
+            attrs: self.attrs.clone(),
+            vis: self.vis.clone(),
+            mutability: self.mutability.clone(),
+            ident: self.ident.clone(),
+            colon_token: self.colon_token.clone(),
+            ty: self.ty.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::FieldMutability {
+    fn clone(&self) -> Self {
+        match self {
+            crate::FieldMutability::None => crate::FieldMutability::None,
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::FieldPat {
+    fn clone(&self) -> Self {
+        crate::FieldPat {
+            attrs: self.attrs.clone(),
+            member: self.member.clone(),
+            colon_token: self.colon_token.clone(),
+            pat: self.pat.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::FieldValue {
+    fn clone(&self) -> Self {
+        crate::FieldValue {
+            attrs: self.attrs.clone(),
+            member: self.member.clone(),
+            colon_token: self.colon_token.clone(),
+            expr: self.expr.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::Fields {
+    fn clone(&self) -> Self {
+        match self {
+            crate::Fields::Named(v0) => crate::Fields::Named(v0.clone()),
+            crate::Fields::Unnamed(v0) => crate::Fields::Unnamed(v0.clone()),
+            crate::Fields::Unit => crate::Fields::Unit,
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::FieldsNamed {
+    fn clone(&self) -> Self {
+        crate::FieldsNamed {
+            brace_token: self.brace_token.clone(),
+            named: self.named.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::FieldsUnnamed {
+    fn clone(&self) -> Self {
+        crate::FieldsUnnamed {
+            paren_token: self.paren_token.clone(),
+            unnamed: self.unnamed.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::File {
+    fn clone(&self) -> Self {
+        crate::File {
+            shebang: self.shebang.clone(),
+            attrs: self.attrs.clone(),
+            items: self.items.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::FnArg {
+    fn clone(&self) -> Self {
+        match self {
+            crate::FnArg::Receiver(v0) => crate::FnArg::Receiver(v0.clone()),
+            crate::FnArg::Typed(v0) => crate::FnArg::Typed(v0.clone()),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ForeignItem {
+    fn clone(&self) -> Self {
+        match self {
+            crate::ForeignItem::Fn(v0) => crate::ForeignItem::Fn(v0.clone()),
+            crate::ForeignItem::Static(v0) => crate::ForeignItem::Static(v0.clone()),
+            crate::ForeignItem::Type(v0) => crate::ForeignItem::Type(v0.clone()),
+            crate::ForeignItem::Macro(v0) => crate::ForeignItem::Macro(v0.clone()),
+            crate::ForeignItem::Verbatim(v0) => crate::ForeignItem::Verbatim(v0.clone()),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ForeignItemFn {
+    fn clone(&self) -> Self {
+        crate::ForeignItemFn {
+            attrs: self.attrs.clone(),
+            vis: self.vis.clone(),
+            sig: self.sig.clone(),
+            semi_token: self.semi_token.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ForeignItemMacro {
+    fn clone(&self) -> Self {
+        crate::ForeignItemMacro {
+            attrs: self.attrs.clone(),
+            mac: self.mac.clone(),
+            semi_token: self.semi_token.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ForeignItemStatic {
+    fn clone(&self) -> Self {
+        crate::ForeignItemStatic {
+            attrs: self.attrs.clone(),
+            vis: self.vis.clone(),
+            static_token: self.static_token.clone(),
+            mutability: self.mutability.clone(),
+            ident: self.ident.clone(),
+            colon_token: self.colon_token.clone(),
+            ty: self.ty.clone(),
+            semi_token: self.semi_token.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ForeignItemType {
+    fn clone(&self) -> Self {
+        crate::ForeignItemType {
+            attrs: self.attrs.clone(),
+            vis: self.vis.clone(),
+            type_token: self.type_token.clone(),
+            ident: self.ident.clone(),
+            generics: self.generics.clone(),
+            semi_token: self.semi_token.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::GenericArgument {
+    fn clone(&self) -> Self {
+        match self {
+            crate::GenericArgument::Lifetime(v0) => {
+                crate::GenericArgument::Lifetime(v0.clone())
+            }
+            crate::GenericArgument::Type(v0) => crate::GenericArgument::Type(v0.clone()),
+            crate::GenericArgument::Const(v0) => {
+                crate::GenericArgument::Const(v0.clone())
+            }
+            crate::GenericArgument::AssocType(v0) => {
+                crate::GenericArgument::AssocType(v0.clone())
+            }
+            crate::GenericArgument::AssocConst(v0) => {
+                crate::GenericArgument::AssocConst(v0.clone())
+            }
+            crate::GenericArgument::Constraint(v0) => {
+                crate::GenericArgument::Constraint(v0.clone())
+            }
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::GenericParam {
+    fn clone(&self) -> Self {
+        match self {
+            crate::GenericParam::Lifetime(v0) => {
+                crate::GenericParam::Lifetime(v0.clone())
+            }
+            crate::GenericParam::Type(v0) => crate::GenericParam::Type(v0.clone()),
+            crate::GenericParam::Const(v0) => crate::GenericParam::Const(v0.clone()),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::Generics {
+    fn clone(&self) -> Self {
+        crate::Generics {
+            lt_token: self.lt_token.clone(),
+            params: self.params.clone(),
+            gt_token: self.gt_token.clone(),
+            where_clause: self.where_clause.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ImplItem {
+    fn clone(&self) -> Self {
+        match self {
+            crate::ImplItem::Const(v0) => crate::ImplItem::Const(v0.clone()),
+            crate::ImplItem::Fn(v0) => crate::ImplItem::Fn(v0.clone()),
+            crate::ImplItem::Type(v0) => crate::ImplItem::Type(v0.clone()),
+            crate::ImplItem::Macro(v0) => crate::ImplItem::Macro(v0.clone()),
+            crate::ImplItem::Verbatim(v0) => crate::ImplItem::Verbatim(v0.clone()),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ImplItemConst {
+    fn clone(&self) -> Self {
+        crate::ImplItemConst {
+            attrs: self.attrs.clone(),
+            vis: self.vis.clone(),
+            defaultness: self.defaultness.clone(),
+            const_token: self.const_token.clone(),
+            ident: self.ident.clone(),
+            generics: self.generics.clone(),
+            colon_token: self.colon_token.clone(),
+            ty: self.ty.clone(),
+            eq_token: self.eq_token.clone(),
+            expr: self.expr.clone(),
+            semi_token: self.semi_token.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ImplItemFn {
+    fn clone(&self) -> Self {
+        crate::ImplItemFn {
+            attrs: self.attrs.clone(),
+            vis: self.vis.clone(),
+            defaultness: self.defaultness.clone(),
+            sig: self.sig.clone(),
+            block: self.block.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ImplItemMacro {
+    fn clone(&self) -> Self {
+        crate::ImplItemMacro {
+            attrs: self.attrs.clone(),
+            mac: self.mac.clone(),
+            semi_token: self.semi_token.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ImplItemType {
+    fn clone(&self) -> Self {
+        crate::ImplItemType {
+            attrs: self.attrs.clone(),
+            vis: self.vis.clone(),
+            defaultness: self.defaultness.clone(),
+            type_token: self.type_token.clone(),
+            ident: self.ident.clone(),
+            generics: self.generics.clone(),
+            eq_token: self.eq_token.clone(),
+            ty: self.ty.clone(),
+            semi_token: self.semi_token.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ImplRestriction {
+    fn clone(&self) -> Self {
+        match *self {}
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::Index {
+    fn clone(&self) -> Self {
+        crate::Index {
+            index: self.index.clone(),
+            span: self.span.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::Item {
+    fn clone(&self) -> Self {
+        match self {
+            crate::Item::Const(v0) => crate::Item::Const(v0.clone()),
+            crate::Item::Enum(v0) => crate::Item::Enum(v0.clone()),
+            crate::Item::ExternCrate(v0) => crate::Item::ExternCrate(v0.clone()),
+            crate::Item::Fn(v0) => crate::Item::Fn(v0.clone()),
+            crate::Item::ForeignMod(v0) => crate::Item::ForeignMod(v0.clone()),
+            crate::Item::Impl(v0) => crate::Item::Impl(v0.clone()),
+            crate::Item::Macro(v0) => crate::Item::Macro(v0.clone()),
+            crate::Item::Mod(v0) => crate::Item::Mod(v0.clone()),
+            crate::Item::Static(v0) => crate::Item::Static(v0.clone()),
+            crate::Item::Struct(v0) => crate::Item::Struct(v0.clone()),
+            crate::Item::Trait(v0) => crate::Item::Trait(v0.clone()),
+            crate::Item::TraitAlias(v0) => crate::Item::TraitAlias(v0.clone()),
+            crate::Item::Type(v0) => crate::Item::Type(v0.clone()),
+            crate::Item::Union(v0) => crate::Item::Union(v0.clone()),
+            crate::Item::Use(v0) => crate::Item::Use(v0.clone()),
+            crate::Item::Verbatim(v0) => crate::Item::Verbatim(v0.clone()),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ItemConst {
+    fn clone(&self) -> Self {
+        crate::ItemConst {
+            attrs: self.attrs.clone(),
+            vis: self.vis.clone(),
+            const_token: self.const_token.clone(),
+            ident: self.ident.clone(),
+            generics: self.generics.clone(),
+            colon_token: self.colon_token.clone(),
+            ty: self.ty.clone(),
+            eq_token: self.eq_token.clone(),
+            expr: self.expr.clone(),
+            semi_token: self.semi_token.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ItemEnum {
+    fn clone(&self) -> Self {
+        crate::ItemEnum {
+            attrs: self.attrs.clone(),
+            vis: self.vis.clone(),
+            enum_token: self.enum_token.clone(),
+            ident: self.ident.clone(),
+            generics: self.generics.clone(),
+            brace_token: self.brace_token.clone(),
+            variants: self.variants.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ItemExternCrate {
+    fn clone(&self) -> Self {
+        crate::ItemExternCrate {
+            attrs: self.attrs.clone(),
+            vis: self.vis.clone(),
+            extern_token: self.extern_token.clone(),
+            crate_token: self.crate_token.clone(),
+            ident: self.ident.clone(),
+            rename: self.rename.clone(),
+            semi_token: self.semi_token.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ItemFn {
+    fn clone(&self) -> Self {
+        crate::ItemFn {
+            attrs: self.attrs.clone(),
+            vis: self.vis.clone(),
+            sig: self.sig.clone(),
+            block: self.block.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ItemForeignMod {
+    fn clone(&self) -> Self {
+        crate::ItemForeignMod {
+            attrs: self.attrs.clone(),
+            unsafety: self.unsafety.clone(),
+            abi: self.abi.clone(),
+            brace_token: self.brace_token.clone(),
+            items: self.items.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ItemImpl {
+    fn clone(&self) -> Self {
+        crate::ItemImpl {
+            attrs: self.attrs.clone(),
+            defaultness: self.defaultness.clone(),
+            unsafety: self.unsafety.clone(),
+            impl_token: self.impl_token.clone(),
+            generics: self.generics.clone(),
+            trait_: self.trait_.clone(),
+            self_ty: self.self_ty.clone(),
+            brace_token: self.brace_token.clone(),
+            items: self.items.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ItemMacro {
+    fn clone(&self) -> Self {
+        crate::ItemMacro {
+            attrs: self.attrs.clone(),
+            ident: self.ident.clone(),
+            mac: self.mac.clone(),
+            semi_token: self.semi_token.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ItemMod {
+    fn clone(&self) -> Self {
+        crate::ItemMod {
+            attrs: self.attrs.clone(),
+            vis: self.vis.clone(),
+            unsafety: self.unsafety.clone(),
+            mod_token: self.mod_token.clone(),
+            ident: self.ident.clone(),
+            content: self.content.clone(),
+            semi: self.semi.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ItemStatic {
+    fn clone(&self) -> Self {
+        crate::ItemStatic {
+            attrs: self.attrs.clone(),
+            vis: self.vis.clone(),
+            static_token: self.static_token.clone(),
+            mutability: self.mutability.clone(),
+            ident: self.ident.clone(),
+            colon_token: self.colon_token.clone(),
+            ty: self.ty.clone(),
+            eq_token: self.eq_token.clone(),
+            expr: self.expr.clone(),
+            semi_token: self.semi_token.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ItemStruct {
+    fn clone(&self) -> Self {
+        crate::ItemStruct {
+            attrs: self.attrs.clone(),
+            vis: self.vis.clone(),
+            struct_token: self.struct_token.clone(),
+            ident: self.ident.clone(),
+            generics: self.generics.clone(),
+            fields: self.fields.clone(),
+            semi_token: self.semi_token.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ItemTrait {
+    fn clone(&self) -> Self {
+        crate::ItemTrait {
+            attrs: self.attrs.clone(),
+            vis: self.vis.clone(),
+            unsafety: self.unsafety.clone(),
+            auto_token: self.auto_token.clone(),
+            restriction: self.restriction.clone(),
+            trait_token: self.trait_token.clone(),
+            ident: self.ident.clone(),
+            generics: self.generics.clone(),
+            colon_token: self.colon_token.clone(),
+            supertraits: self.supertraits.clone(),
+            brace_token: self.brace_token.clone(),
+            items: self.items.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ItemTraitAlias {
+    fn clone(&self) -> Self {
+        crate::ItemTraitAlias {
+            attrs: self.attrs.clone(),
+            vis: self.vis.clone(),
+            trait_token: self.trait_token.clone(),
+            ident: self.ident.clone(),
+            generics: self.generics.clone(),
+            eq_token: self.eq_token.clone(),
+            bounds: self.bounds.clone(),
+            semi_token: self.semi_token.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ItemType {
+    fn clone(&self) -> Self {
+        crate::ItemType {
+            attrs: self.attrs.clone(),
+            vis: self.vis.clone(),
+            type_token: self.type_token.clone(),
+            ident: self.ident.clone(),
+            generics: self.generics.clone(),
+            eq_token: self.eq_token.clone(),
+            ty: self.ty.clone(),
+            semi_token: self.semi_token.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ItemUnion {
+    fn clone(&self) -> Self {
+        crate::ItemUnion {
+            attrs: self.attrs.clone(),
+            vis: self.vis.clone(),
+            union_token: self.union_token.clone(),
+            ident: self.ident.clone(),
+            generics: self.generics.clone(),
+            fields: self.fields.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ItemUse {
+    fn clone(&self) -> Self {
+        crate::ItemUse {
+            attrs: self.attrs.clone(),
+            vis: self.vis.clone(),
+            use_token: self.use_token.clone(),
+            leading_colon: self.leading_colon.clone(),
+            tree: self.tree.clone(),
+            semi_token: self.semi_token.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::Label {
+    fn clone(&self) -> Self {
+        crate::Label {
+            name: self.name.clone(),
+            colon_token: self.colon_token.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::LifetimeParam {
+    fn clone(&self) -> Self {
+        crate::LifetimeParam {
+            attrs: self.attrs.clone(),
+            lifetime: self.lifetime.clone(),
+            colon_token: self.colon_token.clone(),
+            bounds: self.bounds.clone(),
+        }
+    }
+}
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::Lit {
+    fn clone(&self) -> Self {
+        match self {
+            crate::Lit::Str(v0) => crate::Lit::Str(v0.clone()),
+            crate::Lit::ByteStr(v0) => crate::Lit::ByteStr(v0.clone()),
+            crate::Lit::CStr(v0) => crate::Lit::CStr(v0.clone()),
+            crate::Lit::Byte(v0) => crate::Lit::Byte(v0.clone()),
+            crate::Lit::Char(v0) => crate::Lit::Char(v0.clone()),
+            crate::Lit::Int(v0) => crate::Lit::Int(v0.clone()),
+            crate::Lit::Float(v0) => crate::Lit::Float(v0.clone()),
+            crate::Lit::Bool(v0) => crate::Lit::Bool(v0.clone()),
+            crate::Lit::Verbatim(v0) => crate::Lit::Verbatim(v0.clone()),
+        }
+    }
+}
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::LitBool {
+    fn clone(&self) -> Self {
+        crate::LitBool {
+            value: self.value.clone(),
+            span: self.span.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::Local {
+    fn clone(&self) -> Self {
+        crate::Local {
+            attrs: self.attrs.clone(),
+            let_token: self.let_token.clone(),
+            pat: self.pat.clone(),
+            init: self.init.clone(),
+            semi_token: self.semi_token.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::LocalInit {
+    fn clone(&self) -> Self {
+        crate::LocalInit {
+            eq_token: self.eq_token.clone(),
+            expr: self.expr.clone(),
+            diverge: self.diverge.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::Macro {
+    fn clone(&self) -> Self {
+        crate::Macro {
+            path: self.path.clone(),
+            bang_token: self.bang_token.clone(),
+            delimiter: self.delimiter.clone(),
+            tokens: self.tokens.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::MacroDelimiter {
+    fn clone(&self) -> Self {
+        match self {
+            crate::MacroDelimiter::Paren(v0) => crate::MacroDelimiter::Paren(v0.clone()),
+            crate::MacroDelimiter::Brace(v0) => crate::MacroDelimiter::Brace(v0.clone()),
+            crate::MacroDelimiter::Bracket(v0) => {
+                crate::MacroDelimiter::Bracket(v0.clone())
+            }
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::Member {
+    fn clone(&self) -> Self {
+        match self {
+            crate::Member::Named(v0) => crate::Member::Named(v0.clone()),
+            crate::Member::Unnamed(v0) => crate::Member::Unnamed(v0.clone()),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::Meta {
+    fn clone(&self) -> Self {
+        match self {
+            crate::Meta::Path(v0) => crate::Meta::Path(v0.clone()),
+            crate::Meta::List(v0) => crate::Meta::List(v0.clone()),
+            crate::Meta::NameValue(v0) => crate::Meta::NameValue(v0.clone()),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::MetaList {
+    fn clone(&self) -> Self {
+        crate::MetaList {
+            path: self.path.clone(),
+            delimiter: self.delimiter.clone(),
+            tokens: self.tokens.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::MetaNameValue {
+    fn clone(&self) -> Self {
+        crate::MetaNameValue {
+            path: self.path.clone(),
+            eq_token: self.eq_token.clone(),
+            value: self.value.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ParenthesizedGenericArguments {
+    fn clone(&self) -> Self {
+        crate::ParenthesizedGenericArguments {
+            paren_token: self.paren_token.clone(),
+            inputs: self.inputs.clone(),
+            output: self.output.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::Pat {
+    fn clone(&self) -> Self {
+        match self {
+            crate::Pat::Const(v0) => crate::Pat::Const(v0.clone()),
+            crate::Pat::Ident(v0) => crate::Pat::Ident(v0.clone()),
+            crate::Pat::Lit(v0) => crate::Pat::Lit(v0.clone()),
+            crate::Pat::Macro(v0) => crate::Pat::Macro(v0.clone()),
+            crate::Pat::Or(v0) => crate::Pat::Or(v0.clone()),
+            crate::Pat::Paren(v0) => crate::Pat::Paren(v0.clone()),
+            crate::Pat::Path(v0) => crate::Pat::Path(v0.clone()),
+            crate::Pat::Range(v0) => crate::Pat::Range(v0.clone()),
+            crate::Pat::Reference(v0) => crate::Pat::Reference(v0.clone()),
+            crate::Pat::Rest(v0) => crate::Pat::Rest(v0.clone()),
+            crate::Pat::Slice(v0) => crate::Pat::Slice(v0.clone()),
+            crate::Pat::Struct(v0) => crate::Pat::Struct(v0.clone()),
+            crate::Pat::Tuple(v0) => crate::Pat::Tuple(v0.clone()),
+            crate::Pat::TupleStruct(v0) => crate::Pat::TupleStruct(v0.clone()),
+            crate::Pat::Type(v0) => crate::Pat::Type(v0.clone()),
+            crate::Pat::Verbatim(v0) => crate::Pat::Verbatim(v0.clone()),
+            crate::Pat::Wild(v0) => crate::Pat::Wild(v0.clone()),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::PatIdent {
+    fn clone(&self) -> Self {
+        crate::PatIdent {
+            attrs: self.attrs.clone(),
+            by_ref: self.by_ref.clone(),
+            mutability: self.mutability.clone(),
+            ident: self.ident.clone(),
+            subpat: self.subpat.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::PatOr {
+    fn clone(&self) -> Self {
+        crate::PatOr {
+            attrs: self.attrs.clone(),
+            leading_vert: self.leading_vert.clone(),
+            cases: self.cases.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::PatParen {
+    fn clone(&self) -> Self {
+        crate::PatParen {
+            attrs: self.attrs.clone(),
+            paren_token: self.paren_token.clone(),
+            pat: self.pat.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::PatReference {
+    fn clone(&self) -> Self {
+        crate::PatReference {
+            attrs: self.attrs.clone(),
+            and_token: self.and_token.clone(),
+            mutability: self.mutability.clone(),
+            pat: self.pat.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::PatRest {
+    fn clone(&self) -> Self {
+        crate::PatRest {
+            attrs: self.attrs.clone(),
+            dot2_token: self.dot2_token.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::PatSlice {
+    fn clone(&self) -> Self {
+        crate::PatSlice {
+            attrs: self.attrs.clone(),
+            bracket_token: self.bracket_token.clone(),
+            elems: self.elems.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::PatStruct {
+    fn clone(&self) -> Self {
+        crate::PatStruct {
+            attrs: self.attrs.clone(),
+            qself: self.qself.clone(),
+            path: self.path.clone(),
+            brace_token: self.brace_token.clone(),
+            fields: self.fields.clone(),
+            rest: self.rest.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::PatTuple {
+    fn clone(&self) -> Self {
+        crate::PatTuple {
+            attrs: self.attrs.clone(),
+            paren_token: self.paren_token.clone(),
+            elems: self.elems.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::PatTupleStruct {
+    fn clone(&self) -> Self {
+        crate::PatTupleStruct {
+            attrs: self.attrs.clone(),
+            qself: self.qself.clone(),
+            path: self.path.clone(),
+            paren_token: self.paren_token.clone(),
+            elems: self.elems.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::PatType {
+    fn clone(&self) -> Self {
+        crate::PatType {
+            attrs: self.attrs.clone(),
+            pat: self.pat.clone(),
+            colon_token: self.colon_token.clone(),
+            ty: self.ty.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::PatWild {
+    fn clone(&self) -> Self {
+        crate::PatWild {
+            attrs: self.attrs.clone(),
+            underscore_token: self.underscore_token.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::Path {
+    fn clone(&self) -> Self {
+        crate::Path {
+            leading_colon: self.leading_colon.clone(),
+            segments: self.segments.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::PathArguments {
+    fn clone(&self) -> Self {
+        match self {
+            crate::PathArguments::None => crate::PathArguments::None,
+            crate::PathArguments::AngleBracketed(v0) => {
+                crate::PathArguments::AngleBracketed(v0.clone())
+            }
+            crate::PathArguments::Parenthesized(v0) => {
+                crate::PathArguments::Parenthesized(v0.clone())
+            }
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::PathSegment {
+    fn clone(&self) -> Self {
+        crate::PathSegment {
+            ident: self.ident.clone(),
+            arguments: self.arguments.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::PredicateLifetime {
+    fn clone(&self) -> Self {
+        crate::PredicateLifetime {
+            lifetime: self.lifetime.clone(),
+            colon_token: self.colon_token.clone(),
+            bounds: self.bounds.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::PredicateType {
+    fn clone(&self) -> Self {
+        crate::PredicateType {
+            lifetimes: self.lifetimes.clone(),
+            bounded_ty: self.bounded_ty.clone(),
+            colon_token: self.colon_token.clone(),
+            bounds: self.bounds.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::QSelf {
+    fn clone(&self) -> Self {
+        crate::QSelf {
+            lt_token: self.lt_token.clone(),
+            ty: self.ty.clone(),
+            position: self.position.clone(),
+            as_token: self.as_token.clone(),
+            gt_token: self.gt_token.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Copy for crate::RangeLimits {}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::RangeLimits {
+    fn clone(&self) -> Self {
+        *self
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::Receiver {
+    fn clone(&self) -> Self {
+        crate::Receiver {
+            attrs: self.attrs.clone(),
+            reference: self.reference.clone(),
+            mutability: self.mutability.clone(),
+            self_token: self.self_token.clone(),
+            colon_token: self.colon_token.clone(),
+            ty: self.ty.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::ReturnType {
+    fn clone(&self) -> Self {
+        match self {
+            crate::ReturnType::Default => crate::ReturnType::Default,
+            crate::ReturnType::Type(v0, v1) => {
+                crate::ReturnType::Type(v0.clone(), v1.clone())
+            }
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::Signature {
+    fn clone(&self) -> Self {
+        crate::Signature {
+            constness: self.constness.clone(),
+            asyncness: self.asyncness.clone(),
+            unsafety: self.unsafety.clone(),
+            abi: self.abi.clone(),
+            fn_token: self.fn_token.clone(),
+            ident: self.ident.clone(),
+            generics: self.generics.clone(),
+            paren_token: self.paren_token.clone(),
+            inputs: self.inputs.clone(),
+            variadic: self.variadic.clone(),
+            output: self.output.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::StaticMutability {
+    fn clone(&self) -> Self {
+        match self {
+            crate::StaticMutability::Mut(v0) => crate::StaticMutability::Mut(v0.clone()),
+            crate::StaticMutability::None => crate::StaticMutability::None,
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::Stmt {
+    fn clone(&self) -> Self {
+        match self {
+            crate::Stmt::Local(v0) => crate::Stmt::Local(v0.clone()),
+            crate::Stmt::Item(v0) => crate::Stmt::Item(v0.clone()),
+            crate::Stmt::Expr(v0, v1) => crate::Stmt::Expr(v0.clone(), v1.clone()),
+            crate::Stmt::Macro(v0) => crate::Stmt::Macro(v0.clone()),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::StmtMacro {
+    fn clone(&self) -> Self {
+        crate::StmtMacro {
+            attrs: self.attrs.clone(),
+            mac: self.mac.clone(),
+            semi_token: self.semi_token.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::TraitBound {
+    fn clone(&self) -> Self {
+        crate::TraitBound {
+            paren_token: self.paren_token.clone(),
+            modifier: self.modifier.clone(),
+            lifetimes: self.lifetimes.clone(),
+            path: self.path.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Copy for crate::TraitBoundModifier {}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::TraitBoundModifier {
+    fn clone(&self) -> Self {
+        *self
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::TraitItem {
+    fn clone(&self) -> Self {
+        match self {
+            crate::TraitItem::Const(v0) => crate::TraitItem::Const(v0.clone()),
+            crate::TraitItem::Fn(v0) => crate::TraitItem::Fn(v0.clone()),
+            crate::TraitItem::Type(v0) => crate::TraitItem::Type(v0.clone()),
+            crate::TraitItem::Macro(v0) => crate::TraitItem::Macro(v0.clone()),
+            crate::TraitItem::Verbatim(v0) => crate::TraitItem::Verbatim(v0.clone()),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::TraitItemConst {
+    fn clone(&self) -> Self {
+        crate::TraitItemConst {
+            attrs: self.attrs.clone(),
+            const_token: self.const_token.clone(),
+            ident: self.ident.clone(),
+            generics: self.generics.clone(),
+            colon_token: self.colon_token.clone(),
+            ty: self.ty.clone(),
+            default: self.default.clone(),
+            semi_token: self.semi_token.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::TraitItemFn {
+    fn clone(&self) -> Self {
+        crate::TraitItemFn {
+            attrs: self.attrs.clone(),
+            sig: self.sig.clone(),
+            default: self.default.clone(),
+            semi_token: self.semi_token.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::TraitItemMacro {
+    fn clone(&self) -> Self {
+        crate::TraitItemMacro {
+            attrs: self.attrs.clone(),
+            mac: self.mac.clone(),
+            semi_token: self.semi_token.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::TraitItemType {
+    fn clone(&self) -> Self {
+        crate::TraitItemType {
+            attrs: self.attrs.clone(),
+            type_token: self.type_token.clone(),
+            ident: self.ident.clone(),
+            generics: self.generics.clone(),
+            colon_token: self.colon_token.clone(),
+            bounds: self.bounds.clone(),
+            default: self.default.clone(),
+            semi_token: self.semi_token.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::Type {
+    fn clone(&self) -> Self {
+        match self {
+            crate::Type::Array(v0) => crate::Type::Array(v0.clone()),
+            crate::Type::BareFn(v0) => crate::Type::BareFn(v0.clone()),
+            crate::Type::Group(v0) => crate::Type::Group(v0.clone()),
+            crate::Type::ImplTrait(v0) => crate::Type::ImplTrait(v0.clone()),
+            crate::Type::Infer(v0) => crate::Type::Infer(v0.clone()),
+            crate::Type::Macro(v0) => crate::Type::Macro(v0.clone()),
+            crate::Type::Never(v0) => crate::Type::Never(v0.clone()),
+            crate::Type::Paren(v0) => crate::Type::Paren(v0.clone()),
+            crate::Type::Path(v0) => crate::Type::Path(v0.clone()),
+            crate::Type::Ptr(v0) => crate::Type::Ptr(v0.clone()),
+            crate::Type::Reference(v0) => crate::Type::Reference(v0.clone()),
+            crate::Type::Slice(v0) => crate::Type::Slice(v0.clone()),
+            crate::Type::TraitObject(v0) => crate::Type::TraitObject(v0.clone()),
+            crate::Type::Tuple(v0) => crate::Type::Tuple(v0.clone()),
+            crate::Type::Verbatim(v0) => crate::Type::Verbatim(v0.clone()),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::TypeArray {
+    fn clone(&self) -> Self {
+        crate::TypeArray {
+            bracket_token: self.bracket_token.clone(),
+            elem: self.elem.clone(),
+            semi_token: self.semi_token.clone(),
+            len: self.len.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::TypeBareFn {
+    fn clone(&self) -> Self {
+        crate::TypeBareFn {
+            lifetimes: self.lifetimes.clone(),
+            unsafety: self.unsafety.clone(),
+            abi: self.abi.clone(),
+            fn_token: self.fn_token.clone(),
+            paren_token: self.paren_token.clone(),
+            inputs: self.inputs.clone(),
+            variadic: self.variadic.clone(),
+            output: self.output.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::TypeGroup {
+    fn clone(&self) -> Self {
+        crate::TypeGroup {
+            group_token: self.group_token.clone(),
+            elem: self.elem.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::TypeImplTrait {
+    fn clone(&self) -> Self {
+        crate::TypeImplTrait {
+            impl_token: self.impl_token.clone(),
+            bounds: self.bounds.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::TypeInfer {
+    fn clone(&self) -> Self {
+        crate::TypeInfer {
+            underscore_token: self.underscore_token.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::TypeMacro {
+    fn clone(&self) -> Self {
+        crate::TypeMacro {
+            mac: self.mac.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::TypeNever {
+    fn clone(&self) -> Self {
+        crate::TypeNever {
+            bang_token: self.bang_token.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::TypeParam {
+    fn clone(&self) -> Self {
+        crate::TypeParam {
+            attrs: self.attrs.clone(),
+            ident: self.ident.clone(),
+            colon_token: self.colon_token.clone(),
+            bounds: self.bounds.clone(),
+            eq_token: self.eq_token.clone(),
+            default: self.default.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::TypeParamBound {
+    fn clone(&self) -> Self {
+        match self {
+            crate::TypeParamBound::Trait(v0) => crate::TypeParamBound::Trait(v0.clone()),
+            crate::TypeParamBound::Lifetime(v0) => {
+                crate::TypeParamBound::Lifetime(v0.clone())
+            }
+            crate::TypeParamBound::Verbatim(v0) => {
+                crate::TypeParamBound::Verbatim(v0.clone())
+            }
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::TypeParen {
+    fn clone(&self) -> Self {
+        crate::TypeParen {
+            paren_token: self.paren_token.clone(),
+            elem: self.elem.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::TypePath {
+    fn clone(&self) -> Self {
+        crate::TypePath {
+            qself: self.qself.clone(),
+            path: self.path.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::TypePtr {
+    fn clone(&self) -> Self {
+        crate::TypePtr {
+            star_token: self.star_token.clone(),
+            const_token: self.const_token.clone(),
+            mutability: self.mutability.clone(),
+            elem: self.elem.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::TypeReference {
+    fn clone(&self) -> Self {
+        crate::TypeReference {
+            and_token: self.and_token.clone(),
+            lifetime: self.lifetime.clone(),
+            mutability: self.mutability.clone(),
+            elem: self.elem.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::TypeSlice {
+    fn clone(&self) -> Self {
+        crate::TypeSlice {
+            bracket_token: self.bracket_token.clone(),
+            elem: self.elem.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::TypeTraitObject {
+    fn clone(&self) -> Self {
+        crate::TypeTraitObject {
+            dyn_token: self.dyn_token.clone(),
+            bounds: self.bounds.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::TypeTuple {
+    fn clone(&self) -> Self {
+        crate::TypeTuple {
+            paren_token: self.paren_token.clone(),
+            elems: self.elems.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Copy for crate::UnOp {}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::UnOp {
+    fn clone(&self) -> Self {
+        *self
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::UseGlob {
+    fn clone(&self) -> Self {
+        crate::UseGlob {
+            star_token: self.star_token.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::UseGroup {
+    fn clone(&self) -> Self {
+        crate::UseGroup {
+            brace_token: self.brace_token.clone(),
+            items: self.items.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::UseName {
+    fn clone(&self) -> Self {
+        crate::UseName {
+            ident: self.ident.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::UsePath {
+    fn clone(&self) -> Self {
+        crate::UsePath {
+            ident: self.ident.clone(),
+            colon2_token: self.colon2_token.clone(),
+            tree: self.tree.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::UseRename {
+    fn clone(&self) -> Self {
+        crate::UseRename {
+            ident: self.ident.clone(),
+            as_token: self.as_token.clone(),
+            rename: self.rename.clone(),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::UseTree {
+    fn clone(&self) -> Self {
+        match self {
+            crate::UseTree::Path(v0) => crate::UseTree::Path(v0.clone()),
+            crate::UseTree::Name(v0) => crate::UseTree::Name(v0.clone()),
+            crate::UseTree::Rename(v0) => crate::UseTree::Rename(v0.clone()),
+            crate::UseTree::Glob(v0) => crate::UseTree::Glob(v0.clone()),
+            crate::UseTree::Group(v0) => crate::UseTree::Group(v0.clone()),
+        }
+    }
+}
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::Variadic {
+    fn clone(&self) -> Self {
+        crate::Variadic {
+            attrs: self.attrs.clone(),
+            pat: self.pat.clone(),
+            dots: self.dots.clone(),
+            comma: self.comma.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::Variant {
+    fn clone(&self) -> Self {
+        crate::Variant {
+            attrs: self.attrs.clone(),
+            ident: self.ident.clone(),
+            fields: self.fields.clone(),
+            discriminant: self.discriminant.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::VisRestricted {
+    fn clone(&self) -> Self {
+        crate::VisRestricted {
+            pub_token: self.pub_token.clone(),
+            paren_token: self.paren_token.clone(),
+            in_token: self.in_token.clone(),
+            path: self.path.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::Visibility {
+    fn clone(&self) -> Self {
+        match self {
+            crate::Visibility::Public(v0) => crate::Visibility::Public(v0.clone()),
+            crate::Visibility::Restricted(v0) => {
+                crate::Visibility::Restricted(v0.clone())
+            }
+            crate::Visibility::Inherited => crate::Visibility::Inherited,
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::WhereClause {
+    fn clone(&self) -> Self {
+        crate::WhereClause {
+            where_token: self.where_token.clone(),
+            predicates: self.predicates.clone(),
+        }
+    }
+}
+#[cfg(any(feature = "derive", feature = "full"))]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for crate::WherePredicate {
+    fn clone(&self) -> Self {
+        match self {
+            crate::WherePredicate::Lifetime(v0) => {
+                crate::WherePredicate::Lifetime(v0.clone())
+            }
+            crate::WherePredicate::Type(v0) => crate::WherePredicate::Type(v0.clone()),
+        }
+    }
+}
+
\ No newline at end of file diff --git a/src/syn/gen_helper.rs.html b/src/syn/gen_helper.rs.html new file mode 100644 index 0000000..c96ee21 --- /dev/null +++ b/src/syn/gen_helper.rs.html @@ -0,0 +1,69 @@ +gen_helper.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+
#[cfg(feature = "fold")]
+pub(crate) mod fold {
+    use crate::punctuated::{Pair, Punctuated};
+
+    pub(crate) trait FoldHelper {
+        type Item;
+        fn lift<F>(self, f: F) -> Self
+        where
+            F: FnMut(Self::Item) -> Self::Item;
+    }
+
+    impl<T> FoldHelper for Vec<T> {
+        type Item = T;
+        fn lift<F>(self, f: F) -> Self
+        where
+            F: FnMut(Self::Item) -> Self::Item,
+        {
+            self.into_iter().map(f).collect()
+        }
+    }
+
+    impl<T, U> FoldHelper for Punctuated<T, U> {
+        type Item = T;
+        fn lift<F>(self, mut f: F) -> Self
+        where
+            F: FnMut(Self::Item) -> Self::Item,
+        {
+            self.into_pairs()
+                .map(Pair::into_tuple)
+                .map(|(t, u)| Pair::new(f(t), u))
+                .collect()
+        }
+    }
+}
+
\ No newline at end of file diff --git a/src/syn/generics.rs.html b/src/syn/generics.rs.html new file mode 100644 index 0000000..b4d944c --- /dev/null +++ b/src/syn/generics.rs.html @@ -0,0 +1,2501 @@ +generics.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+753
+754
+755
+756
+757
+758
+759
+760
+761
+762
+763
+764
+765
+766
+767
+768
+769
+770
+771
+772
+773
+774
+775
+776
+777
+778
+779
+780
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+794
+795
+796
+797
+798
+799
+800
+801
+802
+803
+804
+805
+806
+807
+808
+809
+810
+811
+812
+813
+814
+815
+816
+817
+818
+819
+820
+821
+822
+823
+824
+825
+826
+827
+828
+829
+830
+831
+832
+833
+834
+835
+836
+837
+838
+839
+840
+841
+842
+843
+844
+845
+846
+847
+848
+849
+850
+851
+852
+853
+854
+855
+856
+857
+858
+859
+860
+861
+862
+863
+864
+865
+866
+867
+868
+869
+870
+871
+872
+873
+874
+875
+876
+877
+878
+879
+880
+881
+882
+883
+884
+885
+886
+887
+888
+889
+890
+891
+892
+893
+894
+895
+896
+897
+898
+899
+900
+901
+902
+903
+904
+905
+906
+907
+908
+909
+910
+911
+912
+913
+914
+915
+916
+917
+918
+919
+920
+921
+922
+923
+924
+925
+926
+927
+928
+929
+930
+931
+932
+933
+934
+935
+936
+937
+938
+939
+940
+941
+942
+943
+944
+945
+946
+947
+948
+949
+950
+951
+952
+953
+954
+955
+956
+957
+958
+959
+960
+961
+962
+963
+964
+965
+966
+967
+968
+969
+970
+971
+972
+973
+974
+975
+976
+977
+978
+979
+980
+981
+982
+983
+984
+985
+986
+987
+988
+989
+990
+991
+992
+993
+994
+995
+996
+997
+998
+999
+1000
+1001
+1002
+1003
+1004
+1005
+1006
+1007
+1008
+1009
+1010
+1011
+1012
+1013
+1014
+1015
+1016
+1017
+1018
+1019
+1020
+1021
+1022
+1023
+1024
+1025
+1026
+1027
+1028
+1029
+1030
+1031
+1032
+1033
+1034
+1035
+1036
+1037
+1038
+1039
+1040
+1041
+1042
+1043
+1044
+1045
+1046
+1047
+1048
+1049
+1050
+1051
+1052
+1053
+1054
+1055
+1056
+1057
+1058
+1059
+1060
+1061
+1062
+1063
+1064
+1065
+1066
+1067
+1068
+1069
+1070
+1071
+1072
+1073
+1074
+1075
+1076
+1077
+1078
+1079
+1080
+1081
+1082
+1083
+1084
+1085
+1086
+1087
+1088
+1089
+1090
+1091
+1092
+1093
+1094
+1095
+1096
+1097
+1098
+1099
+1100
+1101
+1102
+1103
+1104
+1105
+1106
+1107
+1108
+1109
+1110
+1111
+1112
+1113
+1114
+1115
+1116
+1117
+1118
+1119
+1120
+1121
+1122
+1123
+1124
+1125
+1126
+1127
+1128
+1129
+1130
+1131
+1132
+1133
+1134
+1135
+1136
+1137
+1138
+1139
+1140
+1141
+1142
+1143
+1144
+1145
+1146
+1147
+1148
+1149
+1150
+1151
+1152
+1153
+1154
+1155
+1156
+1157
+1158
+1159
+1160
+1161
+1162
+1163
+1164
+1165
+1166
+1167
+1168
+1169
+1170
+1171
+1172
+1173
+1174
+1175
+1176
+1177
+1178
+1179
+1180
+1181
+1182
+1183
+1184
+1185
+1186
+1187
+1188
+1189
+1190
+1191
+1192
+1193
+1194
+1195
+1196
+1197
+1198
+1199
+1200
+1201
+1202
+1203
+1204
+1205
+1206
+1207
+1208
+1209
+1210
+1211
+1212
+1213
+1214
+1215
+1216
+1217
+1218
+1219
+1220
+1221
+1222
+1223
+1224
+1225
+1226
+1227
+1228
+1229
+1230
+1231
+1232
+1233
+1234
+1235
+1236
+1237
+1238
+1239
+1240
+1241
+1242
+1243
+1244
+1245
+1246
+1247
+1248
+1249
+1250
+
use crate::attr::Attribute;
+use crate::expr::Expr;
+use crate::ident::Ident;
+use crate::lifetime::Lifetime;
+use crate::path::Path;
+use crate::punctuated::{Iter, IterMut, Punctuated};
+use crate::token;
+use crate::ty::Type;
+use proc_macro2::TokenStream;
+#[cfg(all(feature = "printing", feature = "extra-traits"))]
+use std::fmt::{self, Debug};
+#[cfg(all(feature = "printing", feature = "extra-traits"))]
+use std::hash::{Hash, Hasher};
+
+ast_struct! {
+    /// Lifetimes and type parameters attached to a declaration of a function,
+    /// enum, trait, etc.
+    ///
+    /// This struct represents two distinct optional syntactic elements,
+    /// [generic parameters] and [where clause]. In some locations of the
+    /// grammar, there may be other tokens in between these two things.
+    ///
+    /// [generic parameters]: https://doc.rust-lang.org/stable/reference/items/generics.html#generic-parameters
+    /// [where clause]: https://doc.rust-lang.org/stable/reference/items/generics.html#where-clauses
+    #[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct Generics {
+        pub lt_token: Option<Token![<]>,
+        pub params: Punctuated<GenericParam, Token![,]>,
+        pub gt_token: Option<Token![>]>,
+        pub where_clause: Option<WhereClause>,
+    }
+}
+
+ast_enum_of_structs! {
+    /// A generic type parameter, lifetime, or const generic: `T: Into<String>`,
+    /// `'a: 'b`, `const LEN: usize`.
+    ///
+    /// # Syntax tree enum
+    ///
+    /// This type is a [syntax tree enum].
+    ///
+    /// [syntax tree enum]: crate::expr::Expr#syntax-tree-enums
+    #[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub enum GenericParam {
+        /// A lifetime parameter: `'a: 'b + 'c + 'd`.
+        Lifetime(LifetimeParam),
+
+        /// A generic type parameter: `T: Into<String>`.
+        Type(TypeParam),
+
+        /// A const generic parameter: `const LENGTH: usize`.
+        Const(ConstParam),
+    }
+}
+
+ast_struct! {
+    /// A lifetime definition: `'a: 'b + 'c + 'd`.
+    #[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct LifetimeParam {
+        pub attrs: Vec<Attribute>,
+        pub lifetime: Lifetime,
+        pub colon_token: Option<Token![:]>,
+        pub bounds: Punctuated<Lifetime, Token![+]>,
+    }
+}
+
+ast_struct! {
+    /// A generic type parameter: `T: Into<String>`.
+    #[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct TypeParam {
+        pub attrs: Vec<Attribute>,
+        pub ident: Ident,
+        pub colon_token: Option<Token![:]>,
+        pub bounds: Punctuated<TypeParamBound, Token![+]>,
+        pub eq_token: Option<Token![=]>,
+        pub default: Option<Type>,
+    }
+}
+
+ast_struct! {
+    /// A const generic parameter: `const LENGTH: usize`.
+    #[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct ConstParam {
+        pub attrs: Vec<Attribute>,
+        pub const_token: Token![const],
+        pub ident: Ident,
+        pub colon_token: Token![:],
+        pub ty: Type,
+        pub eq_token: Option<Token![=]>,
+        pub default: Option<Expr>,
+    }
+}
+
+impl Default for Generics {
+    fn default() -> Self {
+        Generics {
+            lt_token: None,
+            params: Punctuated::new(),
+            gt_token: None,
+            where_clause: None,
+        }
+    }
+}
+
+impl Generics {
+    /// Returns an
+    /// <code
+    ///   style="padding-right:0;">Iterator&lt;Item = &amp;</code><a
+    ///   href="struct.LifetimeParam.html"><code
+    ///   style="padding-left:0;padding-right:0;">LifetimeParam</code></a><code
+    ///   style="padding-left:0;">&gt;</code>
+    /// over the lifetime parameters in `self.params`.
+    pub fn lifetimes(&self) -> Lifetimes {
+        Lifetimes(self.params.iter())
+    }
+
+    /// Returns an
+    /// <code
+    ///   style="padding-right:0;">Iterator&lt;Item = &amp;mut </code><a
+    ///   href="struct.LifetimeParam.html"><code
+    ///   style="padding-left:0;padding-right:0;">LifetimeParam</code></a><code
+    ///   style="padding-left:0;">&gt;</code>
+    /// over the lifetime parameters in `self.params`.
+    pub fn lifetimes_mut(&mut self) -> LifetimesMut {
+        LifetimesMut(self.params.iter_mut())
+    }
+
+    /// Returns an
+    /// <code
+    ///   style="padding-right:0;">Iterator&lt;Item = &amp;</code><a
+    ///   href="struct.TypeParam.html"><code
+    ///   style="padding-left:0;padding-right:0;">TypeParam</code></a><code
+    ///   style="padding-left:0;">&gt;</code>
+    /// over the type parameters in `self.params`.
+    pub fn type_params(&self) -> TypeParams {
+        TypeParams(self.params.iter())
+    }
+
+    /// Returns an
+    /// <code
+    ///   style="padding-right:0;">Iterator&lt;Item = &amp;mut </code><a
+    ///   href="struct.TypeParam.html"><code
+    ///   style="padding-left:0;padding-right:0;">TypeParam</code></a><code
+    ///   style="padding-left:0;">&gt;</code>
+    /// over the type parameters in `self.params`.
+    pub fn type_params_mut(&mut self) -> TypeParamsMut {
+        TypeParamsMut(self.params.iter_mut())
+    }
+
+    /// Returns an
+    /// <code
+    ///   style="padding-right:0;">Iterator&lt;Item = &amp;</code><a
+    ///   href="struct.ConstParam.html"><code
+    ///   style="padding-left:0;padding-right:0;">ConstParam</code></a><code
+    ///   style="padding-left:0;">&gt;</code>
+    /// over the constant parameters in `self.params`.
+    pub fn const_params(&self) -> ConstParams {
+        ConstParams(self.params.iter())
+    }
+
+    /// Returns an
+    /// <code
+    ///   style="padding-right:0;">Iterator&lt;Item = &amp;mut </code><a
+    ///   href="struct.ConstParam.html"><code
+    ///   style="padding-left:0;padding-right:0;">ConstParam</code></a><code
+    ///   style="padding-left:0;">&gt;</code>
+    /// over the constant parameters in `self.params`.
+    pub fn const_params_mut(&mut self) -> ConstParamsMut {
+        ConstParamsMut(self.params.iter_mut())
+    }
+
+    /// Initializes an empty `where`-clause if there is not one present already.
+    pub fn make_where_clause(&mut self) -> &mut WhereClause {
+        self.where_clause.get_or_insert_with(|| WhereClause {
+            where_token: <Token![where]>::default(),
+            predicates: Punctuated::new(),
+        })
+    }
+}
+
+pub struct Lifetimes<'a>(Iter<'a, GenericParam>);
+
+impl<'a> Iterator for Lifetimes<'a> {
+    type Item = &'a LifetimeParam;
+
+    fn next(&mut self) -> Option<Self::Item> {
+        let next = match self.0.next() {
+            Some(item) => item,
+            None => return None,
+        };
+        if let GenericParam::Lifetime(lifetime) = next {
+            Some(lifetime)
+        } else {
+            self.next()
+        }
+    }
+}
+
+pub struct LifetimesMut<'a>(IterMut<'a, GenericParam>);
+
+impl<'a> Iterator for LifetimesMut<'a> {
+    type Item = &'a mut LifetimeParam;
+
+    fn next(&mut self) -> Option<Self::Item> {
+        let next = match self.0.next() {
+            Some(item) => item,
+            None => return None,
+        };
+        if let GenericParam::Lifetime(lifetime) = next {
+            Some(lifetime)
+        } else {
+            self.next()
+        }
+    }
+}
+
+pub struct TypeParams<'a>(Iter<'a, GenericParam>);
+
+impl<'a> Iterator for TypeParams<'a> {
+    type Item = &'a TypeParam;
+
+    fn next(&mut self) -> Option<Self::Item> {
+        let next = match self.0.next() {
+            Some(item) => item,
+            None => return None,
+        };
+        if let GenericParam::Type(type_param) = next {
+            Some(type_param)
+        } else {
+            self.next()
+        }
+    }
+}
+
+pub struct TypeParamsMut<'a>(IterMut<'a, GenericParam>);
+
+impl<'a> Iterator for TypeParamsMut<'a> {
+    type Item = &'a mut TypeParam;
+
+    fn next(&mut self) -> Option<Self::Item> {
+        let next = match self.0.next() {
+            Some(item) => item,
+            None => return None,
+        };
+        if let GenericParam::Type(type_param) = next {
+            Some(type_param)
+        } else {
+            self.next()
+        }
+    }
+}
+
+pub struct ConstParams<'a>(Iter<'a, GenericParam>);
+
+impl<'a> Iterator for ConstParams<'a> {
+    type Item = &'a ConstParam;
+
+    fn next(&mut self) -> Option<Self::Item> {
+        let next = match self.0.next() {
+            Some(item) => item,
+            None => return None,
+        };
+        if let GenericParam::Const(const_param) = next {
+            Some(const_param)
+        } else {
+            self.next()
+        }
+    }
+}
+
+pub struct ConstParamsMut<'a>(IterMut<'a, GenericParam>);
+
+impl<'a> Iterator for ConstParamsMut<'a> {
+    type Item = &'a mut ConstParam;
+
+    fn next(&mut self) -> Option<Self::Item> {
+        let next = match self.0.next() {
+            Some(item) => item,
+            None => return None,
+        };
+        if let GenericParam::Const(const_param) = next {
+            Some(const_param)
+        } else {
+            self.next()
+        }
+    }
+}
+
+/// Returned by `Generics::split_for_impl`.
+#[cfg(feature = "printing")]
+#[cfg_attr(
+    doc_cfg,
+    doc(cfg(all(any(feature = "full", feature = "derive"), feature = "printing")))
+)]
+pub struct ImplGenerics<'a>(&'a Generics);
+
+/// Returned by `Generics::split_for_impl`.
+#[cfg(feature = "printing")]
+#[cfg_attr(
+    doc_cfg,
+    doc(cfg(all(any(feature = "full", feature = "derive"), feature = "printing")))
+)]
+pub struct TypeGenerics<'a>(&'a Generics);
+
+/// Returned by `TypeGenerics::as_turbofish`.
+#[cfg(feature = "printing")]
+#[cfg_attr(
+    doc_cfg,
+    doc(cfg(all(any(feature = "full", feature = "derive"), feature = "printing")))
+)]
+pub struct Turbofish<'a>(&'a Generics);
+
+#[cfg(feature = "printing")]
+impl Generics {
+    /// Split a type's generics into the pieces required for impl'ing a trait
+    /// for that type.
+    ///
+    /// ```
+    /// # use proc_macro2::{Span, Ident};
+    /// # use quote::quote;
+    /// #
+    /// # let generics: syn::Generics = Default::default();
+    /// # let name = Ident::new("MyType", Span::call_site());
+    /// #
+    /// let (impl_generics, ty_generics, where_clause) = generics.split_for_impl();
+    /// quote! {
+    ///     impl #impl_generics MyTrait for #name #ty_generics #where_clause {
+    ///         // ...
+    ///     }
+    /// }
+    /// # ;
+    /// ```
+    #[cfg_attr(
+        doc_cfg,
+        doc(cfg(all(any(feature = "full", feature = "derive"), feature = "printing")))
+    )]
+    pub fn split_for_impl(&self) -> (ImplGenerics, TypeGenerics, Option<&WhereClause>) {
+        (
+            ImplGenerics(self),
+            TypeGenerics(self),
+            self.where_clause.as_ref(),
+        )
+    }
+}
+
+#[cfg(feature = "printing")]
+macro_rules! generics_wrapper_impls {
+    ($ty:ident) => {
+        #[cfg(feature = "clone-impls")]
+        #[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+        impl<'a> Clone for $ty<'a> {
+            fn clone(&self) -> Self {
+                $ty(self.0)
+            }
+        }
+
+        #[cfg(feature = "extra-traits")]
+        #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))]
+        impl<'a> Debug for $ty<'a> {
+            fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+                formatter
+                    .debug_tuple(stringify!($ty))
+                    .field(self.0)
+                    .finish()
+            }
+        }
+
+        #[cfg(feature = "extra-traits")]
+        #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))]
+        impl<'a> Eq for $ty<'a> {}
+
+        #[cfg(feature = "extra-traits")]
+        #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))]
+        impl<'a> PartialEq for $ty<'a> {
+            fn eq(&self, other: &Self) -> bool {
+                self.0 == other.0
+            }
+        }
+
+        #[cfg(feature = "extra-traits")]
+        #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))]
+        impl<'a> Hash for $ty<'a> {
+            fn hash<H: Hasher>(&self, state: &mut H) {
+                self.0.hash(state);
+            }
+        }
+    };
+}
+
+#[cfg(feature = "printing")]
+generics_wrapper_impls!(ImplGenerics);
+#[cfg(feature = "printing")]
+generics_wrapper_impls!(TypeGenerics);
+#[cfg(feature = "printing")]
+generics_wrapper_impls!(Turbofish);
+
+#[cfg(feature = "printing")]
+impl<'a> TypeGenerics<'a> {
+    /// Turn a type's generics like `<X, Y>` into a turbofish like `::<X, Y>`.
+    pub fn as_turbofish(&self) -> Turbofish {
+        Turbofish(self.0)
+    }
+}
+
+ast_struct! {
+    /// A set of bound lifetimes: `for<'a, 'b, 'c>`.
+    #[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct BoundLifetimes {
+        pub for_token: Token![for],
+        pub lt_token: Token![<],
+        pub lifetimes: Punctuated<GenericParam, Token![,]>,
+        pub gt_token: Token![>],
+    }
+}
+
+impl Default for BoundLifetimes {
+    fn default() -> Self {
+        BoundLifetimes {
+            for_token: Default::default(),
+            lt_token: Default::default(),
+            lifetimes: Punctuated::new(),
+            gt_token: Default::default(),
+        }
+    }
+}
+
+impl LifetimeParam {
+    pub fn new(lifetime: Lifetime) -> Self {
+        LifetimeParam {
+            attrs: Vec::new(),
+            lifetime,
+            colon_token: None,
+            bounds: Punctuated::new(),
+        }
+    }
+}
+
+impl From<Ident> for TypeParam {
+    fn from(ident: Ident) -> Self {
+        TypeParam {
+            attrs: vec![],
+            ident,
+            colon_token: None,
+            bounds: Punctuated::new(),
+            eq_token: None,
+            default: None,
+        }
+    }
+}
+
+ast_enum_of_structs! {
+    /// A trait or lifetime used as a bound on a type parameter.
+    #[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
+    #[non_exhaustive]
+    pub enum TypeParamBound {
+        Trait(TraitBound),
+        Lifetime(Lifetime),
+        Verbatim(TokenStream),
+    }
+}
+
+ast_struct! {
+    /// A trait used as a bound on a type parameter.
+    #[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct TraitBound {
+        pub paren_token: Option<token::Paren>,
+        pub modifier: TraitBoundModifier,
+        /// The `for<'a>` in `for<'a> Foo<&'a T>`
+        pub lifetimes: Option<BoundLifetimes>,
+        /// The `Foo<&'a T>` in `for<'a> Foo<&'a T>`
+        pub path: Path,
+    }
+}
+
+ast_enum! {
+    /// A modifier on a trait bound, currently only used for the `?` in
+    /// `?Sized`.
+    #[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub enum TraitBoundModifier {
+        None,
+        Maybe(Token![?]),
+    }
+}
+
+ast_struct! {
+    /// A `where` clause in a definition: `where T: Deserialize<'de>, D:
+    /// 'static`.
+    #[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct WhereClause {
+        pub where_token: Token![where],
+        pub predicates: Punctuated<WherePredicate, Token![,]>,
+    }
+}
+
+ast_enum_of_structs! {
+    /// A single predicate in a `where` clause: `T: Deserialize<'de>`.
+    ///
+    /// # Syntax tree enum
+    ///
+    /// This type is a [syntax tree enum].
+    ///
+    /// [syntax tree enum]: crate::expr::Expr#syntax-tree-enums
+    #[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
+    #[non_exhaustive]
+    pub enum WherePredicate {
+        /// A lifetime predicate in a `where` clause: `'a: 'b + 'c`.
+        Lifetime(PredicateLifetime),
+
+        /// A type predicate in a `where` clause: `for<'c> Foo<'c>: Trait<'c>`.
+        Type(PredicateType),
+    }
+}
+
+ast_struct! {
+    /// A lifetime predicate in a `where` clause: `'a: 'b + 'c`.
+    #[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct PredicateLifetime {
+        pub lifetime: Lifetime,
+        pub colon_token: Token![:],
+        pub bounds: Punctuated<Lifetime, Token![+]>,
+    }
+}
+
+ast_struct! {
+    /// A type predicate in a `where` clause: `for<'c> Foo<'c>: Trait<'c>`.
+    #[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct PredicateType {
+        /// Any lifetimes from a `for` binding
+        pub lifetimes: Option<BoundLifetimes>,
+        /// The type being bounded
+        pub bounded_ty: Type,
+        pub colon_token: Token![:],
+        /// Trait and lifetime bounds (`Clone+Send+'static`)
+        pub bounds: Punctuated<TypeParamBound, Token![+]>,
+    }
+}
+
+#[cfg(feature = "parsing")]
+pub(crate) mod parsing {
+    use crate::attr::Attribute;
+    use crate::error::Result;
+    use crate::ext::IdentExt as _;
+    use crate::generics::{
+        BoundLifetimes, ConstParam, GenericParam, Generics, LifetimeParam, PredicateLifetime,
+        PredicateType, TraitBound, TraitBoundModifier, TypeParam, TypeParamBound, WhereClause,
+        WherePredicate,
+    };
+    use crate::ident::Ident;
+    use crate::lifetime::Lifetime;
+    use crate::parse::{Parse, ParseStream};
+    use crate::path::{self, ParenthesizedGenericArguments, Path, PathArguments};
+    use crate::punctuated::Punctuated;
+    use crate::token;
+    use crate::ty::Type;
+    use crate::verbatim;
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for Generics {
+        fn parse(input: ParseStream) -> Result<Self> {
+            if !input.peek(Token![<]) {
+                return Ok(Generics::default());
+            }
+
+            let lt_token: Token![<] = input.parse()?;
+
+            let mut params = Punctuated::new();
+            loop {
+                if input.peek(Token![>]) {
+                    break;
+                }
+
+                let attrs = input.call(Attribute::parse_outer)?;
+                let lookahead = input.lookahead1();
+                if lookahead.peek(Lifetime) {
+                    params.push_value(GenericParam::Lifetime(LifetimeParam {
+                        attrs,
+                        ..input.parse()?
+                    }));
+                } else if lookahead.peek(Ident) {
+                    params.push_value(GenericParam::Type(TypeParam {
+                        attrs,
+                        ..input.parse()?
+                    }));
+                } else if lookahead.peek(Token![const]) {
+                    params.push_value(GenericParam::Const(ConstParam {
+                        attrs,
+                        ..input.parse()?
+                    }));
+                } else if input.peek(Token![_]) {
+                    params.push_value(GenericParam::Type(TypeParam {
+                        attrs,
+                        ident: input.call(Ident::parse_any)?,
+                        colon_token: None,
+                        bounds: Punctuated::new(),
+                        eq_token: None,
+                        default: None,
+                    }));
+                } else {
+                    return Err(lookahead.error());
+                }
+
+                if input.peek(Token![>]) {
+                    break;
+                }
+                let punct = input.parse()?;
+                params.push_punct(punct);
+            }
+
+            let gt_token: Token![>] = input.parse()?;
+
+            Ok(Generics {
+                lt_token: Some(lt_token),
+                params,
+                gt_token: Some(gt_token),
+                where_clause: None,
+            })
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for GenericParam {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let attrs = input.call(Attribute::parse_outer)?;
+
+            let lookahead = input.lookahead1();
+            if lookahead.peek(Ident) {
+                Ok(GenericParam::Type(TypeParam {
+                    attrs,
+                    ..input.parse()?
+                }))
+            } else if lookahead.peek(Lifetime) {
+                Ok(GenericParam::Lifetime(LifetimeParam {
+                    attrs,
+                    ..input.parse()?
+                }))
+            } else if lookahead.peek(Token![const]) {
+                Ok(GenericParam::Const(ConstParam {
+                    attrs,
+                    ..input.parse()?
+                }))
+            } else {
+                Err(lookahead.error())
+            }
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for LifetimeParam {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let has_colon;
+            Ok(LifetimeParam {
+                attrs: input.call(Attribute::parse_outer)?,
+                lifetime: input.parse()?,
+                colon_token: {
+                    if input.peek(Token![:]) {
+                        has_colon = true;
+                        Some(input.parse()?)
+                    } else {
+                        has_colon = false;
+                        None
+                    }
+                },
+                bounds: {
+                    let mut bounds = Punctuated::new();
+                    if has_colon {
+                        loop {
+                            if input.peek(Token![,]) || input.peek(Token![>]) {
+                                break;
+                            }
+                            let value = input.parse()?;
+                            bounds.push_value(value);
+                            if !input.peek(Token![+]) {
+                                break;
+                            }
+                            let punct = input.parse()?;
+                            bounds.push_punct(punct);
+                        }
+                    }
+                    bounds
+                },
+            })
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for BoundLifetimes {
+        fn parse(input: ParseStream) -> Result<Self> {
+            Ok(BoundLifetimes {
+                for_token: input.parse()?,
+                lt_token: input.parse()?,
+                lifetimes: {
+                    let mut lifetimes = Punctuated::new();
+                    while !input.peek(Token![>]) {
+                        let attrs = input.call(Attribute::parse_outer)?;
+                        let lifetime: Lifetime = input.parse()?;
+                        lifetimes.push_value(GenericParam::Lifetime(LifetimeParam {
+                            attrs,
+                            lifetime,
+                            colon_token: None,
+                            bounds: Punctuated::new(),
+                        }));
+                        if input.peek(Token![>]) {
+                            break;
+                        }
+                        lifetimes.push_punct(input.parse()?);
+                    }
+                    lifetimes
+                },
+                gt_token: input.parse()?,
+            })
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for Option<BoundLifetimes> {
+        fn parse(input: ParseStream) -> Result<Self> {
+            if input.peek(Token![for]) {
+                input.parse().map(Some)
+            } else {
+                Ok(None)
+            }
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for TypeParam {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let attrs = input.call(Attribute::parse_outer)?;
+            let ident: Ident = input.parse()?;
+            let colon_token: Option<Token![:]> = input.parse()?;
+
+            let mut bounds = Punctuated::new();
+            if colon_token.is_some() {
+                loop {
+                    if input.peek(Token![,]) || input.peek(Token![>]) || input.peek(Token![=]) {
+                        break;
+                    }
+                    let value: TypeParamBound = input.parse()?;
+                    bounds.push_value(value);
+                    if !input.peek(Token![+]) {
+                        break;
+                    }
+                    let punct: Token![+] = input.parse()?;
+                    bounds.push_punct(punct);
+                }
+            }
+
+            let eq_token: Option<Token![=]> = input.parse()?;
+            let default = if eq_token.is_some() {
+                Some(input.parse::<Type>()?)
+            } else {
+                None
+            };
+
+            Ok(TypeParam {
+                attrs,
+                ident,
+                colon_token,
+                bounds,
+                eq_token,
+                default,
+            })
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for TypeParamBound {
+        fn parse(input: ParseStream) -> Result<Self> {
+            if input.peek(Lifetime) {
+                return input.parse().map(TypeParamBound::Lifetime);
+            }
+
+            let begin = input.fork();
+
+            let content;
+            let (paren_token, content) = if input.peek(token::Paren) {
+                (Some(parenthesized!(content in input)), &content)
+            } else {
+                (None, input)
+            };
+
+            let is_tilde_const =
+                cfg!(feature = "full") && content.peek(Token![~]) && content.peek2(Token![const]);
+            if is_tilde_const {
+                content.parse::<Token![~]>()?;
+                content.parse::<Token![const]>()?;
+            }
+
+            let mut bound: TraitBound = content.parse()?;
+            bound.paren_token = paren_token;
+
+            if is_tilde_const {
+                Ok(TypeParamBound::Verbatim(verbatim::between(&begin, input)))
+            } else {
+                Ok(TypeParamBound::Trait(bound))
+            }
+        }
+    }
+
+    impl TypeParamBound {
+        pub(crate) fn parse_multiple(
+            input: ParseStream,
+            allow_plus: bool,
+        ) -> Result<Punctuated<Self, Token![+]>> {
+            let mut bounds = Punctuated::new();
+            loop {
+                bounds.push_value(input.parse()?);
+                if !(allow_plus && input.peek(Token![+])) {
+                    break;
+                }
+                bounds.push_punct(input.parse()?);
+                if !(input.peek(Ident::peek_any)
+                    || input.peek(Token![::])
+                    || input.peek(Token![?])
+                    || input.peek(Lifetime)
+                    || input.peek(token::Paren)
+                    || input.peek(Token![~]))
+                {
+                    break;
+                }
+            }
+            Ok(bounds)
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for TraitBound {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let modifier: TraitBoundModifier = input.parse()?;
+            let lifetimes: Option<BoundLifetimes> = input.parse()?;
+
+            let mut path: Path = input.parse()?;
+            if path.segments.last().unwrap().arguments.is_empty()
+                && (input.peek(token::Paren) || input.peek(Token![::]) && input.peek3(token::Paren))
+            {
+                input.parse::<Option<Token![::]>>()?;
+                let args: ParenthesizedGenericArguments = input.parse()?;
+                let parenthesized = PathArguments::Parenthesized(args);
+                path.segments.last_mut().unwrap().arguments = parenthesized;
+            }
+
+            Ok(TraitBound {
+                paren_token: None,
+                modifier,
+                lifetimes,
+                path,
+            })
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for TraitBoundModifier {
+        fn parse(input: ParseStream) -> Result<Self> {
+            if input.peek(Token![?]) {
+                input.parse().map(TraitBoundModifier::Maybe)
+            } else {
+                Ok(TraitBoundModifier::None)
+            }
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for ConstParam {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let mut default = None;
+            Ok(ConstParam {
+                attrs: input.call(Attribute::parse_outer)?,
+                const_token: input.parse()?,
+                ident: input.parse()?,
+                colon_token: input.parse()?,
+                ty: input.parse()?,
+                eq_token: {
+                    if input.peek(Token![=]) {
+                        let eq_token = input.parse()?;
+                        default = Some(path::parsing::const_argument(input)?);
+                        Some(eq_token)
+                    } else {
+                        None
+                    }
+                },
+                default,
+            })
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for WhereClause {
+        fn parse(input: ParseStream) -> Result<Self> {
+            Ok(WhereClause {
+                where_token: input.parse()?,
+                predicates: {
+                    let mut predicates = Punctuated::new();
+                    loop {
+                        if input.is_empty()
+                            || input.peek(token::Brace)
+                            || input.peek(Token![,])
+                            || input.peek(Token![;])
+                            || input.peek(Token![:]) && !input.peek(Token![::])
+                            || input.peek(Token![=])
+                        {
+                            break;
+                        }
+                        let value = input.parse()?;
+                        predicates.push_value(value);
+                        if !input.peek(Token![,]) {
+                            break;
+                        }
+                        let punct = input.parse()?;
+                        predicates.push_punct(punct);
+                    }
+                    predicates
+                },
+            })
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for Option<WhereClause> {
+        fn parse(input: ParseStream) -> Result<Self> {
+            if input.peek(Token![where]) {
+                input.parse().map(Some)
+            } else {
+                Ok(None)
+            }
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for WherePredicate {
+        fn parse(input: ParseStream) -> Result<Self> {
+            if input.peek(Lifetime) && input.peek2(Token![:]) {
+                Ok(WherePredicate::Lifetime(PredicateLifetime {
+                    lifetime: input.parse()?,
+                    colon_token: input.parse()?,
+                    bounds: {
+                        let mut bounds = Punctuated::new();
+                        loop {
+                            if input.is_empty()
+                                || input.peek(token::Brace)
+                                || input.peek(Token![,])
+                                || input.peek(Token![;])
+                                || input.peek(Token![:])
+                                || input.peek(Token![=])
+                            {
+                                break;
+                            }
+                            let value = input.parse()?;
+                            bounds.push_value(value);
+                            if !input.peek(Token![+]) {
+                                break;
+                            }
+                            let punct = input.parse()?;
+                            bounds.push_punct(punct);
+                        }
+                        bounds
+                    },
+                }))
+            } else {
+                Ok(WherePredicate::Type(PredicateType {
+                    lifetimes: input.parse()?,
+                    bounded_ty: input.parse()?,
+                    colon_token: input.parse()?,
+                    bounds: {
+                        let mut bounds = Punctuated::new();
+                        loop {
+                            if input.is_empty()
+                                || input.peek(token::Brace)
+                                || input.peek(Token![,])
+                                || input.peek(Token![;])
+                                || input.peek(Token![:]) && !input.peek(Token![::])
+                                || input.peek(Token![=])
+                            {
+                                break;
+                            }
+                            let value = input.parse()?;
+                            bounds.push_value(value);
+                            if !input.peek(Token![+]) {
+                                break;
+                            }
+                            let punct = input.parse()?;
+                            bounds.push_punct(punct);
+                        }
+                        bounds
+                    },
+                }))
+            }
+        }
+    }
+}
+
+#[cfg(feature = "printing")]
+mod printing {
+    use crate::attr::FilterAttrs;
+    use crate::generics::{
+        BoundLifetimes, ConstParam, GenericParam, Generics, ImplGenerics, LifetimeParam,
+        PredicateLifetime, PredicateType, TraitBound, TraitBoundModifier, Turbofish, TypeGenerics,
+        TypeParam, WhereClause,
+    };
+    use crate::print::TokensOrDefault;
+    use proc_macro2::TokenStream;
+    use quote::{ToTokens, TokenStreamExt};
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for Generics {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            if self.params.is_empty() {
+                return;
+            }
+
+            TokensOrDefault(&self.lt_token).to_tokens(tokens);
+
+            // Print lifetimes before types and consts, regardless of their
+            // order in self.params.
+            let mut trailing_or_empty = true;
+            for param in self.params.pairs() {
+                if let GenericParam::Lifetime(_) = **param.value() {
+                    param.to_tokens(tokens);
+                    trailing_or_empty = param.punct().is_some();
+                }
+            }
+            for param in self.params.pairs() {
+                match param.value() {
+                    GenericParam::Type(_) | GenericParam::Const(_) => {
+                        if !trailing_or_empty {
+                            <Token![,]>::default().to_tokens(tokens);
+                            trailing_or_empty = true;
+                        }
+                        param.to_tokens(tokens);
+                    }
+                    GenericParam::Lifetime(_) => {}
+                }
+            }
+
+            TokensOrDefault(&self.gt_token).to_tokens(tokens);
+        }
+    }
+
+    impl<'a> ToTokens for ImplGenerics<'a> {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            if self.0.params.is_empty() {
+                return;
+            }
+
+            TokensOrDefault(&self.0.lt_token).to_tokens(tokens);
+
+            // Print lifetimes before types and consts, regardless of their
+            // order in self.params.
+            let mut trailing_or_empty = true;
+            for param in self.0.params.pairs() {
+                if let GenericParam::Lifetime(_) = **param.value() {
+                    param.to_tokens(tokens);
+                    trailing_or_empty = param.punct().is_some();
+                }
+            }
+            for param in self.0.params.pairs() {
+                if let GenericParam::Lifetime(_) = **param.value() {
+                    continue;
+                }
+                if !trailing_or_empty {
+                    <Token![,]>::default().to_tokens(tokens);
+                    trailing_or_empty = true;
+                }
+                match param.value() {
+                    GenericParam::Lifetime(_) => unreachable!(),
+                    GenericParam::Type(param) => {
+                        // Leave off the type parameter defaults
+                        tokens.append_all(param.attrs.outer());
+                        param.ident.to_tokens(tokens);
+                        if !param.bounds.is_empty() {
+                            TokensOrDefault(&param.colon_token).to_tokens(tokens);
+                            param.bounds.to_tokens(tokens);
+                        }
+                    }
+                    GenericParam::Const(param) => {
+                        // Leave off the const parameter defaults
+                        tokens.append_all(param.attrs.outer());
+                        param.const_token.to_tokens(tokens);
+                        param.ident.to_tokens(tokens);
+                        param.colon_token.to_tokens(tokens);
+                        param.ty.to_tokens(tokens);
+                    }
+                }
+                param.punct().to_tokens(tokens);
+            }
+
+            TokensOrDefault(&self.0.gt_token).to_tokens(tokens);
+        }
+    }
+
+    impl<'a> ToTokens for TypeGenerics<'a> {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            if self.0.params.is_empty() {
+                return;
+            }
+
+            TokensOrDefault(&self.0.lt_token).to_tokens(tokens);
+
+            // Print lifetimes before types and consts, regardless of their
+            // order in self.params.
+            let mut trailing_or_empty = true;
+            for param in self.0.params.pairs() {
+                if let GenericParam::Lifetime(def) = *param.value() {
+                    // Leave off the lifetime bounds and attributes
+                    def.lifetime.to_tokens(tokens);
+                    param.punct().to_tokens(tokens);
+                    trailing_or_empty = param.punct().is_some();
+                }
+            }
+            for param in self.0.params.pairs() {
+                if let GenericParam::Lifetime(_) = **param.value() {
+                    continue;
+                }
+                if !trailing_or_empty {
+                    <Token![,]>::default().to_tokens(tokens);
+                    trailing_or_empty = true;
+                }
+                match param.value() {
+                    GenericParam::Lifetime(_) => unreachable!(),
+                    GenericParam::Type(param) => {
+                        // Leave off the type parameter defaults
+                        param.ident.to_tokens(tokens);
+                    }
+                    GenericParam::Const(param) => {
+                        // Leave off the const parameter defaults
+                        param.ident.to_tokens(tokens);
+                    }
+                }
+                param.punct().to_tokens(tokens);
+            }
+
+            TokensOrDefault(&self.0.gt_token).to_tokens(tokens);
+        }
+    }
+
+    impl<'a> ToTokens for Turbofish<'a> {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            if !self.0.params.is_empty() {
+                <Token![::]>::default().to_tokens(tokens);
+                TypeGenerics(self.0).to_tokens(tokens);
+            }
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for BoundLifetimes {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.for_token.to_tokens(tokens);
+            self.lt_token.to_tokens(tokens);
+            self.lifetimes.to_tokens(tokens);
+            self.gt_token.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for LifetimeParam {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            self.lifetime.to_tokens(tokens);
+            if !self.bounds.is_empty() {
+                TokensOrDefault(&self.colon_token).to_tokens(tokens);
+                self.bounds.to_tokens(tokens);
+            }
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for TypeParam {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            self.ident.to_tokens(tokens);
+            if !self.bounds.is_empty() {
+                TokensOrDefault(&self.colon_token).to_tokens(tokens);
+                self.bounds.to_tokens(tokens);
+            }
+            if let Some(default) = &self.default {
+                TokensOrDefault(&self.eq_token).to_tokens(tokens);
+                default.to_tokens(tokens);
+            }
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for TraitBound {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            let to_tokens = |tokens: &mut TokenStream| {
+                self.modifier.to_tokens(tokens);
+                self.lifetimes.to_tokens(tokens);
+                self.path.to_tokens(tokens);
+            };
+            match &self.paren_token {
+                Some(paren) => paren.surround(tokens, to_tokens),
+                None => to_tokens(tokens),
+            }
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for TraitBoundModifier {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            match self {
+                TraitBoundModifier::None => {}
+                TraitBoundModifier::Maybe(t) => t.to_tokens(tokens),
+            }
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for ConstParam {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            self.const_token.to_tokens(tokens);
+            self.ident.to_tokens(tokens);
+            self.colon_token.to_tokens(tokens);
+            self.ty.to_tokens(tokens);
+            if let Some(default) = &self.default {
+                TokensOrDefault(&self.eq_token).to_tokens(tokens);
+                default.to_tokens(tokens);
+            }
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for WhereClause {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            if !self.predicates.is_empty() {
+                self.where_token.to_tokens(tokens);
+                self.predicates.to_tokens(tokens);
+            }
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for PredicateLifetime {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.lifetime.to_tokens(tokens);
+            self.colon_token.to_tokens(tokens);
+            self.bounds.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for PredicateType {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.lifetimes.to_tokens(tokens);
+            self.bounded_ty.to_tokens(tokens);
+            self.colon_token.to_tokens(tokens);
+            self.bounds.to_tokens(tokens);
+        }
+    }
+}
+
\ No newline at end of file diff --git a/src/syn/group.rs.html b/src/syn/group.rs.html new file mode 100644 index 0000000..f7d9af5 --- /dev/null +++ b/src/syn/group.rs.html @@ -0,0 +1,583 @@ +group.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+
use crate::error::Result;
+use crate::parse::ParseBuffer;
+use crate::token;
+use proc_macro2::extra::DelimSpan;
+use proc_macro2::Delimiter;
+
+// Not public API.
+#[doc(hidden)]
+pub struct Parens<'a> {
+    #[doc(hidden)]
+    pub token: token::Paren,
+    #[doc(hidden)]
+    pub content: ParseBuffer<'a>,
+}
+
+// Not public API.
+#[doc(hidden)]
+pub struct Braces<'a> {
+    #[doc(hidden)]
+    pub token: token::Brace,
+    #[doc(hidden)]
+    pub content: ParseBuffer<'a>,
+}
+
+// Not public API.
+#[doc(hidden)]
+pub struct Brackets<'a> {
+    #[doc(hidden)]
+    pub token: token::Bracket,
+    #[doc(hidden)]
+    pub content: ParseBuffer<'a>,
+}
+
+// Not public API.
+#[cfg(any(feature = "full", feature = "derive"))]
+#[doc(hidden)]
+pub struct Group<'a> {
+    #[doc(hidden)]
+    pub token: token::Group,
+    #[doc(hidden)]
+    pub content: ParseBuffer<'a>,
+}
+
+// Not public API.
+#[doc(hidden)]
+pub fn parse_parens<'a>(input: &ParseBuffer<'a>) -> Result<Parens<'a>> {
+    parse_delimited(input, Delimiter::Parenthesis).map(|(span, content)| Parens {
+        token: token::Paren(span),
+        content,
+    })
+}
+
+// Not public API.
+#[doc(hidden)]
+pub fn parse_braces<'a>(input: &ParseBuffer<'a>) -> Result<Braces<'a>> {
+    parse_delimited(input, Delimiter::Brace).map(|(span, content)| Braces {
+        token: token::Brace(span),
+        content,
+    })
+}
+
+// Not public API.
+#[doc(hidden)]
+pub fn parse_brackets<'a>(input: &ParseBuffer<'a>) -> Result<Brackets<'a>> {
+    parse_delimited(input, Delimiter::Bracket).map(|(span, content)| Brackets {
+        token: token::Bracket(span),
+        content,
+    })
+}
+
+#[cfg(any(feature = "full", feature = "derive"))]
+pub(crate) fn parse_group<'a>(input: &ParseBuffer<'a>) -> Result<Group<'a>> {
+    parse_delimited(input, Delimiter::None).map(|(span, content)| Group {
+        token: token::Group(span.join()),
+        content,
+    })
+}
+
+fn parse_delimited<'a>(
+    input: &ParseBuffer<'a>,
+    delimiter: Delimiter,
+) -> Result<(DelimSpan, ParseBuffer<'a>)> {
+    input.step(|cursor| {
+        if let Some((content, span, rest)) = cursor.group(delimiter) {
+            let scope = crate::buffer::close_span_of_group(*cursor);
+            let nested = crate::parse::advance_step_cursor(cursor, content);
+            let unexpected = crate::parse::get_unexpected(input);
+            let content = crate::parse::new_parse_buffer(scope, nested, unexpected);
+            Ok(((span, content), rest))
+        } else {
+            let message = match delimiter {
+                Delimiter::Parenthesis => "expected parentheses",
+                Delimiter::Brace => "expected curly braces",
+                Delimiter::Bracket => "expected square brackets",
+                Delimiter::None => "expected invisible group",
+            };
+            Err(cursor.error(message))
+        }
+    })
+}
+
+/// Parse a set of parentheses and expose their content to subsequent parsers.
+///
+/// # Example
+///
+/// ```
+/// # use quote::quote;
+/// #
+/// use syn::{parenthesized, token, Ident, Result, Token, Type};
+/// use syn::parse::{Parse, ParseStream};
+/// use syn::punctuated::Punctuated;
+///
+/// // Parse a simplified tuple struct syntax like:
+/// //
+/// //     struct S(A, B);
+/// struct TupleStruct {
+///     struct_token: Token![struct],
+///     ident: Ident,
+///     paren_token: token::Paren,
+///     fields: Punctuated<Type, Token![,]>,
+///     semi_token: Token![;],
+/// }
+///
+/// impl Parse for TupleStruct {
+///     fn parse(input: ParseStream) -> Result<Self> {
+///         let content;
+///         Ok(TupleStruct {
+///             struct_token: input.parse()?,
+///             ident: input.parse()?,
+///             paren_token: parenthesized!(content in input),
+///             fields: content.parse_terminated(Type::parse, Token![,])?,
+///             semi_token: input.parse()?,
+///         })
+///     }
+/// }
+/// #
+/// # fn main() {
+/// #     let input = quote! {
+/// #         struct S(A, B);
+/// #     };
+/// #     syn::parse2::<TupleStruct>(input).unwrap();
+/// # }
+/// ```
+#[macro_export]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+macro_rules! parenthesized {
+    ($content:ident in $cursor:expr) => {
+        match $crate::__private::parse_parens(&$cursor) {
+            $crate::__private::Ok(parens) => {
+                $content = parens.content;
+                parens.token
+            }
+            $crate::__private::Err(error) => {
+                return $crate::__private::Err(error);
+            }
+        }
+    };
+}
+
+/// Parse a set of curly braces and expose their content to subsequent parsers.
+///
+/// # Example
+///
+/// ```
+/// # use quote::quote;
+/// #
+/// use syn::{braced, token, Ident, Result, Token, Type};
+/// use syn::parse::{Parse, ParseStream};
+/// use syn::punctuated::Punctuated;
+///
+/// // Parse a simplified struct syntax like:
+/// //
+/// //     struct S {
+/// //         a: A,
+/// //         b: B,
+/// //     }
+/// struct Struct {
+///     struct_token: Token![struct],
+///     ident: Ident,
+///     brace_token: token::Brace,
+///     fields: Punctuated<Field, Token![,]>,
+/// }
+///
+/// struct Field {
+///     name: Ident,
+///     colon_token: Token![:],
+///     ty: Type,
+/// }
+///
+/// impl Parse for Struct {
+///     fn parse(input: ParseStream) -> Result<Self> {
+///         let content;
+///         Ok(Struct {
+///             struct_token: input.parse()?,
+///             ident: input.parse()?,
+///             brace_token: braced!(content in input),
+///             fields: content.parse_terminated(Field::parse, Token![,])?,
+///         })
+///     }
+/// }
+///
+/// impl Parse for Field {
+///     fn parse(input: ParseStream) -> Result<Self> {
+///         Ok(Field {
+///             name: input.parse()?,
+///             colon_token: input.parse()?,
+///             ty: input.parse()?,
+///         })
+///     }
+/// }
+/// #
+/// # fn main() {
+/// #     let input = quote! {
+/// #         struct S {
+/// #             a: A,
+/// #             b: B,
+/// #         }
+/// #     };
+/// #     syn::parse2::<Struct>(input).unwrap();
+/// # }
+/// ```
+#[macro_export]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+macro_rules! braced {
+    ($content:ident in $cursor:expr) => {
+        match $crate::__private::parse_braces(&$cursor) {
+            $crate::__private::Ok(braces) => {
+                $content = braces.content;
+                braces.token
+            }
+            $crate::__private::Err(error) => {
+                return $crate::__private::Err(error);
+            }
+        }
+    };
+}
+
+/// Parse a set of square brackets and expose their content to subsequent
+/// parsers.
+///
+/// # Example
+///
+/// ```
+/// # use quote::quote;
+/// #
+/// use proc_macro2::TokenStream;
+/// use syn::{bracketed, token, Result, Token};
+/// use syn::parse::{Parse, ParseStream};
+///
+/// // Parse an outer attribute like:
+/// //
+/// //     #[repr(C, packed)]
+/// struct OuterAttribute {
+///     pound_token: Token![#],
+///     bracket_token: token::Bracket,
+///     content: TokenStream,
+/// }
+///
+/// impl Parse for OuterAttribute {
+///     fn parse(input: ParseStream) -> Result<Self> {
+///         let content;
+///         Ok(OuterAttribute {
+///             pound_token: input.parse()?,
+///             bracket_token: bracketed!(content in input),
+///             content: content.parse()?,
+///         })
+///     }
+/// }
+/// #
+/// # fn main() {
+/// #     let input = quote! {
+/// #         #[repr(C, packed)]
+/// #     };
+/// #     syn::parse2::<OuterAttribute>(input).unwrap();
+/// # }
+/// ```
+#[macro_export]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+macro_rules! bracketed {
+    ($content:ident in $cursor:expr) => {
+        match $crate::__private::parse_brackets(&$cursor) {
+            $crate::__private::Ok(brackets) => {
+                $content = brackets.content;
+                brackets.token
+            }
+            $crate::__private::Err(error) => {
+                return $crate::__private::Err(error);
+            }
+        }
+    };
+}
+
\ No newline at end of file diff --git a/src/syn/ident.rs.html b/src/syn/ident.rs.html new file mode 100644 index 0000000..1390a33 --- /dev/null +++ b/src/syn/ident.rs.html @@ -0,0 +1,217 @@ +ident.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+
#[cfg(feature = "parsing")]
+use crate::lookahead;
+
+pub use proc_macro2::Ident;
+
+#[cfg(feature = "parsing")]
+pub_if_not_doc! {
+    #[doc(hidden)]
+    #[allow(non_snake_case)]
+    pub fn Ident(marker: lookahead::TokenMarker) -> Ident {
+        match marker {}
+    }
+}
+
+macro_rules! ident_from_token {
+    ($token:ident) => {
+        impl From<Token![$token]> for Ident {
+            fn from(token: Token![$token]) -> Ident {
+                Ident::new(stringify!($token), token.span)
+            }
+        }
+    };
+}
+
+ident_from_token!(self);
+ident_from_token!(Self);
+ident_from_token!(super);
+ident_from_token!(crate);
+ident_from_token!(extern);
+
+impl From<Token![_]> for Ident {
+    fn from(token: Token![_]) -> Ident {
+        Ident::new("_", token.span)
+    }
+}
+
+pub(crate) fn xid_ok(symbol: &str) -> bool {
+    let mut chars = symbol.chars();
+    let first = chars.next().unwrap();
+    if !(first == '_' || unicode_ident::is_xid_start(first)) {
+        return false;
+    }
+    for ch in chars {
+        if !unicode_ident::is_xid_continue(ch) {
+            return false;
+        }
+    }
+    true
+}
+
+#[cfg(feature = "parsing")]
+mod parsing {
+    use crate::buffer::Cursor;
+    use crate::error::Result;
+    use crate::parse::{Parse, ParseStream};
+    use crate::token::Token;
+    use proc_macro2::Ident;
+
+    fn accept_as_ident(ident: &Ident) -> bool {
+        match ident.to_string().as_str() {
+            "_" |
+            // Based on https://doc.rust-lang.org/1.65.0/reference/keywords.html
+            "abstract" | "as" | "async" | "await" | "become" | "box" | "break" |
+            "const" | "continue" | "crate" | "do" | "dyn" | "else" | "enum" |
+            "extern" | "false" | "final" | "fn" | "for" | "if" | "impl" | "in" |
+            "let" | "loop" | "macro" | "match" | "mod" | "move" | "mut" |
+            "override" | "priv" | "pub" | "ref" | "return" | "Self" | "self" |
+            "static" | "struct" | "super" | "trait" | "true" | "try" | "type" |
+            "typeof" | "unsafe" | "unsized" | "use" | "virtual" | "where" |
+            "while" | "yield" => false,
+            _ => true,
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for Ident {
+        fn parse(input: ParseStream) -> Result<Self> {
+            input.step(|cursor| {
+                if let Some((ident, rest)) = cursor.ident() {
+                    if accept_as_ident(&ident) {
+                        Ok((ident, rest))
+                    } else {
+                        Err(cursor.error(format_args!(
+                            "expected identifier, found keyword `{}`",
+                            ident,
+                        )))
+                    }
+                } else {
+                    Err(cursor.error("expected identifier"))
+                }
+            })
+        }
+    }
+
+    impl Token for Ident {
+        fn peek(cursor: Cursor) -> bool {
+            if let Some((ident, _rest)) = cursor.ident() {
+                accept_as_ident(&ident)
+            } else {
+                false
+            }
+        }
+
+        fn display() -> &'static str {
+            "identifier"
+        }
+    }
+}
+
\ No newline at end of file diff --git a/src/syn/item.rs.html b/src/syn/item.rs.html new file mode 100644 index 0000000..e5ad2e6 --- /dev/null +++ b/src/syn/item.rs.html @@ -0,0 +1,6901 @@ +item.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+753
+754
+755
+756
+757
+758
+759
+760
+761
+762
+763
+764
+765
+766
+767
+768
+769
+770
+771
+772
+773
+774
+775
+776
+777
+778
+779
+780
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+794
+795
+796
+797
+798
+799
+800
+801
+802
+803
+804
+805
+806
+807
+808
+809
+810
+811
+812
+813
+814
+815
+816
+817
+818
+819
+820
+821
+822
+823
+824
+825
+826
+827
+828
+829
+830
+831
+832
+833
+834
+835
+836
+837
+838
+839
+840
+841
+842
+843
+844
+845
+846
+847
+848
+849
+850
+851
+852
+853
+854
+855
+856
+857
+858
+859
+860
+861
+862
+863
+864
+865
+866
+867
+868
+869
+870
+871
+872
+873
+874
+875
+876
+877
+878
+879
+880
+881
+882
+883
+884
+885
+886
+887
+888
+889
+890
+891
+892
+893
+894
+895
+896
+897
+898
+899
+900
+901
+902
+903
+904
+905
+906
+907
+908
+909
+910
+911
+912
+913
+914
+915
+916
+917
+918
+919
+920
+921
+922
+923
+924
+925
+926
+927
+928
+929
+930
+931
+932
+933
+934
+935
+936
+937
+938
+939
+940
+941
+942
+943
+944
+945
+946
+947
+948
+949
+950
+951
+952
+953
+954
+955
+956
+957
+958
+959
+960
+961
+962
+963
+964
+965
+966
+967
+968
+969
+970
+971
+972
+973
+974
+975
+976
+977
+978
+979
+980
+981
+982
+983
+984
+985
+986
+987
+988
+989
+990
+991
+992
+993
+994
+995
+996
+997
+998
+999
+1000
+1001
+1002
+1003
+1004
+1005
+1006
+1007
+1008
+1009
+1010
+1011
+1012
+1013
+1014
+1015
+1016
+1017
+1018
+1019
+1020
+1021
+1022
+1023
+1024
+1025
+1026
+1027
+1028
+1029
+1030
+1031
+1032
+1033
+1034
+1035
+1036
+1037
+1038
+1039
+1040
+1041
+1042
+1043
+1044
+1045
+1046
+1047
+1048
+1049
+1050
+1051
+1052
+1053
+1054
+1055
+1056
+1057
+1058
+1059
+1060
+1061
+1062
+1063
+1064
+1065
+1066
+1067
+1068
+1069
+1070
+1071
+1072
+1073
+1074
+1075
+1076
+1077
+1078
+1079
+1080
+1081
+1082
+1083
+1084
+1085
+1086
+1087
+1088
+1089
+1090
+1091
+1092
+1093
+1094
+1095
+1096
+1097
+1098
+1099
+1100
+1101
+1102
+1103
+1104
+1105
+1106
+1107
+1108
+1109
+1110
+1111
+1112
+1113
+1114
+1115
+1116
+1117
+1118
+1119
+1120
+1121
+1122
+1123
+1124
+1125
+1126
+1127
+1128
+1129
+1130
+1131
+1132
+1133
+1134
+1135
+1136
+1137
+1138
+1139
+1140
+1141
+1142
+1143
+1144
+1145
+1146
+1147
+1148
+1149
+1150
+1151
+1152
+1153
+1154
+1155
+1156
+1157
+1158
+1159
+1160
+1161
+1162
+1163
+1164
+1165
+1166
+1167
+1168
+1169
+1170
+1171
+1172
+1173
+1174
+1175
+1176
+1177
+1178
+1179
+1180
+1181
+1182
+1183
+1184
+1185
+1186
+1187
+1188
+1189
+1190
+1191
+1192
+1193
+1194
+1195
+1196
+1197
+1198
+1199
+1200
+1201
+1202
+1203
+1204
+1205
+1206
+1207
+1208
+1209
+1210
+1211
+1212
+1213
+1214
+1215
+1216
+1217
+1218
+1219
+1220
+1221
+1222
+1223
+1224
+1225
+1226
+1227
+1228
+1229
+1230
+1231
+1232
+1233
+1234
+1235
+1236
+1237
+1238
+1239
+1240
+1241
+1242
+1243
+1244
+1245
+1246
+1247
+1248
+1249
+1250
+1251
+1252
+1253
+1254
+1255
+1256
+1257
+1258
+1259
+1260
+1261
+1262
+1263
+1264
+1265
+1266
+1267
+1268
+1269
+1270
+1271
+1272
+1273
+1274
+1275
+1276
+1277
+1278
+1279
+1280
+1281
+1282
+1283
+1284
+1285
+1286
+1287
+1288
+1289
+1290
+1291
+1292
+1293
+1294
+1295
+1296
+1297
+1298
+1299
+1300
+1301
+1302
+1303
+1304
+1305
+1306
+1307
+1308
+1309
+1310
+1311
+1312
+1313
+1314
+1315
+1316
+1317
+1318
+1319
+1320
+1321
+1322
+1323
+1324
+1325
+1326
+1327
+1328
+1329
+1330
+1331
+1332
+1333
+1334
+1335
+1336
+1337
+1338
+1339
+1340
+1341
+1342
+1343
+1344
+1345
+1346
+1347
+1348
+1349
+1350
+1351
+1352
+1353
+1354
+1355
+1356
+1357
+1358
+1359
+1360
+1361
+1362
+1363
+1364
+1365
+1366
+1367
+1368
+1369
+1370
+1371
+1372
+1373
+1374
+1375
+1376
+1377
+1378
+1379
+1380
+1381
+1382
+1383
+1384
+1385
+1386
+1387
+1388
+1389
+1390
+1391
+1392
+1393
+1394
+1395
+1396
+1397
+1398
+1399
+1400
+1401
+1402
+1403
+1404
+1405
+1406
+1407
+1408
+1409
+1410
+1411
+1412
+1413
+1414
+1415
+1416
+1417
+1418
+1419
+1420
+1421
+1422
+1423
+1424
+1425
+1426
+1427
+1428
+1429
+1430
+1431
+1432
+1433
+1434
+1435
+1436
+1437
+1438
+1439
+1440
+1441
+1442
+1443
+1444
+1445
+1446
+1447
+1448
+1449
+1450
+1451
+1452
+1453
+1454
+1455
+1456
+1457
+1458
+1459
+1460
+1461
+1462
+1463
+1464
+1465
+1466
+1467
+1468
+1469
+1470
+1471
+1472
+1473
+1474
+1475
+1476
+1477
+1478
+1479
+1480
+1481
+1482
+1483
+1484
+1485
+1486
+1487
+1488
+1489
+1490
+1491
+1492
+1493
+1494
+1495
+1496
+1497
+1498
+1499
+1500
+1501
+1502
+1503
+1504
+1505
+1506
+1507
+1508
+1509
+1510
+1511
+1512
+1513
+1514
+1515
+1516
+1517
+1518
+1519
+1520
+1521
+1522
+1523
+1524
+1525
+1526
+1527
+1528
+1529
+1530
+1531
+1532
+1533
+1534
+1535
+1536
+1537
+1538
+1539
+1540
+1541
+1542
+1543
+1544
+1545
+1546
+1547
+1548
+1549
+1550
+1551
+1552
+1553
+1554
+1555
+1556
+1557
+1558
+1559
+1560
+1561
+1562
+1563
+1564
+1565
+1566
+1567
+1568
+1569
+1570
+1571
+1572
+1573
+1574
+1575
+1576
+1577
+1578
+1579
+1580
+1581
+1582
+1583
+1584
+1585
+1586
+1587
+1588
+1589
+1590
+1591
+1592
+1593
+1594
+1595
+1596
+1597
+1598
+1599
+1600
+1601
+1602
+1603
+1604
+1605
+1606
+1607
+1608
+1609
+1610
+1611
+1612
+1613
+1614
+1615
+1616
+1617
+1618
+1619
+1620
+1621
+1622
+1623
+1624
+1625
+1626
+1627
+1628
+1629
+1630
+1631
+1632
+1633
+1634
+1635
+1636
+1637
+1638
+1639
+1640
+1641
+1642
+1643
+1644
+1645
+1646
+1647
+1648
+1649
+1650
+1651
+1652
+1653
+1654
+1655
+1656
+1657
+1658
+1659
+1660
+1661
+1662
+1663
+1664
+1665
+1666
+1667
+1668
+1669
+1670
+1671
+1672
+1673
+1674
+1675
+1676
+1677
+1678
+1679
+1680
+1681
+1682
+1683
+1684
+1685
+1686
+1687
+1688
+1689
+1690
+1691
+1692
+1693
+1694
+1695
+1696
+1697
+1698
+1699
+1700
+1701
+1702
+1703
+1704
+1705
+1706
+1707
+1708
+1709
+1710
+1711
+1712
+1713
+1714
+1715
+1716
+1717
+1718
+1719
+1720
+1721
+1722
+1723
+1724
+1725
+1726
+1727
+1728
+1729
+1730
+1731
+1732
+1733
+1734
+1735
+1736
+1737
+1738
+1739
+1740
+1741
+1742
+1743
+1744
+1745
+1746
+1747
+1748
+1749
+1750
+1751
+1752
+1753
+1754
+1755
+1756
+1757
+1758
+1759
+1760
+1761
+1762
+1763
+1764
+1765
+1766
+1767
+1768
+1769
+1770
+1771
+1772
+1773
+1774
+1775
+1776
+1777
+1778
+1779
+1780
+1781
+1782
+1783
+1784
+1785
+1786
+1787
+1788
+1789
+1790
+1791
+1792
+1793
+1794
+1795
+1796
+1797
+1798
+1799
+1800
+1801
+1802
+1803
+1804
+1805
+1806
+1807
+1808
+1809
+1810
+1811
+1812
+1813
+1814
+1815
+1816
+1817
+1818
+1819
+1820
+1821
+1822
+1823
+1824
+1825
+1826
+1827
+1828
+1829
+1830
+1831
+1832
+1833
+1834
+1835
+1836
+1837
+1838
+1839
+1840
+1841
+1842
+1843
+1844
+1845
+1846
+1847
+1848
+1849
+1850
+1851
+1852
+1853
+1854
+1855
+1856
+1857
+1858
+1859
+1860
+1861
+1862
+1863
+1864
+1865
+1866
+1867
+1868
+1869
+1870
+1871
+1872
+1873
+1874
+1875
+1876
+1877
+1878
+1879
+1880
+1881
+1882
+1883
+1884
+1885
+1886
+1887
+1888
+1889
+1890
+1891
+1892
+1893
+1894
+1895
+1896
+1897
+1898
+1899
+1900
+1901
+1902
+1903
+1904
+1905
+1906
+1907
+1908
+1909
+1910
+1911
+1912
+1913
+1914
+1915
+1916
+1917
+1918
+1919
+1920
+1921
+1922
+1923
+1924
+1925
+1926
+1927
+1928
+1929
+1930
+1931
+1932
+1933
+1934
+1935
+1936
+1937
+1938
+1939
+1940
+1941
+1942
+1943
+1944
+1945
+1946
+1947
+1948
+1949
+1950
+1951
+1952
+1953
+1954
+1955
+1956
+1957
+1958
+1959
+1960
+1961
+1962
+1963
+1964
+1965
+1966
+1967
+1968
+1969
+1970
+1971
+1972
+1973
+1974
+1975
+1976
+1977
+1978
+1979
+1980
+1981
+1982
+1983
+1984
+1985
+1986
+1987
+1988
+1989
+1990
+1991
+1992
+1993
+1994
+1995
+1996
+1997
+1998
+1999
+2000
+2001
+2002
+2003
+2004
+2005
+2006
+2007
+2008
+2009
+2010
+2011
+2012
+2013
+2014
+2015
+2016
+2017
+2018
+2019
+2020
+2021
+2022
+2023
+2024
+2025
+2026
+2027
+2028
+2029
+2030
+2031
+2032
+2033
+2034
+2035
+2036
+2037
+2038
+2039
+2040
+2041
+2042
+2043
+2044
+2045
+2046
+2047
+2048
+2049
+2050
+2051
+2052
+2053
+2054
+2055
+2056
+2057
+2058
+2059
+2060
+2061
+2062
+2063
+2064
+2065
+2066
+2067
+2068
+2069
+2070
+2071
+2072
+2073
+2074
+2075
+2076
+2077
+2078
+2079
+2080
+2081
+2082
+2083
+2084
+2085
+2086
+2087
+2088
+2089
+2090
+2091
+2092
+2093
+2094
+2095
+2096
+2097
+2098
+2099
+2100
+2101
+2102
+2103
+2104
+2105
+2106
+2107
+2108
+2109
+2110
+2111
+2112
+2113
+2114
+2115
+2116
+2117
+2118
+2119
+2120
+2121
+2122
+2123
+2124
+2125
+2126
+2127
+2128
+2129
+2130
+2131
+2132
+2133
+2134
+2135
+2136
+2137
+2138
+2139
+2140
+2141
+2142
+2143
+2144
+2145
+2146
+2147
+2148
+2149
+2150
+2151
+2152
+2153
+2154
+2155
+2156
+2157
+2158
+2159
+2160
+2161
+2162
+2163
+2164
+2165
+2166
+2167
+2168
+2169
+2170
+2171
+2172
+2173
+2174
+2175
+2176
+2177
+2178
+2179
+2180
+2181
+2182
+2183
+2184
+2185
+2186
+2187
+2188
+2189
+2190
+2191
+2192
+2193
+2194
+2195
+2196
+2197
+2198
+2199
+2200
+2201
+2202
+2203
+2204
+2205
+2206
+2207
+2208
+2209
+2210
+2211
+2212
+2213
+2214
+2215
+2216
+2217
+2218
+2219
+2220
+2221
+2222
+2223
+2224
+2225
+2226
+2227
+2228
+2229
+2230
+2231
+2232
+2233
+2234
+2235
+2236
+2237
+2238
+2239
+2240
+2241
+2242
+2243
+2244
+2245
+2246
+2247
+2248
+2249
+2250
+2251
+2252
+2253
+2254
+2255
+2256
+2257
+2258
+2259
+2260
+2261
+2262
+2263
+2264
+2265
+2266
+2267
+2268
+2269
+2270
+2271
+2272
+2273
+2274
+2275
+2276
+2277
+2278
+2279
+2280
+2281
+2282
+2283
+2284
+2285
+2286
+2287
+2288
+2289
+2290
+2291
+2292
+2293
+2294
+2295
+2296
+2297
+2298
+2299
+2300
+2301
+2302
+2303
+2304
+2305
+2306
+2307
+2308
+2309
+2310
+2311
+2312
+2313
+2314
+2315
+2316
+2317
+2318
+2319
+2320
+2321
+2322
+2323
+2324
+2325
+2326
+2327
+2328
+2329
+2330
+2331
+2332
+2333
+2334
+2335
+2336
+2337
+2338
+2339
+2340
+2341
+2342
+2343
+2344
+2345
+2346
+2347
+2348
+2349
+2350
+2351
+2352
+2353
+2354
+2355
+2356
+2357
+2358
+2359
+2360
+2361
+2362
+2363
+2364
+2365
+2366
+2367
+2368
+2369
+2370
+2371
+2372
+2373
+2374
+2375
+2376
+2377
+2378
+2379
+2380
+2381
+2382
+2383
+2384
+2385
+2386
+2387
+2388
+2389
+2390
+2391
+2392
+2393
+2394
+2395
+2396
+2397
+2398
+2399
+2400
+2401
+2402
+2403
+2404
+2405
+2406
+2407
+2408
+2409
+2410
+2411
+2412
+2413
+2414
+2415
+2416
+2417
+2418
+2419
+2420
+2421
+2422
+2423
+2424
+2425
+2426
+2427
+2428
+2429
+2430
+2431
+2432
+2433
+2434
+2435
+2436
+2437
+2438
+2439
+2440
+2441
+2442
+2443
+2444
+2445
+2446
+2447
+2448
+2449
+2450
+2451
+2452
+2453
+2454
+2455
+2456
+2457
+2458
+2459
+2460
+2461
+2462
+2463
+2464
+2465
+2466
+2467
+2468
+2469
+2470
+2471
+2472
+2473
+2474
+2475
+2476
+2477
+2478
+2479
+2480
+2481
+2482
+2483
+2484
+2485
+2486
+2487
+2488
+2489
+2490
+2491
+2492
+2493
+2494
+2495
+2496
+2497
+2498
+2499
+2500
+2501
+2502
+2503
+2504
+2505
+2506
+2507
+2508
+2509
+2510
+2511
+2512
+2513
+2514
+2515
+2516
+2517
+2518
+2519
+2520
+2521
+2522
+2523
+2524
+2525
+2526
+2527
+2528
+2529
+2530
+2531
+2532
+2533
+2534
+2535
+2536
+2537
+2538
+2539
+2540
+2541
+2542
+2543
+2544
+2545
+2546
+2547
+2548
+2549
+2550
+2551
+2552
+2553
+2554
+2555
+2556
+2557
+2558
+2559
+2560
+2561
+2562
+2563
+2564
+2565
+2566
+2567
+2568
+2569
+2570
+2571
+2572
+2573
+2574
+2575
+2576
+2577
+2578
+2579
+2580
+2581
+2582
+2583
+2584
+2585
+2586
+2587
+2588
+2589
+2590
+2591
+2592
+2593
+2594
+2595
+2596
+2597
+2598
+2599
+2600
+2601
+2602
+2603
+2604
+2605
+2606
+2607
+2608
+2609
+2610
+2611
+2612
+2613
+2614
+2615
+2616
+2617
+2618
+2619
+2620
+2621
+2622
+2623
+2624
+2625
+2626
+2627
+2628
+2629
+2630
+2631
+2632
+2633
+2634
+2635
+2636
+2637
+2638
+2639
+2640
+2641
+2642
+2643
+2644
+2645
+2646
+2647
+2648
+2649
+2650
+2651
+2652
+2653
+2654
+2655
+2656
+2657
+2658
+2659
+2660
+2661
+2662
+2663
+2664
+2665
+2666
+2667
+2668
+2669
+2670
+2671
+2672
+2673
+2674
+2675
+2676
+2677
+2678
+2679
+2680
+2681
+2682
+2683
+2684
+2685
+2686
+2687
+2688
+2689
+2690
+2691
+2692
+2693
+2694
+2695
+2696
+2697
+2698
+2699
+2700
+2701
+2702
+2703
+2704
+2705
+2706
+2707
+2708
+2709
+2710
+2711
+2712
+2713
+2714
+2715
+2716
+2717
+2718
+2719
+2720
+2721
+2722
+2723
+2724
+2725
+2726
+2727
+2728
+2729
+2730
+2731
+2732
+2733
+2734
+2735
+2736
+2737
+2738
+2739
+2740
+2741
+2742
+2743
+2744
+2745
+2746
+2747
+2748
+2749
+2750
+2751
+2752
+2753
+2754
+2755
+2756
+2757
+2758
+2759
+2760
+2761
+2762
+2763
+2764
+2765
+2766
+2767
+2768
+2769
+2770
+2771
+2772
+2773
+2774
+2775
+2776
+2777
+2778
+2779
+2780
+2781
+2782
+2783
+2784
+2785
+2786
+2787
+2788
+2789
+2790
+2791
+2792
+2793
+2794
+2795
+2796
+2797
+2798
+2799
+2800
+2801
+2802
+2803
+2804
+2805
+2806
+2807
+2808
+2809
+2810
+2811
+2812
+2813
+2814
+2815
+2816
+2817
+2818
+2819
+2820
+2821
+2822
+2823
+2824
+2825
+2826
+2827
+2828
+2829
+2830
+2831
+2832
+2833
+2834
+2835
+2836
+2837
+2838
+2839
+2840
+2841
+2842
+2843
+2844
+2845
+2846
+2847
+2848
+2849
+2850
+2851
+2852
+2853
+2854
+2855
+2856
+2857
+2858
+2859
+2860
+2861
+2862
+2863
+2864
+2865
+2866
+2867
+2868
+2869
+2870
+2871
+2872
+2873
+2874
+2875
+2876
+2877
+2878
+2879
+2880
+2881
+2882
+2883
+2884
+2885
+2886
+2887
+2888
+2889
+2890
+2891
+2892
+2893
+2894
+2895
+2896
+2897
+2898
+2899
+2900
+2901
+2902
+2903
+2904
+2905
+2906
+2907
+2908
+2909
+2910
+2911
+2912
+2913
+2914
+2915
+2916
+2917
+2918
+2919
+2920
+2921
+2922
+2923
+2924
+2925
+2926
+2927
+2928
+2929
+2930
+2931
+2932
+2933
+2934
+2935
+2936
+2937
+2938
+2939
+2940
+2941
+2942
+2943
+2944
+2945
+2946
+2947
+2948
+2949
+2950
+2951
+2952
+2953
+2954
+2955
+2956
+2957
+2958
+2959
+2960
+2961
+2962
+2963
+2964
+2965
+2966
+2967
+2968
+2969
+2970
+2971
+2972
+2973
+2974
+2975
+2976
+2977
+2978
+2979
+2980
+2981
+2982
+2983
+2984
+2985
+2986
+2987
+2988
+2989
+2990
+2991
+2992
+2993
+2994
+2995
+2996
+2997
+2998
+2999
+3000
+3001
+3002
+3003
+3004
+3005
+3006
+3007
+3008
+3009
+3010
+3011
+3012
+3013
+3014
+3015
+3016
+3017
+3018
+3019
+3020
+3021
+3022
+3023
+3024
+3025
+3026
+3027
+3028
+3029
+3030
+3031
+3032
+3033
+3034
+3035
+3036
+3037
+3038
+3039
+3040
+3041
+3042
+3043
+3044
+3045
+3046
+3047
+3048
+3049
+3050
+3051
+3052
+3053
+3054
+3055
+3056
+3057
+3058
+3059
+3060
+3061
+3062
+3063
+3064
+3065
+3066
+3067
+3068
+3069
+3070
+3071
+3072
+3073
+3074
+3075
+3076
+3077
+3078
+3079
+3080
+3081
+3082
+3083
+3084
+3085
+3086
+3087
+3088
+3089
+3090
+3091
+3092
+3093
+3094
+3095
+3096
+3097
+3098
+3099
+3100
+3101
+3102
+3103
+3104
+3105
+3106
+3107
+3108
+3109
+3110
+3111
+3112
+3113
+3114
+3115
+3116
+3117
+3118
+3119
+3120
+3121
+3122
+3123
+3124
+3125
+3126
+3127
+3128
+3129
+3130
+3131
+3132
+3133
+3134
+3135
+3136
+3137
+3138
+3139
+3140
+3141
+3142
+3143
+3144
+3145
+3146
+3147
+3148
+3149
+3150
+3151
+3152
+3153
+3154
+3155
+3156
+3157
+3158
+3159
+3160
+3161
+3162
+3163
+3164
+3165
+3166
+3167
+3168
+3169
+3170
+3171
+3172
+3173
+3174
+3175
+3176
+3177
+3178
+3179
+3180
+3181
+3182
+3183
+3184
+3185
+3186
+3187
+3188
+3189
+3190
+3191
+3192
+3193
+3194
+3195
+3196
+3197
+3198
+3199
+3200
+3201
+3202
+3203
+3204
+3205
+3206
+3207
+3208
+3209
+3210
+3211
+3212
+3213
+3214
+3215
+3216
+3217
+3218
+3219
+3220
+3221
+3222
+3223
+3224
+3225
+3226
+3227
+3228
+3229
+3230
+3231
+3232
+3233
+3234
+3235
+3236
+3237
+3238
+3239
+3240
+3241
+3242
+3243
+3244
+3245
+3246
+3247
+3248
+3249
+3250
+3251
+3252
+3253
+3254
+3255
+3256
+3257
+3258
+3259
+3260
+3261
+3262
+3263
+3264
+3265
+3266
+3267
+3268
+3269
+3270
+3271
+3272
+3273
+3274
+3275
+3276
+3277
+3278
+3279
+3280
+3281
+3282
+3283
+3284
+3285
+3286
+3287
+3288
+3289
+3290
+3291
+3292
+3293
+3294
+3295
+3296
+3297
+3298
+3299
+3300
+3301
+3302
+3303
+3304
+3305
+3306
+3307
+3308
+3309
+3310
+3311
+3312
+3313
+3314
+3315
+3316
+3317
+3318
+3319
+3320
+3321
+3322
+3323
+3324
+3325
+3326
+3327
+3328
+3329
+3330
+3331
+3332
+3333
+3334
+3335
+3336
+3337
+3338
+3339
+3340
+3341
+3342
+3343
+3344
+3345
+3346
+3347
+3348
+3349
+3350
+3351
+3352
+3353
+3354
+3355
+3356
+3357
+3358
+3359
+3360
+3361
+3362
+3363
+3364
+3365
+3366
+3367
+3368
+3369
+3370
+3371
+3372
+3373
+3374
+3375
+3376
+3377
+3378
+3379
+3380
+3381
+3382
+3383
+3384
+3385
+3386
+3387
+3388
+3389
+3390
+3391
+3392
+3393
+3394
+3395
+3396
+3397
+3398
+3399
+3400
+3401
+3402
+3403
+3404
+3405
+3406
+3407
+3408
+3409
+3410
+3411
+3412
+3413
+3414
+3415
+3416
+3417
+3418
+3419
+3420
+3421
+3422
+3423
+3424
+3425
+3426
+3427
+3428
+3429
+3430
+3431
+3432
+3433
+3434
+3435
+3436
+3437
+3438
+3439
+3440
+3441
+3442
+3443
+3444
+3445
+3446
+3447
+3448
+3449
+3450
+
use crate::attr::Attribute;
+use crate::data::{Fields, FieldsNamed, Variant};
+use crate::derive::{Data, DataEnum, DataStruct, DataUnion, DeriveInput};
+use crate::expr::Expr;
+use crate::generics::{Generics, TypeParamBound};
+use crate::ident::Ident;
+use crate::lifetime::Lifetime;
+use crate::mac::Macro;
+use crate::pat::{Pat, PatType};
+use crate::path::Path;
+use crate::punctuated::Punctuated;
+use crate::restriction::Visibility;
+use crate::stmt::Block;
+use crate::token;
+use crate::ty::{Abi, ReturnType, Type};
+use proc_macro2::TokenStream;
+#[cfg(feature = "parsing")]
+use std::mem;
+
+ast_enum_of_structs! {
+    /// Things that can appear directly inside of a module or scope.
+    ///
+    /// # Syntax tree enum
+    ///
+    /// This type is a [syntax tree enum].
+    ///
+    /// [syntax tree enum]: crate::expr::Expr#syntax-tree-enums
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    #[non_exhaustive]
+    pub enum Item {
+        /// A constant item: `const MAX: u16 = 65535`.
+        Const(ItemConst),
+
+        /// An enum definition: `enum Foo<A, B> { A(A), B(B) }`.
+        Enum(ItemEnum),
+
+        /// An `extern crate` item: `extern crate serde`.
+        ExternCrate(ItemExternCrate),
+
+        /// A free-standing function: `fn process(n: usize) -> Result<()> { ...
+        /// }`.
+        Fn(ItemFn),
+
+        /// A block of foreign items: `extern "C" { ... }`.
+        ForeignMod(ItemForeignMod),
+
+        /// An impl block providing trait or associated items: `impl<A> Trait
+        /// for Data<A> { ... }`.
+        Impl(ItemImpl),
+
+        /// A macro invocation, which includes `macro_rules!` definitions.
+        Macro(ItemMacro),
+
+        /// A module or module declaration: `mod m` or `mod m { ... }`.
+        Mod(ItemMod),
+
+        /// A static item: `static BIKE: Shed = Shed(42)`.
+        Static(ItemStatic),
+
+        /// A struct definition: `struct Foo<A> { x: A }`.
+        Struct(ItemStruct),
+
+        /// A trait definition: `pub trait Iterator { ... }`.
+        Trait(ItemTrait),
+
+        /// A trait alias: `pub trait SharableIterator = Iterator + Sync`.
+        TraitAlias(ItemTraitAlias),
+
+        /// A type alias: `type Result<T> = std::result::Result<T, MyError>`.
+        Type(ItemType),
+
+        /// A union definition: `union Foo<A, B> { x: A, y: B }`.
+        Union(ItemUnion),
+
+        /// A use declaration: `use std::collections::HashMap`.
+        Use(ItemUse),
+
+        /// Tokens forming an item not interpreted by Syn.
+        Verbatim(TokenStream),
+
+        // For testing exhaustiveness in downstream code, use the following idiom:
+        //
+        //     match item {
+        //         #![cfg_attr(test, deny(non_exhaustive_omitted_patterns))]
+        //
+        //         Item::Const(item) => {...}
+        //         Item::Enum(item) => {...}
+        //         ...
+        //         Item::Verbatim(item) => {...}
+        //
+        //         _ => { /* some sane fallback */ }
+        //     }
+        //
+        // This way we fail your tests but don't break your library when adding
+        // a variant. You will be notified by a test failure when a variant is
+        // added, so that you can add code to handle it, but your library will
+        // continue to compile and work for downstream users in the interim.
+    }
+}
+
+ast_struct! {
+    /// A constant item: `const MAX: u16 = 65535`.
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    pub struct ItemConst {
+        pub attrs: Vec<Attribute>,
+        pub vis: Visibility,
+        pub const_token: Token![const],
+        pub ident: Ident,
+        pub generics: Generics,
+        pub colon_token: Token![:],
+        pub ty: Box<Type>,
+        pub eq_token: Token![=],
+        pub expr: Box<Expr>,
+        pub semi_token: Token![;],
+    }
+}
+
+ast_struct! {
+    /// An enum definition: `enum Foo<A, B> { A(A), B(B) }`.
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    pub struct ItemEnum {
+        pub attrs: Vec<Attribute>,
+        pub vis: Visibility,
+        pub enum_token: Token![enum],
+        pub ident: Ident,
+        pub generics: Generics,
+        pub brace_token: token::Brace,
+        pub variants: Punctuated<Variant, Token![,]>,
+    }
+}
+
+ast_struct! {
+    /// An `extern crate` item: `extern crate serde`.
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    pub struct ItemExternCrate {
+        pub attrs: Vec<Attribute>,
+        pub vis: Visibility,
+        pub extern_token: Token![extern],
+        pub crate_token: Token![crate],
+        pub ident: Ident,
+        pub rename: Option<(Token![as], Ident)>,
+        pub semi_token: Token![;],
+    }
+}
+
+ast_struct! {
+    /// A free-standing function: `fn process(n: usize) -> Result<()> { ... }`.
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    pub struct ItemFn {
+        pub attrs: Vec<Attribute>,
+        pub vis: Visibility,
+        pub sig: Signature,
+        pub block: Box<Block>,
+    }
+}
+
+ast_struct! {
+    /// A block of foreign items: `extern "C" { ... }`.
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    pub struct ItemForeignMod {
+        pub attrs: Vec<Attribute>,
+        pub unsafety: Option<Token![unsafe]>,
+        pub abi: Abi,
+        pub brace_token: token::Brace,
+        pub items: Vec<ForeignItem>,
+    }
+}
+
+ast_struct! {
+    /// An impl block providing trait or associated items: `impl<A> Trait
+    /// for Data<A> { ... }`.
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    pub struct ItemImpl {
+        pub attrs: Vec<Attribute>,
+        pub defaultness: Option<Token![default]>,
+        pub unsafety: Option<Token![unsafe]>,
+        pub impl_token: Token![impl],
+        pub generics: Generics,
+        /// Trait this impl implements.
+        pub trait_: Option<(Option<Token![!]>, Path, Token![for])>,
+        /// The Self type of the impl.
+        pub self_ty: Box<Type>,
+        pub brace_token: token::Brace,
+        pub items: Vec<ImplItem>,
+    }
+}
+
+ast_struct! {
+    /// A macro invocation, which includes `macro_rules!` definitions.
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    pub struct ItemMacro {
+        pub attrs: Vec<Attribute>,
+        /// The `example` in `macro_rules! example { ... }`.
+        pub ident: Option<Ident>,
+        pub mac: Macro,
+        pub semi_token: Option<Token![;]>,
+    }
+}
+
+ast_struct! {
+    /// A module or module declaration: `mod m` or `mod m { ... }`.
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    pub struct ItemMod {
+        pub attrs: Vec<Attribute>,
+        pub vis: Visibility,
+        pub unsafety: Option<Token![unsafe]>,
+        pub mod_token: Token![mod],
+        pub ident: Ident,
+        pub content: Option<(token::Brace, Vec<Item>)>,
+        pub semi: Option<Token![;]>,
+    }
+}
+
+ast_struct! {
+    /// A static item: `static BIKE: Shed = Shed(42)`.
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    pub struct ItemStatic {
+        pub attrs: Vec<Attribute>,
+        pub vis: Visibility,
+        pub static_token: Token![static],
+        pub mutability: StaticMutability,
+        pub ident: Ident,
+        pub colon_token: Token![:],
+        pub ty: Box<Type>,
+        pub eq_token: Token![=],
+        pub expr: Box<Expr>,
+        pub semi_token: Token![;],
+    }
+}
+
+ast_struct! {
+    /// A struct definition: `struct Foo<A> { x: A }`.
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    pub struct ItemStruct {
+        pub attrs: Vec<Attribute>,
+        pub vis: Visibility,
+        pub struct_token: Token![struct],
+        pub ident: Ident,
+        pub generics: Generics,
+        pub fields: Fields,
+        pub semi_token: Option<Token![;]>,
+    }
+}
+
+ast_struct! {
+    /// A trait definition: `pub trait Iterator { ... }`.
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    pub struct ItemTrait {
+        pub attrs: Vec<Attribute>,
+        pub vis: Visibility,
+        pub unsafety: Option<Token![unsafe]>,
+        pub auto_token: Option<Token![auto]>,
+        pub restriction: Option<ImplRestriction>,
+        pub trait_token: Token![trait],
+        pub ident: Ident,
+        pub generics: Generics,
+        pub colon_token: Option<Token![:]>,
+        pub supertraits: Punctuated<TypeParamBound, Token![+]>,
+        pub brace_token: token::Brace,
+        pub items: Vec<TraitItem>,
+    }
+}
+
+ast_struct! {
+    /// A trait alias: `pub trait SharableIterator = Iterator + Sync`.
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    pub struct ItemTraitAlias {
+        pub attrs: Vec<Attribute>,
+        pub vis: Visibility,
+        pub trait_token: Token![trait],
+        pub ident: Ident,
+        pub generics: Generics,
+        pub eq_token: Token![=],
+        pub bounds: Punctuated<TypeParamBound, Token![+]>,
+        pub semi_token: Token![;],
+    }
+}
+
+ast_struct! {
+    /// A type alias: `type Result<T> = std::result::Result<T, MyError>`.
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    pub struct ItemType {
+        pub attrs: Vec<Attribute>,
+        pub vis: Visibility,
+        pub type_token: Token![type],
+        pub ident: Ident,
+        pub generics: Generics,
+        pub eq_token: Token![=],
+        pub ty: Box<Type>,
+        pub semi_token: Token![;],
+    }
+}
+
+ast_struct! {
+    /// A union definition: `union Foo<A, B> { x: A, y: B }`.
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    pub struct ItemUnion {
+        pub attrs: Vec<Attribute>,
+        pub vis: Visibility,
+        pub union_token: Token![union],
+        pub ident: Ident,
+        pub generics: Generics,
+        pub fields: FieldsNamed,
+    }
+}
+
+ast_struct! {
+    /// A use declaration: `use std::collections::HashMap`.
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    pub struct ItemUse {
+        pub attrs: Vec<Attribute>,
+        pub vis: Visibility,
+        pub use_token: Token![use],
+        pub leading_colon: Option<Token![::]>,
+        pub tree: UseTree,
+        pub semi_token: Token![;],
+    }
+}
+
+impl Item {
+    #[cfg(feature = "parsing")]
+    pub(crate) fn replace_attrs(&mut self, new: Vec<Attribute>) -> Vec<Attribute> {
+        match self {
+            Item::Const(ItemConst { attrs, .. })
+            | Item::Enum(ItemEnum { attrs, .. })
+            | Item::ExternCrate(ItemExternCrate { attrs, .. })
+            | Item::Fn(ItemFn { attrs, .. })
+            | Item::ForeignMod(ItemForeignMod { attrs, .. })
+            | Item::Impl(ItemImpl { attrs, .. })
+            | Item::Macro(ItemMacro { attrs, .. })
+            | Item::Mod(ItemMod { attrs, .. })
+            | Item::Static(ItemStatic { attrs, .. })
+            | Item::Struct(ItemStruct { attrs, .. })
+            | Item::Trait(ItemTrait { attrs, .. })
+            | Item::TraitAlias(ItemTraitAlias { attrs, .. })
+            | Item::Type(ItemType { attrs, .. })
+            | Item::Union(ItemUnion { attrs, .. })
+            | Item::Use(ItemUse { attrs, .. }) => mem::replace(attrs, new),
+            Item::Verbatim(_) => Vec::new(),
+        }
+    }
+}
+
+impl From<DeriveInput> for Item {
+    fn from(input: DeriveInput) -> Item {
+        match input.data {
+            Data::Struct(data) => Item::Struct(ItemStruct {
+                attrs: input.attrs,
+                vis: input.vis,
+                struct_token: data.struct_token,
+                ident: input.ident,
+                generics: input.generics,
+                fields: data.fields,
+                semi_token: data.semi_token,
+            }),
+            Data::Enum(data) => Item::Enum(ItemEnum {
+                attrs: input.attrs,
+                vis: input.vis,
+                enum_token: data.enum_token,
+                ident: input.ident,
+                generics: input.generics,
+                brace_token: data.brace_token,
+                variants: data.variants,
+            }),
+            Data::Union(data) => Item::Union(ItemUnion {
+                attrs: input.attrs,
+                vis: input.vis,
+                union_token: data.union_token,
+                ident: input.ident,
+                generics: input.generics,
+                fields: data.fields,
+            }),
+        }
+    }
+}
+
+impl From<ItemStruct> for DeriveInput {
+    fn from(input: ItemStruct) -> DeriveInput {
+        DeriveInput {
+            attrs: input.attrs,
+            vis: input.vis,
+            ident: input.ident,
+            generics: input.generics,
+            data: Data::Struct(DataStruct {
+                struct_token: input.struct_token,
+                fields: input.fields,
+                semi_token: input.semi_token,
+            }),
+        }
+    }
+}
+
+impl From<ItemEnum> for DeriveInput {
+    fn from(input: ItemEnum) -> DeriveInput {
+        DeriveInput {
+            attrs: input.attrs,
+            vis: input.vis,
+            ident: input.ident,
+            generics: input.generics,
+            data: Data::Enum(DataEnum {
+                enum_token: input.enum_token,
+                brace_token: input.brace_token,
+                variants: input.variants,
+            }),
+        }
+    }
+}
+
+impl From<ItemUnion> for DeriveInput {
+    fn from(input: ItemUnion) -> DeriveInput {
+        DeriveInput {
+            attrs: input.attrs,
+            vis: input.vis,
+            ident: input.ident,
+            generics: input.generics,
+            data: Data::Union(DataUnion {
+                union_token: input.union_token,
+                fields: input.fields,
+            }),
+        }
+    }
+}
+
+ast_enum_of_structs! {
+    /// A suffix of an import tree in a `use` item: `Type as Renamed` or `*`.
+    ///
+    /// # Syntax tree enum
+    ///
+    /// This type is a [syntax tree enum].
+    ///
+    /// [syntax tree enum]: crate::expr::Expr#syntax-tree-enums
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    pub enum UseTree {
+        /// A path prefix of imports in a `use` item: `std::...`.
+        Path(UsePath),
+
+        /// An identifier imported by a `use` item: `HashMap`.
+        Name(UseName),
+
+        /// An renamed identifier imported by a `use` item: `HashMap as Map`.
+        Rename(UseRename),
+
+        /// A glob import in a `use` item: `*`.
+        Glob(UseGlob),
+
+        /// A braced group of imports in a `use` item: `{A, B, C}`.
+        Group(UseGroup),
+    }
+}
+
+ast_struct! {
+    /// A path prefix of imports in a `use` item: `std::...`.
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    pub struct UsePath {
+        pub ident: Ident,
+        pub colon2_token: Token![::],
+        pub tree: Box<UseTree>,
+    }
+}
+
+ast_struct! {
+    /// An identifier imported by a `use` item: `HashMap`.
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    pub struct UseName {
+        pub ident: Ident,
+    }
+}
+
+ast_struct! {
+    /// An renamed identifier imported by a `use` item: `HashMap as Map`.
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    pub struct UseRename {
+        pub ident: Ident,
+        pub as_token: Token![as],
+        pub rename: Ident,
+    }
+}
+
+ast_struct! {
+    /// A glob import in a `use` item: `*`.
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    pub struct UseGlob {
+        pub star_token: Token![*],
+    }
+}
+
+ast_struct! {
+    /// A braced group of imports in a `use` item: `{A, B, C}`.
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    pub struct UseGroup {
+        pub brace_token: token::Brace,
+        pub items: Punctuated<UseTree, Token![,]>,
+    }
+}
+
+ast_enum_of_structs! {
+    /// An item within an `extern` block.
+    ///
+    /// # Syntax tree enum
+    ///
+    /// This type is a [syntax tree enum].
+    ///
+    /// [syntax tree enum]: crate::expr::Expr#syntax-tree-enums
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    #[non_exhaustive]
+    pub enum ForeignItem {
+        /// A foreign function in an `extern` block.
+        Fn(ForeignItemFn),
+
+        /// A foreign static item in an `extern` block: `static ext: u8`.
+        Static(ForeignItemStatic),
+
+        /// A foreign type in an `extern` block: `type void`.
+        Type(ForeignItemType),
+
+        /// A macro invocation within an extern block.
+        Macro(ForeignItemMacro),
+
+        /// Tokens in an `extern` block not interpreted by Syn.
+        Verbatim(TokenStream),
+
+        // For testing exhaustiveness in downstream code, use the following idiom:
+        //
+        //     match item {
+        //         #![cfg_attr(test, deny(non_exhaustive_omitted_patterns))]
+        //
+        //         ForeignItem::Fn(item) => {...}
+        //         ForeignItem::Static(item) => {...}
+        //         ...
+        //         ForeignItem::Verbatim(item) => {...}
+        //
+        //         _ => { /* some sane fallback */ }
+        //     }
+        //
+        // This way we fail your tests but don't break your library when adding
+        // a variant. You will be notified by a test failure when a variant is
+        // added, so that you can add code to handle it, but your library will
+        // continue to compile and work for downstream users in the interim.
+    }
+}
+
+ast_struct! {
+    /// A foreign function in an `extern` block.
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    pub struct ForeignItemFn {
+        pub attrs: Vec<Attribute>,
+        pub vis: Visibility,
+        pub sig: Signature,
+        pub semi_token: Token![;],
+    }
+}
+
+ast_struct! {
+    /// A foreign static item in an `extern` block: `static ext: u8`.
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    pub struct ForeignItemStatic {
+        pub attrs: Vec<Attribute>,
+        pub vis: Visibility,
+        pub static_token: Token![static],
+        pub mutability: StaticMutability,
+        pub ident: Ident,
+        pub colon_token: Token![:],
+        pub ty: Box<Type>,
+        pub semi_token: Token![;],
+    }
+}
+
+ast_struct! {
+    /// A foreign type in an `extern` block: `type void`.
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    pub struct ForeignItemType {
+        pub attrs: Vec<Attribute>,
+        pub vis: Visibility,
+        pub type_token: Token![type],
+        pub ident: Ident,
+        pub generics: Generics,
+        pub semi_token: Token![;],
+    }
+}
+
+ast_struct! {
+    /// A macro invocation within an extern block.
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    pub struct ForeignItemMacro {
+        pub attrs: Vec<Attribute>,
+        pub mac: Macro,
+        pub semi_token: Option<Token![;]>,
+    }
+}
+
+ast_enum_of_structs! {
+    /// An item declaration within the definition of a trait.
+    ///
+    /// # Syntax tree enum
+    ///
+    /// This type is a [syntax tree enum].
+    ///
+    /// [syntax tree enum]: crate::expr::Expr#syntax-tree-enums
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    #[non_exhaustive]
+    pub enum TraitItem {
+        /// An associated constant within the definition of a trait.
+        Const(TraitItemConst),
+
+        /// An associated function within the definition of a trait.
+        Fn(TraitItemFn),
+
+        /// An associated type within the definition of a trait.
+        Type(TraitItemType),
+
+        /// A macro invocation within the definition of a trait.
+        Macro(TraitItemMacro),
+
+        /// Tokens within the definition of a trait not interpreted by Syn.
+        Verbatim(TokenStream),
+
+        // For testing exhaustiveness in downstream code, use the following idiom:
+        //
+        //     match item {
+        //         #![cfg_attr(test, deny(non_exhaustive_omitted_patterns))]
+        //
+        //         TraitItem::Const(item) => {...}
+        //         TraitItem::Fn(item) => {...}
+        //         ...
+        //         TraitItem::Verbatim(item) => {...}
+        //
+        //         _ => { /* some sane fallback */ }
+        //     }
+        //
+        // This way we fail your tests but don't break your library when adding
+        // a variant. You will be notified by a test failure when a variant is
+        // added, so that you can add code to handle it, but your library will
+        // continue to compile and work for downstream users in the interim.
+    }
+}
+
+ast_struct! {
+    /// An associated constant within the definition of a trait.
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    pub struct TraitItemConst {
+        pub attrs: Vec<Attribute>,
+        pub const_token: Token![const],
+        pub ident: Ident,
+        pub generics: Generics,
+        pub colon_token: Token![:],
+        pub ty: Type,
+        pub default: Option<(Token![=], Expr)>,
+        pub semi_token: Token![;],
+    }
+}
+
+ast_struct! {
+    /// An associated function within the definition of a trait.
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    pub struct TraitItemFn {
+        pub attrs: Vec<Attribute>,
+        pub sig: Signature,
+        pub default: Option<Block>,
+        pub semi_token: Option<Token![;]>,
+    }
+}
+
+ast_struct! {
+    /// An associated type within the definition of a trait.
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    pub struct TraitItemType {
+        pub attrs: Vec<Attribute>,
+        pub type_token: Token![type],
+        pub ident: Ident,
+        pub generics: Generics,
+        pub colon_token: Option<Token![:]>,
+        pub bounds: Punctuated<TypeParamBound, Token![+]>,
+        pub default: Option<(Token![=], Type)>,
+        pub semi_token: Token![;],
+    }
+}
+
+ast_struct! {
+    /// A macro invocation within the definition of a trait.
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    pub struct TraitItemMacro {
+        pub attrs: Vec<Attribute>,
+        pub mac: Macro,
+        pub semi_token: Option<Token![;]>,
+    }
+}
+
+ast_enum_of_structs! {
+    /// An item within an impl block.
+    ///
+    /// # Syntax tree enum
+    ///
+    /// This type is a [syntax tree enum].
+    ///
+    /// [syntax tree enum]: crate::expr::Expr#syntax-tree-enums
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    #[non_exhaustive]
+    pub enum ImplItem {
+        /// An associated constant within an impl block.
+        Const(ImplItemConst),
+
+        /// An associated function within an impl block.
+        Fn(ImplItemFn),
+
+        /// An associated type within an impl block.
+        Type(ImplItemType),
+
+        /// A macro invocation within an impl block.
+        Macro(ImplItemMacro),
+
+        /// Tokens within an impl block not interpreted by Syn.
+        Verbatim(TokenStream),
+
+        // For testing exhaustiveness in downstream code, use the following idiom:
+        //
+        //     match item {
+        //         #![cfg_attr(test, deny(non_exhaustive_omitted_patterns))]
+        //
+        //         ImplItem::Const(item) => {...}
+        //         ImplItem::Fn(item) => {...}
+        //         ...
+        //         ImplItem::Verbatim(item) => {...}
+        //
+        //         _ => { /* some sane fallback */ }
+        //     }
+        //
+        // This way we fail your tests but don't break your library when adding
+        // a variant. You will be notified by a test failure when a variant is
+        // added, so that you can add code to handle it, but your library will
+        // continue to compile and work for downstream users in the interim.
+    }
+}
+
+ast_struct! {
+    /// An associated constant within an impl block.
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    pub struct ImplItemConst {
+        pub attrs: Vec<Attribute>,
+        pub vis: Visibility,
+        pub defaultness: Option<Token![default]>,
+        pub const_token: Token![const],
+        pub ident: Ident,
+        pub generics: Generics,
+        pub colon_token: Token![:],
+        pub ty: Type,
+        pub eq_token: Token![=],
+        pub expr: Expr,
+        pub semi_token: Token![;],
+    }
+}
+
+ast_struct! {
+    /// An associated function within an impl block.
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    pub struct ImplItemFn {
+        pub attrs: Vec<Attribute>,
+        pub vis: Visibility,
+        pub defaultness: Option<Token![default]>,
+        pub sig: Signature,
+        pub block: Block,
+    }
+}
+
+ast_struct! {
+    /// An associated type within an impl block.
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    pub struct ImplItemType {
+        pub attrs: Vec<Attribute>,
+        pub vis: Visibility,
+        pub defaultness: Option<Token![default]>,
+        pub type_token: Token![type],
+        pub ident: Ident,
+        pub generics: Generics,
+        pub eq_token: Token![=],
+        pub ty: Type,
+        pub semi_token: Token![;],
+    }
+}
+
+ast_struct! {
+    /// A macro invocation within an impl block.
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    pub struct ImplItemMacro {
+        pub attrs: Vec<Attribute>,
+        pub mac: Macro,
+        pub semi_token: Option<Token![;]>,
+    }
+}
+
+ast_struct! {
+    /// A function signature in a trait or implementation: `unsafe fn
+    /// initialize(&self)`.
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    pub struct Signature {
+        pub constness: Option<Token![const]>,
+        pub asyncness: Option<Token![async]>,
+        pub unsafety: Option<Token![unsafe]>,
+        pub abi: Option<Abi>,
+        pub fn_token: Token![fn],
+        pub ident: Ident,
+        pub generics: Generics,
+        pub paren_token: token::Paren,
+        pub inputs: Punctuated<FnArg, Token![,]>,
+        pub variadic: Option<Variadic>,
+        pub output: ReturnType,
+    }
+}
+
+impl Signature {
+    /// A method's `self` receiver, such as `&self` or `self: Box<Self>`.
+    pub fn receiver(&self) -> Option<&Receiver> {
+        let arg = self.inputs.first()?;
+        match arg {
+            FnArg::Receiver(receiver) => Some(receiver),
+            FnArg::Typed(_) => None,
+        }
+    }
+}
+
+ast_enum_of_structs! {
+    /// An argument in a function signature: the `n: usize` in `fn f(n: usize)`.
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    pub enum FnArg {
+        /// The `self` argument of an associated method.
+        Receiver(Receiver),
+
+        /// A function argument accepted by pattern and type.
+        Typed(PatType),
+    }
+}
+
+ast_struct! {
+    /// The `self` argument of an associated method.
+    ///
+    /// If `colon_token` is present, the receiver is written with an explicit
+    /// type such as `self: Box<Self>`. If `colon_token` is absent, the receiver
+    /// is written in shorthand such as `self` or `&self` or `&mut self`. In the
+    /// shorthand case, the type in `ty` is reconstructed as one of `Self`,
+    /// `&Self`, or `&mut Self`.
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    pub struct Receiver {
+        pub attrs: Vec<Attribute>,
+        pub reference: Option<(Token![&], Option<Lifetime>)>,
+        pub mutability: Option<Token![mut]>,
+        pub self_token: Token![self],
+        pub colon_token: Option<Token![:]>,
+        pub ty: Box<Type>,
+    }
+}
+
+impl Receiver {
+    pub fn lifetime(&self) -> Option<&Lifetime> {
+        self.reference.as_ref()?.1.as_ref()
+    }
+}
+
+ast_struct! {
+    /// The variadic argument of a foreign function.
+    ///
+    /// ```rust
+    /// # struct c_char;
+    /// # struct c_int;
+    /// #
+    /// extern "C" {
+    ///     fn printf(format: *const c_char, ...) -> c_int;
+    ///     //                               ^^^
+    /// }
+    /// ```
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    pub struct Variadic {
+        pub attrs: Vec<Attribute>,
+        pub pat: Option<(Box<Pat>, Token![:])>,
+        pub dots: Token![...],
+        pub comma: Option<Token![,]>,
+    }
+}
+
+ast_enum! {
+    /// The mutability of an `Item::Static` or `ForeignItem::Static`.
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    #[non_exhaustive]
+    pub enum StaticMutability {
+        Mut(Token![mut]),
+        None,
+    }
+}
+
+ast_enum! {
+    /// Unused, but reserved for RFC 3323 restrictions.
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    #[non_exhaustive]
+    pub enum ImplRestriction {}
+
+
+    // TODO: https://rust-lang.github.io/rfcs/3323-restrictions.html
+    //
+    // pub struct ImplRestriction {
+    //     pub impl_token: Token![impl],
+    //     pub paren_token: token::Paren,
+    //     pub in_token: Option<Token![in]>,
+    //     pub path: Box<Path>,
+    // }
+}
+
+#[cfg(feature = "parsing")]
+pub(crate) mod parsing {
+    use crate::attr::{self, Attribute};
+    use crate::derive;
+    use crate::error::{Error, Result};
+    use crate::expr::Expr;
+    use crate::ext::IdentExt as _;
+    use crate::generics::{Generics, TypeParamBound};
+    use crate::ident::Ident;
+    use crate::item::{
+        FnArg, ForeignItem, ForeignItemFn, ForeignItemMacro, ForeignItemStatic, ForeignItemType,
+        ImplItem, ImplItemConst, ImplItemFn, ImplItemMacro, ImplItemType, Item, ItemConst,
+        ItemEnum, ItemExternCrate, ItemFn, ItemForeignMod, ItemImpl, ItemMacro, ItemMod,
+        ItemStatic, ItemStruct, ItemTrait, ItemTraitAlias, ItemType, ItemUnion, ItemUse, Receiver,
+        Signature, StaticMutability, TraitItem, TraitItemConst, TraitItemFn, TraitItemMacro,
+        TraitItemType, UseGlob, UseGroup, UseName, UsePath, UseRename, UseTree, Variadic,
+    };
+    use crate::lifetime::Lifetime;
+    use crate::lit::LitStr;
+    use crate::mac::{self, Macro, MacroDelimiter};
+    use crate::parse::discouraged::Speculative as _;
+    use crate::parse::{Parse, ParseBuffer, ParseStream};
+    use crate::pat::{Pat, PatType, PatWild};
+    use crate::path::Path;
+    use crate::punctuated::Punctuated;
+    use crate::restriction::Visibility;
+    use crate::stmt::Block;
+    use crate::token;
+    use crate::ty::{Abi, ReturnType, Type, TypePath, TypeReference};
+    use crate::verbatim;
+    use proc_macro2::TokenStream;
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for Item {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let begin = input.fork();
+            let attrs = input.call(Attribute::parse_outer)?;
+            parse_rest_of_item(begin, attrs, input)
+        }
+    }
+
+    pub(crate) fn parse_rest_of_item(
+        begin: ParseBuffer,
+        mut attrs: Vec<Attribute>,
+        input: ParseStream,
+    ) -> Result<Item> {
+        let ahead = input.fork();
+        let vis: Visibility = ahead.parse()?;
+
+        let lookahead = ahead.lookahead1();
+        let mut item = if lookahead.peek(Token![fn]) || peek_signature(&ahead) {
+            let vis: Visibility = input.parse()?;
+            let sig: Signature = input.parse()?;
+            if input.peek(Token![;]) {
+                input.parse::<Token![;]>()?;
+                Ok(Item::Verbatim(verbatim::between(&begin, input)))
+            } else {
+                parse_rest_of_fn(input, Vec::new(), vis, sig).map(Item::Fn)
+            }
+        } else if lookahead.peek(Token![extern]) {
+            ahead.parse::<Token![extern]>()?;
+            let lookahead = ahead.lookahead1();
+            if lookahead.peek(Token![crate]) {
+                input.parse().map(Item::ExternCrate)
+            } else if lookahead.peek(token::Brace) {
+                input.parse().map(Item::ForeignMod)
+            } else if lookahead.peek(LitStr) {
+                ahead.parse::<LitStr>()?;
+                let lookahead = ahead.lookahead1();
+                if lookahead.peek(token::Brace) {
+                    input.parse().map(Item::ForeignMod)
+                } else {
+                    Err(lookahead.error())
+                }
+            } else {
+                Err(lookahead.error())
+            }
+        } else if lookahead.peek(Token![use]) {
+            let allow_crate_root_in_path = true;
+            match parse_item_use(input, allow_crate_root_in_path)? {
+                Some(item_use) => Ok(Item::Use(item_use)),
+                None => Ok(Item::Verbatim(verbatim::between(&begin, input))),
+            }
+        } else if lookahead.peek(Token![static]) {
+            let vis = input.parse()?;
+            let static_token = input.parse()?;
+            let mutability = input.parse()?;
+            let ident = input.parse()?;
+            if input.peek(Token![=]) {
+                input.parse::<Token![=]>()?;
+                input.parse::<Expr>()?;
+                input.parse::<Token![;]>()?;
+                Ok(Item::Verbatim(verbatim::between(&begin, input)))
+            } else {
+                let colon_token = input.parse()?;
+                let ty = input.parse()?;
+                if input.peek(Token![;]) {
+                    input.parse::<Token![;]>()?;
+                    Ok(Item::Verbatim(verbatim::between(&begin, input)))
+                } else {
+                    Ok(Item::Static(ItemStatic {
+                        attrs: Vec::new(),
+                        vis,
+                        static_token,
+                        mutability,
+                        ident,
+                        colon_token,
+                        ty,
+                        eq_token: input.parse()?,
+                        expr: input.parse()?,
+                        semi_token: input.parse()?,
+                    }))
+                }
+            }
+        } else if lookahead.peek(Token![const]) {
+            let vis = input.parse()?;
+            let const_token: Token![const] = input.parse()?;
+            let lookahead = input.lookahead1();
+            let ident = if lookahead.peek(Ident) || lookahead.peek(Token![_]) {
+                input.call(Ident::parse_any)?
+            } else {
+                return Err(lookahead.error());
+            };
+            let mut generics: Generics = input.parse()?;
+            let colon_token = input.parse()?;
+            let ty = input.parse()?;
+            let value = if let Some(eq_token) = input.parse::<Option<Token![=]>>()? {
+                let expr: Expr = input.parse()?;
+                Some((eq_token, expr))
+            } else {
+                None
+            };
+            generics.where_clause = input.parse()?;
+            let semi_token: Token![;] = input.parse()?;
+            match value {
+                Some((eq_token, expr))
+                    if generics.lt_token.is_none() && generics.where_clause.is_none() =>
+                {
+                    Ok(Item::Const(ItemConst {
+                        attrs: Vec::new(),
+                        vis,
+                        const_token,
+                        ident,
+                        generics,
+                        colon_token,
+                        ty,
+                        eq_token,
+                        expr: Box::new(expr),
+                        semi_token,
+                    }))
+                }
+                _ => Ok(Item::Verbatim(verbatim::between(&begin, input))),
+            }
+        } else if lookahead.peek(Token![unsafe]) {
+            ahead.parse::<Token![unsafe]>()?;
+            let lookahead = ahead.lookahead1();
+            if lookahead.peek(Token![trait])
+                || lookahead.peek(Token![auto]) && ahead.peek2(Token![trait])
+            {
+                input.parse().map(Item::Trait)
+            } else if lookahead.peek(Token![impl]) {
+                let allow_verbatim_impl = true;
+                if let Some(item) = parse_impl(input, allow_verbatim_impl)? {
+                    Ok(Item::Impl(item))
+                } else {
+                    Ok(Item::Verbatim(verbatim::between(&begin, input)))
+                }
+            } else if lookahead.peek(Token![extern]) {
+                input.parse().map(Item::ForeignMod)
+            } else if lookahead.peek(Token![mod]) {
+                input.parse().map(Item::Mod)
+            } else {
+                Err(lookahead.error())
+            }
+        } else if lookahead.peek(Token![mod]) {
+            input.parse().map(Item::Mod)
+        } else if lookahead.peek(Token![type]) {
+            parse_item_type(begin, input)
+        } else if lookahead.peek(Token![struct]) {
+            input.parse().map(Item::Struct)
+        } else if lookahead.peek(Token![enum]) {
+            input.parse().map(Item::Enum)
+        } else if lookahead.peek(Token![union]) && ahead.peek2(Ident) {
+            input.parse().map(Item::Union)
+        } else if lookahead.peek(Token![trait]) {
+            input.call(parse_trait_or_trait_alias)
+        } else if lookahead.peek(Token![auto]) && ahead.peek2(Token![trait]) {
+            input.parse().map(Item::Trait)
+        } else if lookahead.peek(Token![impl])
+            || lookahead.peek(Token![default]) && !ahead.peek2(Token![!])
+        {
+            let allow_verbatim_impl = true;
+            if let Some(item) = parse_impl(input, allow_verbatim_impl)? {
+                Ok(Item::Impl(item))
+            } else {
+                Ok(Item::Verbatim(verbatim::between(&begin, input)))
+            }
+        } else if lookahead.peek(Token![macro]) {
+            input.advance_to(&ahead);
+            parse_macro2(begin, vis, input)
+        } else if vis.is_inherited()
+            && (lookahead.peek(Ident)
+                || lookahead.peek(Token![self])
+                || lookahead.peek(Token![super])
+                || lookahead.peek(Token![crate])
+                || lookahead.peek(Token![::]))
+        {
+            input.parse().map(Item::Macro)
+        } else {
+            Err(lookahead.error())
+        }?;
+
+        attrs.extend(item.replace_attrs(Vec::new()));
+        item.replace_attrs(attrs);
+        Ok(item)
+    }
+
+    struct FlexibleItemType {
+        vis: Visibility,
+        defaultness: Option<Token![default]>,
+        type_token: Token![type],
+        ident: Ident,
+        generics: Generics,
+        colon_token: Option<Token![:]>,
+        bounds: Punctuated<TypeParamBound, Token![+]>,
+        ty: Option<(Token![=], Type)>,
+        semi_token: Token![;],
+    }
+
+    enum TypeDefaultness {
+        Optional,
+        Disallowed,
+    }
+
+    enum WhereClauseLocation {
+        // type Ty<T> where T: 'static = T;
+        BeforeEq,
+        // type Ty<T> = T where T: 'static;
+        AfterEq,
+        // TODO: goes away once the migration period on rust-lang/rust#89122 is over
+        Both,
+    }
+
+    impl FlexibleItemType {
+        fn parse(
+            input: ParseStream,
+            allow_defaultness: TypeDefaultness,
+            where_clause_location: WhereClauseLocation,
+        ) -> Result<Self> {
+            let vis: Visibility = input.parse()?;
+            let defaultness: Option<Token![default]> = match allow_defaultness {
+                TypeDefaultness::Optional => input.parse()?,
+                TypeDefaultness::Disallowed => None,
+            };
+            let type_token: Token![type] = input.parse()?;
+            let ident: Ident = input.parse()?;
+            let mut generics: Generics = input.parse()?;
+            let (colon_token, bounds) = Self::parse_optional_bounds(input)?;
+
+            match where_clause_location {
+                WhereClauseLocation::BeforeEq | WhereClauseLocation::Both => {
+                    generics.where_clause = input.parse()?;
+                }
+                WhereClauseLocation::AfterEq => {}
+            }
+
+            let ty = Self::parse_optional_definition(input)?;
+
+            match where_clause_location {
+                WhereClauseLocation::AfterEq | WhereClauseLocation::Both
+                    if generics.where_clause.is_none() =>
+                {
+                    generics.where_clause = input.parse()?;
+                }
+                _ => {}
+            }
+
+            let semi_token: Token![;] = input.parse()?;
+
+            Ok(FlexibleItemType {
+                vis,
+                defaultness,
+                type_token,
+                ident,
+                generics,
+                colon_token,
+                bounds,
+                ty,
+                semi_token,
+            })
+        }
+
+        fn parse_optional_bounds(
+            input: ParseStream,
+        ) -> Result<(Option<Token![:]>, Punctuated<TypeParamBound, Token![+]>)> {
+            let colon_token: Option<Token![:]> = input.parse()?;
+
+            let mut bounds = Punctuated::new();
+            if colon_token.is_some() {
+                loop {
+                    if input.peek(Token![where]) || input.peek(Token![=]) || input.peek(Token![;]) {
+                        break;
+                    }
+                    bounds.push_value(input.parse::<TypeParamBound>()?);
+                    if input.peek(Token![where]) || input.peek(Token![=]) || input.peek(Token![;]) {
+                        break;
+                    }
+                    bounds.push_punct(input.parse::<Token![+]>()?);
+                }
+            }
+
+            Ok((colon_token, bounds))
+        }
+
+        fn parse_optional_definition(input: ParseStream) -> Result<Option<(Token![=], Type)>> {
+            let eq_token: Option<Token![=]> = input.parse()?;
+            if let Some(eq_token) = eq_token {
+                let definition: Type = input.parse()?;
+                Ok(Some((eq_token, definition)))
+            } else {
+                Ok(None)
+            }
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for ItemMacro {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let attrs = input.call(Attribute::parse_outer)?;
+            let path = input.call(Path::parse_mod_style)?;
+            let bang_token: Token![!] = input.parse()?;
+            let ident: Option<Ident> = if input.peek(Token![try]) {
+                input.call(Ident::parse_any).map(Some)
+            } else {
+                input.parse()
+            }?;
+            let (delimiter, tokens) = input.call(mac::parse_delimiter)?;
+            let semi_token: Option<Token![;]> = if !delimiter.is_brace() {
+                Some(input.parse()?)
+            } else {
+                None
+            };
+            Ok(ItemMacro {
+                attrs,
+                ident,
+                mac: Macro {
+                    path,
+                    bang_token,
+                    delimiter,
+                    tokens,
+                },
+                semi_token,
+            })
+        }
+    }
+
+    fn parse_macro2(begin: ParseBuffer, _vis: Visibility, input: ParseStream) -> Result<Item> {
+        input.parse::<Token![macro]>()?;
+        input.parse::<Ident>()?;
+
+        let mut lookahead = input.lookahead1();
+        if lookahead.peek(token::Paren) {
+            let paren_content;
+            parenthesized!(paren_content in input);
+            paren_content.parse::<TokenStream>()?;
+            lookahead = input.lookahead1();
+        }
+
+        if lookahead.peek(token::Brace) {
+            let brace_content;
+            braced!(brace_content in input);
+            brace_content.parse::<TokenStream>()?;
+        } else {
+            return Err(lookahead.error());
+        }
+
+        Ok(Item::Verbatim(verbatim::between(&begin, input)))
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for ItemExternCrate {
+        fn parse(input: ParseStream) -> Result<Self> {
+            Ok(ItemExternCrate {
+                attrs: input.call(Attribute::parse_outer)?,
+                vis: input.parse()?,
+                extern_token: input.parse()?,
+                crate_token: input.parse()?,
+                ident: {
+                    if input.peek(Token![self]) {
+                        input.call(Ident::parse_any)?
+                    } else {
+                        input.parse()?
+                    }
+                },
+                rename: {
+                    if input.peek(Token![as]) {
+                        let as_token: Token![as] = input.parse()?;
+                        let rename: Ident = if input.peek(Token![_]) {
+                            Ident::from(input.parse::<Token![_]>()?)
+                        } else {
+                            input.parse()?
+                        };
+                        Some((as_token, rename))
+                    } else {
+                        None
+                    }
+                },
+                semi_token: input.parse()?,
+            })
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for ItemUse {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let allow_crate_root_in_path = false;
+            parse_item_use(input, allow_crate_root_in_path).map(Option::unwrap)
+        }
+    }
+
+    fn parse_item_use(
+        input: ParseStream,
+        allow_crate_root_in_path: bool,
+    ) -> Result<Option<ItemUse>> {
+        let attrs = input.call(Attribute::parse_outer)?;
+        let vis: Visibility = input.parse()?;
+        let use_token: Token![use] = input.parse()?;
+        let leading_colon: Option<Token![::]> = input.parse()?;
+        let tree = parse_use_tree(input, allow_crate_root_in_path && leading_colon.is_none())?;
+        let semi_token: Token![;] = input.parse()?;
+
+        let tree = match tree {
+            Some(tree) => tree,
+            None => return Ok(None),
+        };
+
+        Ok(Some(ItemUse {
+            attrs,
+            vis,
+            use_token,
+            leading_colon,
+            tree,
+            semi_token,
+        }))
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for UseTree {
+        fn parse(input: ParseStream) -> Result<UseTree> {
+            let allow_crate_root_in_path = false;
+            parse_use_tree(input, allow_crate_root_in_path).map(Option::unwrap)
+        }
+    }
+
+    fn parse_use_tree(
+        input: ParseStream,
+        allow_crate_root_in_path: bool,
+    ) -> Result<Option<UseTree>> {
+        let lookahead = input.lookahead1();
+        if lookahead.peek(Ident)
+            || lookahead.peek(Token![self])
+            || lookahead.peek(Token![super])
+            || lookahead.peek(Token![crate])
+            || lookahead.peek(Token![try])
+        {
+            let ident = input.call(Ident::parse_any)?;
+            if input.peek(Token![::]) {
+                Ok(Some(UseTree::Path(UsePath {
+                    ident,
+                    colon2_token: input.parse()?,
+                    tree: Box::new(input.parse()?),
+                })))
+            } else if input.peek(Token![as]) {
+                Ok(Some(UseTree::Rename(UseRename {
+                    ident,
+                    as_token: input.parse()?,
+                    rename: {
+                        if input.peek(Ident) {
+                            input.parse()?
+                        } else if input.peek(Token![_]) {
+                            Ident::from(input.parse::<Token![_]>()?)
+                        } else {
+                            return Err(input.error("expected identifier or underscore"));
+                        }
+                    },
+                })))
+            } else {
+                Ok(Some(UseTree::Name(UseName { ident })))
+            }
+        } else if lookahead.peek(Token![*]) {
+            Ok(Some(UseTree::Glob(UseGlob {
+                star_token: input.parse()?,
+            })))
+        } else if lookahead.peek(token::Brace) {
+            let content;
+            let brace_token = braced!(content in input);
+            let mut items = Punctuated::new();
+            let mut has_any_crate_root_in_path = false;
+            loop {
+                if content.is_empty() {
+                    break;
+                }
+                let this_tree_starts_with_crate_root =
+                    allow_crate_root_in_path && content.parse::<Option<Token![::]>>()?.is_some();
+                has_any_crate_root_in_path |= this_tree_starts_with_crate_root;
+                match parse_use_tree(
+                    &content,
+                    allow_crate_root_in_path && !this_tree_starts_with_crate_root,
+                )? {
+                    Some(tree) => items.push_value(tree),
+                    None => has_any_crate_root_in_path = true,
+                }
+                if content.is_empty() {
+                    break;
+                }
+                let comma: Token![,] = content.parse()?;
+                items.push_punct(comma);
+            }
+            if has_any_crate_root_in_path {
+                Ok(None)
+            } else {
+                Ok(Some(UseTree::Group(UseGroup { brace_token, items })))
+            }
+        } else {
+            Err(lookahead.error())
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for ItemStatic {
+        fn parse(input: ParseStream) -> Result<Self> {
+            Ok(ItemStatic {
+                attrs: input.call(Attribute::parse_outer)?,
+                vis: input.parse()?,
+                static_token: input.parse()?,
+                mutability: input.parse()?,
+                ident: input.parse()?,
+                colon_token: input.parse()?,
+                ty: input.parse()?,
+                eq_token: input.parse()?,
+                expr: input.parse()?,
+                semi_token: input.parse()?,
+            })
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for ItemConst {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let attrs = input.call(Attribute::parse_outer)?;
+            let vis: Visibility = input.parse()?;
+            let const_token: Token![const] = input.parse()?;
+
+            let lookahead = input.lookahead1();
+            let ident = if lookahead.peek(Ident) || lookahead.peek(Token![_]) {
+                input.call(Ident::parse_any)?
+            } else {
+                return Err(lookahead.error());
+            };
+
+            let colon_token: Token![:] = input.parse()?;
+            let ty: Type = input.parse()?;
+            let eq_token: Token![=] = input.parse()?;
+            let expr: Expr = input.parse()?;
+            let semi_token: Token![;] = input.parse()?;
+
+            Ok(ItemConst {
+                attrs,
+                vis,
+                const_token,
+                ident,
+                generics: Generics::default(),
+                colon_token,
+                ty: Box::new(ty),
+                eq_token,
+                expr: Box::new(expr),
+                semi_token,
+            })
+        }
+    }
+
+    fn peek_signature(input: ParseStream) -> bool {
+        let fork = input.fork();
+        fork.parse::<Option<Token![const]>>().is_ok()
+            && fork.parse::<Option<Token![async]>>().is_ok()
+            && fork.parse::<Option<Token![unsafe]>>().is_ok()
+            && fork.parse::<Option<Abi>>().is_ok()
+            && fork.peek(Token![fn])
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for Signature {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let constness: Option<Token![const]> = input.parse()?;
+            let asyncness: Option<Token![async]> = input.parse()?;
+            let unsafety: Option<Token![unsafe]> = input.parse()?;
+            let abi: Option<Abi> = input.parse()?;
+            let fn_token: Token![fn] = input.parse()?;
+            let ident: Ident = input.parse()?;
+            let mut generics: Generics = input.parse()?;
+
+            let content;
+            let paren_token = parenthesized!(content in input);
+            let (inputs, variadic) = parse_fn_args(&content)?;
+
+            let output: ReturnType = input.parse()?;
+            generics.where_clause = input.parse()?;
+
+            Ok(Signature {
+                constness,
+                asyncness,
+                unsafety,
+                abi,
+                fn_token,
+                ident,
+                generics,
+                paren_token,
+                inputs,
+                variadic,
+                output,
+            })
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for ItemFn {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let outer_attrs = input.call(Attribute::parse_outer)?;
+            let vis: Visibility = input.parse()?;
+            let sig: Signature = input.parse()?;
+            parse_rest_of_fn(input, outer_attrs, vis, sig)
+        }
+    }
+
+    fn parse_rest_of_fn(
+        input: ParseStream,
+        mut attrs: Vec<Attribute>,
+        vis: Visibility,
+        sig: Signature,
+    ) -> Result<ItemFn> {
+        let content;
+        let brace_token = braced!(content in input);
+        attr::parsing::parse_inner(&content, &mut attrs)?;
+        let stmts = content.call(Block::parse_within)?;
+
+        Ok(ItemFn {
+            attrs,
+            vis,
+            sig,
+            block: Box::new(Block { brace_token, stmts }),
+        })
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for FnArg {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let allow_variadic = false;
+            let attrs = input.call(Attribute::parse_outer)?;
+            match parse_fn_arg_or_variadic(input, attrs, allow_variadic)? {
+                FnArgOrVariadic::FnArg(arg) => Ok(arg),
+                FnArgOrVariadic::Variadic(_) => unreachable!(),
+            }
+        }
+    }
+
+    enum FnArgOrVariadic {
+        FnArg(FnArg),
+        Variadic(Variadic),
+    }
+
+    fn parse_fn_arg_or_variadic(
+        input: ParseStream,
+        attrs: Vec<Attribute>,
+        allow_variadic: bool,
+    ) -> Result<FnArgOrVariadic> {
+        let ahead = input.fork();
+        if let Ok(mut receiver) = ahead.parse::<Receiver>() {
+            input.advance_to(&ahead);
+            receiver.attrs = attrs;
+            return Ok(FnArgOrVariadic::FnArg(FnArg::Receiver(receiver)));
+        }
+
+        // Hack to parse pre-2018 syntax in
+        // test/ui/rfc-2565-param-attrs/param-attrs-pretty.rs
+        // because the rest of the test case is valuable.
+        if input.peek(Ident) && input.peek2(Token![<]) {
+            let span = input.fork().parse::<Ident>()?.span();
+            return Ok(FnArgOrVariadic::FnArg(FnArg::Typed(PatType {
+                attrs,
+                pat: Box::new(Pat::Wild(PatWild {
+                    attrs: Vec::new(),
+                    underscore_token: Token![_](span),
+                })),
+                colon_token: Token![:](span),
+                ty: input.parse()?,
+            })));
+        }
+
+        let pat = Box::new(Pat::parse_single(input)?);
+        let colon_token: Token![:] = input.parse()?;
+
+        if allow_variadic {
+            if let Some(dots) = input.parse::<Option<Token![...]>>()? {
+                return Ok(FnArgOrVariadic::Variadic(Variadic {
+                    attrs,
+                    pat: Some((pat, colon_token)),
+                    dots,
+                    comma: None,
+                }));
+            }
+        }
+
+        Ok(FnArgOrVariadic::FnArg(FnArg::Typed(PatType {
+            attrs,
+            pat,
+            colon_token,
+            ty: input.parse()?,
+        })))
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for Receiver {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let reference = if input.peek(Token![&]) {
+                let ampersand: Token![&] = input.parse()?;
+                let lifetime: Option<Lifetime> = input.parse()?;
+                Some((ampersand, lifetime))
+            } else {
+                None
+            };
+            let mutability: Option<Token![mut]> = input.parse()?;
+            let self_token: Token![self] = input.parse()?;
+            let colon_token: Option<Token![:]> = if reference.is_some() {
+                None
+            } else {
+                input.parse()?
+            };
+            let ty: Type = if colon_token.is_some() {
+                input.parse()?
+            } else {
+                let mut ty = Type::Path(TypePath {
+                    qself: None,
+                    path: Path::from(Ident::new("Self", self_token.span)),
+                });
+                if let Some((ampersand, lifetime)) = reference.as_ref() {
+                    ty = Type::Reference(TypeReference {
+                        and_token: Token![&](ampersand.span),
+                        lifetime: lifetime.clone(),
+                        mutability: mutability.as_ref().map(|m| Token![mut](m.span)),
+                        elem: Box::new(ty),
+                    });
+                }
+                ty
+            };
+            Ok(Receiver {
+                attrs: Vec::new(),
+                reference,
+                mutability,
+                self_token,
+                colon_token,
+                ty: Box::new(ty),
+            })
+        }
+    }
+
+    fn parse_fn_args(
+        input: ParseStream,
+    ) -> Result<(Punctuated<FnArg, Token![,]>, Option<Variadic>)> {
+        let mut args = Punctuated::new();
+        let mut variadic = None;
+        let mut has_receiver = false;
+
+        while !input.is_empty() {
+            let attrs = input.call(Attribute::parse_outer)?;
+
+            if let Some(dots) = input.parse::<Option<Token![...]>>()? {
+                variadic = Some(Variadic {
+                    attrs,
+                    pat: None,
+                    dots,
+                    comma: if input.is_empty() {
+                        None
+                    } else {
+                        Some(input.parse()?)
+                    },
+                });
+                break;
+            }
+
+            let allow_variadic = true;
+            let arg = match parse_fn_arg_or_variadic(input, attrs, allow_variadic)? {
+                FnArgOrVariadic::FnArg(arg) => arg,
+                FnArgOrVariadic::Variadic(arg) => {
+                    variadic = Some(Variadic {
+                        comma: if input.is_empty() {
+                            None
+                        } else {
+                            Some(input.parse()?)
+                        },
+                        ..arg
+                    });
+                    break;
+                }
+            };
+
+            match &arg {
+                FnArg::Receiver(receiver) if has_receiver => {
+                    return Err(Error::new(
+                        receiver.self_token.span,
+                        "unexpected second method receiver",
+                    ));
+                }
+                FnArg::Receiver(receiver) if !args.is_empty() => {
+                    return Err(Error::new(
+                        receiver.self_token.span,
+                        "unexpected method receiver",
+                    ));
+                }
+                FnArg::Receiver(_) => has_receiver = true,
+                FnArg::Typed(_) => {}
+            }
+            args.push_value(arg);
+
+            if input.is_empty() {
+                break;
+            }
+
+            let comma: Token![,] = input.parse()?;
+            args.push_punct(comma);
+        }
+
+        Ok((args, variadic))
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for ItemMod {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let mut attrs = input.call(Attribute::parse_outer)?;
+            let vis: Visibility = input.parse()?;
+            let unsafety: Option<Token![unsafe]> = input.parse()?;
+            let mod_token: Token![mod] = input.parse()?;
+            let ident: Ident = if input.peek(Token![try]) {
+                input.call(Ident::parse_any)
+            } else {
+                input.parse()
+            }?;
+
+            let lookahead = input.lookahead1();
+            if lookahead.peek(Token![;]) {
+                Ok(ItemMod {
+                    attrs,
+                    vis,
+                    unsafety,
+                    mod_token,
+                    ident,
+                    content: None,
+                    semi: Some(input.parse()?),
+                })
+            } else if lookahead.peek(token::Brace) {
+                let content;
+                let brace_token = braced!(content in input);
+                attr::parsing::parse_inner(&content, &mut attrs)?;
+
+                let mut items = Vec::new();
+                while !content.is_empty() {
+                    items.push(content.parse()?);
+                }
+
+                Ok(ItemMod {
+                    attrs,
+                    vis,
+                    unsafety,
+                    mod_token,
+                    ident,
+                    content: Some((brace_token, items)),
+                    semi: None,
+                })
+            } else {
+                Err(lookahead.error())
+            }
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for ItemForeignMod {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let mut attrs = input.call(Attribute::parse_outer)?;
+            let unsafety: Option<Token![unsafe]> = input.parse()?;
+            let abi: Abi = input.parse()?;
+
+            let content;
+            let brace_token = braced!(content in input);
+            attr::parsing::parse_inner(&content, &mut attrs)?;
+            let mut items = Vec::new();
+            while !content.is_empty() {
+                items.push(content.parse()?);
+            }
+
+            Ok(ItemForeignMod {
+                attrs,
+                unsafety,
+                abi,
+                brace_token,
+                items,
+            })
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for ForeignItem {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let begin = input.fork();
+            let mut attrs = input.call(Attribute::parse_outer)?;
+            let ahead = input.fork();
+            let vis: Visibility = ahead.parse()?;
+
+            let lookahead = ahead.lookahead1();
+            let mut item = if lookahead.peek(Token![fn]) || peek_signature(&ahead) {
+                let vis: Visibility = input.parse()?;
+                let sig: Signature = input.parse()?;
+                if input.peek(token::Brace) {
+                    let content;
+                    braced!(content in input);
+                    content.call(Attribute::parse_inner)?;
+                    content.call(Block::parse_within)?;
+
+                    Ok(ForeignItem::Verbatim(verbatim::between(&begin, input)))
+                } else {
+                    Ok(ForeignItem::Fn(ForeignItemFn {
+                        attrs: Vec::new(),
+                        vis,
+                        sig,
+                        semi_token: input.parse()?,
+                    }))
+                }
+            } else if lookahead.peek(Token![static]) {
+                let vis = input.parse()?;
+                let static_token = input.parse()?;
+                let mutability = input.parse()?;
+                let ident = input.parse()?;
+                let colon_token = input.parse()?;
+                let ty = input.parse()?;
+                if input.peek(Token![=]) {
+                    input.parse::<Token![=]>()?;
+                    input.parse::<Expr>()?;
+                    input.parse::<Token![;]>()?;
+                    Ok(ForeignItem::Verbatim(verbatim::between(&begin, input)))
+                } else {
+                    Ok(ForeignItem::Static(ForeignItemStatic {
+                        attrs: Vec::new(),
+                        vis,
+                        static_token,
+                        mutability,
+                        ident,
+                        colon_token,
+                        ty,
+                        semi_token: input.parse()?,
+                    }))
+                }
+            } else if lookahead.peek(Token![type]) {
+                parse_foreign_item_type(begin, input)
+            } else if vis.is_inherited()
+                && (lookahead.peek(Ident)
+                    || lookahead.peek(Token![self])
+                    || lookahead.peek(Token![super])
+                    || lookahead.peek(Token![crate])
+                    || lookahead.peek(Token![::]))
+            {
+                input.parse().map(ForeignItem::Macro)
+            } else {
+                Err(lookahead.error())
+            }?;
+
+            let item_attrs = match &mut item {
+                ForeignItem::Fn(item) => &mut item.attrs,
+                ForeignItem::Static(item) => &mut item.attrs,
+                ForeignItem::Type(item) => &mut item.attrs,
+                ForeignItem::Macro(item) => &mut item.attrs,
+                ForeignItem::Verbatim(_) => return Ok(item),
+            };
+            attrs.append(item_attrs);
+            *item_attrs = attrs;
+
+            Ok(item)
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for ForeignItemFn {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let attrs = input.call(Attribute::parse_outer)?;
+            let vis: Visibility = input.parse()?;
+            let sig: Signature = input.parse()?;
+            let semi_token: Token![;] = input.parse()?;
+            Ok(ForeignItemFn {
+                attrs,
+                vis,
+                sig,
+                semi_token,
+            })
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for ForeignItemStatic {
+        fn parse(input: ParseStream) -> Result<Self> {
+            Ok(ForeignItemStatic {
+                attrs: input.call(Attribute::parse_outer)?,
+                vis: input.parse()?,
+                static_token: input.parse()?,
+                mutability: input.parse()?,
+                ident: input.parse()?,
+                colon_token: input.parse()?,
+                ty: input.parse()?,
+                semi_token: input.parse()?,
+            })
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for ForeignItemType {
+        fn parse(input: ParseStream) -> Result<Self> {
+            Ok(ForeignItemType {
+                attrs: input.call(Attribute::parse_outer)?,
+                vis: input.parse()?,
+                type_token: input.parse()?,
+                ident: input.parse()?,
+                generics: {
+                    let mut generics: Generics = input.parse()?;
+                    generics.where_clause = input.parse()?;
+                    generics
+                },
+                semi_token: input.parse()?,
+            })
+        }
+    }
+
+    fn parse_foreign_item_type(begin: ParseBuffer, input: ParseStream) -> Result<ForeignItem> {
+        let FlexibleItemType {
+            vis,
+            defaultness: _,
+            type_token,
+            ident,
+            generics,
+            colon_token,
+            bounds: _,
+            ty,
+            semi_token,
+        } = FlexibleItemType::parse(
+            input,
+            TypeDefaultness::Disallowed,
+            WhereClauseLocation::Both,
+        )?;
+
+        if colon_token.is_some() || ty.is_some() {
+            Ok(ForeignItem::Verbatim(verbatim::between(&begin, input)))
+        } else {
+            Ok(ForeignItem::Type(ForeignItemType {
+                attrs: Vec::new(),
+                vis,
+                type_token,
+                ident,
+                generics,
+                semi_token,
+            }))
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for ForeignItemMacro {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let attrs = input.call(Attribute::parse_outer)?;
+            let mac: Macro = input.parse()?;
+            let semi_token: Option<Token![;]> = if mac.delimiter.is_brace() {
+                None
+            } else {
+                Some(input.parse()?)
+            };
+            Ok(ForeignItemMacro {
+                attrs,
+                mac,
+                semi_token,
+            })
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for ItemType {
+        fn parse(input: ParseStream) -> Result<Self> {
+            Ok(ItemType {
+                attrs: input.call(Attribute::parse_outer)?,
+                vis: input.parse()?,
+                type_token: input.parse()?,
+                ident: input.parse()?,
+                generics: {
+                    let mut generics: Generics = input.parse()?;
+                    generics.where_clause = input.parse()?;
+                    generics
+                },
+                eq_token: input.parse()?,
+                ty: input.parse()?,
+                semi_token: input.parse()?,
+            })
+        }
+    }
+
+    fn parse_item_type(begin: ParseBuffer, input: ParseStream) -> Result<Item> {
+        let FlexibleItemType {
+            vis,
+            defaultness: _,
+            type_token,
+            ident,
+            generics,
+            colon_token,
+            bounds: _,
+            ty,
+            semi_token,
+        } = FlexibleItemType::parse(
+            input,
+            TypeDefaultness::Disallowed,
+            WhereClauseLocation::BeforeEq,
+        )?;
+
+        let (eq_token, ty) = match ty {
+            Some(ty) if colon_token.is_none() => ty,
+            _ => return Ok(Item::Verbatim(verbatim::between(&begin, input))),
+        };
+
+        Ok(Item::Type(ItemType {
+            attrs: Vec::new(),
+            vis,
+            type_token,
+            ident,
+            generics,
+            eq_token,
+            ty: Box::new(ty),
+            semi_token,
+        }))
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for ItemStruct {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let attrs = input.call(Attribute::parse_outer)?;
+            let vis = input.parse::<Visibility>()?;
+            let struct_token = input.parse::<Token![struct]>()?;
+            let ident = input.parse::<Ident>()?;
+            let generics = input.parse::<Generics>()?;
+            let (where_clause, fields, semi_token) = derive::parsing::data_struct(input)?;
+            Ok(ItemStruct {
+                attrs,
+                vis,
+                struct_token,
+                ident,
+                generics: Generics {
+                    where_clause,
+                    ..generics
+                },
+                fields,
+                semi_token,
+            })
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for ItemEnum {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let attrs = input.call(Attribute::parse_outer)?;
+            let vis = input.parse::<Visibility>()?;
+            let enum_token = input.parse::<Token![enum]>()?;
+            let ident = input.parse::<Ident>()?;
+            let generics = input.parse::<Generics>()?;
+            let (where_clause, brace_token, variants) = derive::parsing::data_enum(input)?;
+            Ok(ItemEnum {
+                attrs,
+                vis,
+                enum_token,
+                ident,
+                generics: Generics {
+                    where_clause,
+                    ..generics
+                },
+                brace_token,
+                variants,
+            })
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for ItemUnion {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let attrs = input.call(Attribute::parse_outer)?;
+            let vis = input.parse::<Visibility>()?;
+            let union_token = input.parse::<Token![union]>()?;
+            let ident = input.parse::<Ident>()?;
+            let generics = input.parse::<Generics>()?;
+            let (where_clause, fields) = derive::parsing::data_union(input)?;
+            Ok(ItemUnion {
+                attrs,
+                vis,
+                union_token,
+                ident,
+                generics: Generics {
+                    where_clause,
+                    ..generics
+                },
+                fields,
+            })
+        }
+    }
+
+    fn parse_trait_or_trait_alias(input: ParseStream) -> Result<Item> {
+        let (attrs, vis, trait_token, ident, generics) = parse_start_of_trait_alias(input)?;
+        let lookahead = input.lookahead1();
+        if lookahead.peek(token::Brace)
+            || lookahead.peek(Token![:])
+            || lookahead.peek(Token![where])
+        {
+            let unsafety = None;
+            let auto_token = None;
+            parse_rest_of_trait(
+                input,
+                attrs,
+                vis,
+                unsafety,
+                auto_token,
+                trait_token,
+                ident,
+                generics,
+            )
+            .map(Item::Trait)
+        } else if lookahead.peek(Token![=]) {
+            parse_rest_of_trait_alias(input, attrs, vis, trait_token, ident, generics)
+                .map(Item::TraitAlias)
+        } else {
+            Err(lookahead.error())
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for ItemTrait {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let outer_attrs = input.call(Attribute::parse_outer)?;
+            let vis: Visibility = input.parse()?;
+            let unsafety: Option<Token![unsafe]> = input.parse()?;
+            let auto_token: Option<Token![auto]> = input.parse()?;
+            let trait_token: Token![trait] = input.parse()?;
+            let ident: Ident = input.parse()?;
+            let generics: Generics = input.parse()?;
+            parse_rest_of_trait(
+                input,
+                outer_attrs,
+                vis,
+                unsafety,
+                auto_token,
+                trait_token,
+                ident,
+                generics,
+            )
+        }
+    }
+
+    fn parse_rest_of_trait(
+        input: ParseStream,
+        mut attrs: Vec<Attribute>,
+        vis: Visibility,
+        unsafety: Option<Token![unsafe]>,
+        auto_token: Option<Token![auto]>,
+        trait_token: Token![trait],
+        ident: Ident,
+        mut generics: Generics,
+    ) -> Result<ItemTrait> {
+        let colon_token: Option<Token![:]> = input.parse()?;
+
+        let mut supertraits = Punctuated::new();
+        if colon_token.is_some() {
+            loop {
+                if input.peek(Token![where]) || input.peek(token::Brace) {
+                    break;
+                }
+                supertraits.push_value(input.parse()?);
+                if input.peek(Token![where]) || input.peek(token::Brace) {
+                    break;
+                }
+                supertraits.push_punct(input.parse()?);
+            }
+        }
+
+        generics.where_clause = input.parse()?;
+
+        let content;
+        let brace_token = braced!(content in input);
+        attr::parsing::parse_inner(&content, &mut attrs)?;
+        let mut items = Vec::new();
+        while !content.is_empty() {
+            items.push(content.parse()?);
+        }
+
+        Ok(ItemTrait {
+            attrs,
+            vis,
+            unsafety,
+            auto_token,
+            restriction: None,
+            trait_token,
+            ident,
+            generics,
+            colon_token,
+            supertraits,
+            brace_token,
+            items,
+        })
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for ItemTraitAlias {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let (attrs, vis, trait_token, ident, generics) = parse_start_of_trait_alias(input)?;
+            parse_rest_of_trait_alias(input, attrs, vis, trait_token, ident, generics)
+        }
+    }
+
+    fn parse_start_of_trait_alias(
+        input: ParseStream,
+    ) -> Result<(Vec<Attribute>, Visibility, Token![trait], Ident, Generics)> {
+        let attrs = input.call(Attribute::parse_outer)?;
+        let vis: Visibility = input.parse()?;
+        let trait_token: Token![trait] = input.parse()?;
+        let ident: Ident = input.parse()?;
+        let generics: Generics = input.parse()?;
+        Ok((attrs, vis, trait_token, ident, generics))
+    }
+
+    fn parse_rest_of_trait_alias(
+        input: ParseStream,
+        attrs: Vec<Attribute>,
+        vis: Visibility,
+        trait_token: Token![trait],
+        ident: Ident,
+        mut generics: Generics,
+    ) -> Result<ItemTraitAlias> {
+        let eq_token: Token![=] = input.parse()?;
+
+        let mut bounds = Punctuated::new();
+        loop {
+            if input.peek(Token![where]) || input.peek(Token![;]) {
+                break;
+            }
+            bounds.push_value(input.parse()?);
+            if input.peek(Token![where]) || input.peek(Token![;]) {
+                break;
+            }
+            bounds.push_punct(input.parse()?);
+        }
+
+        generics.where_clause = input.parse()?;
+        let semi_token: Token![;] = input.parse()?;
+
+        Ok(ItemTraitAlias {
+            attrs,
+            vis,
+            trait_token,
+            ident,
+            generics,
+            eq_token,
+            bounds,
+            semi_token,
+        })
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for TraitItem {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let begin = input.fork();
+            let mut attrs = input.call(Attribute::parse_outer)?;
+            let vis: Visibility = input.parse()?;
+            let defaultness: Option<Token![default]> = input.parse()?;
+            let ahead = input.fork();
+
+            let lookahead = ahead.lookahead1();
+            let mut item = if lookahead.peek(Token![fn]) || peek_signature(&ahead) {
+                input.parse().map(TraitItem::Fn)
+            } else if lookahead.peek(Token![const]) {
+                let const_token: Token![const] = ahead.parse()?;
+                let lookahead = ahead.lookahead1();
+                if lookahead.peek(Ident) || lookahead.peek(Token![_]) {
+                    input.advance_to(&ahead);
+                    let ident = input.call(Ident::parse_any)?;
+                    let mut generics: Generics = input.parse()?;
+                    let colon_token: Token![:] = input.parse()?;
+                    let ty: Type = input.parse()?;
+                    let default = if let Some(eq_token) = input.parse::<Option<Token![=]>>()? {
+                        let expr: Expr = input.parse()?;
+                        Some((eq_token, expr))
+                    } else {
+                        None
+                    };
+                    generics.where_clause = input.parse()?;
+                    let semi_token: Token![;] = input.parse()?;
+                    if generics.lt_token.is_none() && generics.where_clause.is_none() {
+                        Ok(TraitItem::Const(TraitItemConst {
+                            attrs: Vec::new(),
+                            const_token,
+                            ident,
+                            generics,
+                            colon_token,
+                            ty,
+                            default,
+                            semi_token,
+                        }))
+                    } else {
+                        return Ok(TraitItem::Verbatim(verbatim::between(&begin, input)));
+                    }
+                } else if lookahead.peek(Token![async])
+                    || lookahead.peek(Token![unsafe])
+                    || lookahead.peek(Token![extern])
+                    || lookahead.peek(Token![fn])
+                {
+                    input.parse().map(TraitItem::Fn)
+                } else {
+                    Err(lookahead.error())
+                }
+            } else if lookahead.peek(Token![type]) {
+                parse_trait_item_type(begin.fork(), input)
+            } else if vis.is_inherited()
+                && defaultness.is_none()
+                && (lookahead.peek(Ident)
+                    || lookahead.peek(Token![self])
+                    || lookahead.peek(Token![super])
+                    || lookahead.peek(Token![crate])
+                    || lookahead.peek(Token![::]))
+            {
+                input.parse().map(TraitItem::Macro)
+            } else {
+                Err(lookahead.error())
+            }?;
+
+            match (vis, defaultness) {
+                (Visibility::Inherited, None) => {}
+                _ => return Ok(TraitItem::Verbatim(verbatim::between(&begin, input))),
+            }
+
+            let item_attrs = match &mut item {
+                TraitItem::Const(item) => &mut item.attrs,
+                TraitItem::Fn(item) => &mut item.attrs,
+                TraitItem::Type(item) => &mut item.attrs,
+                TraitItem::Macro(item) => &mut item.attrs,
+                TraitItem::Verbatim(_) => unreachable!(),
+            };
+            attrs.append(item_attrs);
+            *item_attrs = attrs;
+            Ok(item)
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for TraitItemConst {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let attrs = input.call(Attribute::parse_outer)?;
+            let const_token: Token![const] = input.parse()?;
+
+            let lookahead = input.lookahead1();
+            let ident = if lookahead.peek(Ident) || lookahead.peek(Token![_]) {
+                input.call(Ident::parse_any)?
+            } else {
+                return Err(lookahead.error());
+            };
+
+            let colon_token: Token![:] = input.parse()?;
+            let ty: Type = input.parse()?;
+            let default = if input.peek(Token![=]) {
+                let eq_token: Token![=] = input.parse()?;
+                let default: Expr = input.parse()?;
+                Some((eq_token, default))
+            } else {
+                None
+            };
+            let semi_token: Token![;] = input.parse()?;
+
+            Ok(TraitItemConst {
+                attrs,
+                const_token,
+                ident,
+                generics: Generics::default(),
+                colon_token,
+                ty,
+                default,
+                semi_token,
+            })
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for TraitItemFn {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let mut attrs = input.call(Attribute::parse_outer)?;
+            let sig: Signature = input.parse()?;
+
+            let lookahead = input.lookahead1();
+            let (brace_token, stmts, semi_token) = if lookahead.peek(token::Brace) {
+                let content;
+                let brace_token = braced!(content in input);
+                attr::parsing::parse_inner(&content, &mut attrs)?;
+                let stmts = content.call(Block::parse_within)?;
+                (Some(brace_token), stmts, None)
+            } else if lookahead.peek(Token![;]) {
+                let semi_token: Token![;] = input.parse()?;
+                (None, Vec::new(), Some(semi_token))
+            } else {
+                return Err(lookahead.error());
+            };
+
+            Ok(TraitItemFn {
+                attrs,
+                sig,
+                default: brace_token.map(|brace_token| Block { brace_token, stmts }),
+                semi_token,
+            })
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for TraitItemType {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let attrs = input.call(Attribute::parse_outer)?;
+            let type_token: Token![type] = input.parse()?;
+            let ident: Ident = input.parse()?;
+            let mut generics: Generics = input.parse()?;
+            let (colon_token, bounds) = FlexibleItemType::parse_optional_bounds(input)?;
+            let default = FlexibleItemType::parse_optional_definition(input)?;
+            generics.where_clause = input.parse()?;
+            let semi_token: Token![;] = input.parse()?;
+            Ok(TraitItemType {
+                attrs,
+                type_token,
+                ident,
+                generics,
+                colon_token,
+                bounds,
+                default,
+                semi_token,
+            })
+        }
+    }
+
+    fn parse_trait_item_type(begin: ParseBuffer, input: ParseStream) -> Result<TraitItem> {
+        let FlexibleItemType {
+            vis,
+            defaultness: _,
+            type_token,
+            ident,
+            generics,
+            colon_token,
+            bounds,
+            ty,
+            semi_token,
+        } = FlexibleItemType::parse(
+            input,
+            TypeDefaultness::Disallowed,
+            WhereClauseLocation::AfterEq,
+        )?;
+
+        if vis.is_some() {
+            Ok(TraitItem::Verbatim(verbatim::between(&begin, input)))
+        } else {
+            Ok(TraitItem::Type(TraitItemType {
+                attrs: Vec::new(),
+                type_token,
+                ident,
+                generics,
+                colon_token,
+                bounds,
+                default: ty,
+                semi_token,
+            }))
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for TraitItemMacro {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let attrs = input.call(Attribute::parse_outer)?;
+            let mac: Macro = input.parse()?;
+            let semi_token: Option<Token![;]> = if mac.delimiter.is_brace() {
+                None
+            } else {
+                Some(input.parse()?)
+            };
+            Ok(TraitItemMacro {
+                attrs,
+                mac,
+                semi_token,
+            })
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for ItemImpl {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let allow_verbatim_impl = false;
+            parse_impl(input, allow_verbatim_impl).map(Option::unwrap)
+        }
+    }
+
+    fn parse_impl(input: ParseStream, allow_verbatim_impl: bool) -> Result<Option<ItemImpl>> {
+        let mut attrs = input.call(Attribute::parse_outer)?;
+        let has_visibility = allow_verbatim_impl && input.parse::<Visibility>()?.is_some();
+        let defaultness: Option<Token![default]> = input.parse()?;
+        let unsafety: Option<Token![unsafe]> = input.parse()?;
+        let impl_token: Token![impl] = input.parse()?;
+
+        let has_generics = input.peek(Token![<])
+            && (input.peek2(Token![>])
+                || input.peek2(Token![#])
+                || (input.peek2(Ident) || input.peek2(Lifetime))
+                    && (input.peek3(Token![:])
+                        || input.peek3(Token![,])
+                        || input.peek3(Token![>])
+                        || input.peek3(Token![=]))
+                || input.peek2(Token![const]));
+        let mut generics: Generics = if has_generics {
+            input.parse()?
+        } else {
+            Generics::default()
+        };
+
+        let is_const_impl = allow_verbatim_impl
+            && (input.peek(Token![const]) || input.peek(Token![?]) && input.peek2(Token![const]));
+        if is_const_impl {
+            input.parse::<Option<Token![?]>>()?;
+            input.parse::<Token![const]>()?;
+        }
+
+        let begin = input.fork();
+        let polarity = if input.peek(Token![!]) && !input.peek2(token::Brace) {
+            Some(input.parse::<Token![!]>()?)
+        } else {
+            None
+        };
+
+        #[cfg(not(feature = "printing"))]
+        let first_ty_span = input.span();
+        let mut first_ty: Type = input.parse()?;
+        let self_ty: Type;
+        let trait_;
+
+        let is_impl_for = input.peek(Token![for]);
+        if is_impl_for {
+            let for_token: Token![for] = input.parse()?;
+            let mut first_ty_ref = &first_ty;
+            while let Type::Group(ty) = first_ty_ref {
+                first_ty_ref = &ty.elem;
+            }
+            if let Type::Path(TypePath { qself: None, .. }) = first_ty_ref {
+                while let Type::Group(ty) = first_ty {
+                    first_ty = *ty.elem;
+                }
+                if let Type::Path(TypePath { qself: None, path }) = first_ty {
+                    trait_ = Some((polarity, path, for_token));
+                } else {
+                    unreachable!();
+                }
+            } else if !allow_verbatim_impl {
+                #[cfg(feature = "printing")]
+                return Err(Error::new_spanned(first_ty_ref, "expected trait path"));
+                #[cfg(not(feature = "printing"))]
+                return Err(Error::new(first_ty_span, "expected trait path"));
+            } else {
+                trait_ = None;
+            }
+            self_ty = input.parse()?;
+        } else {
+            trait_ = None;
+            self_ty = if polarity.is_none() {
+                first_ty
+            } else {
+                Type::Verbatim(verbatim::between(&begin, input))
+            };
+        }
+
+        generics.where_clause = input.parse()?;
+
+        let content;
+        let brace_token = braced!(content in input);
+        attr::parsing::parse_inner(&content, &mut attrs)?;
+
+        let mut items = Vec::new();
+        while !content.is_empty() {
+            items.push(content.parse()?);
+        }
+
+        if has_visibility || is_const_impl || is_impl_for && trait_.is_none() {
+            Ok(None)
+        } else {
+            Ok(Some(ItemImpl {
+                attrs,
+                defaultness,
+                unsafety,
+                impl_token,
+                generics,
+                trait_,
+                self_ty: Box::new(self_ty),
+                brace_token,
+                items,
+            }))
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for ImplItem {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let begin = input.fork();
+            let mut attrs = input.call(Attribute::parse_outer)?;
+            let ahead = input.fork();
+            let vis: Visibility = ahead.parse()?;
+
+            let mut lookahead = ahead.lookahead1();
+            let defaultness = if lookahead.peek(Token![default]) && !ahead.peek2(Token![!]) {
+                let defaultness: Token![default] = ahead.parse()?;
+                lookahead = ahead.lookahead1();
+                Some(defaultness)
+            } else {
+                None
+            };
+
+            let mut item = if lookahead.peek(Token![fn]) || peek_signature(&ahead) {
+                let allow_omitted_body = true;
+                if let Some(item) = parse_impl_item_fn(input, allow_omitted_body)? {
+                    Ok(ImplItem::Fn(item))
+                } else {
+                    Ok(ImplItem::Verbatim(verbatim::between(&begin, input)))
+                }
+            } else if lookahead.peek(Token![const]) {
+                input.advance_to(&ahead);
+                let const_token: Token![const] = input.parse()?;
+                let lookahead = input.lookahead1();
+                let ident = if lookahead.peek(Ident) || lookahead.peek(Token![_]) {
+                    input.call(Ident::parse_any)?
+                } else {
+                    return Err(lookahead.error());
+                };
+                let mut generics: Generics = input.parse()?;
+                let colon_token: Token![:] = input.parse()?;
+                let ty: Type = input.parse()?;
+                let value = if let Some(eq_token) = input.parse::<Option<Token![=]>>()? {
+                    let expr: Expr = input.parse()?;
+                    Some((eq_token, expr))
+                } else {
+                    None
+                };
+                generics.where_clause = input.parse()?;
+                let semi_token: Token![;] = input.parse()?;
+                return match value {
+                    Some((eq_token, expr))
+                        if generics.lt_token.is_none() && generics.where_clause.is_none() =>
+                    {
+                        Ok(ImplItem::Const(ImplItemConst {
+                            attrs,
+                            vis,
+                            defaultness,
+                            const_token,
+                            ident,
+                            generics,
+                            colon_token,
+                            ty,
+                            eq_token,
+                            expr,
+                            semi_token,
+                        }))
+                    }
+                    _ => Ok(ImplItem::Verbatim(verbatim::between(&begin, input))),
+                };
+            } else if lookahead.peek(Token![type]) {
+                parse_impl_item_type(begin, input)
+            } else if vis.is_inherited()
+                && defaultness.is_none()
+                && (lookahead.peek(Ident)
+                    || lookahead.peek(Token![self])
+                    || lookahead.peek(Token![super])
+                    || lookahead.peek(Token![crate])
+                    || lookahead.peek(Token![::]))
+            {
+                input.parse().map(ImplItem::Macro)
+            } else {
+                Err(lookahead.error())
+            }?;
+
+            {
+                let item_attrs = match &mut item {
+                    ImplItem::Const(item) => &mut item.attrs,
+                    ImplItem::Fn(item) => &mut item.attrs,
+                    ImplItem::Type(item) => &mut item.attrs,
+                    ImplItem::Macro(item) => &mut item.attrs,
+                    ImplItem::Verbatim(_) => return Ok(item),
+                };
+                attrs.append(item_attrs);
+                *item_attrs = attrs;
+            }
+
+            Ok(item)
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for ImplItemConst {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let attrs = input.call(Attribute::parse_outer)?;
+            let vis: Visibility = input.parse()?;
+            let defaultness: Option<Token![default]> = input.parse()?;
+            let const_token: Token![const] = input.parse()?;
+
+            let lookahead = input.lookahead1();
+            let ident = if lookahead.peek(Ident) || lookahead.peek(Token![_]) {
+                input.call(Ident::parse_any)?
+            } else {
+                return Err(lookahead.error());
+            };
+
+            let colon_token: Token![:] = input.parse()?;
+            let ty: Type = input.parse()?;
+            let eq_token: Token![=] = input.parse()?;
+            let expr: Expr = input.parse()?;
+            let semi_token: Token![;] = input.parse()?;
+
+            Ok(ImplItemConst {
+                attrs,
+                vis,
+                defaultness,
+                const_token,
+                ident,
+                generics: Generics::default(),
+                colon_token,
+                ty,
+                eq_token,
+                expr,
+                semi_token,
+            })
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for ImplItemFn {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let allow_omitted_body = false;
+            parse_impl_item_fn(input, allow_omitted_body).map(Option::unwrap)
+        }
+    }
+
+    fn parse_impl_item_fn(
+        input: ParseStream,
+        allow_omitted_body: bool,
+    ) -> Result<Option<ImplItemFn>> {
+        let mut attrs = input.call(Attribute::parse_outer)?;
+        let vis: Visibility = input.parse()?;
+        let defaultness: Option<Token![default]> = input.parse()?;
+        let sig: Signature = input.parse()?;
+
+        // Accept functions without a body in an impl block because rustc's
+        // *parser* does not reject them (the compilation error is emitted later
+        // than parsing) and it can be useful for macro DSLs.
+        if allow_omitted_body && input.parse::<Option<Token![;]>>()?.is_some() {
+            return Ok(None);
+        }
+
+        let content;
+        let brace_token = braced!(content in input);
+        attrs.extend(content.call(Attribute::parse_inner)?);
+        let block = Block {
+            brace_token,
+            stmts: content.call(Block::parse_within)?,
+        };
+
+        Ok(Some(ImplItemFn {
+            attrs,
+            vis,
+            defaultness,
+            sig,
+            block,
+        }))
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for ImplItemType {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let attrs = input.call(Attribute::parse_outer)?;
+            let vis: Visibility = input.parse()?;
+            let defaultness: Option<Token![default]> = input.parse()?;
+            let type_token: Token![type] = input.parse()?;
+            let ident: Ident = input.parse()?;
+            let mut generics: Generics = input.parse()?;
+            let eq_token: Token![=] = input.parse()?;
+            let ty: Type = input.parse()?;
+            generics.where_clause = input.parse()?;
+            let semi_token: Token![;] = input.parse()?;
+            Ok(ImplItemType {
+                attrs,
+                vis,
+                defaultness,
+                type_token,
+                ident,
+                generics,
+                eq_token,
+                ty,
+                semi_token,
+            })
+        }
+    }
+
+    fn parse_impl_item_type(begin: ParseBuffer, input: ParseStream) -> Result<ImplItem> {
+        let FlexibleItemType {
+            vis,
+            defaultness,
+            type_token,
+            ident,
+            generics,
+            colon_token,
+            bounds: _,
+            ty,
+            semi_token,
+        } = FlexibleItemType::parse(
+            input,
+            TypeDefaultness::Optional,
+            WhereClauseLocation::AfterEq,
+        )?;
+
+        let (eq_token, ty) = match ty {
+            Some(ty) if colon_token.is_none() => ty,
+            _ => return Ok(ImplItem::Verbatim(verbatim::between(&begin, input))),
+        };
+
+        Ok(ImplItem::Type(ImplItemType {
+            attrs: Vec::new(),
+            vis,
+            defaultness,
+            type_token,
+            ident,
+            generics,
+            eq_token,
+            ty,
+            semi_token,
+        }))
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for ImplItemMacro {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let attrs = input.call(Attribute::parse_outer)?;
+            let mac: Macro = input.parse()?;
+            let semi_token: Option<Token![;]> = if mac.delimiter.is_brace() {
+                None
+            } else {
+                Some(input.parse()?)
+            };
+            Ok(ImplItemMacro {
+                attrs,
+                mac,
+                semi_token,
+            })
+        }
+    }
+
+    impl Visibility {
+        fn is_inherited(&self) -> bool {
+            match self {
+                Visibility::Inherited => true,
+                _ => false,
+            }
+        }
+    }
+
+    impl MacroDelimiter {
+        pub(crate) fn is_brace(&self) -> bool {
+            match self {
+                MacroDelimiter::Brace(_) => true,
+                MacroDelimiter::Paren(_) | MacroDelimiter::Bracket(_) => false,
+            }
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for StaticMutability {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let mut_token: Option<Token![mut]> = input.parse()?;
+            Ok(mut_token.map_or(StaticMutability::None, StaticMutability::Mut))
+        }
+    }
+}
+
+#[cfg(feature = "printing")]
+mod printing {
+    use crate::attr::FilterAttrs;
+    use crate::data::Fields;
+    use crate::item::{
+        ForeignItemFn, ForeignItemMacro, ForeignItemStatic, ForeignItemType, ImplItemConst,
+        ImplItemFn, ImplItemMacro, ImplItemType, ItemConst, ItemEnum, ItemExternCrate, ItemFn,
+        ItemForeignMod, ItemImpl, ItemMacro, ItemMod, ItemStatic, ItemStruct, ItemTrait,
+        ItemTraitAlias, ItemType, ItemUnion, ItemUse, Receiver, Signature, StaticMutability,
+        TraitItemConst, TraitItemFn, TraitItemMacro, TraitItemType, UseGlob, UseGroup, UseName,
+        UsePath, UseRename, Variadic,
+    };
+    use crate::mac::MacroDelimiter;
+    use crate::print::TokensOrDefault;
+    use crate::ty::Type;
+    use proc_macro2::TokenStream;
+    use quote::{ToTokens, TokenStreamExt};
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for ItemExternCrate {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            self.vis.to_tokens(tokens);
+            self.extern_token.to_tokens(tokens);
+            self.crate_token.to_tokens(tokens);
+            self.ident.to_tokens(tokens);
+            if let Some((as_token, rename)) = &self.rename {
+                as_token.to_tokens(tokens);
+                rename.to_tokens(tokens);
+            }
+            self.semi_token.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for ItemUse {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            self.vis.to_tokens(tokens);
+            self.use_token.to_tokens(tokens);
+            self.leading_colon.to_tokens(tokens);
+            self.tree.to_tokens(tokens);
+            self.semi_token.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for ItemStatic {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            self.vis.to_tokens(tokens);
+            self.static_token.to_tokens(tokens);
+            self.mutability.to_tokens(tokens);
+            self.ident.to_tokens(tokens);
+            self.colon_token.to_tokens(tokens);
+            self.ty.to_tokens(tokens);
+            self.eq_token.to_tokens(tokens);
+            self.expr.to_tokens(tokens);
+            self.semi_token.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for ItemConst {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            self.vis.to_tokens(tokens);
+            self.const_token.to_tokens(tokens);
+            self.ident.to_tokens(tokens);
+            self.colon_token.to_tokens(tokens);
+            self.ty.to_tokens(tokens);
+            self.eq_token.to_tokens(tokens);
+            self.expr.to_tokens(tokens);
+            self.semi_token.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for ItemFn {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            self.vis.to_tokens(tokens);
+            self.sig.to_tokens(tokens);
+            self.block.brace_token.surround(tokens, |tokens| {
+                tokens.append_all(self.attrs.inner());
+                tokens.append_all(&self.block.stmts);
+            });
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for ItemMod {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            self.vis.to_tokens(tokens);
+            self.unsafety.to_tokens(tokens);
+            self.mod_token.to_tokens(tokens);
+            self.ident.to_tokens(tokens);
+            if let Some((brace, items)) = &self.content {
+                brace.surround(tokens, |tokens| {
+                    tokens.append_all(self.attrs.inner());
+                    tokens.append_all(items);
+                });
+            } else {
+                TokensOrDefault(&self.semi).to_tokens(tokens);
+            }
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for ItemForeignMod {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            self.unsafety.to_tokens(tokens);
+            self.abi.to_tokens(tokens);
+            self.brace_token.surround(tokens, |tokens| {
+                tokens.append_all(self.attrs.inner());
+                tokens.append_all(&self.items);
+            });
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for ItemType {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            self.vis.to_tokens(tokens);
+            self.type_token.to_tokens(tokens);
+            self.ident.to_tokens(tokens);
+            self.generics.to_tokens(tokens);
+            self.generics.where_clause.to_tokens(tokens);
+            self.eq_token.to_tokens(tokens);
+            self.ty.to_tokens(tokens);
+            self.semi_token.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for ItemEnum {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            self.vis.to_tokens(tokens);
+            self.enum_token.to_tokens(tokens);
+            self.ident.to_tokens(tokens);
+            self.generics.to_tokens(tokens);
+            self.generics.where_clause.to_tokens(tokens);
+            self.brace_token.surround(tokens, |tokens| {
+                self.variants.to_tokens(tokens);
+            });
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for ItemStruct {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            self.vis.to_tokens(tokens);
+            self.struct_token.to_tokens(tokens);
+            self.ident.to_tokens(tokens);
+            self.generics.to_tokens(tokens);
+            match &self.fields {
+                Fields::Named(fields) => {
+                    self.generics.where_clause.to_tokens(tokens);
+                    fields.to_tokens(tokens);
+                }
+                Fields::Unnamed(fields) => {
+                    fields.to_tokens(tokens);
+                    self.generics.where_clause.to_tokens(tokens);
+                    TokensOrDefault(&self.semi_token).to_tokens(tokens);
+                }
+                Fields::Unit => {
+                    self.generics.where_clause.to_tokens(tokens);
+                    TokensOrDefault(&self.semi_token).to_tokens(tokens);
+                }
+            }
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for ItemUnion {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            self.vis.to_tokens(tokens);
+            self.union_token.to_tokens(tokens);
+            self.ident.to_tokens(tokens);
+            self.generics.to_tokens(tokens);
+            self.generics.where_clause.to_tokens(tokens);
+            self.fields.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for ItemTrait {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            self.vis.to_tokens(tokens);
+            self.unsafety.to_tokens(tokens);
+            self.auto_token.to_tokens(tokens);
+            self.trait_token.to_tokens(tokens);
+            self.ident.to_tokens(tokens);
+            self.generics.to_tokens(tokens);
+            if !self.supertraits.is_empty() {
+                TokensOrDefault(&self.colon_token).to_tokens(tokens);
+                self.supertraits.to_tokens(tokens);
+            }
+            self.generics.where_clause.to_tokens(tokens);
+            self.brace_token.surround(tokens, |tokens| {
+                tokens.append_all(self.attrs.inner());
+                tokens.append_all(&self.items);
+            });
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for ItemTraitAlias {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            self.vis.to_tokens(tokens);
+            self.trait_token.to_tokens(tokens);
+            self.ident.to_tokens(tokens);
+            self.generics.to_tokens(tokens);
+            self.eq_token.to_tokens(tokens);
+            self.bounds.to_tokens(tokens);
+            self.generics.where_clause.to_tokens(tokens);
+            self.semi_token.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for ItemImpl {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            self.defaultness.to_tokens(tokens);
+            self.unsafety.to_tokens(tokens);
+            self.impl_token.to_tokens(tokens);
+            self.generics.to_tokens(tokens);
+            if let Some((polarity, path, for_token)) = &self.trait_ {
+                polarity.to_tokens(tokens);
+                path.to_tokens(tokens);
+                for_token.to_tokens(tokens);
+            }
+            self.self_ty.to_tokens(tokens);
+            self.generics.where_clause.to_tokens(tokens);
+            self.brace_token.surround(tokens, |tokens| {
+                tokens.append_all(self.attrs.inner());
+                tokens.append_all(&self.items);
+            });
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for ItemMacro {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            self.mac.path.to_tokens(tokens);
+            self.mac.bang_token.to_tokens(tokens);
+            self.ident.to_tokens(tokens);
+            match &self.mac.delimiter {
+                MacroDelimiter::Paren(paren) => {
+                    paren.surround(tokens, |tokens| self.mac.tokens.to_tokens(tokens));
+                }
+                MacroDelimiter::Brace(brace) => {
+                    brace.surround(tokens, |tokens| self.mac.tokens.to_tokens(tokens));
+                }
+                MacroDelimiter::Bracket(bracket) => {
+                    bracket.surround(tokens, |tokens| self.mac.tokens.to_tokens(tokens));
+                }
+            }
+            self.semi_token.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for UsePath {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.ident.to_tokens(tokens);
+            self.colon2_token.to_tokens(tokens);
+            self.tree.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for UseName {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.ident.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for UseRename {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.ident.to_tokens(tokens);
+            self.as_token.to_tokens(tokens);
+            self.rename.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for UseGlob {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.star_token.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for UseGroup {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.brace_token.surround(tokens, |tokens| {
+                self.items.to_tokens(tokens);
+            });
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for TraitItemConst {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            self.const_token.to_tokens(tokens);
+            self.ident.to_tokens(tokens);
+            self.colon_token.to_tokens(tokens);
+            self.ty.to_tokens(tokens);
+            if let Some((eq_token, default)) = &self.default {
+                eq_token.to_tokens(tokens);
+                default.to_tokens(tokens);
+            }
+            self.semi_token.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for TraitItemFn {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            self.sig.to_tokens(tokens);
+            match &self.default {
+                Some(block) => {
+                    block.brace_token.surround(tokens, |tokens| {
+                        tokens.append_all(self.attrs.inner());
+                        tokens.append_all(&block.stmts);
+                    });
+                }
+                None => {
+                    TokensOrDefault(&self.semi_token).to_tokens(tokens);
+                }
+            }
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for TraitItemType {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            self.type_token.to_tokens(tokens);
+            self.ident.to_tokens(tokens);
+            self.generics.to_tokens(tokens);
+            if !self.bounds.is_empty() {
+                TokensOrDefault(&self.colon_token).to_tokens(tokens);
+                self.bounds.to_tokens(tokens);
+            }
+            if let Some((eq_token, default)) = &self.default {
+                eq_token.to_tokens(tokens);
+                default.to_tokens(tokens);
+            }
+            self.generics.where_clause.to_tokens(tokens);
+            self.semi_token.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for TraitItemMacro {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            self.mac.to_tokens(tokens);
+            self.semi_token.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for ImplItemConst {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            self.vis.to_tokens(tokens);
+            self.defaultness.to_tokens(tokens);
+            self.const_token.to_tokens(tokens);
+            self.ident.to_tokens(tokens);
+            self.colon_token.to_tokens(tokens);
+            self.ty.to_tokens(tokens);
+            self.eq_token.to_tokens(tokens);
+            self.expr.to_tokens(tokens);
+            self.semi_token.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for ImplItemFn {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            self.vis.to_tokens(tokens);
+            self.defaultness.to_tokens(tokens);
+            self.sig.to_tokens(tokens);
+            self.block.brace_token.surround(tokens, |tokens| {
+                tokens.append_all(self.attrs.inner());
+                tokens.append_all(&self.block.stmts);
+            });
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for ImplItemType {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            self.vis.to_tokens(tokens);
+            self.defaultness.to_tokens(tokens);
+            self.type_token.to_tokens(tokens);
+            self.ident.to_tokens(tokens);
+            self.generics.to_tokens(tokens);
+            self.eq_token.to_tokens(tokens);
+            self.ty.to_tokens(tokens);
+            self.generics.where_clause.to_tokens(tokens);
+            self.semi_token.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for ImplItemMacro {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            self.mac.to_tokens(tokens);
+            self.semi_token.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for ForeignItemFn {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            self.vis.to_tokens(tokens);
+            self.sig.to_tokens(tokens);
+            self.semi_token.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for ForeignItemStatic {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            self.vis.to_tokens(tokens);
+            self.static_token.to_tokens(tokens);
+            self.mutability.to_tokens(tokens);
+            self.ident.to_tokens(tokens);
+            self.colon_token.to_tokens(tokens);
+            self.ty.to_tokens(tokens);
+            self.semi_token.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for ForeignItemType {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            self.vis.to_tokens(tokens);
+            self.type_token.to_tokens(tokens);
+            self.ident.to_tokens(tokens);
+            self.generics.to_tokens(tokens);
+            self.generics.where_clause.to_tokens(tokens);
+            self.semi_token.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for ForeignItemMacro {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            self.mac.to_tokens(tokens);
+            self.semi_token.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for Signature {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.constness.to_tokens(tokens);
+            self.asyncness.to_tokens(tokens);
+            self.unsafety.to_tokens(tokens);
+            self.abi.to_tokens(tokens);
+            self.fn_token.to_tokens(tokens);
+            self.ident.to_tokens(tokens);
+            self.generics.to_tokens(tokens);
+            self.paren_token.surround(tokens, |tokens| {
+                self.inputs.to_tokens(tokens);
+                if let Some(variadic) = &self.variadic {
+                    if !self.inputs.empty_or_trailing() {
+                        <Token![,]>::default().to_tokens(tokens);
+                    }
+                    variadic.to_tokens(tokens);
+                }
+            });
+            self.output.to_tokens(tokens);
+            self.generics.where_clause.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for Receiver {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            if let Some((ampersand, lifetime)) = &self.reference {
+                ampersand.to_tokens(tokens);
+                lifetime.to_tokens(tokens);
+            }
+            self.mutability.to_tokens(tokens);
+            self.self_token.to_tokens(tokens);
+            if let Some(colon_token) = &self.colon_token {
+                colon_token.to_tokens(tokens);
+                self.ty.to_tokens(tokens);
+            } else {
+                let consistent = match (&self.reference, &self.mutability, &*self.ty) {
+                    (Some(_), mutability, Type::Reference(ty)) => {
+                        mutability.is_some() == ty.mutability.is_some()
+                            && match &*ty.elem {
+                                Type::Path(ty) => ty.qself.is_none() && ty.path.is_ident("Self"),
+                                _ => false,
+                            }
+                    }
+                    (None, _, Type::Path(ty)) => ty.qself.is_none() && ty.path.is_ident("Self"),
+                    _ => false,
+                };
+                if !consistent {
+                    <Token![:]>::default().to_tokens(tokens);
+                    self.ty.to_tokens(tokens);
+                }
+            }
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for Variadic {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            if let Some((pat, colon)) = &self.pat {
+                pat.to_tokens(tokens);
+                colon.to_tokens(tokens);
+            }
+            self.dots.to_tokens(tokens);
+            self.comma.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for StaticMutability {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            match self {
+                StaticMutability::None => {}
+                StaticMutability::Mut(mut_token) => mut_token.to_tokens(tokens),
+            }
+        }
+    }
+}
+
\ No newline at end of file diff --git a/src/syn/lib.rs.html b/src/syn/lib.rs.html new file mode 100644 index 0000000..1a07f5e --- /dev/null +++ b/src/syn/lib.rs.html @@ -0,0 +1,2017 @@ +lib.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+753
+754
+755
+756
+757
+758
+759
+760
+761
+762
+763
+764
+765
+766
+767
+768
+769
+770
+771
+772
+773
+774
+775
+776
+777
+778
+779
+780
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+794
+795
+796
+797
+798
+799
+800
+801
+802
+803
+804
+805
+806
+807
+808
+809
+810
+811
+812
+813
+814
+815
+816
+817
+818
+819
+820
+821
+822
+823
+824
+825
+826
+827
+828
+829
+830
+831
+832
+833
+834
+835
+836
+837
+838
+839
+840
+841
+842
+843
+844
+845
+846
+847
+848
+849
+850
+851
+852
+853
+854
+855
+856
+857
+858
+859
+860
+861
+862
+863
+864
+865
+866
+867
+868
+869
+870
+871
+872
+873
+874
+875
+876
+877
+878
+879
+880
+881
+882
+883
+884
+885
+886
+887
+888
+889
+890
+891
+892
+893
+894
+895
+896
+897
+898
+899
+900
+901
+902
+903
+904
+905
+906
+907
+908
+909
+910
+911
+912
+913
+914
+915
+916
+917
+918
+919
+920
+921
+922
+923
+924
+925
+926
+927
+928
+929
+930
+931
+932
+933
+934
+935
+936
+937
+938
+939
+940
+941
+942
+943
+944
+945
+946
+947
+948
+949
+950
+951
+952
+953
+954
+955
+956
+957
+958
+959
+960
+961
+962
+963
+964
+965
+966
+967
+968
+969
+970
+971
+972
+973
+974
+975
+976
+977
+978
+979
+980
+981
+982
+983
+984
+985
+986
+987
+988
+989
+990
+991
+992
+993
+994
+995
+996
+997
+998
+999
+1000
+1001
+1002
+1003
+1004
+1005
+1006
+1007
+1008
+
//! [![github]](https://github.com/dtolnay/syn)&ensp;[![crates-io]](https://crates.io/crates/syn)&ensp;[![docs-rs]](crate)
+//!
+//! [github]: https://img.shields.io/badge/github-8da0cb?style=for-the-badge&labelColor=555555&logo=github
+//! [crates-io]: https://img.shields.io/badge/crates.io-fc8d62?style=for-the-badge&labelColor=555555&logo=rust
+//! [docs-rs]: https://img.shields.io/badge/docs.rs-66c2a5?style=for-the-badge&labelColor=555555&logo=docs.rs
+//!
+//! <br>
+//!
+//! Syn is a parsing library for parsing a stream of Rust tokens into a syntax
+//! tree of Rust source code.
+//!
+//! Currently this library is geared toward use in Rust procedural macros, but
+//! contains some APIs that may be useful more generally.
+//!
+//! - **Data structures** — Syn provides a complete syntax tree that can
+//!   represent any valid Rust source code. The syntax tree is rooted at
+//!   [`syn::File`] which represents a full source file, but there are other
+//!   entry points that may be useful to procedural macros including
+//!   [`syn::Item`], [`syn::Expr`] and [`syn::Type`].
+//!
+//! - **Derives** — Of particular interest to derive macros is
+//!   [`syn::DeriveInput`] which is any of the three legal input items to a
+//!   derive macro. An example below shows using this type in a library that can
+//!   derive implementations of a user-defined trait.
+//!
+//! - **Parsing** — Parsing in Syn is built around [parser functions] with the
+//!   signature `fn(ParseStream) -> Result<T>`. Every syntax tree node defined
+//!   by Syn is individually parsable and may be used as a building block for
+//!   custom syntaxes, or you may dream up your own brand new syntax without
+//!   involving any of our syntax tree types.
+//!
+//! - **Location information** — Every token parsed by Syn is associated with a
+//!   `Span` that tracks line and column information back to the source of that
+//!   token. These spans allow a procedural macro to display detailed error
+//!   messages pointing to all the right places in the user's code. There is an
+//!   example of this below.
+//!
+//! - **Feature flags** — Functionality is aggressively feature gated so your
+//!   procedural macros enable only what they need, and do not pay in compile
+//!   time for all the rest.
+//!
+//! [`syn::File`]: File
+//! [`syn::Item`]: Item
+//! [`syn::Expr`]: Expr
+//! [`syn::Type`]: Type
+//! [`syn::DeriveInput`]: DeriveInput
+//! [parser functions]: mod@parse
+//!
+//! <br>
+//!
+//! # Example of a derive macro
+//!
+//! The canonical derive macro using Syn looks like this. We write an ordinary
+//! Rust function tagged with a `proc_macro_derive` attribute and the name of
+//! the trait we are deriving. Any time that derive appears in the user's code,
+//! the Rust compiler passes their data structure as tokens into our macro. We
+//! get to execute arbitrary Rust code to figure out what to do with those
+//! tokens, then hand some tokens back to the compiler to compile into the
+//! user's crate.
+//!
+//! [`TokenStream`]: proc_macro::TokenStream
+//!
+//! ```toml
+//! [dependencies]
+//! syn = "2.0"
+//! quote = "1.0"
+//!
+//! [lib]
+//! proc-macro = true
+//! ```
+//!
+//! ```
+//! # extern crate proc_macro;
+//! #
+//! use proc_macro::TokenStream;
+//! use quote::quote;
+//! use syn::{parse_macro_input, DeriveInput};
+//!
+//! # const IGNORE_TOKENS: &str = stringify! {
+//! #[proc_macro_derive(MyMacro)]
+//! # };
+//! pub fn my_macro(input: TokenStream) -> TokenStream {
+//!     // Parse the input tokens into a syntax tree
+//!     let input = parse_macro_input!(input as DeriveInput);
+//!
+//!     // Build the output, possibly using quasi-quotation
+//!     let expanded = quote! {
+//!         // ...
+//!     };
+//!
+//!     // Hand the output tokens back to the compiler
+//!     TokenStream::from(expanded)
+//! }
+//! ```
+//!
+//! The [`heapsize`] example directory shows a complete working implementation
+//! of a derive macro. The example derives a `HeapSize` trait which computes an
+//! estimate of the amount of heap memory owned by a value.
+//!
+//! [`heapsize`]: https://github.com/dtolnay/syn/tree/master/examples/heapsize
+//!
+//! ```
+//! pub trait HeapSize {
+//!     /// Total number of bytes of heap memory owned by `self`.
+//!     fn heap_size_of_children(&self) -> usize;
+//! }
+//! ```
+//!
+//! The derive macro allows users to write `#[derive(HeapSize)]` on data
+//! structures in their program.
+//!
+//! ```
+//! # const IGNORE_TOKENS: &str = stringify! {
+//! #[derive(HeapSize)]
+//! # };
+//! struct Demo<'a, T: ?Sized> {
+//!     a: Box<T>,
+//!     b: u8,
+//!     c: &'a str,
+//!     d: String,
+//! }
+//! ```
+//!
+//! <p><br></p>
+//!
+//! # Spans and error reporting
+//!
+//! The token-based procedural macro API provides great control over where the
+//! compiler's error messages are displayed in user code. Consider the error the
+//! user sees if one of their field types does not implement `HeapSize`.
+//!
+//! ```
+//! # const IGNORE_TOKENS: &str = stringify! {
+//! #[derive(HeapSize)]
+//! # };
+//! struct Broken {
+//!     ok: String,
+//!     bad: std::thread::Thread,
+//! }
+//! ```
+//!
+//! By tracking span information all the way through the expansion of a
+//! procedural macro as shown in the `heapsize` example, token-based macros in
+//! Syn are able to trigger errors that directly pinpoint the source of the
+//! problem.
+//!
+//! ```text
+//! error[E0277]: the trait bound `std::thread::Thread: HeapSize` is not satisfied
+//!  --> src/main.rs:7:5
+//!   |
+//! 7 |     bad: std::thread::Thread,
+//!   |     ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `HeapSize` is not implemented for `Thread`
+//! ```
+//!
+//! <br>
+//!
+//! # Parsing a custom syntax
+//!
+//! The [`lazy-static`] example directory shows the implementation of a
+//! `functionlike!(...)` procedural macro in which the input tokens are parsed
+//! using Syn's parsing API.
+//!
+//! [`lazy-static`]: https://github.com/dtolnay/syn/tree/master/examples/lazy-static
+//!
+//! The example reimplements the popular `lazy_static` crate from crates.io as a
+//! procedural macro.
+//!
+//! ```
+//! # macro_rules! lazy_static {
+//! #     ($($tt:tt)*) => {}
+//! # }
+//! #
+//! lazy_static! {
+//!     static ref USERNAME: Regex = Regex::new("^[a-z0-9_-]{3,16}$").unwrap();
+//! }
+//! ```
+//!
+//! The implementation shows how to trigger custom warnings and error messages
+//! on the macro input.
+//!
+//! ```text
+//! warning: come on, pick a more creative name
+//!   --> src/main.rs:10:16
+//!    |
+//! 10 |     static ref FOO: String = "lazy_static".to_owned();
+//!    |                ^^^
+//! ```
+//!
+//! <br>
+//!
+//! # Testing
+//!
+//! When testing macros, we often care not just that the macro can be used
+//! successfully but also that when the macro is provided with invalid input it
+//! produces maximally helpful error messages. Consider using the [`trybuild`]
+//! crate to write tests for errors that are emitted by your macro or errors
+//! detected by the Rust compiler in the expanded code following misuse of the
+//! macro. Such tests help avoid regressions from later refactors that
+//! mistakenly make an error no longer trigger or be less helpful than it used
+//! to be.
+//!
+//! [`trybuild`]: https://github.com/dtolnay/trybuild
+//!
+//! <br>
+//!
+//! # Debugging
+//!
+//! When developing a procedural macro it can be helpful to look at what the
+//! generated code looks like. Use `cargo rustc -- -Zunstable-options
+//! --pretty=expanded` or the [`cargo expand`] subcommand.
+//!
+//! [`cargo expand`]: https://github.com/dtolnay/cargo-expand
+//!
+//! To show the expanded code for some crate that uses your procedural macro,
+//! run `cargo expand` from that crate. To show the expanded code for one of
+//! your own test cases, run `cargo expand --test the_test_case` where the last
+//! argument is the name of the test file without the `.rs` extension.
+//!
+//! This write-up by Brandon W Maister discusses debugging in more detail:
+//! [Debugging Rust's new Custom Derive system][debugging].
+//!
+//! [debugging]: https://quodlibetor.github.io/posts/debugging-rusts-new-custom-derive-system/
+//!
+//! <br>
+//!
+//! # Optional features
+//!
+//! Syn puts a lot of functionality behind optional features in order to
+//! optimize compile time for the most common use cases. The following features
+//! are available.
+//!
+//! - **`derive`** *(enabled by default)* — Data structures for representing the
+//!   possible input to a derive macro, including structs and enums and types.
+//! - **`full`** — Data structures for representing the syntax tree of all valid
+//!   Rust source code, including items and expressions.
+//! - **`parsing`** *(enabled by default)* — Ability to parse input tokens into
+//!   a syntax tree node of a chosen type.
+//! - **`printing`** *(enabled by default)* — Ability to print a syntax tree
+//!   node as tokens of Rust source code.
+//! - **`visit`** — Trait for traversing a syntax tree.
+//! - **`visit-mut`** — Trait for traversing and mutating in place a syntax
+//!   tree.
+//! - **`fold`** — Trait for transforming an owned syntax tree.
+//! - **`clone-impls`** *(enabled by default)* — Clone impls for all syntax tree
+//!   types.
+//! - **`extra-traits`** — Debug, Eq, PartialEq, Hash impls for all syntax tree
+//!   types.
+//! - **`proc-macro`** *(enabled by default)* — Runtime dependency on the
+//!   dynamic library libproc_macro from rustc toolchain.
+
+// Syn types in rustdoc of other crates get linked to here.
+#![doc(html_root_url = "https://docs.rs/syn/2.0.63")]
+#![cfg_attr(doc_cfg, feature(doc_cfg))]
+#![deny(unsafe_op_in_unsafe_fn)]
+#![allow(non_camel_case_types)]
+#![cfg_attr(not(check_cfg), allow(unexpected_cfgs))]
+#![allow(
+    clippy::bool_to_int_with_if,
+    clippy::cast_lossless,
+    clippy::cast_possible_truncation,
+    clippy::cast_possible_wrap,
+    clippy::cast_ptr_alignment,
+    clippy::default_trait_access,
+    clippy::derivable_impls,
+    clippy::diverging_sub_expression,
+    clippy::doc_markdown,
+    clippy::expl_impl_clone_on_copy,
+    clippy::explicit_auto_deref,
+    clippy::if_not_else,
+    clippy::inherent_to_string,
+    clippy::into_iter_without_iter,
+    clippy::items_after_statements,
+    clippy::large_enum_variant,
+    clippy::let_underscore_untyped, // https://github.com/rust-lang/rust-clippy/issues/10410
+    clippy::manual_assert,
+    clippy::manual_let_else,
+    clippy::match_like_matches_macro,
+    clippy::match_on_vec_items,
+    clippy::match_same_arms,
+    clippy::match_wildcard_for_single_variants, // clippy bug: https://github.com/rust-lang/rust-clippy/issues/6984
+    clippy::missing_errors_doc,
+    clippy::missing_panics_doc,
+    clippy::module_name_repetitions,
+    clippy::must_use_candidate,
+    clippy::needless_doctest_main,
+    clippy::needless_pass_by_value,
+    clippy::never_loop,
+    clippy::range_plus_one,
+    clippy::redundant_else,
+    clippy::return_self_not_must_use,
+    clippy::similar_names,
+    clippy::single_match_else,
+    clippy::too_many_arguments,
+    clippy::too_many_lines,
+    clippy::trivially_copy_pass_by_ref,
+    clippy::unconditional_recursion, // https://github.com/rust-lang/rust-clippy/issues/12133
+    clippy::uninhabited_references,
+    clippy::uninlined_format_args,
+    clippy::unnecessary_box_returns,
+    clippy::unnecessary_unwrap,
+    clippy::used_underscore_binding,
+    clippy::wildcard_imports,
+)]
+
+#[cfg(feature = "proc-macro")]
+extern crate proc_macro;
+
+#[macro_use]
+mod macros;
+
+#[cfg(feature = "parsing")]
+#[macro_use]
+mod group;
+
+#[macro_use]
+pub mod token;
+
+#[cfg(any(feature = "full", feature = "derive"))]
+mod attr;
+#[cfg(any(feature = "full", feature = "derive"))]
+#[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
+pub use crate::attr::{AttrStyle, Attribute, Meta, MetaList, MetaNameValue};
+
+mod bigint;
+
+#[cfg(feature = "parsing")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+pub mod buffer;
+
+mod custom_keyword;
+
+mod custom_punctuation;
+
+#[cfg(any(feature = "full", feature = "derive"))]
+mod data;
+#[cfg(any(feature = "full", feature = "derive"))]
+#[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
+pub use crate::data::{Field, Fields, FieldsNamed, FieldsUnnamed, Variant};
+
+#[cfg(any(feature = "full", feature = "derive"))]
+mod derive;
+#[cfg(feature = "derive")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "derive")))]
+pub use crate::derive::{Data, DataEnum, DataStruct, DataUnion, DeriveInput};
+
+mod drops;
+
+mod error;
+pub use crate::error::{Error, Result};
+
+#[cfg(any(feature = "full", feature = "derive"))]
+mod expr;
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+pub use crate::expr::{Arm, Label, RangeLimits};
+#[cfg(any(feature = "full", feature = "derive"))]
+#[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
+pub use crate::expr::{
+    Expr, ExprBinary, ExprCall, ExprCast, ExprField, ExprIndex, ExprLit, ExprMacro, ExprMethodCall,
+    ExprParen, ExprPath, ExprReference, ExprStruct, ExprUnary, FieldValue, Index, Member,
+};
+#[cfg(any(feature = "full", feature = "derive"))]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+pub use crate::expr::{
+    ExprArray, ExprAssign, ExprAsync, ExprAwait, ExprBlock, ExprBreak, ExprClosure, ExprConst,
+    ExprContinue, ExprForLoop, ExprGroup, ExprIf, ExprInfer, ExprLet, ExprLoop, ExprMatch,
+    ExprRange, ExprRepeat, ExprReturn, ExprTry, ExprTryBlock, ExprTuple, ExprUnsafe, ExprWhile,
+    ExprYield,
+};
+
+#[cfg(feature = "parsing")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+pub mod ext;
+
+#[cfg(feature = "full")]
+mod file;
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+pub use crate::file::File;
+
+#[cfg(any(feature = "full", feature = "derive"))]
+mod generics;
+#[cfg(any(feature = "full", feature = "derive"))]
+#[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
+pub use crate::generics::{
+    BoundLifetimes, ConstParam, GenericParam, Generics, LifetimeParam, PredicateLifetime,
+    PredicateType, TraitBound, TraitBoundModifier, TypeParam, TypeParamBound, WhereClause,
+    WherePredicate,
+};
+#[cfg(all(any(feature = "full", feature = "derive"), feature = "printing"))]
+#[cfg_attr(
+    doc_cfg,
+    doc(cfg(all(any(feature = "full", feature = "derive"), feature = "printing")))
+)]
+pub use crate::generics::{ImplGenerics, Turbofish, TypeGenerics};
+
+mod ident;
+#[doc(inline)]
+pub use crate::ident::Ident;
+
+#[cfg(feature = "full")]
+mod item;
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+pub use crate::item::{
+    FnArg, ForeignItem, ForeignItemFn, ForeignItemMacro, ForeignItemStatic, ForeignItemType,
+    ImplItem, ImplItemConst, ImplItemFn, ImplItemMacro, ImplItemType, ImplRestriction, Item,
+    ItemConst, ItemEnum, ItemExternCrate, ItemFn, ItemForeignMod, ItemImpl, ItemMacro, ItemMod,
+    ItemStatic, ItemStruct, ItemTrait, ItemTraitAlias, ItemType, ItemUnion, ItemUse, Receiver,
+    Signature, StaticMutability, TraitItem, TraitItemConst, TraitItemFn, TraitItemMacro,
+    TraitItemType, UseGlob, UseGroup, UseName, UsePath, UseRename, UseTree, Variadic,
+};
+
+mod lifetime;
+#[doc(inline)]
+pub use crate::lifetime::Lifetime;
+
+mod lit;
+#[doc(hidden)] // https://github.com/dtolnay/syn/issues/1566
+pub use crate::lit::StrStyle;
+#[doc(inline)]
+pub use crate::lit::{
+    Lit, LitBool, LitByte, LitByteStr, LitCStr, LitChar, LitFloat, LitInt, LitStr,
+};
+
+#[cfg(feature = "parsing")]
+mod lookahead;
+
+#[cfg(any(feature = "full", feature = "derive"))]
+mod mac;
+#[cfg(any(feature = "full", feature = "derive"))]
+#[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
+pub use crate::mac::{Macro, MacroDelimiter};
+
+#[cfg(all(feature = "parsing", any(feature = "full", feature = "derive")))]
+#[cfg_attr(
+    doc_cfg,
+    doc(cfg(all(feature = "parsing", any(feature = "full", feature = "derive"))))
+)]
+pub mod meta;
+
+#[cfg(any(feature = "full", feature = "derive"))]
+mod op;
+#[cfg(any(feature = "full", feature = "derive"))]
+#[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
+pub use crate::op::{BinOp, UnOp};
+
+#[cfg(feature = "parsing")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+pub mod parse;
+
+#[cfg(all(feature = "parsing", feature = "proc-macro"))]
+mod parse_macro_input;
+
+#[cfg(all(feature = "parsing", feature = "printing"))]
+mod parse_quote;
+
+#[cfg(feature = "full")]
+mod pat;
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+pub use crate::pat::{
+    FieldPat, Pat, PatConst, PatIdent, PatLit, PatMacro, PatOr, PatParen, PatPath, PatRange,
+    PatReference, PatRest, PatSlice, PatStruct, PatTuple, PatTupleStruct, PatType, PatWild,
+};
+
+#[cfg(any(feature = "full", feature = "derive"))]
+mod path;
+#[cfg(any(feature = "full", feature = "derive"))]
+#[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
+pub use crate::path::{
+    AngleBracketedGenericArguments, AssocConst, AssocType, Constraint, GenericArgument,
+    ParenthesizedGenericArguments, Path, PathArguments, PathSegment, QSelf,
+};
+
+#[cfg(all(any(feature = "full", feature = "derive"), feature = "printing"))]
+mod print;
+
+pub mod punctuated;
+
+#[cfg(any(feature = "full", feature = "derive"))]
+mod restriction;
+#[cfg(any(feature = "full", feature = "derive"))]
+#[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
+pub use crate::restriction::{FieldMutability, VisRestricted, Visibility};
+
+mod sealed;
+
+mod span;
+
+#[cfg(all(feature = "parsing", feature = "printing"))]
+#[cfg_attr(doc_cfg, doc(cfg(all(feature = "parsing", feature = "printing"))))]
+pub mod spanned;
+
+#[cfg(feature = "full")]
+mod stmt;
+#[cfg(feature = "full")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+pub use crate::stmt::{Block, Local, LocalInit, Stmt, StmtMacro};
+
+mod thread;
+
+#[cfg(all(any(feature = "full", feature = "derive"), feature = "extra-traits"))]
+mod tt;
+
+#[cfg(any(feature = "full", feature = "derive"))]
+mod ty;
+#[cfg(any(feature = "full", feature = "derive"))]
+#[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
+pub use crate::ty::{
+    Abi, BareFnArg, BareVariadic, ReturnType, Type, TypeArray, TypeBareFn, TypeGroup,
+    TypeImplTrait, TypeInfer, TypeMacro, TypeNever, TypeParen, TypePath, TypePtr, TypeReference,
+    TypeSlice, TypeTraitObject, TypeTuple,
+};
+
+#[cfg(all(any(feature = "full", feature = "derive"), feature = "parsing"))]
+mod verbatim;
+
+#[cfg(all(feature = "parsing", feature = "full"))]
+mod whitespace;
+
+mod gen {
+    /// Syntax tree traversal to transform the nodes of an owned syntax tree.
+    ///
+    /// Each method of the [`Fold`] trait is a hook that can be overridden to
+    /// customize the behavior when transforming the corresponding type of node.
+    /// By default, every method recursively visits the substructure of the
+    /// input by invoking the right visitor method of each of its fields.
+    ///
+    /// [`Fold`]: fold::Fold
+    ///
+    /// ```
+    /// # use syn::{Attribute, BinOp, Expr, ExprBinary};
+    /// #
+    /// pub trait Fold {
+    ///     /* ... */
+    ///
+    ///     fn fold_expr_binary(&mut self, node: ExprBinary) -> ExprBinary {
+    ///         fold_expr_binary(self, node)
+    ///     }
+    ///
+    ///     /* ... */
+    ///     # fn fold_attribute(&mut self, node: Attribute) -> Attribute;
+    ///     # fn fold_expr(&mut self, node: Expr) -> Expr;
+    ///     # fn fold_bin_op(&mut self, node: BinOp) -> BinOp;
+    /// }
+    ///
+    /// pub fn fold_expr_binary<V>(v: &mut V, node: ExprBinary) -> ExprBinary
+    /// where
+    ///     V: Fold + ?Sized,
+    /// {
+    ///     ExprBinary {
+    ///         attrs: node
+    ///             .attrs
+    ///             .into_iter()
+    ///             .map(|attr| v.fold_attribute(attr))
+    ///             .collect(),
+    ///         left: Box::new(v.fold_expr(*node.left)),
+    ///         op: v.fold_bin_op(node.op),
+    ///         right: Box::new(v.fold_expr(*node.right)),
+    ///     }
+    /// }
+    ///
+    /// /* ... */
+    /// ```
+    ///
+    /// <br>
+    ///
+    /// # Example
+    ///
+    /// This fold inserts parentheses to fully parenthesizes any expression.
+    ///
+    /// ```
+    /// // [dependencies]
+    /// // quote = "1.0"
+    /// // syn = { version = "2.0", features = ["fold", "full"] }
+    ///
+    /// use quote::quote;
+    /// use syn::fold::{fold_expr, Fold};
+    /// use syn::{token, Expr, ExprParen};
+    ///
+    /// struct ParenthesizeEveryExpr;
+    ///
+    /// impl Fold for ParenthesizeEveryExpr {
+    ///     fn fold_expr(&mut self, expr: Expr) -> Expr {
+    ///         Expr::Paren(ExprParen {
+    ///             attrs: Vec::new(),
+    ///             expr: Box::new(fold_expr(self, expr)),
+    ///             paren_token: token::Paren::default(),
+    ///         })
+    ///     }
+    /// }
+    ///
+    /// fn main() {
+    ///     let code = quote! { a() + b(1) * c.d };
+    ///     let expr: Expr = syn::parse2(code).unwrap();
+    ///     let parenthesized = ParenthesizeEveryExpr.fold_expr(expr);
+    ///     println!("{}", quote!(#parenthesized));
+    ///
+    ///     // Output: (((a)()) + (((b)((1))) * ((c).d)))
+    /// }
+    /// ```
+    #[cfg(feature = "fold")]
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "fold")))]
+    #[rustfmt::skip]
+    pub mod fold;
+
+    /// Syntax tree traversal to walk a shared borrow of a syntax tree.
+    ///
+    /// Each method of the [`Visit`] trait is a hook that can be overridden to
+    /// customize the behavior when visiting the corresponding type of node. By
+    /// default, every method recursively visits the substructure of the input
+    /// by invoking the right visitor method of each of its fields.
+    ///
+    /// [`Visit`]: visit::Visit
+    ///
+    /// ```
+    /// # use syn::{Attribute, BinOp, Expr, ExprBinary};
+    /// #
+    /// pub trait Visit<'ast> {
+    ///     /* ... */
+    ///
+    ///     fn visit_expr_binary(&mut self, node: &'ast ExprBinary) {
+    ///         visit_expr_binary(self, node);
+    ///     }
+    ///
+    ///     /* ... */
+    ///     # fn visit_attribute(&mut self, node: &'ast Attribute);
+    ///     # fn visit_expr(&mut self, node: &'ast Expr);
+    ///     # fn visit_bin_op(&mut self, node: &'ast BinOp);
+    /// }
+    ///
+    /// pub fn visit_expr_binary<'ast, V>(v: &mut V, node: &'ast ExprBinary)
+    /// where
+    ///     V: Visit<'ast> + ?Sized,
+    /// {
+    ///     for attr in &node.attrs {
+    ///         v.visit_attribute(attr);
+    ///     }
+    ///     v.visit_expr(&*node.left);
+    ///     v.visit_bin_op(&node.op);
+    ///     v.visit_expr(&*node.right);
+    /// }
+    ///
+    /// /* ... */
+    /// ```
+    ///
+    /// <br>
+    ///
+    /// # Example
+    ///
+    /// This visitor will print the name of every freestanding function in the
+    /// syntax tree, including nested functions.
+    ///
+    /// ```
+    /// // [dependencies]
+    /// // quote = "1.0"
+    /// // syn = { version = "2.0", features = ["full", "visit"] }
+    ///
+    /// use quote::quote;
+    /// use syn::visit::{self, Visit};
+    /// use syn::{File, ItemFn};
+    ///
+    /// struct FnVisitor;
+    ///
+    /// impl<'ast> Visit<'ast> for FnVisitor {
+    ///     fn visit_item_fn(&mut self, node: &'ast ItemFn) {
+    ///         println!("Function with name={}", node.sig.ident);
+    ///
+    ///         // Delegate to the default impl to visit any nested functions.
+    ///         visit::visit_item_fn(self, node);
+    ///     }
+    /// }
+    ///
+    /// fn main() {
+    ///     let code = quote! {
+    ///         pub fn f() {
+    ///             fn g() {}
+    ///         }
+    ///     };
+    ///
+    ///     let syntax_tree: File = syn::parse2(code).unwrap();
+    ///     FnVisitor.visit_file(&syntax_tree);
+    /// }
+    /// ```
+    ///
+    /// The `'ast` lifetime on the input references means that the syntax tree
+    /// outlives the complete recursive visit call, so the visitor is allowed to
+    /// hold on to references into the syntax tree.
+    ///
+    /// ```
+    /// use quote::quote;
+    /// use syn::visit::{self, Visit};
+    /// use syn::{File, ItemFn};
+    ///
+    /// struct FnVisitor<'ast> {
+    ///     functions: Vec<&'ast ItemFn>,
+    /// }
+    ///
+    /// impl<'ast> Visit<'ast> for FnVisitor<'ast> {
+    ///     fn visit_item_fn(&mut self, node: &'ast ItemFn) {
+    ///         self.functions.push(node);
+    ///         visit::visit_item_fn(self, node);
+    ///     }
+    /// }
+    ///
+    /// fn main() {
+    ///     let code = quote! {
+    ///         pub fn f() {
+    ///             fn g() {}
+    ///         }
+    ///     };
+    ///
+    ///     let syntax_tree: File = syn::parse2(code).unwrap();
+    ///     let mut visitor = FnVisitor { functions: Vec::new() };
+    ///     visitor.visit_file(&syntax_tree);
+    ///     for f in visitor.functions {
+    ///         println!("Function with name={}", f.sig.ident);
+    ///     }
+    /// }
+    /// ```
+    #[cfg(feature = "visit")]
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "visit")))]
+    #[rustfmt::skip]
+    pub mod visit;
+
+    /// Syntax tree traversal to mutate an exclusive borrow of a syntax tree in
+    /// place.
+    ///
+    /// Each method of the [`VisitMut`] trait is a hook that can be overridden
+    /// to customize the behavior when mutating the corresponding type of node.
+    /// By default, every method recursively visits the substructure of the
+    /// input by invoking the right visitor method of each of its fields.
+    ///
+    /// [`VisitMut`]: visit_mut::VisitMut
+    ///
+    /// ```
+    /// # use syn::{Attribute, BinOp, Expr, ExprBinary};
+    /// #
+    /// pub trait VisitMut {
+    ///     /* ... */
+    ///
+    ///     fn visit_expr_binary_mut(&mut self, node: &mut ExprBinary) {
+    ///         visit_expr_binary_mut(self, node);
+    ///     }
+    ///
+    ///     /* ... */
+    ///     # fn visit_attribute_mut(&mut self, node: &mut Attribute);
+    ///     # fn visit_expr_mut(&mut self, node: &mut Expr);
+    ///     # fn visit_bin_op_mut(&mut self, node: &mut BinOp);
+    /// }
+    ///
+    /// pub fn visit_expr_binary_mut<V>(v: &mut V, node: &mut ExprBinary)
+    /// where
+    ///     V: VisitMut + ?Sized,
+    /// {
+    ///     for attr in &mut node.attrs {
+    ///         v.visit_attribute_mut(attr);
+    ///     }
+    ///     v.visit_expr_mut(&mut *node.left);
+    ///     v.visit_bin_op_mut(&mut node.op);
+    ///     v.visit_expr_mut(&mut *node.right);
+    /// }
+    ///
+    /// /* ... */
+    /// ```
+    ///
+    /// <br>
+    ///
+    /// # Example
+    ///
+    /// This mut visitor replace occurrences of u256 suffixed integer literals
+    /// like `999u256` with a macro invocation `bigint::u256!(999)`.
+    ///
+    /// ```
+    /// // [dependencies]
+    /// // quote = "1.0"
+    /// // syn = { version = "2.0", features = ["full", "visit-mut"] }
+    ///
+    /// use quote::quote;
+    /// use syn::visit_mut::{self, VisitMut};
+    /// use syn::{parse_quote, Expr, File, Lit, LitInt};
+    ///
+    /// struct BigintReplace;
+    ///
+    /// impl VisitMut for BigintReplace {
+    ///     fn visit_expr_mut(&mut self, node: &mut Expr) {
+    ///         if let Expr::Lit(expr) = &node {
+    ///             if let Lit::Int(int) = &expr.lit {
+    ///                 if int.suffix() == "u256" {
+    ///                     let digits = int.base10_digits();
+    ///                     let unsuffixed: LitInt = syn::parse_str(digits).unwrap();
+    ///                     *node = parse_quote!(bigint::u256!(#unsuffixed));
+    ///                     return;
+    ///                 }
+    ///             }
+    ///         }
+    ///
+    ///         // Delegate to the default impl to visit nested expressions.
+    ///         visit_mut::visit_expr_mut(self, node);
+    ///     }
+    /// }
+    ///
+    /// fn main() {
+    ///     let code = quote! {
+    ///         fn main() {
+    ///             let _ = 999u256;
+    ///         }
+    ///     };
+    ///
+    ///     let mut syntax_tree: File = syn::parse2(code).unwrap();
+    ///     BigintReplace.visit_file_mut(&mut syntax_tree);
+    ///     println!("{}", quote!(#syntax_tree));
+    /// }
+    /// ```
+    #[cfg(feature = "visit-mut")]
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "visit-mut")))]
+    #[rustfmt::skip]
+    pub mod visit_mut;
+
+    #[cfg(feature = "clone-impls")]
+    #[rustfmt::skip]
+    mod clone;
+
+    #[cfg(feature = "extra-traits")]
+    #[rustfmt::skip]
+    mod debug;
+
+    #[cfg(feature = "extra-traits")]
+    #[rustfmt::skip]
+    mod eq;
+
+    #[cfg(feature = "extra-traits")]
+    #[rustfmt::skip]
+    mod hash;
+
+    #[cfg(any(feature = "full", feature = "derive"))]
+    #[path = "../gen_helper.rs"]
+    mod helper;
+}
+
+#[cfg(feature = "fold")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "fold")))]
+pub use crate::gen::fold;
+
+#[cfg(feature = "visit")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "visit")))]
+pub use crate::gen::visit;
+
+#[cfg(feature = "visit-mut")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "visit-mut")))]
+pub use crate::gen::visit_mut;
+
+// Not public API.
+#[doc(hidden)]
+#[path = "export.rs"]
+pub mod __private;
+
+/// Parse tokens of source code into the chosen syntax tree node.
+///
+/// This is preferred over parsing a string because tokens are able to preserve
+/// information about where in the user's code they were originally written (the
+/// "span" of the token), possibly allowing the compiler to produce better error
+/// messages.
+///
+/// This function parses a `proc_macro::TokenStream` which is the type used for
+/// interop with the compiler in a procedural macro. To parse a
+/// `proc_macro2::TokenStream`, use [`syn::parse2`] instead.
+///
+/// [`syn::parse2`]: parse2
+///
+/// # Examples
+///
+/// ```
+/// # extern crate proc_macro;
+/// #
+/// use proc_macro::TokenStream;
+/// use quote::quote;
+/// use syn::DeriveInput;
+///
+/// # const IGNORE_TOKENS: &str = stringify! {
+/// #[proc_macro_derive(MyMacro)]
+/// # };
+/// pub fn my_macro(input: TokenStream) -> TokenStream {
+///     // Parse the tokens into a syntax tree
+///     let ast: DeriveInput = syn::parse(input).unwrap();
+///
+///     // Build the output, possibly using quasi-quotation
+///     let expanded = quote! {
+///         /* ... */
+///     };
+///
+///     // Convert into a token stream and return it
+///     expanded.into()
+/// }
+/// ```
+#[cfg(all(feature = "parsing", feature = "proc-macro"))]
+#[cfg_attr(doc_cfg, doc(cfg(all(feature = "parsing", feature = "proc-macro"))))]
+pub fn parse<T: parse::Parse>(tokens: proc_macro::TokenStream) -> Result<T> {
+    parse::Parser::parse(T::parse, tokens)
+}
+
+/// Parse a proc-macro2 token stream into the chosen syntax tree node.
+///
+/// This function will check that the input is fully parsed. If there are
+/// any unparsed tokens at the end of the stream, an error is returned.
+///
+/// This function parses a `proc_macro2::TokenStream` which is commonly useful
+/// when the input comes from a node of the Syn syntax tree, for example the
+/// body tokens of a [`Macro`] node. When in a procedural macro parsing the
+/// `proc_macro::TokenStream` provided by the compiler, use [`syn::parse`]
+/// instead.
+///
+/// [`syn::parse`]: parse()
+#[cfg(feature = "parsing")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+pub fn parse2<T: parse::Parse>(tokens: proc_macro2::TokenStream) -> Result<T> {
+    parse::Parser::parse2(T::parse, tokens)
+}
+
+/// Parse a string of Rust code into the chosen syntax tree node.
+///
+/// # Hygiene
+///
+/// Every span in the resulting syntax tree will be set to resolve at the macro
+/// call site.
+///
+/// # Examples
+///
+/// ```
+/// use syn::{Expr, Result};
+///
+/// fn run() -> Result<()> {
+///     let code = "assert_eq!(u8::max_value(), 255)";
+///     let expr = syn::parse_str::<Expr>(code)?;
+///     println!("{:#?}", expr);
+///     Ok(())
+/// }
+/// #
+/// # run().unwrap();
+/// ```
+#[cfg(feature = "parsing")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+pub fn parse_str<T: parse::Parse>(s: &str) -> Result<T> {
+    parse::Parser::parse_str(T::parse, s)
+}
+
+// FIXME the name parse_file makes it sound like you might pass in a path to a
+// file, rather than the content.
+/// Parse the content of a file of Rust code.
+///
+/// This is different from `syn::parse_str::<File>(content)` in two ways:
+///
+/// - It discards a leading byte order mark `\u{FEFF}` if the file has one.
+/// - It preserves the shebang line of the file, such as `#!/usr/bin/env rustx`.
+///
+/// If present, either of these would be an error using `from_str`.
+///
+/// # Examples
+///
+/// ```no_run
+/// use std::error::Error;
+/// use std::fs::File;
+/// use std::io::Read;
+///
+/// fn run() -> Result<(), Box<dyn Error>> {
+///     let mut file = File::open("path/to/code.rs")?;
+///     let mut content = String::new();
+///     file.read_to_string(&mut content)?;
+///
+///     let ast = syn::parse_file(&content)?;
+///     if let Some(shebang) = ast.shebang {
+///         println!("{}", shebang);
+///     }
+///     println!("{} items", ast.items.len());
+///
+///     Ok(())
+/// }
+/// #
+/// # run().unwrap();
+/// ```
+#[cfg(all(feature = "parsing", feature = "full"))]
+#[cfg_attr(doc_cfg, doc(cfg(all(feature = "parsing", feature = "full"))))]
+pub fn parse_file(mut content: &str) -> Result<File> {
+    // Strip the BOM if it is present
+    const BOM: &str = "\u{feff}";
+    if content.starts_with(BOM) {
+        content = &content[BOM.len()..];
+    }
+
+    let mut shebang = None;
+    if content.starts_with("#!") {
+        let rest = whitespace::skip(&content[2..]);
+        if !rest.starts_with('[') {
+            if let Some(idx) = content.find('\n') {
+                shebang = Some(content[..idx].to_string());
+                content = &content[idx..];
+            } else {
+                shebang = Some(content.to_string());
+                content = "";
+            }
+        }
+    }
+
+    let mut file: File = parse_str(content)?;
+    file.shebang = shebang;
+    Ok(file)
+}
+
\ No newline at end of file diff --git a/src/syn/lifetime.rs.html b/src/syn/lifetime.rs.html new file mode 100644 index 0000000..c3b6b0c --- /dev/null +++ b/src/syn/lifetime.rs.html @@ -0,0 +1,313 @@ +lifetime.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+
#[cfg(feature = "parsing")]
+use crate::lookahead;
+use proc_macro2::{Ident, Span};
+use std::cmp::Ordering;
+use std::fmt::{self, Display};
+use std::hash::{Hash, Hasher};
+
+/// A Rust lifetime: `'a`.
+///
+/// Lifetime names must conform to the following rules:
+///
+/// - Must start with an apostrophe.
+/// - Must not consist of just an apostrophe: `'`.
+/// - Character after the apostrophe must be `_` or a Unicode code point with
+///   the XID_Start property.
+/// - All following characters must be Unicode code points with the XID_Continue
+///   property.
+pub struct Lifetime {
+    pub apostrophe: Span,
+    pub ident: Ident,
+}
+
+impl Lifetime {
+    /// # Panics
+    ///
+    /// Panics if the lifetime does not conform to the bulleted rules above.
+    ///
+    /// # Invocation
+    ///
+    /// ```
+    /// # use proc_macro2::Span;
+    /// # use syn::Lifetime;
+    /// #
+    /// # fn f() -> Lifetime {
+    /// Lifetime::new("'a", Span::call_site())
+    /// # }
+    /// ```
+    pub fn new(symbol: &str, span: Span) -> Self {
+        if !symbol.starts_with('\'') {
+            panic!(
+                "lifetime name must start with apostrophe as in \"'a\", got {:?}",
+                symbol
+            );
+        }
+
+        if symbol == "'" {
+            panic!("lifetime name must not be empty");
+        }
+
+        if !crate::ident::xid_ok(&symbol[1..]) {
+            panic!("{:?} is not a valid lifetime name", symbol);
+        }
+
+        Lifetime {
+            apostrophe: span,
+            ident: Ident::new(&symbol[1..], span),
+        }
+    }
+
+    pub fn span(&self) -> Span {
+        self.apostrophe
+            .join(self.ident.span())
+            .unwrap_or(self.apostrophe)
+    }
+
+    pub fn set_span(&mut self, span: Span) {
+        self.apostrophe = span;
+        self.ident.set_span(span);
+    }
+}
+
+impl Display for Lifetime {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        "'".fmt(formatter)?;
+        self.ident.fmt(formatter)
+    }
+}
+
+impl Clone for Lifetime {
+    fn clone(&self) -> Self {
+        Lifetime {
+            apostrophe: self.apostrophe,
+            ident: self.ident.clone(),
+        }
+    }
+}
+
+impl PartialEq for Lifetime {
+    fn eq(&self, other: &Lifetime) -> bool {
+        self.ident.eq(&other.ident)
+    }
+}
+
+impl Eq for Lifetime {}
+
+impl PartialOrd for Lifetime {
+    fn partial_cmp(&self, other: &Lifetime) -> Option<Ordering> {
+        Some(self.cmp(other))
+    }
+}
+
+impl Ord for Lifetime {
+    fn cmp(&self, other: &Lifetime) -> Ordering {
+        self.ident.cmp(&other.ident)
+    }
+}
+
+impl Hash for Lifetime {
+    fn hash<H: Hasher>(&self, h: &mut H) {
+        self.ident.hash(h);
+    }
+}
+
+#[cfg(feature = "parsing")]
+pub_if_not_doc! {
+    #[doc(hidden)]
+    #[allow(non_snake_case)]
+    pub fn Lifetime(marker: lookahead::TokenMarker) -> Lifetime {
+        match marker {}
+    }
+}
+
+#[cfg(feature = "parsing")]
+pub(crate) mod parsing {
+    use crate::error::Result;
+    use crate::lifetime::Lifetime;
+    use crate::parse::{Parse, ParseStream};
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for Lifetime {
+        fn parse(input: ParseStream) -> Result<Self> {
+            input.step(|cursor| {
+                cursor
+                    .lifetime()
+                    .ok_or_else(|| cursor.error("expected lifetime"))
+            })
+        }
+    }
+}
+
+#[cfg(feature = "printing")]
+mod printing {
+    use crate::lifetime::Lifetime;
+    use proc_macro2::{Punct, Spacing, TokenStream};
+    use quote::{ToTokens, TokenStreamExt};
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for Lifetime {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            let mut apostrophe = Punct::new('\'', Spacing::Joint);
+            apostrophe.set_span(self.apostrophe);
+            tokens.append(apostrophe);
+            self.ident.to_tokens(tokens);
+        }
+    }
+}
+
\ No newline at end of file diff --git a/src/syn/lit.rs.html b/src/syn/lit.rs.html new file mode 100644 index 0000000..4632c64 --- /dev/null +++ b/src/syn/lit.rs.html @@ -0,0 +1,3661 @@ +lit.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+753
+754
+755
+756
+757
+758
+759
+760
+761
+762
+763
+764
+765
+766
+767
+768
+769
+770
+771
+772
+773
+774
+775
+776
+777
+778
+779
+780
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+794
+795
+796
+797
+798
+799
+800
+801
+802
+803
+804
+805
+806
+807
+808
+809
+810
+811
+812
+813
+814
+815
+816
+817
+818
+819
+820
+821
+822
+823
+824
+825
+826
+827
+828
+829
+830
+831
+832
+833
+834
+835
+836
+837
+838
+839
+840
+841
+842
+843
+844
+845
+846
+847
+848
+849
+850
+851
+852
+853
+854
+855
+856
+857
+858
+859
+860
+861
+862
+863
+864
+865
+866
+867
+868
+869
+870
+871
+872
+873
+874
+875
+876
+877
+878
+879
+880
+881
+882
+883
+884
+885
+886
+887
+888
+889
+890
+891
+892
+893
+894
+895
+896
+897
+898
+899
+900
+901
+902
+903
+904
+905
+906
+907
+908
+909
+910
+911
+912
+913
+914
+915
+916
+917
+918
+919
+920
+921
+922
+923
+924
+925
+926
+927
+928
+929
+930
+931
+932
+933
+934
+935
+936
+937
+938
+939
+940
+941
+942
+943
+944
+945
+946
+947
+948
+949
+950
+951
+952
+953
+954
+955
+956
+957
+958
+959
+960
+961
+962
+963
+964
+965
+966
+967
+968
+969
+970
+971
+972
+973
+974
+975
+976
+977
+978
+979
+980
+981
+982
+983
+984
+985
+986
+987
+988
+989
+990
+991
+992
+993
+994
+995
+996
+997
+998
+999
+1000
+1001
+1002
+1003
+1004
+1005
+1006
+1007
+1008
+1009
+1010
+1011
+1012
+1013
+1014
+1015
+1016
+1017
+1018
+1019
+1020
+1021
+1022
+1023
+1024
+1025
+1026
+1027
+1028
+1029
+1030
+1031
+1032
+1033
+1034
+1035
+1036
+1037
+1038
+1039
+1040
+1041
+1042
+1043
+1044
+1045
+1046
+1047
+1048
+1049
+1050
+1051
+1052
+1053
+1054
+1055
+1056
+1057
+1058
+1059
+1060
+1061
+1062
+1063
+1064
+1065
+1066
+1067
+1068
+1069
+1070
+1071
+1072
+1073
+1074
+1075
+1076
+1077
+1078
+1079
+1080
+1081
+1082
+1083
+1084
+1085
+1086
+1087
+1088
+1089
+1090
+1091
+1092
+1093
+1094
+1095
+1096
+1097
+1098
+1099
+1100
+1101
+1102
+1103
+1104
+1105
+1106
+1107
+1108
+1109
+1110
+1111
+1112
+1113
+1114
+1115
+1116
+1117
+1118
+1119
+1120
+1121
+1122
+1123
+1124
+1125
+1126
+1127
+1128
+1129
+1130
+1131
+1132
+1133
+1134
+1135
+1136
+1137
+1138
+1139
+1140
+1141
+1142
+1143
+1144
+1145
+1146
+1147
+1148
+1149
+1150
+1151
+1152
+1153
+1154
+1155
+1156
+1157
+1158
+1159
+1160
+1161
+1162
+1163
+1164
+1165
+1166
+1167
+1168
+1169
+1170
+1171
+1172
+1173
+1174
+1175
+1176
+1177
+1178
+1179
+1180
+1181
+1182
+1183
+1184
+1185
+1186
+1187
+1188
+1189
+1190
+1191
+1192
+1193
+1194
+1195
+1196
+1197
+1198
+1199
+1200
+1201
+1202
+1203
+1204
+1205
+1206
+1207
+1208
+1209
+1210
+1211
+1212
+1213
+1214
+1215
+1216
+1217
+1218
+1219
+1220
+1221
+1222
+1223
+1224
+1225
+1226
+1227
+1228
+1229
+1230
+1231
+1232
+1233
+1234
+1235
+1236
+1237
+1238
+1239
+1240
+1241
+1242
+1243
+1244
+1245
+1246
+1247
+1248
+1249
+1250
+1251
+1252
+1253
+1254
+1255
+1256
+1257
+1258
+1259
+1260
+1261
+1262
+1263
+1264
+1265
+1266
+1267
+1268
+1269
+1270
+1271
+1272
+1273
+1274
+1275
+1276
+1277
+1278
+1279
+1280
+1281
+1282
+1283
+1284
+1285
+1286
+1287
+1288
+1289
+1290
+1291
+1292
+1293
+1294
+1295
+1296
+1297
+1298
+1299
+1300
+1301
+1302
+1303
+1304
+1305
+1306
+1307
+1308
+1309
+1310
+1311
+1312
+1313
+1314
+1315
+1316
+1317
+1318
+1319
+1320
+1321
+1322
+1323
+1324
+1325
+1326
+1327
+1328
+1329
+1330
+1331
+1332
+1333
+1334
+1335
+1336
+1337
+1338
+1339
+1340
+1341
+1342
+1343
+1344
+1345
+1346
+1347
+1348
+1349
+1350
+1351
+1352
+1353
+1354
+1355
+1356
+1357
+1358
+1359
+1360
+1361
+1362
+1363
+1364
+1365
+1366
+1367
+1368
+1369
+1370
+1371
+1372
+1373
+1374
+1375
+1376
+1377
+1378
+1379
+1380
+1381
+1382
+1383
+1384
+1385
+1386
+1387
+1388
+1389
+1390
+1391
+1392
+1393
+1394
+1395
+1396
+1397
+1398
+1399
+1400
+1401
+1402
+1403
+1404
+1405
+1406
+1407
+1408
+1409
+1410
+1411
+1412
+1413
+1414
+1415
+1416
+1417
+1418
+1419
+1420
+1421
+1422
+1423
+1424
+1425
+1426
+1427
+1428
+1429
+1430
+1431
+1432
+1433
+1434
+1435
+1436
+1437
+1438
+1439
+1440
+1441
+1442
+1443
+1444
+1445
+1446
+1447
+1448
+1449
+1450
+1451
+1452
+1453
+1454
+1455
+1456
+1457
+1458
+1459
+1460
+1461
+1462
+1463
+1464
+1465
+1466
+1467
+1468
+1469
+1470
+1471
+1472
+1473
+1474
+1475
+1476
+1477
+1478
+1479
+1480
+1481
+1482
+1483
+1484
+1485
+1486
+1487
+1488
+1489
+1490
+1491
+1492
+1493
+1494
+1495
+1496
+1497
+1498
+1499
+1500
+1501
+1502
+1503
+1504
+1505
+1506
+1507
+1508
+1509
+1510
+1511
+1512
+1513
+1514
+1515
+1516
+1517
+1518
+1519
+1520
+1521
+1522
+1523
+1524
+1525
+1526
+1527
+1528
+1529
+1530
+1531
+1532
+1533
+1534
+1535
+1536
+1537
+1538
+1539
+1540
+1541
+1542
+1543
+1544
+1545
+1546
+1547
+1548
+1549
+1550
+1551
+1552
+1553
+1554
+1555
+1556
+1557
+1558
+1559
+1560
+1561
+1562
+1563
+1564
+1565
+1566
+1567
+1568
+1569
+1570
+1571
+1572
+1573
+1574
+1575
+1576
+1577
+1578
+1579
+1580
+1581
+1582
+1583
+1584
+1585
+1586
+1587
+1588
+1589
+1590
+1591
+1592
+1593
+1594
+1595
+1596
+1597
+1598
+1599
+1600
+1601
+1602
+1603
+1604
+1605
+1606
+1607
+1608
+1609
+1610
+1611
+1612
+1613
+1614
+1615
+1616
+1617
+1618
+1619
+1620
+1621
+1622
+1623
+1624
+1625
+1626
+1627
+1628
+1629
+1630
+1631
+1632
+1633
+1634
+1635
+1636
+1637
+1638
+1639
+1640
+1641
+1642
+1643
+1644
+1645
+1646
+1647
+1648
+1649
+1650
+1651
+1652
+1653
+1654
+1655
+1656
+1657
+1658
+1659
+1660
+1661
+1662
+1663
+1664
+1665
+1666
+1667
+1668
+1669
+1670
+1671
+1672
+1673
+1674
+1675
+1676
+1677
+1678
+1679
+1680
+1681
+1682
+1683
+1684
+1685
+1686
+1687
+1688
+1689
+1690
+1691
+1692
+1693
+1694
+1695
+1696
+1697
+1698
+1699
+1700
+1701
+1702
+1703
+1704
+1705
+1706
+1707
+1708
+1709
+1710
+1711
+1712
+1713
+1714
+1715
+1716
+1717
+1718
+1719
+1720
+1721
+1722
+1723
+1724
+1725
+1726
+1727
+1728
+1729
+1730
+1731
+1732
+1733
+1734
+1735
+1736
+1737
+1738
+1739
+1740
+1741
+1742
+1743
+1744
+1745
+1746
+1747
+1748
+1749
+1750
+1751
+1752
+1753
+1754
+1755
+1756
+1757
+1758
+1759
+1760
+1761
+1762
+1763
+1764
+1765
+1766
+1767
+1768
+1769
+1770
+1771
+1772
+1773
+1774
+1775
+1776
+1777
+1778
+1779
+1780
+1781
+1782
+1783
+1784
+1785
+1786
+1787
+1788
+1789
+1790
+1791
+1792
+1793
+1794
+1795
+1796
+1797
+1798
+1799
+1800
+1801
+1802
+1803
+1804
+1805
+1806
+1807
+1808
+1809
+1810
+1811
+1812
+1813
+1814
+1815
+1816
+1817
+1818
+1819
+1820
+1821
+1822
+1823
+1824
+1825
+1826
+1827
+1828
+1829
+1830
+
#[cfg(feature = "parsing")]
+use crate::lookahead;
+#[cfg(feature = "parsing")]
+use crate::parse::{Parse, Parser};
+use crate::{Error, Result};
+use proc_macro2::{Ident, Literal, Span};
+#[cfg(feature = "parsing")]
+use proc_macro2::{TokenStream, TokenTree};
+use std::ffi::{CStr, CString};
+use std::fmt::{self, Display};
+#[cfg(feature = "extra-traits")]
+use std::hash::{Hash, Hasher};
+use std::str::{self, FromStr};
+
+ast_enum_of_structs! {
+    /// A Rust literal such as a string or integer or boolean.
+    ///
+    /// # Syntax tree enum
+    ///
+    /// This type is a [syntax tree enum].
+    ///
+    /// [syntax tree enum]: crate::expr::Expr#syntax-tree-enums
+    #[non_exhaustive]
+    pub enum Lit {
+        /// A UTF-8 string literal: `"foo"`.
+        Str(LitStr),
+
+        /// A byte string literal: `b"foo"`.
+        ByteStr(LitByteStr),
+
+        /// A nul-terminated C-string literal: `c"foo"`.
+        CStr(LitCStr),
+
+        /// A byte literal: `b'f'`.
+        Byte(LitByte),
+
+        /// A character literal: `'a'`.
+        Char(LitChar),
+
+        /// An integer literal: `1` or `1u16`.
+        Int(LitInt),
+
+        /// A floating point literal: `1f64` or `1.0e10f64`.
+        ///
+        /// Must be finite. May not be infinite or NaN.
+        Float(LitFloat),
+
+        /// A boolean literal: `true` or `false`.
+        Bool(LitBool),
+
+        /// A raw token literal not interpreted by Syn.
+        Verbatim(Literal),
+    }
+}
+
+ast_struct! {
+    /// A UTF-8 string literal: `"foo"`.
+    pub struct LitStr {
+        repr: Box<LitRepr>,
+    }
+}
+
+ast_struct! {
+    /// A byte string literal: `b"foo"`.
+    pub struct LitByteStr {
+        repr: Box<LitRepr>,
+    }
+}
+
+ast_struct! {
+    /// A nul-terminated C-string literal: `c"foo"`.
+    pub struct LitCStr {
+        repr: Box<LitRepr>,
+    }
+}
+
+ast_struct! {
+    /// A byte literal: `b'f'`.
+    pub struct LitByte {
+        repr: Box<LitRepr>,
+    }
+}
+
+ast_struct! {
+    /// A character literal: `'a'`.
+    pub struct LitChar {
+        repr: Box<LitRepr>,
+    }
+}
+
+struct LitRepr {
+    token: Literal,
+    suffix: Box<str>,
+}
+
+ast_struct! {
+    /// An integer literal: `1` or `1u16`.
+    pub struct LitInt {
+        repr: Box<LitIntRepr>,
+    }
+}
+
+struct LitIntRepr {
+    token: Literal,
+    digits: Box<str>,
+    suffix: Box<str>,
+}
+
+ast_struct! {
+    /// A floating point literal: `1f64` or `1.0e10f64`.
+    ///
+    /// Must be finite. May not be infinite or NaN.
+    pub struct LitFloat {
+        repr: Box<LitFloatRepr>,
+    }
+}
+
+struct LitFloatRepr {
+    token: Literal,
+    digits: Box<str>,
+    suffix: Box<str>,
+}
+
+ast_struct! {
+    /// A boolean literal: `true` or `false`.
+    pub struct LitBool {
+        pub value: bool,
+        pub span: Span,
+    }
+}
+
+impl LitStr {
+    pub fn new(value: &str, span: Span) -> Self {
+        let mut token = Literal::string(value);
+        token.set_span(span);
+        LitStr {
+            repr: Box::new(LitRepr {
+                token,
+                suffix: Box::<str>::default(),
+            }),
+        }
+    }
+
+    pub fn value(&self) -> String {
+        let repr = self.repr.token.to_string();
+        let (value, _suffix) = value::parse_lit_str(&repr);
+        String::from(value)
+    }
+
+    /// Parse a syntax tree node from the content of this string literal.
+    ///
+    /// All spans in the syntax tree will point to the span of this `LitStr`.
+    ///
+    /// # Example
+    ///
+    /// ```
+    /// use syn::{Attribute, Error, Expr, Lit, Meta, Path, Result};
+    ///
+    /// // Parses the path from an attribute that looks like:
+    /// //
+    /// //     #[path = "a::b::c"]
+    /// //
+    /// // or returns `None` if the input is some other attribute.
+    /// fn get_path(attr: &Attribute) -> Result<Option<Path>> {
+    ///     if !attr.path().is_ident("path") {
+    ///         return Ok(None);
+    ///     }
+    ///
+    ///     if let Meta::NameValue(meta) = &attr.meta {
+    ///         if let Expr::Lit(expr) = &meta.value {
+    ///             if let Lit::Str(lit_str) = &expr.lit {
+    ///                 return lit_str.parse().map(Some);
+    ///             }
+    ///         }
+    ///     }
+    ///
+    ///     let message = "expected #[path = \"...\"]";
+    ///     Err(Error::new_spanned(attr, message))
+    /// }
+    /// ```
+    #[cfg(feature = "parsing")]
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    pub fn parse<T: Parse>(&self) -> Result<T> {
+        self.parse_with(T::parse)
+    }
+
+    /// Invoke parser on the content of this string literal.
+    ///
+    /// All spans in the syntax tree will point to the span of this `LitStr`.
+    ///
+    /// # Example
+    ///
+    /// ```
+    /// # use proc_macro2::Span;
+    /// # use syn::{LitStr, Result};
+    /// #
+    /// # fn main() -> Result<()> {
+    /// #     let lit_str = LitStr::new("a::b::c", Span::call_site());
+    /// #
+    /// #     const IGNORE: &str = stringify! {
+    /// let lit_str: LitStr = /* ... */;
+    /// #     };
+    ///
+    /// // Parse a string literal like "a::b::c" into a Path, not allowing
+    /// // generic arguments on any of the path segments.
+    /// let basic_path = lit_str.parse_with(syn::Path::parse_mod_style)?;
+    /// #
+    /// #     Ok(())
+    /// # }
+    /// ```
+    #[cfg(feature = "parsing")]
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    pub fn parse_with<F: Parser>(&self, parser: F) -> Result<F::Output> {
+        use proc_macro2::Group;
+
+        // Token stream with every span replaced by the given one.
+        fn respan_token_stream(stream: TokenStream, span: Span) -> TokenStream {
+            stream
+                .into_iter()
+                .map(|token| respan_token_tree(token, span))
+                .collect()
+        }
+
+        // Token tree with every span replaced by the given one.
+        fn respan_token_tree(mut token: TokenTree, span: Span) -> TokenTree {
+            match &mut token {
+                TokenTree::Group(g) => {
+                    let stream = respan_token_stream(g.stream(), span);
+                    *g = Group::new(g.delimiter(), stream);
+                    g.set_span(span);
+                }
+                other => other.set_span(span),
+            }
+            token
+        }
+
+        // Parse string literal into a token stream with every span equal to the
+        // original literal's span.
+        let span = self.span();
+        let mut tokens = TokenStream::from_str(&self.value())?;
+        tokens = respan_token_stream(tokens, span);
+
+        let result = crate::parse::parse_scoped(parser, span, tokens)?;
+
+        let suffix = self.suffix();
+        if !suffix.is_empty() {
+            return Err(Error::new(
+                self.span(),
+                format!("unexpected suffix `{}` on string literal", suffix),
+            ));
+        }
+
+        Ok(result)
+    }
+
+    pub fn span(&self) -> Span {
+        self.repr.token.span()
+    }
+
+    pub fn set_span(&mut self, span: Span) {
+        self.repr.token.set_span(span);
+    }
+
+    pub fn suffix(&self) -> &str {
+        &self.repr.suffix
+    }
+
+    pub fn token(&self) -> Literal {
+        self.repr.token.clone()
+    }
+}
+
+impl LitByteStr {
+    pub fn new(value: &[u8], span: Span) -> Self {
+        let mut token = Literal::byte_string(value);
+        token.set_span(span);
+        LitByteStr {
+            repr: Box::new(LitRepr {
+                token,
+                suffix: Box::<str>::default(),
+            }),
+        }
+    }
+
+    pub fn value(&self) -> Vec<u8> {
+        let repr = self.repr.token.to_string();
+        let (value, _suffix) = value::parse_lit_byte_str(&repr);
+        value
+    }
+
+    pub fn span(&self) -> Span {
+        self.repr.token.span()
+    }
+
+    pub fn set_span(&mut self, span: Span) {
+        self.repr.token.set_span(span);
+    }
+
+    pub fn suffix(&self) -> &str {
+        &self.repr.suffix
+    }
+
+    pub fn token(&self) -> Literal {
+        self.repr.token.clone()
+    }
+}
+
+impl LitCStr {
+    pub fn new(value: &CStr, span: Span) -> Self {
+        let mut token = Literal::c_string(value);
+        token.set_span(span);
+        LitCStr {
+            repr: Box::new(LitRepr {
+                token,
+                suffix: Box::<str>::default(),
+            }),
+        }
+    }
+
+    pub fn value(&self) -> CString {
+        let repr = self.repr.token.to_string();
+        let (value, _suffix) = value::parse_lit_c_str(&repr);
+        value
+    }
+
+    pub fn span(&self) -> Span {
+        self.repr.token.span()
+    }
+
+    pub fn set_span(&mut self, span: Span) {
+        self.repr.token.set_span(span);
+    }
+
+    pub fn suffix(&self) -> &str {
+        &self.repr.suffix
+    }
+
+    pub fn token(&self) -> Literal {
+        self.repr.token.clone()
+    }
+}
+
+impl LitByte {
+    pub fn new(value: u8, span: Span) -> Self {
+        let mut token = Literal::u8_suffixed(value);
+        token.set_span(span);
+        LitByte {
+            repr: Box::new(LitRepr {
+                token,
+                suffix: Box::<str>::default(),
+            }),
+        }
+    }
+
+    pub fn value(&self) -> u8 {
+        let repr = self.repr.token.to_string();
+        let (value, _suffix) = value::parse_lit_byte(&repr);
+        value
+    }
+
+    pub fn span(&self) -> Span {
+        self.repr.token.span()
+    }
+
+    pub fn set_span(&mut self, span: Span) {
+        self.repr.token.set_span(span);
+    }
+
+    pub fn suffix(&self) -> &str {
+        &self.repr.suffix
+    }
+
+    pub fn token(&self) -> Literal {
+        self.repr.token.clone()
+    }
+}
+
+impl LitChar {
+    pub fn new(value: char, span: Span) -> Self {
+        let mut token = Literal::character(value);
+        token.set_span(span);
+        LitChar {
+            repr: Box::new(LitRepr {
+                token,
+                suffix: Box::<str>::default(),
+            }),
+        }
+    }
+
+    pub fn value(&self) -> char {
+        let repr = self.repr.token.to_string();
+        let (value, _suffix) = value::parse_lit_char(&repr);
+        value
+    }
+
+    pub fn span(&self) -> Span {
+        self.repr.token.span()
+    }
+
+    pub fn set_span(&mut self, span: Span) {
+        self.repr.token.set_span(span);
+    }
+
+    pub fn suffix(&self) -> &str {
+        &self.repr.suffix
+    }
+
+    pub fn token(&self) -> Literal {
+        self.repr.token.clone()
+    }
+}
+
+impl LitInt {
+    pub fn new(repr: &str, span: Span) -> Self {
+        let (digits, suffix) = match value::parse_lit_int(repr) {
+            Some(parse) => parse,
+            None => panic!("not an integer literal: `{}`", repr),
+        };
+
+        let mut token: Literal = repr.parse().unwrap();
+        token.set_span(span);
+        LitInt {
+            repr: Box::new(LitIntRepr {
+                token,
+                digits,
+                suffix,
+            }),
+        }
+    }
+
+    pub fn base10_digits(&self) -> &str {
+        &self.repr.digits
+    }
+
+    /// Parses the literal into a selected number type.
+    ///
+    /// This is equivalent to `lit.base10_digits().parse()` except that the
+    /// resulting errors will be correctly spanned to point to the literal token
+    /// in the macro input.
+    ///
+    /// ```
+    /// use syn::LitInt;
+    /// use syn::parse::{Parse, ParseStream, Result};
+    ///
+    /// struct Port {
+    ///     value: u16,
+    /// }
+    ///
+    /// impl Parse for Port {
+    ///     fn parse(input: ParseStream) -> Result<Self> {
+    ///         let lit: LitInt = input.parse()?;
+    ///         let value = lit.base10_parse::<u16>()?;
+    ///         Ok(Port { value })
+    ///     }
+    /// }
+    /// ```
+    pub fn base10_parse<N>(&self) -> Result<N>
+    where
+        N: FromStr,
+        N::Err: Display,
+    {
+        self.base10_digits()
+            .parse()
+            .map_err(|err| Error::new(self.span(), err))
+    }
+
+    pub fn suffix(&self) -> &str {
+        &self.repr.suffix
+    }
+
+    pub fn span(&self) -> Span {
+        self.repr.token.span()
+    }
+
+    pub fn set_span(&mut self, span: Span) {
+        self.repr.token.set_span(span);
+    }
+
+    pub fn token(&self) -> Literal {
+        self.repr.token.clone()
+    }
+}
+
+impl From<Literal> for LitInt {
+    fn from(token: Literal) -> Self {
+        let repr = token.to_string();
+        if let Some((digits, suffix)) = value::parse_lit_int(&repr) {
+            LitInt {
+                repr: Box::new(LitIntRepr {
+                    token,
+                    digits,
+                    suffix,
+                }),
+            }
+        } else {
+            panic!("not an integer literal: `{}`", repr);
+        }
+    }
+}
+
+impl Display for LitInt {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.repr.token.fmt(formatter)
+    }
+}
+
+impl LitFloat {
+    pub fn new(repr: &str, span: Span) -> Self {
+        let (digits, suffix) = match value::parse_lit_float(repr) {
+            Some(parse) => parse,
+            None => panic!("not a float literal: `{}`", repr),
+        };
+
+        let mut token: Literal = repr.parse().unwrap();
+        token.set_span(span);
+        LitFloat {
+            repr: Box::new(LitFloatRepr {
+                token,
+                digits,
+                suffix,
+            }),
+        }
+    }
+
+    pub fn base10_digits(&self) -> &str {
+        &self.repr.digits
+    }
+
+    pub fn base10_parse<N>(&self) -> Result<N>
+    where
+        N: FromStr,
+        N::Err: Display,
+    {
+        self.base10_digits()
+            .parse()
+            .map_err(|err| Error::new(self.span(), err))
+    }
+
+    pub fn suffix(&self) -> &str {
+        &self.repr.suffix
+    }
+
+    pub fn span(&self) -> Span {
+        self.repr.token.span()
+    }
+
+    pub fn set_span(&mut self, span: Span) {
+        self.repr.token.set_span(span);
+    }
+
+    pub fn token(&self) -> Literal {
+        self.repr.token.clone()
+    }
+}
+
+impl From<Literal> for LitFloat {
+    fn from(token: Literal) -> Self {
+        let repr = token.to_string();
+        if let Some((digits, suffix)) = value::parse_lit_float(&repr) {
+            LitFloat {
+                repr: Box::new(LitFloatRepr {
+                    token,
+                    digits,
+                    suffix,
+                }),
+            }
+        } else {
+            panic!("not a float literal: `{}`", repr);
+        }
+    }
+}
+
+impl Display for LitFloat {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        self.repr.token.fmt(formatter)
+    }
+}
+
+impl LitBool {
+    pub fn new(value: bool, span: Span) -> Self {
+        LitBool { value, span }
+    }
+
+    pub fn value(&self) -> bool {
+        self.value
+    }
+
+    pub fn span(&self) -> Span {
+        self.span
+    }
+
+    pub fn set_span(&mut self, span: Span) {
+        self.span = span;
+    }
+
+    pub fn token(&self) -> Ident {
+        let s = if self.value { "true" } else { "false" };
+        Ident::new(s, self.span)
+    }
+}
+
+#[cfg(feature = "extra-traits")]
+mod debug_impls {
+    use crate::lit::{LitBool, LitByte, LitByteStr, LitCStr, LitChar, LitFloat, LitInt, LitStr};
+    use std::fmt::{self, Debug};
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))]
+    impl Debug for LitStr {
+        fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+            self.debug(formatter, "LitStr")
+        }
+    }
+
+    impl LitStr {
+        pub(crate) fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+            formatter
+                .debug_struct(name)
+                .field("token", &format_args!("{}", self.repr.token))
+                .finish()
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))]
+    impl Debug for LitByteStr {
+        fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+            self.debug(formatter, "LitByteStr")
+        }
+    }
+
+    impl LitByteStr {
+        pub(crate) fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+            formatter
+                .debug_struct(name)
+                .field("token", &format_args!("{}", self.repr.token))
+                .finish()
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))]
+    impl Debug for LitCStr {
+        fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+            self.debug(formatter, "LitCStr")
+        }
+    }
+
+    impl LitCStr {
+        pub(crate) fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+            formatter
+                .debug_struct(name)
+                .field("token", &format_args!("{}", self.repr.token))
+                .finish()
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))]
+    impl Debug for LitByte {
+        fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+            self.debug(formatter, "LitByte")
+        }
+    }
+
+    impl LitByte {
+        pub(crate) fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+            formatter
+                .debug_struct(name)
+                .field("token", &format_args!("{}", self.repr.token))
+                .finish()
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))]
+    impl Debug for LitChar {
+        fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+            self.debug(formatter, "LitChar")
+        }
+    }
+
+    impl LitChar {
+        pub(crate) fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+            formatter
+                .debug_struct(name)
+                .field("token", &format_args!("{}", self.repr.token))
+                .finish()
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))]
+    impl Debug for LitInt {
+        fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+            self.debug(formatter, "LitInt")
+        }
+    }
+
+    impl LitInt {
+        pub(crate) fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+            formatter
+                .debug_struct(name)
+                .field("token", &format_args!("{}", self.repr.token))
+                .finish()
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))]
+    impl Debug for LitFloat {
+        fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+            self.debug(formatter, "LitFloat")
+        }
+    }
+
+    impl LitFloat {
+        pub(crate) fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+            formatter
+                .debug_struct(name)
+                .field("token", &format_args!("{}", self.repr.token))
+                .finish()
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))]
+    impl Debug for LitBool {
+        fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+            self.debug(formatter, "LitBool")
+        }
+    }
+
+    impl LitBool {
+        pub(crate) fn debug(&self, formatter: &mut fmt::Formatter, name: &str) -> fmt::Result {
+            formatter
+                .debug_struct(name)
+                .field("value", &self.value)
+                .finish()
+        }
+    }
+}
+
+#[cfg(feature = "clone-impls")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for LitRepr {
+    fn clone(&self) -> Self {
+        LitRepr {
+            token: self.token.clone(),
+            suffix: self.suffix.clone(),
+        }
+    }
+}
+
+#[cfg(feature = "clone-impls")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for LitIntRepr {
+    fn clone(&self) -> Self {
+        LitIntRepr {
+            token: self.token.clone(),
+            digits: self.digits.clone(),
+            suffix: self.suffix.clone(),
+        }
+    }
+}
+
+#[cfg(feature = "clone-impls")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for LitFloatRepr {
+    fn clone(&self) -> Self {
+        LitFloatRepr {
+            token: self.token.clone(),
+            digits: self.digits.clone(),
+            suffix: self.suffix.clone(),
+        }
+    }
+}
+
+macro_rules! lit_extra_traits {
+    ($ty:ident) => {
+        #[cfg(feature = "clone-impls")]
+        #[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+        impl Clone for $ty {
+            fn clone(&self) -> Self {
+                $ty {
+                    repr: self.repr.clone(),
+                }
+            }
+        }
+
+        #[cfg(feature = "extra-traits")]
+        #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))]
+        impl PartialEq for $ty {
+            fn eq(&self, other: &Self) -> bool {
+                self.repr.token.to_string() == other.repr.token.to_string()
+            }
+        }
+
+        #[cfg(feature = "extra-traits")]
+        #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))]
+        impl Hash for $ty {
+            fn hash<H>(&self, state: &mut H)
+            where
+                H: Hasher,
+            {
+                self.repr.token.to_string().hash(state);
+            }
+        }
+
+        #[cfg(feature = "parsing")]
+        pub_if_not_doc! {
+            #[doc(hidden)]
+            #[allow(non_snake_case)]
+            pub fn $ty(marker: lookahead::TokenMarker) -> $ty {
+                match marker {}
+            }
+        }
+    };
+}
+
+lit_extra_traits!(LitStr);
+lit_extra_traits!(LitByteStr);
+lit_extra_traits!(LitCStr);
+lit_extra_traits!(LitByte);
+lit_extra_traits!(LitChar);
+lit_extra_traits!(LitInt);
+lit_extra_traits!(LitFloat);
+
+#[cfg(feature = "parsing")]
+pub_if_not_doc! {
+    #[doc(hidden)]
+    #[allow(non_snake_case)]
+    pub fn LitBool(marker: lookahead::TokenMarker) -> LitBool {
+        match marker {}
+    }
+}
+
+/// The style of a string literal, either plain quoted or a raw string like
+/// `r##"data"##`.
+#[doc(hidden)] // https://github.com/dtolnay/syn/issues/1566
+pub enum StrStyle {
+    /// An ordinary string like `"data"`.
+    Cooked,
+    /// A raw string like `r##"data"##`.
+    ///
+    /// The unsigned integer is the number of `#` symbols used.
+    Raw(usize),
+}
+
+#[cfg(feature = "parsing")]
+pub_if_not_doc! {
+    #[doc(hidden)]
+    #[allow(non_snake_case)]
+    pub fn Lit(marker: lookahead::TokenMarker) -> Lit {
+        match marker {}
+    }
+}
+
+#[cfg(feature = "parsing")]
+pub(crate) mod parsing {
+    use crate::buffer::Cursor;
+    use crate::error::Result;
+    use crate::lit::{
+        value, Lit, LitBool, LitByte, LitByteStr, LitCStr, LitChar, LitFloat, LitFloatRepr, LitInt,
+        LitIntRepr, LitStr,
+    };
+    use crate::parse::{Parse, ParseStream};
+    use proc_macro2::{Literal, Punct};
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for Lit {
+        fn parse(input: ParseStream) -> Result<Self> {
+            input.step(|cursor| {
+                if let Some((lit, rest)) = cursor.literal() {
+                    return Ok((Lit::new(lit), rest));
+                }
+
+                if let Some((ident, rest)) = cursor.ident() {
+                    let value = ident == "true";
+                    if value || ident == "false" {
+                        let lit_bool = LitBool {
+                            value,
+                            span: ident.span(),
+                        };
+                        return Ok((Lit::Bool(lit_bool), rest));
+                    }
+                }
+
+                if let Some((punct, rest)) = cursor.punct() {
+                    if punct.as_char() == '-' {
+                        if let Some((lit, rest)) = parse_negative_lit(punct, rest) {
+                            return Ok((lit, rest));
+                        }
+                    }
+                }
+
+                Err(cursor.error("expected literal"))
+            })
+        }
+    }
+
+    fn parse_negative_lit(neg: Punct, cursor: Cursor) -> Option<(Lit, Cursor)> {
+        let (lit, rest) = cursor.literal()?;
+
+        let mut span = neg.span();
+        span = span.join(lit.span()).unwrap_or(span);
+
+        let mut repr = lit.to_string();
+        repr.insert(0, '-');
+
+        if let Some((digits, suffix)) = value::parse_lit_int(&repr) {
+            let mut token: Literal = repr.parse().unwrap();
+            token.set_span(span);
+            return Some((
+                Lit::Int(LitInt {
+                    repr: Box::new(LitIntRepr {
+                        token,
+                        digits,
+                        suffix,
+                    }),
+                }),
+                rest,
+            ));
+        }
+
+        let (digits, suffix) = value::parse_lit_float(&repr)?;
+        let mut token: Literal = repr.parse().unwrap();
+        token.set_span(span);
+        Some((
+            Lit::Float(LitFloat {
+                repr: Box::new(LitFloatRepr {
+                    token,
+                    digits,
+                    suffix,
+                }),
+            }),
+            rest,
+        ))
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for LitStr {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let head = input.fork();
+            match input.parse() {
+                Ok(Lit::Str(lit)) => Ok(lit),
+                _ => Err(head.error("expected string literal")),
+            }
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for LitByteStr {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let head = input.fork();
+            match input.parse() {
+                Ok(Lit::ByteStr(lit)) => Ok(lit),
+                _ => Err(head.error("expected byte string literal")),
+            }
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for LitCStr {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let head = input.fork();
+            match input.parse() {
+                Ok(Lit::CStr(lit)) => Ok(lit),
+                _ => Err(head.error("expected C string literal")),
+            }
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for LitByte {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let head = input.fork();
+            match input.parse() {
+                Ok(Lit::Byte(lit)) => Ok(lit),
+                _ => Err(head.error("expected byte literal")),
+            }
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for LitChar {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let head = input.fork();
+            match input.parse() {
+                Ok(Lit::Char(lit)) => Ok(lit),
+                _ => Err(head.error("expected character literal")),
+            }
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for LitInt {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let head = input.fork();
+            match input.parse() {
+                Ok(Lit::Int(lit)) => Ok(lit),
+                _ => Err(head.error("expected integer literal")),
+            }
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for LitFloat {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let head = input.fork();
+            match input.parse() {
+                Ok(Lit::Float(lit)) => Ok(lit),
+                _ => Err(head.error("expected floating point literal")),
+            }
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for LitBool {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let head = input.fork();
+            match input.parse() {
+                Ok(Lit::Bool(lit)) => Ok(lit),
+                _ => Err(head.error("expected boolean literal")),
+            }
+        }
+    }
+}
+
+#[cfg(feature = "printing")]
+mod printing {
+    use crate::lit::{LitBool, LitByte, LitByteStr, LitCStr, LitChar, LitFloat, LitInt, LitStr};
+    use proc_macro2::TokenStream;
+    use quote::{ToTokens, TokenStreamExt};
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for LitStr {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.repr.token.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for LitByteStr {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.repr.token.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for LitCStr {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.repr.token.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for LitByte {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.repr.token.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for LitChar {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.repr.token.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for LitInt {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.repr.token.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for LitFloat {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.repr.token.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for LitBool {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append(self.token());
+        }
+    }
+}
+
+mod value {
+    use crate::bigint::BigInt;
+    use crate::lit::{
+        Lit, LitBool, LitByte, LitByteStr, LitCStr, LitChar, LitFloat, LitFloatRepr, LitInt,
+        LitIntRepr, LitRepr, LitStr,
+    };
+    use proc_macro2::{Literal, Span};
+    use std::ascii;
+    use std::char;
+    use std::ffi::CString;
+    use std::ops::{Index, RangeFrom};
+
+    impl Lit {
+        /// Interpret a Syn literal from a proc-macro2 literal.
+        pub fn new(token: Literal) -> Self {
+            let repr = token.to_string();
+
+            match byte(&repr, 0) {
+                // "...", r"...", r#"..."#
+                b'"' | b'r' => {
+                    let (_, suffix) = parse_lit_str(&repr);
+                    return Lit::Str(LitStr {
+                        repr: Box::new(LitRepr { token, suffix }),
+                    });
+                }
+                b'b' => match byte(&repr, 1) {
+                    // b"...", br"...", br#"...#"
+                    b'"' | b'r' => {
+                        let (_, suffix) = parse_lit_byte_str(&repr);
+                        return Lit::ByteStr(LitByteStr {
+                            repr: Box::new(LitRepr { token, suffix }),
+                        });
+                    }
+                    // b'...'
+                    b'\'' => {
+                        let (_, suffix) = parse_lit_byte(&repr);
+                        return Lit::Byte(LitByte {
+                            repr: Box::new(LitRepr { token, suffix }),
+                        });
+                    }
+                    _ => {}
+                },
+                // c"...", cr"...", cr#"..."#
+                b'c' => {
+                    let (_, suffix) = parse_lit_c_str(&repr);
+                    return Lit::CStr(LitCStr {
+                        repr: Box::new(LitRepr { token, suffix }),
+                    });
+                }
+                // '...'
+                b'\'' => {
+                    let (_, suffix) = parse_lit_char(&repr);
+                    return Lit::Char(LitChar {
+                        repr: Box::new(LitRepr { token, suffix }),
+                    });
+                }
+                b'0'..=b'9' | b'-' => {
+                    // 0, 123, 0xFF, 0o77, 0b11
+                    if let Some((digits, suffix)) = parse_lit_int(&repr) {
+                        return Lit::Int(LitInt {
+                            repr: Box::new(LitIntRepr {
+                                token,
+                                digits,
+                                suffix,
+                            }),
+                        });
+                    }
+                    // 1.0, 1e-1, 1e+1
+                    if let Some((digits, suffix)) = parse_lit_float(&repr) {
+                        return Lit::Float(LitFloat {
+                            repr: Box::new(LitFloatRepr {
+                                token,
+                                digits,
+                                suffix,
+                            }),
+                        });
+                    }
+                }
+                // true, false
+                b't' | b'f' => {
+                    if repr == "true" || repr == "false" {
+                        return Lit::Bool(LitBool {
+                            value: repr == "true",
+                            span: token.span(),
+                        });
+                    }
+                }
+                b'(' if repr == "(/*ERROR*/)" => return Lit::Verbatim(token),
+                _ => {}
+            }
+
+            panic!("unrecognized literal: `{}`", repr);
+        }
+
+        pub fn suffix(&self) -> &str {
+            match self {
+                Lit::Str(lit) => lit.suffix(),
+                Lit::ByteStr(lit) => lit.suffix(),
+                Lit::CStr(lit) => lit.suffix(),
+                Lit::Byte(lit) => lit.suffix(),
+                Lit::Char(lit) => lit.suffix(),
+                Lit::Int(lit) => lit.suffix(),
+                Lit::Float(lit) => lit.suffix(),
+                Lit::Bool(_) | Lit::Verbatim(_) => "",
+            }
+        }
+
+        pub fn span(&self) -> Span {
+            match self {
+                Lit::Str(lit) => lit.span(),
+                Lit::ByteStr(lit) => lit.span(),
+                Lit::CStr(lit) => lit.span(),
+                Lit::Byte(lit) => lit.span(),
+                Lit::Char(lit) => lit.span(),
+                Lit::Int(lit) => lit.span(),
+                Lit::Float(lit) => lit.span(),
+                Lit::Bool(lit) => lit.span,
+                Lit::Verbatim(lit) => lit.span(),
+            }
+        }
+
+        pub fn set_span(&mut self, span: Span) {
+            match self {
+                Lit::Str(lit) => lit.set_span(span),
+                Lit::ByteStr(lit) => lit.set_span(span),
+                Lit::CStr(lit) => lit.set_span(span),
+                Lit::Byte(lit) => lit.set_span(span),
+                Lit::Char(lit) => lit.set_span(span),
+                Lit::Int(lit) => lit.set_span(span),
+                Lit::Float(lit) => lit.set_span(span),
+                Lit::Bool(lit) => lit.span = span,
+                Lit::Verbatim(lit) => lit.set_span(span),
+            }
+        }
+    }
+
+    /// Get the byte at offset idx, or a default of `b'\0'` if we're looking
+    /// past the end of the input buffer.
+    pub(crate) fn byte<S: AsRef<[u8]> + ?Sized>(s: &S, idx: usize) -> u8 {
+        let s = s.as_ref();
+        if idx < s.len() {
+            s[idx]
+        } else {
+            0
+        }
+    }
+
+    fn next_chr(s: &str) -> char {
+        s.chars().next().unwrap_or('\0')
+    }
+
+    // Returns (content, suffix).
+    pub(crate) fn parse_lit_str(s: &str) -> (Box<str>, Box<str>) {
+        match byte(s, 0) {
+            b'"' => parse_lit_str_cooked(s),
+            b'r' => parse_lit_str_raw(s),
+            _ => unreachable!(),
+        }
+    }
+
+    // Clippy false positive
+    // https://github.com/rust-lang-nursery/rust-clippy/issues/2329
+    #[allow(clippy::needless_continue)]
+    fn parse_lit_str_cooked(mut s: &str) -> (Box<str>, Box<str>) {
+        assert_eq!(byte(s, 0), b'"');
+        s = &s[1..];
+
+        let mut content = String::new();
+        'outer: loop {
+            let ch = match byte(s, 0) {
+                b'"' => break,
+                b'\\' => {
+                    let b = byte(s, 1);
+                    s = &s[2..];
+                    match b {
+                        b'x' => {
+                            let (byte, rest) = backslash_x(s);
+                            s = rest;
+                            assert!(byte <= 0x7F, "invalid \\x byte in string literal");
+                            char::from_u32(u32::from(byte)).unwrap()
+                        }
+                        b'u' => {
+                            let (ch, rest) = backslash_u(s);
+                            s = rest;
+                            ch
+                        }
+                        b'n' => '\n',
+                        b'r' => '\r',
+                        b't' => '\t',
+                        b'\\' => '\\',
+                        b'0' => '\0',
+                        b'\'' => '\'',
+                        b'"' => '"',
+                        b'\r' | b'\n' => loop {
+                            let b = byte(s, 0);
+                            match b {
+                                b' ' | b'\t' | b'\n' | b'\r' => s = &s[1..],
+                                _ => continue 'outer,
+                            }
+                        },
+                        b => panic!(
+                            "unexpected byte '{}' after \\ character in string literal",
+                            ascii::escape_default(b),
+                        ),
+                    }
+                }
+                b'\r' => {
+                    assert_eq!(byte(s, 1), b'\n', "bare CR not allowed in string");
+                    s = &s[2..];
+                    '\n'
+                }
+                _ => {
+                    let ch = next_chr(s);
+                    s = &s[ch.len_utf8()..];
+                    ch
+                }
+            };
+            content.push(ch);
+        }
+
+        assert!(s.starts_with('"'));
+        let content = content.into_boxed_str();
+        let suffix = s[1..].to_owned().into_boxed_str();
+        (content, suffix)
+    }
+
+    fn parse_lit_str_raw(mut s: &str) -> (Box<str>, Box<str>) {
+        assert_eq!(byte(s, 0), b'r');
+        s = &s[1..];
+
+        let mut pounds = 0;
+        while byte(s, pounds) == b'#' {
+            pounds += 1;
+        }
+        assert_eq!(byte(s, pounds), b'"');
+        let close = s.rfind('"').unwrap();
+        for end in s[close + 1..close + 1 + pounds].bytes() {
+            assert_eq!(end, b'#');
+        }
+
+        let content = s[pounds + 1..close].to_owned().into_boxed_str();
+        let suffix = s[close + 1 + pounds..].to_owned().into_boxed_str();
+        (content, suffix)
+    }
+
+    // Returns (content, suffix).
+    pub(crate) fn parse_lit_byte_str(s: &str) -> (Vec<u8>, Box<str>) {
+        assert_eq!(byte(s, 0), b'b');
+        match byte(s, 1) {
+            b'"' => parse_lit_byte_str_cooked(s),
+            b'r' => parse_lit_byte_str_raw(s),
+            _ => unreachable!(),
+        }
+    }
+
+    // Clippy false positive
+    // https://github.com/rust-lang-nursery/rust-clippy/issues/2329
+    #[allow(clippy::needless_continue)]
+    fn parse_lit_byte_str_cooked(mut s: &str) -> (Vec<u8>, Box<str>) {
+        assert_eq!(byte(s, 0), b'b');
+        assert_eq!(byte(s, 1), b'"');
+        s = &s[2..];
+
+        // We're going to want to have slices which don't respect codepoint boundaries.
+        let mut v = s.as_bytes();
+
+        let mut out = Vec::new();
+        'outer: loop {
+            let byte = match byte(v, 0) {
+                b'"' => break,
+                b'\\' => {
+                    let b = byte(v, 1);
+                    v = &v[2..];
+                    match b {
+                        b'x' => {
+                            let (b, rest) = backslash_x(v);
+                            v = rest;
+                            b
+                        }
+                        b'n' => b'\n',
+                        b'r' => b'\r',
+                        b't' => b'\t',
+                        b'\\' => b'\\',
+                        b'0' => b'\0',
+                        b'\'' => b'\'',
+                        b'"' => b'"',
+                        b'\r' | b'\n' => loop {
+                            let byte = byte(v, 0);
+                            if matches!(byte, b' ' | b'\t' | b'\n' | b'\r') {
+                                v = &v[1..];
+                            } else {
+                                continue 'outer;
+                            }
+                        },
+                        b => panic!(
+                            "unexpected byte '{}' after \\ character in byte-string literal",
+                            ascii::escape_default(b),
+                        ),
+                    }
+                }
+                b'\r' => {
+                    assert_eq!(byte(v, 1), b'\n', "bare CR not allowed in string");
+                    v = &v[2..];
+                    b'\n'
+                }
+                b => {
+                    v = &v[1..];
+                    b
+                }
+            };
+            out.push(byte);
+        }
+
+        assert_eq!(byte(v, 0), b'"');
+        let suffix = s[s.len() - v.len() + 1..].to_owned().into_boxed_str();
+        (out, suffix)
+    }
+
+    fn parse_lit_byte_str_raw(s: &str) -> (Vec<u8>, Box<str>) {
+        assert_eq!(byte(s, 0), b'b');
+        let (value, suffix) = parse_lit_str_raw(&s[1..]);
+        (String::from(value).into_bytes(), suffix)
+    }
+
+    // Returns (content, suffix).
+    pub(crate) fn parse_lit_c_str(s: &str) -> (CString, Box<str>) {
+        assert_eq!(byte(s, 0), b'c');
+        match byte(s, 1) {
+            b'"' => parse_lit_c_str_cooked(s),
+            b'r' => parse_lit_c_str_raw(s),
+            _ => unreachable!(),
+        }
+    }
+
+    // Clippy false positive
+    // https://github.com/rust-lang-nursery/rust-clippy/issues/2329
+    #[allow(clippy::needless_continue)]
+    fn parse_lit_c_str_cooked(mut s: &str) -> (CString, Box<str>) {
+        assert_eq!(byte(s, 0), b'c');
+        assert_eq!(byte(s, 1), b'"');
+        s = &s[2..];
+
+        // We're going to want to have slices which don't respect codepoint boundaries.
+        let mut v = s.as_bytes();
+
+        let mut out = Vec::new();
+        'outer: loop {
+            let byte = match byte(v, 0) {
+                b'"' => break,
+                b'\\' => {
+                    let b = byte(v, 1);
+                    v = &v[2..];
+                    match b {
+                        b'x' => {
+                            let (b, rest) = backslash_x(v);
+                            assert!(b != 0, "\\x00 is not allowed in C-string literal");
+                            v = rest;
+                            b
+                        }
+                        b'u' => {
+                            let (ch, rest) = backslash_u(v);
+                            assert!(ch != '\0', "\\u{{0}} is not allowed in C-string literal");
+                            v = rest;
+                            out.extend_from_slice(ch.encode_utf8(&mut [0u8; 4]).as_bytes());
+                            continue 'outer;
+                        }
+                        b'n' => b'\n',
+                        b'r' => b'\r',
+                        b't' => b'\t',
+                        b'\\' => b'\\',
+                        b'\'' => b'\'',
+                        b'"' => b'"',
+                        b'\r' | b'\n' => loop {
+                            let byte = byte(v, 0);
+                            if matches!(byte, b' ' | b'\t' | b'\n' | b'\r') {
+                                v = &v[1..];
+                            } else {
+                                continue 'outer;
+                            }
+                        },
+                        b => panic!(
+                            "unexpected byte '{}' after \\ character in byte literal",
+                            ascii::escape_default(b),
+                        ),
+                    }
+                }
+                b'\r' => {
+                    assert_eq!(byte(v, 1), b'\n', "bare CR not allowed in string");
+                    v = &v[2..];
+                    b'\n'
+                }
+                b => {
+                    v = &v[1..];
+                    b
+                }
+            };
+            out.push(byte);
+        }
+
+        assert_eq!(byte(v, 0), b'"');
+        let suffix = s[s.len() - v.len() + 1..].to_owned().into_boxed_str();
+        (CString::new(out).unwrap(), suffix)
+    }
+
+    fn parse_lit_c_str_raw(s: &str) -> (CString, Box<str>) {
+        assert_eq!(byte(s, 0), b'c');
+        let (value, suffix) = parse_lit_str_raw(&s[1..]);
+        (CString::new(String::from(value)).unwrap(), suffix)
+    }
+
+    // Returns (value, suffix).
+    pub(crate) fn parse_lit_byte(s: &str) -> (u8, Box<str>) {
+        assert_eq!(byte(s, 0), b'b');
+        assert_eq!(byte(s, 1), b'\'');
+
+        // We're going to want to have slices which don't respect codepoint boundaries.
+        let mut v = s[2..].as_bytes();
+
+        let b = match byte(v, 0) {
+            b'\\' => {
+                let b = byte(v, 1);
+                v = &v[2..];
+                match b {
+                    b'x' => {
+                        let (b, rest) = backslash_x(v);
+                        v = rest;
+                        b
+                    }
+                    b'n' => b'\n',
+                    b'r' => b'\r',
+                    b't' => b'\t',
+                    b'\\' => b'\\',
+                    b'0' => b'\0',
+                    b'\'' => b'\'',
+                    b'"' => b'"',
+                    b => panic!(
+                        "unexpected byte '{}' after \\ character in byte literal",
+                        ascii::escape_default(b),
+                    ),
+                }
+            }
+            b => {
+                v = &v[1..];
+                b
+            }
+        };
+
+        assert_eq!(byte(v, 0), b'\'');
+        let suffix = s[s.len() - v.len() + 1..].to_owned().into_boxed_str();
+        (b, suffix)
+    }
+
+    // Returns (value, suffix).
+    pub(crate) fn parse_lit_char(mut s: &str) -> (char, Box<str>) {
+        assert_eq!(byte(s, 0), b'\'');
+        s = &s[1..];
+
+        let ch = match byte(s, 0) {
+            b'\\' => {
+                let b = byte(s, 1);
+                s = &s[2..];
+                match b {
+                    b'x' => {
+                        let (byte, rest) = backslash_x(s);
+                        s = rest;
+                        assert!(byte <= 0x7F, "invalid \\x byte in character literal");
+                        char::from_u32(u32::from(byte)).unwrap()
+                    }
+                    b'u' => {
+                        let (ch, rest) = backslash_u(s);
+                        s = rest;
+                        ch
+                    }
+                    b'n' => '\n',
+                    b'r' => '\r',
+                    b't' => '\t',
+                    b'\\' => '\\',
+                    b'0' => '\0',
+                    b'\'' => '\'',
+                    b'"' => '"',
+                    b => panic!(
+                        "unexpected byte '{}' after \\ character in character literal",
+                        ascii::escape_default(b),
+                    ),
+                }
+            }
+            _ => {
+                let ch = next_chr(s);
+                s = &s[ch.len_utf8()..];
+                ch
+            }
+        };
+        assert_eq!(byte(s, 0), b'\'');
+        let suffix = s[1..].to_owned().into_boxed_str();
+        (ch, suffix)
+    }
+
+    fn backslash_x<S>(s: &S) -> (u8, &S)
+    where
+        S: Index<RangeFrom<usize>, Output = S> + AsRef<[u8]> + ?Sized,
+    {
+        let mut ch = 0;
+        let b0 = byte(s, 0);
+        let b1 = byte(s, 1);
+        ch += 0x10
+            * match b0 {
+                b'0'..=b'9' => b0 - b'0',
+                b'a'..=b'f' => 10 + (b0 - b'a'),
+                b'A'..=b'F' => 10 + (b0 - b'A'),
+                _ => panic!("unexpected non-hex character after \\x"),
+            };
+        ch += match b1 {
+            b'0'..=b'9' => b1 - b'0',
+            b'a'..=b'f' => 10 + (b1 - b'a'),
+            b'A'..=b'F' => 10 + (b1 - b'A'),
+            _ => panic!("unexpected non-hex character after \\x"),
+        };
+        (ch, &s[2..])
+    }
+
+    fn backslash_u<S>(mut s: &S) -> (char, &S)
+    where
+        S: Index<RangeFrom<usize>, Output = S> + AsRef<[u8]> + ?Sized,
+    {
+        if byte(s, 0) != b'{' {
+            panic!("{}", "expected { after \\u");
+        }
+        s = &s[1..];
+
+        let mut ch = 0;
+        let mut digits = 0;
+        loop {
+            let b = byte(s, 0);
+            let digit = match b {
+                b'0'..=b'9' => b - b'0',
+                b'a'..=b'f' => 10 + b - b'a',
+                b'A'..=b'F' => 10 + b - b'A',
+                b'_' if digits > 0 => {
+                    s = &s[1..];
+                    continue;
+                }
+                b'}' if digits == 0 => panic!("invalid empty unicode escape"),
+                b'}' => break,
+                _ => panic!("unexpected non-hex character after \\u"),
+            };
+            if digits == 6 {
+                panic!("overlong unicode escape (must have at most 6 hex digits)");
+            }
+            ch *= 0x10;
+            ch += u32::from(digit);
+            digits += 1;
+            s = &s[1..];
+        }
+        assert!(byte(s, 0) == b'}');
+        s = &s[1..];
+
+        if let Some(ch) = char::from_u32(ch) {
+            (ch, s)
+        } else {
+            panic!("character code {:x} is not a valid unicode character", ch);
+        }
+    }
+
+    // Returns base 10 digits and suffix.
+    pub(crate) fn parse_lit_int(mut s: &str) -> Option<(Box<str>, Box<str>)> {
+        let negative = byte(s, 0) == b'-';
+        if negative {
+            s = &s[1..];
+        }
+
+        let base = match (byte(s, 0), byte(s, 1)) {
+            (b'0', b'x') => {
+                s = &s[2..];
+                16
+            }
+            (b'0', b'o') => {
+                s = &s[2..];
+                8
+            }
+            (b'0', b'b') => {
+                s = &s[2..];
+                2
+            }
+            (b'0'..=b'9', _) => 10,
+            _ => return None,
+        };
+
+        let mut value = BigInt::new();
+        let mut has_digit = false;
+        'outer: loop {
+            let b = byte(s, 0);
+            let digit = match b {
+                b'0'..=b'9' => b - b'0',
+                b'a'..=b'f' if base > 10 => b - b'a' + 10,
+                b'A'..=b'F' if base > 10 => b - b'A' + 10,
+                b'_' => {
+                    s = &s[1..];
+                    continue;
+                }
+                // If looking at a floating point literal, we don't want to
+                // consider it an integer.
+                b'.' if base == 10 => return None,
+                b'e' | b'E' if base == 10 => {
+                    let mut has_exp = false;
+                    for (i, b) in s[1..].bytes().enumerate() {
+                        match b {
+                            b'_' => {}
+                            b'-' | b'+' => return None,
+                            b'0'..=b'9' => has_exp = true,
+                            _ => {
+                                let suffix = &s[1 + i..];
+                                if has_exp && crate::ident::xid_ok(suffix) {
+                                    return None;
+                                } else {
+                                    break 'outer;
+                                }
+                            }
+                        }
+                    }
+                    if has_exp {
+                        return None;
+                    } else {
+                        break;
+                    }
+                }
+                _ => break,
+            };
+
+            if digit >= base {
+                return None;
+            }
+
+            has_digit = true;
+            value *= base;
+            value += digit;
+            s = &s[1..];
+        }
+
+        if !has_digit {
+            return None;
+        }
+
+        let suffix = s;
+        if suffix.is_empty() || crate::ident::xid_ok(suffix) {
+            let mut repr = value.to_string();
+            if negative {
+                repr.insert(0, '-');
+            }
+            Some((repr.into_boxed_str(), suffix.to_owned().into_boxed_str()))
+        } else {
+            None
+        }
+    }
+
+    // Returns base 10 digits and suffix.
+    pub(crate) fn parse_lit_float(input: &str) -> Option<(Box<str>, Box<str>)> {
+        // Rust's floating point literals are very similar to the ones parsed by
+        // the standard library, except that rust's literals can contain
+        // ignorable underscores. Let's remove those underscores.
+
+        let mut bytes = input.to_owned().into_bytes();
+
+        let start = (*bytes.first()? == b'-') as usize;
+        match bytes.get(start)? {
+            b'0'..=b'9' => {}
+            _ => return None,
+        }
+
+        let mut read = start;
+        let mut write = start;
+        let mut has_dot = false;
+        let mut has_e = false;
+        let mut has_sign = false;
+        let mut has_exponent = false;
+        while read < bytes.len() {
+            match bytes[read] {
+                b'_' => {
+                    // Don't increase write
+                    read += 1;
+                    continue;
+                }
+                b'0'..=b'9' => {
+                    if has_e {
+                        has_exponent = true;
+                    }
+                    bytes[write] = bytes[read];
+                }
+                b'.' => {
+                    if has_e || has_dot {
+                        return None;
+                    }
+                    has_dot = true;
+                    bytes[write] = b'.';
+                }
+                b'e' | b'E' => {
+                    match bytes[read + 1..]
+                        .iter()
+                        .find(|b| **b != b'_')
+                        .unwrap_or(&b'\0')
+                    {
+                        b'-' | b'+' | b'0'..=b'9' => {}
+                        _ => break,
+                    }
+                    if has_e {
+                        if has_exponent {
+                            break;
+                        } else {
+                            return None;
+                        }
+                    }
+                    has_e = true;
+                    bytes[write] = b'e';
+                }
+                b'-' | b'+' => {
+                    if has_sign || has_exponent || !has_e {
+                        return None;
+                    }
+                    has_sign = true;
+                    if bytes[read] == b'-' {
+                        bytes[write] = bytes[read];
+                    } else {
+                        // Omit '+'
+                        read += 1;
+                        continue;
+                    }
+                }
+                _ => break,
+            }
+            read += 1;
+            write += 1;
+        }
+
+        if has_e && !has_exponent {
+            return None;
+        }
+
+        let mut digits = String::from_utf8(bytes).unwrap();
+        let suffix = digits.split_off(read);
+        digits.truncate(write);
+        if suffix.is_empty() || crate::ident::xid_ok(&suffix) {
+            Some((digits.into_boxed_str(), suffix.into_boxed_str()))
+        } else {
+            None
+        }
+    }
+}
+
\ No newline at end of file diff --git a/src/syn/lookahead.rs.html b/src/syn/lookahead.rs.html new file mode 100644 index 0000000..b9e4e6b --- /dev/null +++ b/src/syn/lookahead.rs.html @@ -0,0 +1,339 @@ +lookahead.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+
use crate::buffer::Cursor;
+use crate::error::{self, Error};
+use crate::sealed::lookahead::Sealed;
+use crate::span::IntoSpans;
+use crate::token::Token;
+use proc_macro2::{Delimiter, Span};
+use std::cell::RefCell;
+
+/// Support for checking the next token in a stream to decide how to parse.
+///
+/// An important advantage over [`ParseStream::peek`] is that here we
+/// automatically construct an appropriate error message based on the token
+/// alternatives that get peeked. If you are producing your own error message,
+/// go ahead and use `ParseStream::peek` instead.
+///
+/// Use [`ParseStream::lookahead1`] to construct this object.
+///
+/// [`ParseStream::peek`]: crate::parse::ParseBuffer::peek
+/// [`ParseStream::lookahead1`]: crate::parse::ParseBuffer::lookahead1
+///
+/// Consuming tokens from the source stream after constructing a lookahead
+/// object does not also advance the lookahead object.
+///
+/// # Example
+///
+/// ```
+/// use syn::{ConstParam, Ident, Lifetime, LifetimeParam, Result, Token, TypeParam};
+/// use syn::parse::{Parse, ParseStream};
+///
+/// // A generic parameter, a single one of the comma-separated elements inside
+/// // angle brackets in:
+/// //
+/// //     fn f<T: Clone, 'a, 'b: 'a, const N: usize>() { ... }
+/// //
+/// // On invalid input, lookahead gives us a reasonable error message.
+/// //
+/// //     error: expected one of: identifier, lifetime, `const`
+/// //       |
+/// //     5 |     fn f<!Sized>() {}
+/// //       |          ^
+/// enum GenericParam {
+///     Type(TypeParam),
+///     Lifetime(LifetimeParam),
+///     Const(ConstParam),
+/// }
+///
+/// impl Parse for GenericParam {
+///     fn parse(input: ParseStream) -> Result<Self> {
+///         let lookahead = input.lookahead1();
+///         if lookahead.peek(Ident) {
+///             input.parse().map(GenericParam::Type)
+///         } else if lookahead.peek(Lifetime) {
+///             input.parse().map(GenericParam::Lifetime)
+///         } else if lookahead.peek(Token![const]) {
+///             input.parse().map(GenericParam::Const)
+///         } else {
+///             Err(lookahead.error())
+///         }
+///     }
+/// }
+/// ```
+pub struct Lookahead1<'a> {
+    scope: Span,
+    cursor: Cursor<'a>,
+    comparisons: RefCell<Vec<&'static str>>,
+}
+
+pub(crate) fn new(scope: Span, cursor: Cursor) -> Lookahead1 {
+    Lookahead1 {
+        scope,
+        cursor,
+        comparisons: RefCell::new(Vec::new()),
+    }
+}
+
+fn peek_impl(
+    lookahead: &Lookahead1,
+    peek: fn(Cursor) -> bool,
+    display: fn() -> &'static str,
+) -> bool {
+    if peek(lookahead.cursor) {
+        return true;
+    }
+    lookahead.comparisons.borrow_mut().push(display());
+    false
+}
+
+impl<'a> Lookahead1<'a> {
+    /// Looks at the next token in the parse stream to determine whether it
+    /// matches the requested type of token.
+    ///
+    /// # Syntax
+    ///
+    /// Note that this method does not use turbofish syntax. Pass the peek type
+    /// inside of parentheses.
+    ///
+    /// - `input.peek(Token![struct])`
+    /// - `input.peek(Token![==])`
+    /// - `input.peek(Ident)`&emsp;*(does not accept keywords)*
+    /// - `input.peek(Ident::peek_any)`
+    /// - `input.peek(Lifetime)`
+    /// - `input.peek(token::Brace)`
+    pub fn peek<T: Peek>(&self, token: T) -> bool {
+        let _ = token;
+        peek_impl(self, T::Token::peek, T::Token::display)
+    }
+
+    /// Triggers an error at the current position of the parse stream.
+    ///
+    /// The error message will identify all of the expected token types that
+    /// have been peeked against this lookahead instance.
+    pub fn error(self) -> Error {
+        let comparisons = self.comparisons.borrow();
+        match comparisons.len() {
+            0 => {
+                if self.cursor.eof() {
+                    Error::new(self.scope, "unexpected end of input")
+                } else {
+                    Error::new(self.cursor.span(), "unexpected token")
+                }
+            }
+            1 => {
+                let message = format!("expected {}", comparisons[0]);
+                error::new_at(self.scope, self.cursor, message)
+            }
+            2 => {
+                let message = format!("expected {} or {}", comparisons[0], comparisons[1]);
+                error::new_at(self.scope, self.cursor, message)
+            }
+            _ => {
+                let join = comparisons.join(", ");
+                let message = format!("expected one of: {}", join);
+                error::new_at(self.scope, self.cursor, message)
+            }
+        }
+    }
+}
+
+/// Types that can be parsed by looking at just one token.
+///
+/// Use [`ParseStream::peek`] to peek one of these types in a parse stream
+/// without consuming it from the stream.
+///
+/// This trait is sealed and cannot be implemented for types outside of Syn.
+///
+/// [`ParseStream::peek`]: crate::parse::ParseBuffer::peek
+pub trait Peek: Sealed {
+    // Not public API.
+    #[doc(hidden)]
+    type Token: Token;
+}
+
+impl<F: Copy + FnOnce(TokenMarker) -> T, T: Token> Peek for F {
+    type Token = T;
+}
+
+pub enum TokenMarker {}
+
+impl<S> IntoSpans<S> for TokenMarker {
+    fn into_spans(self) -> S {
+        match self {}
+    }
+}
+
+pub(crate) fn is_delimiter(cursor: Cursor, delimiter: Delimiter) -> bool {
+    cursor.group(delimiter).is_some()
+}
+
+impl<F: Copy + FnOnce(TokenMarker) -> T, T: Token> Sealed for F {}
+
\ No newline at end of file diff --git a/src/syn/mac.rs.html b/src/syn/mac.rs.html new file mode 100644 index 0000000..79b69d8 --- /dev/null +++ b/src/syn/mac.rs.html @@ -0,0 +1,431 @@ +mac.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+
#[cfg(feature = "parsing")]
+use crate::error::Result;
+#[cfg(feature = "parsing")]
+use crate::parse::{Parse, ParseStream, Parser};
+use crate::path::Path;
+use crate::token::{Brace, Bracket, Paren};
+use proc_macro2::extra::DelimSpan;
+#[cfg(feature = "parsing")]
+use proc_macro2::Delimiter;
+use proc_macro2::TokenStream;
+#[cfg(feature = "parsing")]
+use proc_macro2::TokenTree;
+
+ast_struct! {
+    /// A macro invocation: `println!("{}", mac)`.
+    #[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct Macro {
+        pub path: Path,
+        pub bang_token: Token![!],
+        pub delimiter: MacroDelimiter,
+        pub tokens: TokenStream,
+    }
+}
+
+ast_enum! {
+    /// A grouping token that surrounds a macro body: `m!(...)` or `m!{...}` or `m![...]`.
+    #[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub enum MacroDelimiter {
+        Paren(Paren),
+        Brace(Brace),
+        Bracket(Bracket),
+    }
+}
+
+impl MacroDelimiter {
+    pub fn span(&self) -> &DelimSpan {
+        match self {
+            MacroDelimiter::Paren(token) => &token.span,
+            MacroDelimiter::Brace(token) => &token.span,
+            MacroDelimiter::Bracket(token) => &token.span,
+        }
+    }
+}
+
+impl Macro {
+    /// Parse the tokens within the macro invocation's delimiters into a syntax
+    /// tree.
+    ///
+    /// This is equivalent to `syn::parse2::<T>(mac.tokens)` except that it
+    /// produces a more useful span when `tokens` is empty.
+    ///
+    /// # Example
+    ///
+    /// ```
+    /// use syn::{parse_quote, Expr, ExprLit, Ident, Lit, LitStr, Macro, Token};
+    /// use syn::ext::IdentExt;
+    /// use syn::parse::{Error, Parse, ParseStream, Result};
+    /// use syn::punctuated::Punctuated;
+    ///
+    /// // The arguments expected by libcore's format_args macro, and as a
+    /// // result most other formatting and printing macros like println.
+    /// //
+    /// //     println!("{} is {number:.prec$}", "x", prec=5, number=0.01)
+    /// struct FormatArgs {
+    ///     format_string: Expr,
+    ///     positional_args: Vec<Expr>,
+    ///     named_args: Vec<(Ident, Expr)>,
+    /// }
+    ///
+    /// impl Parse for FormatArgs {
+    ///     fn parse(input: ParseStream) -> Result<Self> {
+    ///         let format_string: Expr;
+    ///         let mut positional_args = Vec::new();
+    ///         let mut named_args = Vec::new();
+    ///
+    ///         format_string = input.parse()?;
+    ///         while !input.is_empty() {
+    ///             input.parse::<Token![,]>()?;
+    ///             if input.is_empty() {
+    ///                 break;
+    ///             }
+    ///             if input.peek(Ident::peek_any) && input.peek2(Token![=]) {
+    ///                 while !input.is_empty() {
+    ///                     let name: Ident = input.call(Ident::parse_any)?;
+    ///                     input.parse::<Token![=]>()?;
+    ///                     let value: Expr = input.parse()?;
+    ///                     named_args.push((name, value));
+    ///                     if input.is_empty() {
+    ///                         break;
+    ///                     }
+    ///                     input.parse::<Token![,]>()?;
+    ///                 }
+    ///                 break;
+    ///             }
+    ///             positional_args.push(input.parse()?);
+    ///         }
+    ///
+    ///         Ok(FormatArgs {
+    ///             format_string,
+    ///             positional_args,
+    ///             named_args,
+    ///         })
+    ///     }
+    /// }
+    ///
+    /// // Extract the first argument, the format string literal, from an
+    /// // invocation of a formatting or printing macro.
+    /// fn get_format_string(m: &Macro) -> Result<LitStr> {
+    ///     let args: FormatArgs = m.parse_body()?;
+    ///     match args.format_string {
+    ///         Expr::Lit(ExprLit { lit: Lit::Str(lit), .. }) => Ok(lit),
+    ///         other => {
+    ///             // First argument was not a string literal expression.
+    ///             // Maybe something like: println!(concat!(...), ...)
+    ///             Err(Error::new_spanned(other, "format string must be a string literal"))
+    ///         }
+    ///     }
+    /// }
+    ///
+    /// fn main() {
+    ///     let invocation = parse_quote! {
+    ///         println!("{:?}", Instant::now())
+    ///     };
+    ///     let lit = get_format_string(&invocation).unwrap();
+    ///     assert_eq!(lit.value(), "{:?}");
+    /// }
+    /// ```
+    #[cfg(feature = "parsing")]
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    pub fn parse_body<T: Parse>(&self) -> Result<T> {
+        self.parse_body_with(T::parse)
+    }
+
+    /// Parse the tokens within the macro invocation's delimiters using the
+    /// given parser.
+    #[cfg(feature = "parsing")]
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    pub fn parse_body_with<F: Parser>(&self, parser: F) -> Result<F::Output> {
+        let scope = self.delimiter.span().close();
+        crate::parse::parse_scoped(parser, scope, self.tokens.clone())
+    }
+}
+
+#[cfg(feature = "parsing")]
+pub(crate) fn parse_delimiter(input: ParseStream) -> Result<(MacroDelimiter, TokenStream)> {
+    input.step(|cursor| {
+        if let Some((TokenTree::Group(g), rest)) = cursor.token_tree() {
+            let span = g.delim_span();
+            let delimiter = match g.delimiter() {
+                Delimiter::Parenthesis => MacroDelimiter::Paren(Paren(span)),
+                Delimiter::Brace => MacroDelimiter::Brace(Brace(span)),
+                Delimiter::Bracket => MacroDelimiter::Bracket(Bracket(span)),
+                Delimiter::None => {
+                    return Err(cursor.error("expected delimiter"));
+                }
+            };
+            Ok(((delimiter, g.stream()), rest))
+        } else {
+            Err(cursor.error("expected delimiter"))
+        }
+    })
+}
+
+#[cfg(feature = "parsing")]
+pub(crate) mod parsing {
+    use crate::error::Result;
+    use crate::mac::{parse_delimiter, Macro};
+    use crate::parse::{Parse, ParseStream};
+    use crate::path::Path;
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for Macro {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let tokens;
+            Ok(Macro {
+                path: input.call(Path::parse_mod_style)?,
+                bang_token: input.parse()?,
+                delimiter: {
+                    let (delimiter, content) = parse_delimiter(input)?;
+                    tokens = content;
+                    delimiter
+                },
+                tokens,
+            })
+        }
+    }
+}
+
+#[cfg(feature = "printing")]
+mod printing {
+    use crate::mac::{Macro, MacroDelimiter};
+    use crate::token;
+    use proc_macro2::{Delimiter, TokenStream};
+    use quote::ToTokens;
+
+    impl MacroDelimiter {
+        pub(crate) fn surround(&self, tokens: &mut TokenStream, inner: TokenStream) {
+            let (delim, span) = match self {
+                MacroDelimiter::Paren(paren) => (Delimiter::Parenthesis, paren.span),
+                MacroDelimiter::Brace(brace) => (Delimiter::Brace, brace.span),
+                MacroDelimiter::Bracket(bracket) => (Delimiter::Bracket, bracket.span),
+            };
+            token::printing::delim(delim, span.join(), tokens, inner);
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for Macro {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.path.to_tokens(tokens);
+            self.bang_token.to_tokens(tokens);
+            self.delimiter.surround(tokens, self.tokens.clone());
+        }
+    }
+}
+
\ No newline at end of file diff --git a/src/syn/macros.rs.html b/src/syn/macros.rs.html new file mode 100644 index 0000000..847ba8f --- /dev/null +++ b/src/syn/macros.rs.html @@ -0,0 +1,353 @@ +macros.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+
#[cfg_attr(
+    not(any(feature = "full", feature = "derive")),
+    allow(unknown_lints, unused_macro_rules)
+)]
+macro_rules! ast_struct {
+    (
+        $(#[$attr:meta])*
+        $pub:ident $struct:ident $name:ident #full $body:tt
+    ) => {
+        check_keyword_matches!(pub $pub);
+        check_keyword_matches!(struct $struct);
+
+        #[cfg(feature = "full")]
+        $(#[$attr])* $pub $struct $name $body
+
+        #[cfg(not(feature = "full"))]
+        $(#[$attr])* $pub $struct $name {
+            _noconstruct: ::std::marker::PhantomData<::proc_macro2::Span>,
+        }
+
+        #[cfg(all(not(feature = "full"), feature = "printing"))]
+        impl ::quote::ToTokens for $name {
+            fn to_tokens(&self, _: &mut ::proc_macro2::TokenStream) {
+                unreachable!()
+            }
+        }
+    };
+
+    (
+        $(#[$attr:meta])*
+        $pub:ident $struct:ident $name:ident $body:tt
+    ) => {
+        check_keyword_matches!(pub $pub);
+        check_keyword_matches!(struct $struct);
+
+        $(#[$attr])* $pub $struct $name $body
+    };
+}
+
+#[cfg(any(feature = "full", feature = "derive"))]
+macro_rules! ast_enum {
+    (
+        $(#[$enum_attr:meta])*
+        $pub:ident $enum:ident $name:ident $body:tt
+    ) => {
+        check_keyword_matches!(pub $pub);
+        check_keyword_matches!(enum $enum);
+
+        $(#[$enum_attr])* $pub $enum $name $body
+    };
+}
+
+macro_rules! ast_enum_of_structs {
+    (
+        $(#[$enum_attr:meta])*
+        $pub:ident $enum:ident $name:ident $body:tt
+    ) => {
+        check_keyword_matches!(pub $pub);
+        check_keyword_matches!(enum $enum);
+
+        $(#[$enum_attr])* $pub $enum $name $body
+
+        ast_enum_of_structs_impl!($name $body);
+    };
+}
+
+macro_rules! ast_enum_of_structs_impl {
+    (
+        $name:ident {
+            $(
+                $(#[cfg $cfg_attr:tt])*
+                $(#[doc $($doc_attr:tt)*])*
+                $variant:ident $( ($($member:ident)::+) )*,
+            )*
+        }
+    ) => {
+        $($(
+            ast_enum_from_struct!($name::$variant, $($member)::+);
+        )*)*
+
+        #[cfg(feature = "printing")]
+        generate_to_tokens! {
+            ()
+            tokens
+            $name {
+                $(
+                    $(#[cfg $cfg_attr])*
+                    $(#[doc $($doc_attr)*])*
+                    $variant $($($member)::+)*,
+                )*
+            }
+        }
+    };
+}
+
+macro_rules! ast_enum_from_struct {
+    // No From<TokenStream> for verbatim variants.
+    ($name:ident::Verbatim, $member:ident) => {};
+
+    ($name:ident::$variant:ident, $member:ident) => {
+        impl From<$member> for $name {
+            fn from(e: $member) -> $name {
+                $name::$variant(e)
+            }
+        }
+    };
+}
+
+#[cfg(feature = "printing")]
+macro_rules! generate_to_tokens {
+    (
+        ($($arms:tt)*) $tokens:ident $name:ident {
+            $(#[cfg $cfg_attr:tt])*
+            $(#[doc $($doc_attr:tt)*])*
+            $variant:ident,
+            $($next:tt)*
+        }
+    ) => {
+        generate_to_tokens!(
+            ($($arms)* $(#[cfg $cfg_attr])* $name::$variant => {})
+            $tokens $name { $($next)* }
+        );
+    };
+
+    (
+        ($($arms:tt)*) $tokens:ident $name:ident {
+            $(#[cfg $cfg_attr:tt])*
+            $(#[doc $($doc_attr:tt)*])*
+            $variant:ident $member:ident,
+            $($next:tt)*
+        }
+    ) => {
+        generate_to_tokens!(
+            ($($arms)* $(#[cfg $cfg_attr])* $name::$variant(_e) => _e.to_tokens($tokens),)
+            $tokens $name { $($next)* }
+        );
+    };
+
+    (($($arms:tt)*) $tokens:ident $name:ident {}) => {
+        #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+        impl ::quote::ToTokens for $name {
+            fn to_tokens(&self, $tokens: &mut ::proc_macro2::TokenStream) {
+                match self {
+                    $($arms)*
+                }
+            }
+        }
+    };
+}
+
+// Rustdoc bug: does not respect the doc(hidden) on some items.
+#[cfg(all(doc, feature = "parsing"))]
+macro_rules! pub_if_not_doc {
+    ($(#[$m:meta])* $pub:ident $($item:tt)*) => {
+        check_keyword_matches!(pub $pub);
+
+        $(#[$m])*
+        $pub(crate) $($item)*
+    };
+}
+
+#[cfg(all(not(doc), feature = "parsing"))]
+macro_rules! pub_if_not_doc {
+    ($(#[$m:meta])* $pub:ident $($item:tt)*) => {
+        check_keyword_matches!(pub $pub);
+
+        $(#[$m])*
+        $pub $($item)*
+    };
+}
+
+macro_rules! check_keyword_matches {
+    (enum enum) => {};
+    (pub pub) => {};
+    (struct struct) => {};
+}
+
\ No newline at end of file diff --git a/src/syn/meta.rs.html b/src/syn/meta.rs.html new file mode 100644 index 0000000..3c68e5c --- /dev/null +++ b/src/syn/meta.rs.html @@ -0,0 +1,855 @@ +meta.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+
//! Facility for interpreting structured content inside of an `Attribute`.
+
+use crate::error::{Error, Result};
+use crate::ext::IdentExt as _;
+use crate::lit::Lit;
+use crate::parse::{ParseStream, Parser};
+use crate::path::{Path, PathSegment};
+use crate::punctuated::Punctuated;
+use proc_macro2::Ident;
+use std::fmt::Display;
+
+/// Make a parser that is usable with `parse_macro_input!` in a
+/// `#[proc_macro_attribute]` macro.
+///
+/// *Warning:* When parsing attribute args **other than** the
+/// `proc_macro::TokenStream` input of a `proc_macro_attribute`, you do **not**
+/// need this function. In several cases your callers will get worse error
+/// messages if you use this function, because the surrounding delimiter's span
+/// is concealed from attribute macros by rustc. Use
+/// [`Attribute::parse_nested_meta`] instead.
+///
+/// [`Attribute::parse_nested_meta`]: crate::Attribute::parse_nested_meta
+///
+/// # Example
+///
+/// This example implements an attribute macro whose invocations look like this:
+///
+/// ```
+/// # const IGNORE: &str = stringify! {
+/// #[tea(kind = "EarlGrey", hot)]
+/// struct Picard {...}
+/// # };
+/// ```
+///
+/// The "parameters" supported by the attribute are:
+///
+/// - `kind = "..."`
+/// - `hot`
+/// - `with(sugar, milk, ...)`, a comma-separated list of ingredients
+///
+/// ```
+/// # extern crate proc_macro;
+/// #
+/// use proc_macro::TokenStream;
+/// use syn::{parse_macro_input, LitStr, Path};
+///
+/// # const IGNORE: &str = stringify! {
+/// #[proc_macro_attribute]
+/// # };
+/// pub fn tea(args: TokenStream, input: TokenStream) -> TokenStream {
+///     let mut kind: Option<LitStr> = None;
+///     let mut hot: bool = false;
+///     let mut with: Vec<Path> = Vec::new();
+///     let tea_parser = syn::meta::parser(|meta| {
+///         if meta.path.is_ident("kind") {
+///             kind = Some(meta.value()?.parse()?);
+///             Ok(())
+///         } else if meta.path.is_ident("hot") {
+///             hot = true;
+///             Ok(())
+///         } else if meta.path.is_ident("with") {
+///             meta.parse_nested_meta(|meta| {
+///                 with.push(meta.path);
+///                 Ok(())
+///             })
+///         } else {
+///             Err(meta.error("unsupported tea property"))
+///         }
+///     });
+///
+///     parse_macro_input!(args with tea_parser);
+///     eprintln!("kind={kind:?} hot={hot} with={with:?}");
+///
+///     /* ... */
+/// #   TokenStream::new()
+/// }
+/// ```
+///
+/// The `syn::meta` library will take care of dealing with the commas including
+/// trailing commas, and producing sensible error messages on unexpected input.
+///
+/// ```console
+/// error: expected `,`
+///  --> src/main.rs:3:37
+///   |
+/// 3 | #[tea(kind = "EarlGrey", with(sugar = "lol", milk))]
+///   |                                     ^
+/// ```
+///
+/// # Example
+///
+/// Same as above but we factor out most of the logic into a separate function.
+///
+/// ```
+/// # extern crate proc_macro;
+/// #
+/// use proc_macro::TokenStream;
+/// use syn::meta::ParseNestedMeta;
+/// use syn::parse::{Parser, Result};
+/// use syn::{parse_macro_input, LitStr, Path};
+///
+/// # const IGNORE: &str = stringify! {
+/// #[proc_macro_attribute]
+/// # };
+/// pub fn tea(args: TokenStream, input: TokenStream) -> TokenStream {
+///     let mut attrs = TeaAttributes::default();
+///     let tea_parser = syn::meta::parser(|meta| attrs.parse(meta));
+///     parse_macro_input!(args with tea_parser);
+///
+///     /* ... */
+/// #   TokenStream::new()
+/// }
+///
+/// #[derive(Default)]
+/// struct TeaAttributes {
+///     kind: Option<LitStr>,
+///     hot: bool,
+///     with: Vec<Path>,
+/// }
+///
+/// impl TeaAttributes {
+///     fn parse(&mut self, meta: ParseNestedMeta) -> Result<()> {
+///         if meta.path.is_ident("kind") {
+///             self.kind = Some(meta.value()?.parse()?);
+///             Ok(())
+///         } else /* just like in last example */
+/// #           { unimplemented!() }
+///
+///     }
+/// }
+/// ```
+pub fn parser(logic: impl FnMut(ParseNestedMeta) -> Result<()>) -> impl Parser<Output = ()> {
+    |input: ParseStream| {
+        if input.is_empty() {
+            Ok(())
+        } else {
+            parse_nested_meta(input, logic)
+        }
+    }
+}
+
+/// Context for parsing a single property in the conventional syntax for
+/// structured attributes.
+///
+/// # Examples
+///
+/// Refer to usage examples on the following two entry-points:
+///
+/// - [`Attribute::parse_nested_meta`] if you have an entire `Attribute` to
+///   parse. Always use this if possible. Generally this is able to produce
+///   better error messages because `Attribute` holds span information for all
+///   of the delimiters therein.
+///
+/// - [`syn::meta::parser`] if you are implementing a `proc_macro_attribute`
+///   macro and parsing the arguments to the attribute macro, i.e. the ones
+///   written in the same attribute that dispatched the macro invocation. Rustc
+///   does not pass span information for the surrounding delimiters into the
+///   attribute macro invocation in this situation, so error messages might be
+///   less precise.
+///
+/// [`Attribute::parse_nested_meta`]: crate::Attribute::parse_nested_meta
+/// [`syn::meta::parser`]: crate::meta::parser
+#[non_exhaustive]
+pub struct ParseNestedMeta<'a> {
+    pub path: Path,
+    pub input: ParseStream<'a>,
+}
+
+impl<'a> ParseNestedMeta<'a> {
+    /// Used when parsing `key = "value"` syntax.
+    ///
+    /// All it does is advance `meta.input` past the `=` sign in the input. You
+    /// could accomplish the same effect by writing
+    /// `meta.parse::<Token![=]>()?`, so at most it is a minor convenience to
+    /// use `meta.value()?`.
+    ///
+    /// # Example
+    ///
+    /// ```
+    /// use syn::{parse_quote, Attribute, LitStr};
+    ///
+    /// let attr: Attribute = parse_quote! {
+    ///     #[tea(kind = "EarlGrey")]
+    /// };
+    ///                                          // conceptually:
+    /// if attr.path().is_ident("tea") {         // this parses the `tea`
+    ///     attr.parse_nested_meta(|meta| {      // this parses the `(`
+    ///         if meta.path.is_ident("kind") {  // this parses the `kind`
+    ///             let value = meta.value()?;   // this parses the `=`
+    ///             let s: LitStr = value.parse()?;  // this parses `"EarlGrey"`
+    ///             if s.value() == "EarlGrey" {
+    ///                 // ...
+    ///             }
+    ///             Ok(())
+    ///         } else {
+    ///             Err(meta.error("unsupported attribute"))
+    ///         }
+    ///     })?;
+    /// }
+    /// # anyhow::Ok(())
+    /// ```
+    pub fn value(&self) -> Result<ParseStream<'a>> {
+        self.input.parse::<Token![=]>()?;
+        Ok(self.input)
+    }
+
+    /// Used when parsing `list(...)` syntax **if** the content inside the
+    /// nested parentheses is also expected to conform to Rust's structured
+    /// attribute convention.
+    ///
+    /// # Example
+    ///
+    /// ```
+    /// use syn::{parse_quote, Attribute};
+    ///
+    /// let attr: Attribute = parse_quote! {
+    ///     #[tea(with(sugar, milk))]
+    /// };
+    ///
+    /// if attr.path().is_ident("tea") {
+    ///     attr.parse_nested_meta(|meta| {
+    ///         if meta.path.is_ident("with") {
+    ///             meta.parse_nested_meta(|meta| {  // <---
+    ///                 if meta.path.is_ident("sugar") {
+    ///                     // Here we can go even deeper if needed.
+    ///                     Ok(())
+    ///                 } else if meta.path.is_ident("milk") {
+    ///                     Ok(())
+    ///                 } else {
+    ///                     Err(meta.error("unsupported ingredient"))
+    ///                 }
+    ///             })
+    ///         } else {
+    ///             Err(meta.error("unsupported tea property"))
+    ///         }
+    ///     })?;
+    /// }
+    /// # anyhow::Ok(())
+    /// ```
+    ///
+    /// # Counterexample
+    ///
+    /// If you don't need `parse_nested_meta`'s help in parsing the content
+    /// written within the nested parentheses, keep in mind that you can always
+    /// just parse it yourself from the exposed ParseStream. Rust syntax permits
+    /// arbitrary tokens within those parentheses so for the crazier stuff,
+    /// `parse_nested_meta` is not what you want.
+    ///
+    /// ```
+    /// use syn::{parenthesized, parse_quote, Attribute, LitInt};
+    ///
+    /// let attr: Attribute = parse_quote! {
+    ///     #[repr(align(32))]
+    /// };
+    ///
+    /// let mut align: Option<LitInt> = None;
+    /// if attr.path().is_ident("repr") {
+    ///     attr.parse_nested_meta(|meta| {
+    ///         if meta.path.is_ident("align") {
+    ///             let content;
+    ///             parenthesized!(content in meta.input);
+    ///             align = Some(content.parse()?);
+    ///             Ok(())
+    ///         } else {
+    ///             Err(meta.error("unsupported repr"))
+    ///         }
+    ///     })?;
+    /// }
+    /// # anyhow::Ok(())
+    /// ```
+    pub fn parse_nested_meta(
+        &self,
+        logic: impl FnMut(ParseNestedMeta) -> Result<()>,
+    ) -> Result<()> {
+        let content;
+        parenthesized!(content in self.input);
+        parse_nested_meta(&content, logic)
+    }
+
+    /// Report that the attribute's content did not conform to expectations.
+    ///
+    /// The span of the resulting error will cover `meta.path` *and* everything
+    /// that has been parsed so far since it.
+    ///
+    /// There are 2 ways you might call this. First, if `meta.path` is not
+    /// something you recognize:
+    ///
+    /// ```
+    /// # use syn::Attribute;
+    /// #
+    /// # fn example(attr: &Attribute) -> syn::Result<()> {
+    /// attr.parse_nested_meta(|meta| {
+    ///     if meta.path.is_ident("kind") {
+    ///         // ...
+    ///         Ok(())
+    ///     } else {
+    ///         Err(meta.error("unsupported tea property"))
+    ///     }
+    /// })?;
+    /// # Ok(())
+    /// # }
+    /// ```
+    ///
+    /// In this case, it behaves exactly like
+    /// `syn::Error::new_spanned(&meta.path, "message...")`.
+    ///
+    /// ```console
+    /// error: unsupported tea property
+    ///  --> src/main.rs:3:26
+    ///   |
+    /// 3 | #[tea(kind = "EarlGrey", wat = "foo")]
+    ///   |                          ^^^
+    /// ```
+    ///
+    /// More usefully, the second place is if you've already parsed a value but
+    /// have decided not to accept the value:
+    ///
+    /// ```
+    /// # use syn::Attribute;
+    /// #
+    /// # fn example(attr: &Attribute) -> syn::Result<()> {
+    /// use syn::Expr;
+    ///
+    /// attr.parse_nested_meta(|meta| {
+    ///     if meta.path.is_ident("kind") {
+    ///         let expr: Expr = meta.value()?.parse()?;
+    ///         match expr {
+    ///             Expr::Lit(expr) => /* ... */
+    /// #               unimplemented!(),
+    ///             Expr::Path(expr) => /* ... */
+    /// #               unimplemented!(),
+    ///             Expr::Macro(expr) => /* ... */
+    /// #               unimplemented!(),
+    ///             _ => Err(meta.error("tea kind must be a string literal, path, or macro")),
+    ///         }
+    ///     } else /* as above */
+    /// #       { unimplemented!() }
+    ///
+    /// })?;
+    /// # Ok(())
+    /// # }
+    /// ```
+    ///
+    /// ```console
+    /// error: tea kind must be a string literal, path, or macro
+    ///  --> src/main.rs:3:7
+    ///   |
+    /// 3 | #[tea(kind = async { replicator.await })]
+    ///   |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+    /// ```
+    ///
+    /// Often you may want to use `syn::Error::new_spanned` even in this
+    /// situation. In the above code, that would be:
+    ///
+    /// ```
+    /// # use syn::{Error, Expr};
+    /// #
+    /// # fn example(expr: Expr) -> syn::Result<()> {
+    ///     match expr {
+    ///         Expr::Lit(expr) => /* ... */
+    /// #           unimplemented!(),
+    ///         Expr::Path(expr) => /* ... */
+    /// #           unimplemented!(),
+    ///         Expr::Macro(expr) => /* ... */
+    /// #           unimplemented!(),
+    ///         _ => Err(Error::new_spanned(expr, "unsupported expression type for `kind`")),
+    ///     }
+    /// # }
+    /// ```
+    ///
+    /// ```console
+    /// error: unsupported expression type for `kind`
+    ///  --> src/main.rs:3:14
+    ///   |
+    /// 3 | #[tea(kind = async { replicator.await })]
+    ///   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^
+    /// ```
+    pub fn error(&self, msg: impl Display) -> Error {
+        let start_span = self.path.segments[0].ident.span();
+        let end_span = self.input.cursor().prev_span();
+        crate::error::new2(start_span, end_span, msg)
+    }
+}
+
+pub(crate) fn parse_nested_meta(
+    input: ParseStream,
+    mut logic: impl FnMut(ParseNestedMeta) -> Result<()>,
+) -> Result<()> {
+    loop {
+        let path = input.call(parse_meta_path)?;
+        logic(ParseNestedMeta { path, input })?;
+        if input.is_empty() {
+            return Ok(());
+        }
+        input.parse::<Token![,]>()?;
+        if input.is_empty() {
+            return Ok(());
+        }
+    }
+}
+
+// Like Path::parse_mod_style, but accepts keywords in the path.
+fn parse_meta_path(input: ParseStream) -> Result<Path> {
+    Ok(Path {
+        leading_colon: input.parse()?,
+        segments: {
+            let mut segments = Punctuated::new();
+            if input.peek(Ident::peek_any) {
+                let ident = Ident::parse_any(input)?;
+                segments.push_value(PathSegment::from(ident));
+            } else if input.is_empty() {
+                return Err(input.error("expected nested attribute"));
+            } else if input.peek(Lit) {
+                return Err(input.error("unexpected literal in nested attribute, expected ident"));
+            } else {
+                return Err(input.error("unexpected token in nested attribute, expected ident"));
+            }
+            while input.peek(Token![::]) {
+                let punct = input.parse()?;
+                segments.push_punct(punct);
+                let ident = Ident::parse_any(input)?;
+                segments.push_value(PathSegment::from(ident));
+            }
+            segments
+        },
+    })
+}
+
\ No newline at end of file diff --git a/src/syn/op.rs.html b/src/syn/op.rs.html new file mode 100644 index 0000000..89f8c7d --- /dev/null +++ b/src/syn/op.rs.html @@ -0,0 +1,439 @@ +op.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+
ast_enum! {
+    /// A binary operator: `+`, `+=`, `&`.
+    #[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
+    #[non_exhaustive]
+    pub enum BinOp {
+        /// The `+` operator (addition)
+        Add(Token![+]),
+        /// The `-` operator (subtraction)
+        Sub(Token![-]),
+        /// The `*` operator (multiplication)
+        Mul(Token![*]),
+        /// The `/` operator (division)
+        Div(Token![/]),
+        /// The `%` operator (modulus)
+        Rem(Token![%]),
+        /// The `&&` operator (logical and)
+        And(Token![&&]),
+        /// The `||` operator (logical or)
+        Or(Token![||]),
+        /// The `^` operator (bitwise xor)
+        BitXor(Token![^]),
+        /// The `&` operator (bitwise and)
+        BitAnd(Token![&]),
+        /// The `|` operator (bitwise or)
+        BitOr(Token![|]),
+        /// The `<<` operator (shift left)
+        Shl(Token![<<]),
+        /// The `>>` operator (shift right)
+        Shr(Token![>>]),
+        /// The `==` operator (equality)
+        Eq(Token![==]),
+        /// The `<` operator (less than)
+        Lt(Token![<]),
+        /// The `<=` operator (less than or equal to)
+        Le(Token![<=]),
+        /// The `!=` operator (not equal to)
+        Ne(Token![!=]),
+        /// The `>=` operator (greater than or equal to)
+        Ge(Token![>=]),
+        /// The `>` operator (greater than)
+        Gt(Token![>]),
+        /// The `+=` operator
+        AddAssign(Token![+=]),
+        /// The `-=` operator
+        SubAssign(Token![-=]),
+        /// The `*=` operator
+        MulAssign(Token![*=]),
+        /// The `/=` operator
+        DivAssign(Token![/=]),
+        /// The `%=` operator
+        RemAssign(Token![%=]),
+        /// The `^=` operator
+        BitXorAssign(Token![^=]),
+        /// The `&=` operator
+        BitAndAssign(Token![&=]),
+        /// The `|=` operator
+        BitOrAssign(Token![|=]),
+        /// The `<<=` operator
+        ShlAssign(Token![<<=]),
+        /// The `>>=` operator
+        ShrAssign(Token![>>=]),
+    }
+}
+
+ast_enum! {
+    /// A unary operator: `*`, `!`, `-`.
+    #[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
+    #[non_exhaustive]
+    pub enum UnOp {
+        /// The `*` operator for dereferencing
+        Deref(Token![*]),
+        /// The `!` operator for logical inversion
+        Not(Token![!]),
+        /// The `-` operator for negation
+        Neg(Token![-]),
+    }
+}
+
+#[cfg(feature = "parsing")]
+pub(crate) mod parsing {
+    use crate::error::Result;
+    use crate::op::{BinOp, UnOp};
+    use crate::parse::{Parse, ParseStream};
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for BinOp {
+        fn parse(input: ParseStream) -> Result<Self> {
+            if input.peek(Token![+=]) {
+                input.parse().map(BinOp::AddAssign)
+            } else if input.peek(Token![-=]) {
+                input.parse().map(BinOp::SubAssign)
+            } else if input.peek(Token![*=]) {
+                input.parse().map(BinOp::MulAssign)
+            } else if input.peek(Token![/=]) {
+                input.parse().map(BinOp::DivAssign)
+            } else if input.peek(Token![%=]) {
+                input.parse().map(BinOp::RemAssign)
+            } else if input.peek(Token![^=]) {
+                input.parse().map(BinOp::BitXorAssign)
+            } else if input.peek(Token![&=]) {
+                input.parse().map(BinOp::BitAndAssign)
+            } else if input.peek(Token![|=]) {
+                input.parse().map(BinOp::BitOrAssign)
+            } else if input.peek(Token![<<=]) {
+                input.parse().map(BinOp::ShlAssign)
+            } else if input.peek(Token![>>=]) {
+                input.parse().map(BinOp::ShrAssign)
+            } else if input.peek(Token![&&]) {
+                input.parse().map(BinOp::And)
+            } else if input.peek(Token![||]) {
+                input.parse().map(BinOp::Or)
+            } else if input.peek(Token![<<]) {
+                input.parse().map(BinOp::Shl)
+            } else if input.peek(Token![>>]) {
+                input.parse().map(BinOp::Shr)
+            } else if input.peek(Token![==]) {
+                input.parse().map(BinOp::Eq)
+            } else if input.peek(Token![<=]) {
+                input.parse().map(BinOp::Le)
+            } else if input.peek(Token![!=]) {
+                input.parse().map(BinOp::Ne)
+            } else if input.peek(Token![>=]) {
+                input.parse().map(BinOp::Ge)
+            } else if input.peek(Token![+]) {
+                input.parse().map(BinOp::Add)
+            } else if input.peek(Token![-]) {
+                input.parse().map(BinOp::Sub)
+            } else if input.peek(Token![*]) {
+                input.parse().map(BinOp::Mul)
+            } else if input.peek(Token![/]) {
+                input.parse().map(BinOp::Div)
+            } else if input.peek(Token![%]) {
+                input.parse().map(BinOp::Rem)
+            } else if input.peek(Token![^]) {
+                input.parse().map(BinOp::BitXor)
+            } else if input.peek(Token![&]) {
+                input.parse().map(BinOp::BitAnd)
+            } else if input.peek(Token![|]) {
+                input.parse().map(BinOp::BitOr)
+            } else if input.peek(Token![<]) {
+                input.parse().map(BinOp::Lt)
+            } else if input.peek(Token![>]) {
+                input.parse().map(BinOp::Gt)
+            } else {
+                Err(input.error("expected binary operator"))
+            }
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for UnOp {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let lookahead = input.lookahead1();
+            if lookahead.peek(Token![*]) {
+                input.parse().map(UnOp::Deref)
+            } else if lookahead.peek(Token![!]) {
+                input.parse().map(UnOp::Not)
+            } else if lookahead.peek(Token![-]) {
+                input.parse().map(UnOp::Neg)
+            } else {
+                Err(lookahead.error())
+            }
+        }
+    }
+}
+
+#[cfg(feature = "printing")]
+mod printing {
+    use crate::op::{BinOp, UnOp};
+    use proc_macro2::TokenStream;
+    use quote::ToTokens;
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for BinOp {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            match self {
+                BinOp::Add(t) => t.to_tokens(tokens),
+                BinOp::Sub(t) => t.to_tokens(tokens),
+                BinOp::Mul(t) => t.to_tokens(tokens),
+                BinOp::Div(t) => t.to_tokens(tokens),
+                BinOp::Rem(t) => t.to_tokens(tokens),
+                BinOp::And(t) => t.to_tokens(tokens),
+                BinOp::Or(t) => t.to_tokens(tokens),
+                BinOp::BitXor(t) => t.to_tokens(tokens),
+                BinOp::BitAnd(t) => t.to_tokens(tokens),
+                BinOp::BitOr(t) => t.to_tokens(tokens),
+                BinOp::Shl(t) => t.to_tokens(tokens),
+                BinOp::Shr(t) => t.to_tokens(tokens),
+                BinOp::Eq(t) => t.to_tokens(tokens),
+                BinOp::Lt(t) => t.to_tokens(tokens),
+                BinOp::Le(t) => t.to_tokens(tokens),
+                BinOp::Ne(t) => t.to_tokens(tokens),
+                BinOp::Ge(t) => t.to_tokens(tokens),
+                BinOp::Gt(t) => t.to_tokens(tokens),
+                BinOp::AddAssign(t) => t.to_tokens(tokens),
+                BinOp::SubAssign(t) => t.to_tokens(tokens),
+                BinOp::MulAssign(t) => t.to_tokens(tokens),
+                BinOp::DivAssign(t) => t.to_tokens(tokens),
+                BinOp::RemAssign(t) => t.to_tokens(tokens),
+                BinOp::BitXorAssign(t) => t.to_tokens(tokens),
+                BinOp::BitAndAssign(t) => t.to_tokens(tokens),
+                BinOp::BitOrAssign(t) => t.to_tokens(tokens),
+                BinOp::ShlAssign(t) => t.to_tokens(tokens),
+                BinOp::ShrAssign(t) => t.to_tokens(tokens),
+            }
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for UnOp {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            match self {
+                UnOp::Deref(t) => t.to_tokens(tokens),
+                UnOp::Not(t) => t.to_tokens(tokens),
+                UnOp::Neg(t) => t.to_tokens(tokens),
+            }
+        }
+    }
+}
+
\ No newline at end of file diff --git a/src/syn/parse.rs.html b/src/syn/parse.rs.html new file mode 100644 index 0000000..cf75921 --- /dev/null +++ b/src/syn/parse.rs.html @@ -0,0 +1,2787 @@ +parse.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+753
+754
+755
+756
+757
+758
+759
+760
+761
+762
+763
+764
+765
+766
+767
+768
+769
+770
+771
+772
+773
+774
+775
+776
+777
+778
+779
+780
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+794
+795
+796
+797
+798
+799
+800
+801
+802
+803
+804
+805
+806
+807
+808
+809
+810
+811
+812
+813
+814
+815
+816
+817
+818
+819
+820
+821
+822
+823
+824
+825
+826
+827
+828
+829
+830
+831
+832
+833
+834
+835
+836
+837
+838
+839
+840
+841
+842
+843
+844
+845
+846
+847
+848
+849
+850
+851
+852
+853
+854
+855
+856
+857
+858
+859
+860
+861
+862
+863
+864
+865
+866
+867
+868
+869
+870
+871
+872
+873
+874
+875
+876
+877
+878
+879
+880
+881
+882
+883
+884
+885
+886
+887
+888
+889
+890
+891
+892
+893
+894
+895
+896
+897
+898
+899
+900
+901
+902
+903
+904
+905
+906
+907
+908
+909
+910
+911
+912
+913
+914
+915
+916
+917
+918
+919
+920
+921
+922
+923
+924
+925
+926
+927
+928
+929
+930
+931
+932
+933
+934
+935
+936
+937
+938
+939
+940
+941
+942
+943
+944
+945
+946
+947
+948
+949
+950
+951
+952
+953
+954
+955
+956
+957
+958
+959
+960
+961
+962
+963
+964
+965
+966
+967
+968
+969
+970
+971
+972
+973
+974
+975
+976
+977
+978
+979
+980
+981
+982
+983
+984
+985
+986
+987
+988
+989
+990
+991
+992
+993
+994
+995
+996
+997
+998
+999
+1000
+1001
+1002
+1003
+1004
+1005
+1006
+1007
+1008
+1009
+1010
+1011
+1012
+1013
+1014
+1015
+1016
+1017
+1018
+1019
+1020
+1021
+1022
+1023
+1024
+1025
+1026
+1027
+1028
+1029
+1030
+1031
+1032
+1033
+1034
+1035
+1036
+1037
+1038
+1039
+1040
+1041
+1042
+1043
+1044
+1045
+1046
+1047
+1048
+1049
+1050
+1051
+1052
+1053
+1054
+1055
+1056
+1057
+1058
+1059
+1060
+1061
+1062
+1063
+1064
+1065
+1066
+1067
+1068
+1069
+1070
+1071
+1072
+1073
+1074
+1075
+1076
+1077
+1078
+1079
+1080
+1081
+1082
+1083
+1084
+1085
+1086
+1087
+1088
+1089
+1090
+1091
+1092
+1093
+1094
+1095
+1096
+1097
+1098
+1099
+1100
+1101
+1102
+1103
+1104
+1105
+1106
+1107
+1108
+1109
+1110
+1111
+1112
+1113
+1114
+1115
+1116
+1117
+1118
+1119
+1120
+1121
+1122
+1123
+1124
+1125
+1126
+1127
+1128
+1129
+1130
+1131
+1132
+1133
+1134
+1135
+1136
+1137
+1138
+1139
+1140
+1141
+1142
+1143
+1144
+1145
+1146
+1147
+1148
+1149
+1150
+1151
+1152
+1153
+1154
+1155
+1156
+1157
+1158
+1159
+1160
+1161
+1162
+1163
+1164
+1165
+1166
+1167
+1168
+1169
+1170
+1171
+1172
+1173
+1174
+1175
+1176
+1177
+1178
+1179
+1180
+1181
+1182
+1183
+1184
+1185
+1186
+1187
+1188
+1189
+1190
+1191
+1192
+1193
+1194
+1195
+1196
+1197
+1198
+1199
+1200
+1201
+1202
+1203
+1204
+1205
+1206
+1207
+1208
+1209
+1210
+1211
+1212
+1213
+1214
+1215
+1216
+1217
+1218
+1219
+1220
+1221
+1222
+1223
+1224
+1225
+1226
+1227
+1228
+1229
+1230
+1231
+1232
+1233
+1234
+1235
+1236
+1237
+1238
+1239
+1240
+1241
+1242
+1243
+1244
+1245
+1246
+1247
+1248
+1249
+1250
+1251
+1252
+1253
+1254
+1255
+1256
+1257
+1258
+1259
+1260
+1261
+1262
+1263
+1264
+1265
+1266
+1267
+1268
+1269
+1270
+1271
+1272
+1273
+1274
+1275
+1276
+1277
+1278
+1279
+1280
+1281
+1282
+1283
+1284
+1285
+1286
+1287
+1288
+1289
+1290
+1291
+1292
+1293
+1294
+1295
+1296
+1297
+1298
+1299
+1300
+1301
+1302
+1303
+1304
+1305
+1306
+1307
+1308
+1309
+1310
+1311
+1312
+1313
+1314
+1315
+1316
+1317
+1318
+1319
+1320
+1321
+1322
+1323
+1324
+1325
+1326
+1327
+1328
+1329
+1330
+1331
+1332
+1333
+1334
+1335
+1336
+1337
+1338
+1339
+1340
+1341
+1342
+1343
+1344
+1345
+1346
+1347
+1348
+1349
+1350
+1351
+1352
+1353
+1354
+1355
+1356
+1357
+1358
+1359
+1360
+1361
+1362
+1363
+1364
+1365
+1366
+1367
+1368
+1369
+1370
+1371
+1372
+1373
+1374
+1375
+1376
+1377
+1378
+1379
+1380
+1381
+1382
+1383
+1384
+1385
+1386
+1387
+1388
+1389
+1390
+1391
+1392
+1393
+
//! Parsing interface for parsing a token stream into a syntax tree node.
+//!
+//! Parsing in Syn is built on parser functions that take in a [`ParseStream`]
+//! and produce a [`Result<T>`] where `T` is some syntax tree node. Underlying
+//! these parser functions is a lower level mechanism built around the
+//! [`Cursor`] type. `Cursor` is a cheaply copyable cursor over a range of
+//! tokens in a token stream.
+//!
+//! [`Result<T>`]: Result
+//! [`Cursor`]: crate::buffer::Cursor
+//!
+//! # Example
+//!
+//! Here is a snippet of parsing code to get a feel for the style of the
+//! library. We define data structures for a subset of Rust syntax including
+//! enums (not shown) and structs, then provide implementations of the [`Parse`]
+//! trait to parse these syntax tree data structures from a token stream.
+//!
+//! Once `Parse` impls have been defined, they can be called conveniently from a
+//! procedural macro through [`parse_macro_input!`] as shown at the bottom of
+//! the snippet. If the caller provides syntactically invalid input to the
+//! procedural macro, they will receive a helpful compiler error message
+//! pointing out the exact token that triggered the failure to parse.
+//!
+//! [`parse_macro_input!`]: crate::parse_macro_input!
+//!
+//! ```
+//! # extern crate proc_macro;
+//! #
+//! use proc_macro::TokenStream;
+//! use syn::{braced, parse_macro_input, token, Field, Ident, Result, Token};
+//! use syn::parse::{Parse, ParseStream};
+//! use syn::punctuated::Punctuated;
+//!
+//! enum Item {
+//!     Struct(ItemStruct),
+//!     Enum(ItemEnum),
+//! }
+//!
+//! struct ItemStruct {
+//!     struct_token: Token![struct],
+//!     ident: Ident,
+//!     brace_token: token::Brace,
+//!     fields: Punctuated<Field, Token![,]>,
+//! }
+//! #
+//! # enum ItemEnum {}
+//!
+//! impl Parse for Item {
+//!     fn parse(input: ParseStream) -> Result<Self> {
+//!         let lookahead = input.lookahead1();
+//!         if lookahead.peek(Token![struct]) {
+//!             input.parse().map(Item::Struct)
+//!         } else if lookahead.peek(Token![enum]) {
+//!             input.parse().map(Item::Enum)
+//!         } else {
+//!             Err(lookahead.error())
+//!         }
+//!     }
+//! }
+//!
+//! impl Parse for ItemStruct {
+//!     fn parse(input: ParseStream) -> Result<Self> {
+//!         let content;
+//!         Ok(ItemStruct {
+//!             struct_token: input.parse()?,
+//!             ident: input.parse()?,
+//!             brace_token: braced!(content in input),
+//!             fields: content.parse_terminated(Field::parse_named, Token![,])?,
+//!         })
+//!     }
+//! }
+//! #
+//! # impl Parse for ItemEnum {
+//! #     fn parse(input: ParseStream) -> Result<Self> {
+//! #         unimplemented!()
+//! #     }
+//! # }
+//!
+//! # const IGNORE: &str = stringify! {
+//! #[proc_macro]
+//! # };
+//! pub fn my_macro(tokens: TokenStream) -> TokenStream {
+//!     let input = parse_macro_input!(tokens as Item);
+//!
+//!     /* ... */
+//! #   TokenStream::new()
+//! }
+//! ```
+//!
+//! # The `syn::parse*` functions
+//!
+//! The [`syn::parse`], [`syn::parse2`], and [`syn::parse_str`] functions serve
+//! as an entry point for parsing syntax tree nodes that can be parsed in an
+//! obvious default way. These functions can return any syntax tree node that
+//! implements the [`Parse`] trait, which includes most types in Syn.
+//!
+//! [`syn::parse`]: crate::parse()
+//! [`syn::parse2`]: crate::parse2()
+//! [`syn::parse_str`]: crate::parse_str()
+//!
+//! ```
+//! use syn::Type;
+//!
+//! # fn run_parser() -> syn::Result<()> {
+//! let t: Type = syn::parse_str("std::collections::HashMap<String, Value>")?;
+//! #     Ok(())
+//! # }
+//! #
+//! # run_parser().unwrap();
+//! ```
+//!
+//! The [`parse_quote!`] macro also uses this approach.
+//!
+//! [`parse_quote!`]: crate::parse_quote!
+//!
+//! # The `Parser` trait
+//!
+//! Some types can be parsed in several ways depending on context. For example
+//! an [`Attribute`] can be either "outer" like `#[...]` or "inner" like
+//! `#![...]` and parsing the wrong one would be a bug. Similarly [`Punctuated`]
+//! may or may not allow trailing punctuation, and parsing it the wrong way
+//! would either reject valid input or accept invalid input.
+//!
+//! [`Attribute`]: crate::Attribute
+//! [`Punctuated`]: crate::punctuated
+//!
+//! The `Parse` trait is not implemented in these cases because there is no good
+//! behavior to consider the default.
+//!
+//! ```compile_fail
+//! # extern crate proc_macro;
+//! #
+//! # use syn::punctuated::Punctuated;
+//! # use syn::{PathSegment, Result, Token};
+//! #
+//! # fn f(tokens: proc_macro::TokenStream) -> Result<()> {
+//! #
+//! // Can't parse `Punctuated` without knowing whether trailing punctuation
+//! // should be allowed in this context.
+//! let path: Punctuated<PathSegment, Token![::]> = syn::parse(tokens)?;
+//! #
+//! #     Ok(())
+//! # }
+//! ```
+//!
+//! In these cases the types provide a choice of parser functions rather than a
+//! single `Parse` implementation, and those parser functions can be invoked
+//! through the [`Parser`] trait.
+//!
+//!
+//! ```
+//! # extern crate proc_macro;
+//! #
+//! use proc_macro::TokenStream;
+//! use syn::parse::Parser;
+//! use syn::punctuated::Punctuated;
+//! use syn::{Attribute, Expr, PathSegment, Result, Token};
+//!
+//! fn call_some_parser_methods(input: TokenStream) -> Result<()> {
+//!     // Parse a nonempty sequence of path segments separated by `::` punctuation
+//!     // with no trailing punctuation.
+//!     let tokens = input.clone();
+//!     let parser = Punctuated::<PathSegment, Token![::]>::parse_separated_nonempty;
+//!     let _path = parser.parse(tokens)?;
+//!
+//!     // Parse a possibly empty sequence of expressions terminated by commas with
+//!     // an optional trailing punctuation.
+//!     let tokens = input.clone();
+//!     let parser = Punctuated::<Expr, Token![,]>::parse_terminated;
+//!     let _args = parser.parse(tokens)?;
+//!
+//!     // Parse zero or more outer attributes but not inner attributes.
+//!     let tokens = input.clone();
+//!     let parser = Attribute::parse_outer;
+//!     let _attrs = parser.parse(tokens)?;
+//!
+//!     Ok(())
+//! }
+//! ```
+
+#[path = "discouraged.rs"]
+pub mod discouraged;
+
+use crate::buffer::{Cursor, TokenBuffer};
+use crate::error;
+use crate::lookahead;
+use crate::punctuated::Punctuated;
+use crate::token::Token;
+use proc_macro2::{Delimiter, Group, Literal, Punct, Span, TokenStream, TokenTree};
+#[cfg(feature = "printing")]
+use quote::ToTokens;
+use std::cell::Cell;
+use std::fmt::{self, Debug, Display};
+#[cfg(feature = "extra-traits")]
+use std::hash::{Hash, Hasher};
+use std::marker::PhantomData;
+use std::mem;
+use std::ops::Deref;
+use std::rc::Rc;
+use std::str::FromStr;
+
+pub use crate::error::{Error, Result};
+pub use crate::lookahead::{Lookahead1, Peek};
+
+/// Parsing interface implemented by all types that can be parsed in a default
+/// way from a token stream.
+///
+/// Refer to the [module documentation] for details about implementing and using
+/// the `Parse` trait.
+///
+/// [module documentation]: self
+pub trait Parse: Sized {
+    fn parse(input: ParseStream) -> Result<Self>;
+}
+
+/// Input to a Syn parser function.
+///
+/// See the methods of this type under the documentation of [`ParseBuffer`]. For
+/// an overview of parsing in Syn, refer to the [module documentation].
+///
+/// [module documentation]: self
+pub type ParseStream<'a> = &'a ParseBuffer<'a>;
+
+/// Cursor position within a buffered token stream.
+///
+/// This type is more commonly used through the type alias [`ParseStream`] which
+/// is an alias for `&ParseBuffer`.
+///
+/// `ParseStream` is the input type for all parser functions in Syn. They have
+/// the signature `fn(ParseStream) -> Result<T>`.
+///
+/// ## Calling a parser function
+///
+/// There is no public way to construct a `ParseBuffer`. Instead, if you are
+/// looking to invoke a parser function that requires `ParseStream` as input,
+/// you will need to go through one of the public parsing entry points.
+///
+/// - The [`parse_macro_input!`] macro if parsing input of a procedural macro;
+/// - One of [the `syn::parse*` functions][syn-parse]; or
+/// - A method of the [`Parser`] trait.
+///
+/// [`parse_macro_input!`]: crate::parse_macro_input!
+/// [syn-parse]: self#the-synparse-functions
+pub struct ParseBuffer<'a> {
+    scope: Span,
+    // Instead of Cell<Cursor<'a>> so that ParseBuffer<'a> is covariant in 'a.
+    // The rest of the code in this module needs to be careful that only a
+    // cursor derived from this `cell` is ever assigned to this `cell`.
+    //
+    // Cell<Cursor<'a>> cannot be covariant in 'a because then we could take a
+    // ParseBuffer<'a>, upcast to ParseBuffer<'short> for some lifetime shorter
+    // than 'a, and then assign a Cursor<'short> into the Cell.
+    //
+    // By extension, it would not be safe to expose an API that accepts a
+    // Cursor<'a> and trusts that it lives as long as the cursor currently in
+    // the cell.
+    cell: Cell<Cursor<'static>>,
+    marker: PhantomData<Cursor<'a>>,
+    unexpected: Cell<Option<Rc<Cell<Unexpected>>>>,
+}
+
+impl<'a> Drop for ParseBuffer<'a> {
+    fn drop(&mut self) {
+        if let Some(unexpected_span) = span_of_unexpected_ignoring_nones(self.cursor()) {
+            let (inner, old_span) = inner_unexpected(self);
+            if old_span.is_none() {
+                inner.set(Unexpected::Some(unexpected_span));
+            }
+        }
+    }
+}
+
+impl<'a> Display for ParseBuffer<'a> {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        Display::fmt(&self.cursor().token_stream(), f)
+    }
+}
+
+impl<'a> Debug for ParseBuffer<'a> {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        Debug::fmt(&self.cursor().token_stream(), f)
+    }
+}
+
+/// Cursor state associated with speculative parsing.
+///
+/// This type is the input of the closure provided to [`ParseStream::step`].
+///
+/// [`ParseStream::step`]: ParseBuffer::step
+///
+/// # Example
+///
+/// ```
+/// use proc_macro2::TokenTree;
+/// use syn::Result;
+/// use syn::parse::ParseStream;
+///
+/// // This function advances the stream past the next occurrence of `@`. If
+/// // no `@` is present in the stream, the stream position is unchanged and
+/// // an error is returned.
+/// fn skip_past_next_at(input: ParseStream) -> Result<()> {
+///     input.step(|cursor| {
+///         let mut rest = *cursor;
+///         while let Some((tt, next)) = rest.token_tree() {
+///             match &tt {
+///                 TokenTree::Punct(punct) if punct.as_char() == '@' => {
+///                     return Ok(((), next));
+///                 }
+///                 _ => rest = next,
+///             }
+///         }
+///         Err(cursor.error("no `@` was found after this point"))
+///     })
+/// }
+/// #
+/// # fn remainder_after_skipping_past_next_at(
+/// #     input: ParseStream,
+/// # ) -> Result<proc_macro2::TokenStream> {
+/// #     skip_past_next_at(input)?;
+/// #     input.parse()
+/// # }
+/// #
+/// # use syn::parse::Parser;
+/// # let remainder = remainder_after_skipping_past_next_at
+/// #     .parse_str("a @ b c")
+/// #     .unwrap();
+/// # assert_eq!(remainder.to_string(), "b c");
+/// ```
+pub struct StepCursor<'c, 'a> {
+    scope: Span,
+    // This field is covariant in 'c.
+    cursor: Cursor<'c>,
+    // This field is contravariant in 'c. Together these make StepCursor
+    // invariant in 'c. Also covariant in 'a. The user cannot cast 'c to a
+    // different lifetime but can upcast into a StepCursor with a shorter
+    // lifetime 'a.
+    //
+    // As long as we only ever construct a StepCursor for which 'c outlives 'a,
+    // this means if ever a StepCursor<'c, 'a> exists we are guaranteed that 'c
+    // outlives 'a.
+    marker: PhantomData<fn(Cursor<'c>) -> Cursor<'a>>,
+}
+
+impl<'c, 'a> Deref for StepCursor<'c, 'a> {
+    type Target = Cursor<'c>;
+
+    fn deref(&self) -> &Self::Target {
+        &self.cursor
+    }
+}
+
+impl<'c, 'a> Copy for StepCursor<'c, 'a> {}
+
+impl<'c, 'a> Clone for StepCursor<'c, 'a> {
+    fn clone(&self) -> Self {
+        *self
+    }
+}
+
+impl<'c, 'a> StepCursor<'c, 'a> {
+    /// Triggers an error at the current position of the parse stream.
+    ///
+    /// The `ParseStream::step` invocation will return this same error without
+    /// advancing the stream state.
+    pub fn error<T: Display>(self, message: T) -> Error {
+        error::new_at(self.scope, self.cursor, message)
+    }
+}
+
+pub(crate) fn advance_step_cursor<'c, 'a>(proof: StepCursor<'c, 'a>, to: Cursor<'c>) -> Cursor<'a> {
+    // Refer to the comments within the StepCursor definition. We use the
+    // fact that a StepCursor<'c, 'a> exists as proof that 'c outlives 'a.
+    // Cursor is covariant in its lifetime parameter so we can cast a
+    // Cursor<'c> to one with the shorter lifetime Cursor<'a>.
+    let _ = proof;
+    unsafe { mem::transmute::<Cursor<'c>, Cursor<'a>>(to) }
+}
+
+pub(crate) fn new_parse_buffer(
+    scope: Span,
+    cursor: Cursor,
+    unexpected: Rc<Cell<Unexpected>>,
+) -> ParseBuffer {
+    ParseBuffer {
+        scope,
+        // See comment on `cell` in the struct definition.
+        cell: Cell::new(unsafe { mem::transmute::<Cursor, Cursor<'static>>(cursor) }),
+        marker: PhantomData,
+        unexpected: Cell::new(Some(unexpected)),
+    }
+}
+
+pub(crate) enum Unexpected {
+    None,
+    Some(Span),
+    Chain(Rc<Cell<Unexpected>>),
+}
+
+impl Default for Unexpected {
+    fn default() -> Self {
+        Unexpected::None
+    }
+}
+
+impl Clone for Unexpected {
+    fn clone(&self) -> Self {
+        match self {
+            Unexpected::None => Unexpected::None,
+            Unexpected::Some(span) => Unexpected::Some(*span),
+            Unexpected::Chain(next) => Unexpected::Chain(next.clone()),
+        }
+    }
+}
+
+// We call this on Cell<Unexpected> and Cell<Option<T>> where temporarily
+// swapping in a None is cheap.
+fn cell_clone<T: Default + Clone>(cell: &Cell<T>) -> T {
+    let prev = cell.take();
+    let ret = prev.clone();
+    cell.set(prev);
+    ret
+}
+
+fn inner_unexpected(buffer: &ParseBuffer) -> (Rc<Cell<Unexpected>>, Option<Span>) {
+    let mut unexpected = get_unexpected(buffer);
+    loop {
+        match cell_clone(&unexpected) {
+            Unexpected::None => return (unexpected, None),
+            Unexpected::Some(span) => return (unexpected, Some(span)),
+            Unexpected::Chain(next) => unexpected = next,
+        }
+    }
+}
+
+pub(crate) fn get_unexpected(buffer: &ParseBuffer) -> Rc<Cell<Unexpected>> {
+    cell_clone(&buffer.unexpected).unwrap()
+}
+
+fn span_of_unexpected_ignoring_nones(mut cursor: Cursor) -> Option<Span> {
+    if cursor.eof() {
+        return None;
+    }
+    while let Some((inner, _span, rest)) = cursor.group(Delimiter::None) {
+        if let Some(unexpected) = span_of_unexpected_ignoring_nones(inner) {
+            return Some(unexpected);
+        }
+        cursor = rest;
+    }
+    if cursor.eof() {
+        None
+    } else {
+        Some(cursor.span())
+    }
+}
+
+impl<'a> ParseBuffer<'a> {
+    /// Parses a syntax tree node of type `T`, advancing the position of our
+    /// parse stream past it.
+    pub fn parse<T: Parse>(&self) -> Result<T> {
+        T::parse(self)
+    }
+
+    /// Calls the given parser function to parse a syntax tree node of type `T`
+    /// from this stream.
+    ///
+    /// # Example
+    ///
+    /// The parser below invokes [`Attribute::parse_outer`] to parse a vector of
+    /// zero or more outer attributes.
+    ///
+    /// [`Attribute::parse_outer`]: crate::Attribute::parse_outer
+    ///
+    /// ```
+    /// use syn::{Attribute, Ident, Result, Token};
+    /// use syn::parse::{Parse, ParseStream};
+    ///
+    /// // Parses a unit struct with attributes.
+    /// //
+    /// //     #[path = "s.tmpl"]
+    /// //     struct S;
+    /// struct UnitStruct {
+    ///     attrs: Vec<Attribute>,
+    ///     struct_token: Token![struct],
+    ///     name: Ident,
+    ///     semi_token: Token![;],
+    /// }
+    ///
+    /// impl Parse for UnitStruct {
+    ///     fn parse(input: ParseStream) -> Result<Self> {
+    ///         Ok(UnitStruct {
+    ///             attrs: input.call(Attribute::parse_outer)?,
+    ///             struct_token: input.parse()?,
+    ///             name: input.parse()?,
+    ///             semi_token: input.parse()?,
+    ///         })
+    ///     }
+    /// }
+    /// ```
+    pub fn call<T>(&self, function: fn(ParseStream) -> Result<T>) -> Result<T> {
+        function(self)
+    }
+
+    /// Looks at the next token in the parse stream to determine whether it
+    /// matches the requested type of token.
+    ///
+    /// Does not advance the position of the parse stream.
+    ///
+    /// # Syntax
+    ///
+    /// Note that this method does not use turbofish syntax. Pass the peek type
+    /// inside of parentheses.
+    ///
+    /// - `input.peek(Token![struct])`
+    /// - `input.peek(Token![==])`
+    /// - `input.peek(syn::Ident)`&emsp;*(does not accept keywords)*
+    /// - `input.peek(syn::Ident::peek_any)`
+    /// - `input.peek(Lifetime)`
+    /// - `input.peek(token::Brace)`
+    ///
+    /// # Example
+    ///
+    /// In this example we finish parsing the list of supertraits when the next
+    /// token in the input is either `where` or an opening curly brace.
+    ///
+    /// ```
+    /// use syn::{braced, token, Generics, Ident, Result, Token, TypeParamBound};
+    /// use syn::parse::{Parse, ParseStream};
+    /// use syn::punctuated::Punctuated;
+    ///
+    /// // Parses a trait definition containing no associated items.
+    /// //
+    /// //     trait Marker<'de, T>: A + B<'de> where Box<T>: Clone {}
+    /// struct MarkerTrait {
+    ///     trait_token: Token![trait],
+    ///     ident: Ident,
+    ///     generics: Generics,
+    ///     colon_token: Option<Token![:]>,
+    ///     supertraits: Punctuated<TypeParamBound, Token![+]>,
+    ///     brace_token: token::Brace,
+    /// }
+    ///
+    /// impl Parse for MarkerTrait {
+    ///     fn parse(input: ParseStream) -> Result<Self> {
+    ///         let trait_token: Token![trait] = input.parse()?;
+    ///         let ident: Ident = input.parse()?;
+    ///         let mut generics: Generics = input.parse()?;
+    ///         let colon_token: Option<Token![:]> = input.parse()?;
+    ///
+    ///         let mut supertraits = Punctuated::new();
+    ///         if colon_token.is_some() {
+    ///             loop {
+    ///                 supertraits.push_value(input.parse()?);
+    ///                 if input.peek(Token![where]) || input.peek(token::Brace) {
+    ///                     break;
+    ///                 }
+    ///                 supertraits.push_punct(input.parse()?);
+    ///             }
+    ///         }
+    ///
+    ///         generics.where_clause = input.parse()?;
+    ///         let content;
+    ///         let empty_brace_token = braced!(content in input);
+    ///
+    ///         Ok(MarkerTrait {
+    ///             trait_token,
+    ///             ident,
+    ///             generics,
+    ///             colon_token,
+    ///             supertraits,
+    ///             brace_token: empty_brace_token,
+    ///         })
+    ///     }
+    /// }
+    /// ```
+    pub fn peek<T: Peek>(&self, token: T) -> bool {
+        let _ = token;
+        T::Token::peek(self.cursor())
+    }
+
+    /// Looks at the second-next token in the parse stream.
+    ///
+    /// This is commonly useful as a way to implement contextual keywords.
+    ///
+    /// # Example
+    ///
+    /// This example needs to use `peek2` because the symbol `union` is not a
+    /// keyword in Rust. We can't use just `peek` and decide to parse a union if
+    /// the very next token is `union`, because someone is free to write a `mod
+    /// union` and a macro invocation that looks like `union::some_macro! { ...
+    /// }`. In other words `union` is a contextual keyword.
+    ///
+    /// ```
+    /// use syn::{Ident, ItemUnion, Macro, Result, Token};
+    /// use syn::parse::{Parse, ParseStream};
+    ///
+    /// // Parses either a union or a macro invocation.
+    /// enum UnionOrMacro {
+    ///     // union MaybeUninit<T> { uninit: (), value: T }
+    ///     Union(ItemUnion),
+    ///     // lazy_static! { ... }
+    ///     Macro(Macro),
+    /// }
+    ///
+    /// impl Parse for UnionOrMacro {
+    ///     fn parse(input: ParseStream) -> Result<Self> {
+    ///         if input.peek(Token![union]) && input.peek2(Ident) {
+    ///             input.parse().map(UnionOrMacro::Union)
+    ///         } else {
+    ///             input.parse().map(UnionOrMacro::Macro)
+    ///         }
+    ///     }
+    /// }
+    /// ```
+    pub fn peek2<T: Peek>(&self, token: T) -> bool {
+        fn peek2(buffer: &ParseBuffer, peek: fn(Cursor) -> bool) -> bool {
+            buffer.cursor().skip().map_or(false, peek)
+        }
+
+        let _ = token;
+        peek2(self, T::Token::peek)
+    }
+
+    /// Looks at the third-next token in the parse stream.
+    pub fn peek3<T: Peek>(&self, token: T) -> bool {
+        fn peek3(buffer: &ParseBuffer, peek: fn(Cursor) -> bool) -> bool {
+            buffer
+                .cursor()
+                .skip()
+                .and_then(Cursor::skip)
+                .map_or(false, peek)
+        }
+
+        let _ = token;
+        peek3(self, T::Token::peek)
+    }
+
+    /// Parses zero or more occurrences of `T` separated by punctuation of type
+    /// `P`, with optional trailing punctuation.
+    ///
+    /// Parsing continues until the end of this parse stream. The entire content
+    /// of this parse stream must consist of `T` and `P`.
+    ///
+    /// # Example
+    ///
+    /// ```
+    /// # use quote::quote;
+    /// #
+    /// use syn::{parenthesized, token, Ident, Result, Token, Type};
+    /// use syn::parse::{Parse, ParseStream};
+    /// use syn::punctuated::Punctuated;
+    ///
+    /// // Parse a simplified tuple struct syntax like:
+    /// //
+    /// //     struct S(A, B);
+    /// struct TupleStruct {
+    ///     struct_token: Token![struct],
+    ///     ident: Ident,
+    ///     paren_token: token::Paren,
+    ///     fields: Punctuated<Type, Token![,]>,
+    ///     semi_token: Token![;],
+    /// }
+    ///
+    /// impl Parse for TupleStruct {
+    ///     fn parse(input: ParseStream) -> Result<Self> {
+    ///         let content;
+    ///         Ok(TupleStruct {
+    ///             struct_token: input.parse()?,
+    ///             ident: input.parse()?,
+    ///             paren_token: parenthesized!(content in input),
+    ///             fields: content.parse_terminated(Type::parse, Token![,])?,
+    ///             semi_token: input.parse()?,
+    ///         })
+    ///     }
+    /// }
+    /// #
+    /// # let input = quote! {
+    /// #     struct S(A, B);
+    /// # };
+    /// # syn::parse2::<TupleStruct>(input).unwrap();
+    /// ```
+    ///
+    /// # See also
+    ///
+    /// If your separator is anything more complicated than an invocation of the
+    /// `Token!` macro, this method won't be applicable and you can instead
+    /// directly use `Punctuated`'s parser functions: [`parse_terminated`],
+    /// [`parse_separated_nonempty`] etc.
+    ///
+    /// [`parse_terminated`]: Punctuated::parse_terminated
+    /// [`parse_separated_nonempty`]: Punctuated::parse_separated_nonempty
+    ///
+    /// ```
+    /// use syn::{custom_keyword, Expr, Result, Token};
+    /// use syn::parse::{Parse, ParseStream};
+    /// use syn::punctuated::Punctuated;
+    ///
+    /// mod kw {
+    ///     syn::custom_keyword!(fin);
+    /// }
+    ///
+    /// struct Fin(kw::fin, Token![;]);
+    ///
+    /// impl Parse for Fin {
+    ///     fn parse(input: ParseStream) -> Result<Self> {
+    ///         Ok(Self(input.parse()?, input.parse()?))
+    ///     }
+    /// }
+    ///
+    /// struct Thing {
+    ///     steps: Punctuated<Expr, Fin>,
+    /// }
+    ///
+    /// impl Parse for Thing {
+    ///     fn parse(input: ParseStream) -> Result<Self> {
+    /// # if true {
+    ///         Ok(Thing {
+    ///             steps: Punctuated::parse_terminated(input)?,
+    ///         })
+    /// # } else {
+    ///         // or equivalently, this means the same thing:
+    /// #       Ok(Thing {
+    ///             steps: input.call(Punctuated::parse_terminated)?,
+    /// #       })
+    /// # }
+    ///     }
+    /// }
+    /// ```
+    pub fn parse_terminated<T, P>(
+        &self,
+        parser: fn(ParseStream) -> Result<T>,
+        separator: P,
+    ) -> Result<Punctuated<T, P::Token>>
+    where
+        P: Peek,
+        P::Token: Parse,
+    {
+        let _ = separator;
+        Punctuated::parse_terminated_with(self, parser)
+    }
+
+    /// Returns whether there are tokens remaining in this stream.
+    ///
+    /// This method returns true at the end of the content of a set of
+    /// delimiters, as well as at the very end of the complete macro input.
+    ///
+    /// # Example
+    ///
+    /// ```
+    /// use syn::{braced, token, Ident, Item, Result, Token};
+    /// use syn::parse::{Parse, ParseStream};
+    ///
+    /// // Parses a Rust `mod m { ... }` containing zero or more items.
+    /// struct Mod {
+    ///     mod_token: Token![mod],
+    ///     name: Ident,
+    ///     brace_token: token::Brace,
+    ///     items: Vec<Item>,
+    /// }
+    ///
+    /// impl Parse for Mod {
+    ///     fn parse(input: ParseStream) -> Result<Self> {
+    ///         let content;
+    ///         Ok(Mod {
+    ///             mod_token: input.parse()?,
+    ///             name: input.parse()?,
+    ///             brace_token: braced!(content in input),
+    ///             items: {
+    ///                 let mut items = Vec::new();
+    ///                 while !content.is_empty() {
+    ///                     items.push(content.parse()?);
+    ///                 }
+    ///                 items
+    ///             },
+    ///         })
+    ///     }
+    /// }
+    /// ```
+    pub fn is_empty(&self) -> bool {
+        self.cursor().eof()
+    }
+
+    /// Constructs a helper for peeking at the next token in this stream and
+    /// building an error message if it is not one of a set of expected tokens.
+    ///
+    /// # Example
+    ///
+    /// ```
+    /// use syn::{ConstParam, Ident, Lifetime, LifetimeParam, Result, Token, TypeParam};
+    /// use syn::parse::{Parse, ParseStream};
+    ///
+    /// // A generic parameter, a single one of the comma-separated elements inside
+    /// // angle brackets in:
+    /// //
+    /// //     fn f<T: Clone, 'a, 'b: 'a, const N: usize>() { ... }
+    /// //
+    /// // On invalid input, lookahead gives us a reasonable error message.
+    /// //
+    /// //     error: expected one of: identifier, lifetime, `const`
+    /// //       |
+    /// //     5 |     fn f<!Sized>() {}
+    /// //       |          ^
+    /// enum GenericParam {
+    ///     Type(TypeParam),
+    ///     Lifetime(LifetimeParam),
+    ///     Const(ConstParam),
+    /// }
+    ///
+    /// impl Parse for GenericParam {
+    ///     fn parse(input: ParseStream) -> Result<Self> {
+    ///         let lookahead = input.lookahead1();
+    ///         if lookahead.peek(Ident) {
+    ///             input.parse().map(GenericParam::Type)
+    ///         } else if lookahead.peek(Lifetime) {
+    ///             input.parse().map(GenericParam::Lifetime)
+    ///         } else if lookahead.peek(Token![const]) {
+    ///             input.parse().map(GenericParam::Const)
+    ///         } else {
+    ///             Err(lookahead.error())
+    ///         }
+    ///     }
+    /// }
+    /// ```
+    pub fn lookahead1(&self) -> Lookahead1<'a> {
+        lookahead::new(self.scope, self.cursor())
+    }
+
+    /// Forks a parse stream so that parsing tokens out of either the original
+    /// or the fork does not advance the position of the other.
+    ///
+    /// # Performance
+    ///
+    /// Forking a parse stream is a cheap fixed amount of work and does not
+    /// involve copying token buffers. Where you might hit performance problems
+    /// is if your macro ends up parsing a large amount of content more than
+    /// once.
+    ///
+    /// ```
+    /// # use syn::{Expr, Result};
+    /// # use syn::parse::ParseStream;
+    /// #
+    /// # fn bad(input: ParseStream) -> Result<Expr> {
+    /// // Do not do this.
+    /// if input.fork().parse::<Expr>().is_ok() {
+    ///     return input.parse::<Expr>();
+    /// }
+    /// # unimplemented!()
+    /// # }
+    /// ```
+    ///
+    /// As a rule, avoid parsing an unbounded amount of tokens out of a forked
+    /// parse stream. Only use a fork when the amount of work performed against
+    /// the fork is small and bounded.
+    ///
+    /// When complex speculative parsing against the forked stream is
+    /// unavoidable, use [`parse::discouraged::Speculative`] to advance the
+    /// original stream once the fork's parse is determined to have been
+    /// successful.
+    ///
+    /// For a lower level way to perform speculative parsing at the token level,
+    /// consider using [`ParseStream::step`] instead.
+    ///
+    /// [`parse::discouraged::Speculative`]: discouraged::Speculative
+    /// [`ParseStream::step`]: ParseBuffer::step
+    ///
+    /// # Example
+    ///
+    /// The parse implementation shown here parses possibly restricted `pub`
+    /// visibilities.
+    ///
+    /// - `pub`
+    /// - `pub(crate)`
+    /// - `pub(self)`
+    /// - `pub(super)`
+    /// - `pub(in some::path)`
+    ///
+    /// To handle the case of visibilities inside of tuple structs, the parser
+    /// needs to distinguish parentheses that specify visibility restrictions
+    /// from parentheses that form part of a tuple type.
+    ///
+    /// ```
+    /// # struct A;
+    /// # struct B;
+    /// # struct C;
+    /// #
+    /// struct S(pub(crate) A, pub (B, C));
+    /// ```
+    ///
+    /// In this example input the first tuple struct element of `S` has
+    /// `pub(crate)` visibility while the second tuple struct element has `pub`
+    /// visibility; the parentheses around `(B, C)` are part of the type rather
+    /// than part of a visibility restriction.
+    ///
+    /// The parser uses a forked parse stream to check the first token inside of
+    /// parentheses after the `pub` keyword. This is a small bounded amount of
+    /// work performed against the forked parse stream.
+    ///
+    /// ```
+    /// use syn::{parenthesized, token, Ident, Path, Result, Token};
+    /// use syn::ext::IdentExt;
+    /// use syn::parse::{Parse, ParseStream};
+    ///
+    /// struct PubVisibility {
+    ///     pub_token: Token![pub],
+    ///     restricted: Option<Restricted>,
+    /// }
+    ///
+    /// struct Restricted {
+    ///     paren_token: token::Paren,
+    ///     in_token: Option<Token![in]>,
+    ///     path: Path,
+    /// }
+    ///
+    /// impl Parse for PubVisibility {
+    ///     fn parse(input: ParseStream) -> Result<Self> {
+    ///         let pub_token: Token![pub] = input.parse()?;
+    ///
+    ///         if input.peek(token::Paren) {
+    ///             let ahead = input.fork();
+    ///             let mut content;
+    ///             parenthesized!(content in ahead);
+    ///
+    ///             if content.peek(Token![crate])
+    ///                 || content.peek(Token![self])
+    ///                 || content.peek(Token![super])
+    ///             {
+    ///                 return Ok(PubVisibility {
+    ///                     pub_token,
+    ///                     restricted: Some(Restricted {
+    ///                         paren_token: parenthesized!(content in input),
+    ///                         in_token: None,
+    ///                         path: Path::from(content.call(Ident::parse_any)?),
+    ///                     }),
+    ///                 });
+    ///             } else if content.peek(Token![in]) {
+    ///                 return Ok(PubVisibility {
+    ///                     pub_token,
+    ///                     restricted: Some(Restricted {
+    ///                         paren_token: parenthesized!(content in input),
+    ///                         in_token: Some(content.parse()?),
+    ///                         path: content.call(Path::parse_mod_style)?,
+    ///                     }),
+    ///                 });
+    ///             }
+    ///         }
+    ///
+    ///         Ok(PubVisibility {
+    ///             pub_token,
+    ///             restricted: None,
+    ///         })
+    ///     }
+    /// }
+    /// ```
+    pub fn fork(&self) -> Self {
+        ParseBuffer {
+            scope: self.scope,
+            cell: self.cell.clone(),
+            marker: PhantomData,
+            // Not the parent's unexpected. Nothing cares whether the clone
+            // parses all the way unless we `advance_to`.
+            unexpected: Cell::new(Some(Rc::new(Cell::new(Unexpected::None)))),
+        }
+    }
+
+    /// Triggers an error at the current position of the parse stream.
+    ///
+    /// # Example
+    ///
+    /// ```
+    /// use syn::{Expr, Result, Token};
+    /// use syn::parse::{Parse, ParseStream};
+    ///
+    /// // Some kind of loop: `while` or `for` or `loop`.
+    /// struct Loop {
+    ///     expr: Expr,
+    /// }
+    ///
+    /// impl Parse for Loop {
+    ///     fn parse(input: ParseStream) -> Result<Self> {
+    ///         if input.peek(Token![while])
+    ///             || input.peek(Token![for])
+    ///             || input.peek(Token![loop])
+    ///         {
+    ///             Ok(Loop {
+    ///                 expr: input.parse()?,
+    ///             })
+    ///         } else {
+    ///             Err(input.error("expected some kind of loop"))
+    ///         }
+    ///     }
+    /// }
+    /// ```
+    pub fn error<T: Display>(&self, message: T) -> Error {
+        error::new_at(self.scope, self.cursor(), message)
+    }
+
+    /// Speculatively parses tokens from this parse stream, advancing the
+    /// position of this stream only if parsing succeeds.
+    ///
+    /// This is a powerful low-level API used for defining the `Parse` impls of
+    /// the basic built-in token types. It is not something that will be used
+    /// widely outside of the Syn codebase.
+    ///
+    /// # Example
+    ///
+    /// ```
+    /// use proc_macro2::TokenTree;
+    /// use syn::Result;
+    /// use syn::parse::ParseStream;
+    ///
+    /// // This function advances the stream past the next occurrence of `@`. If
+    /// // no `@` is present in the stream, the stream position is unchanged and
+    /// // an error is returned.
+    /// fn skip_past_next_at(input: ParseStream) -> Result<()> {
+    ///     input.step(|cursor| {
+    ///         let mut rest = *cursor;
+    ///         while let Some((tt, next)) = rest.token_tree() {
+    ///             match &tt {
+    ///                 TokenTree::Punct(punct) if punct.as_char() == '@' => {
+    ///                     return Ok(((), next));
+    ///                 }
+    ///                 _ => rest = next,
+    ///             }
+    ///         }
+    ///         Err(cursor.error("no `@` was found after this point"))
+    ///     })
+    /// }
+    /// #
+    /// # fn remainder_after_skipping_past_next_at(
+    /// #     input: ParseStream,
+    /// # ) -> Result<proc_macro2::TokenStream> {
+    /// #     skip_past_next_at(input)?;
+    /// #     input.parse()
+    /// # }
+    /// #
+    /// # use syn::parse::Parser;
+    /// # let remainder = remainder_after_skipping_past_next_at
+    /// #     .parse_str("a @ b c")
+    /// #     .unwrap();
+    /// # assert_eq!(remainder.to_string(), "b c");
+    /// ```
+    pub fn step<F, R>(&self, function: F) -> Result<R>
+    where
+        F: for<'c> FnOnce(StepCursor<'c, 'a>) -> Result<(R, Cursor<'c>)>,
+    {
+        // Since the user's function is required to work for any 'c, we know
+        // that the Cursor<'c> they return is either derived from the input
+        // StepCursor<'c, 'a> or from a Cursor<'static>.
+        //
+        // It would not be legal to write this function without the invariant
+        // lifetime 'c in StepCursor<'c, 'a>. If this function were written only
+        // in terms of 'a, the user could take our ParseBuffer<'a>, upcast it to
+        // a ParseBuffer<'short> which some shorter lifetime than 'a, invoke
+        // `step` on their ParseBuffer<'short> with a closure that returns
+        // Cursor<'short>, and we would wrongly write that Cursor<'short> into
+        // the Cell intended to hold Cursor<'a>.
+        //
+        // In some cases it may be necessary for R to contain a Cursor<'a>.
+        // Within Syn we solve this using `advance_step_cursor` which uses the
+        // existence of a StepCursor<'c, 'a> as proof that it is safe to cast
+        // from Cursor<'c> to Cursor<'a>. If needed outside of Syn, it would be
+        // safe to expose that API as a method on StepCursor.
+        let (node, rest) = function(StepCursor {
+            scope: self.scope,
+            cursor: self.cell.get(),
+            marker: PhantomData,
+        })?;
+        self.cell.set(rest);
+        Ok(node)
+    }
+
+    /// Returns the `Span` of the next token in the parse stream, or
+    /// `Span::call_site()` if this parse stream has completely exhausted its
+    /// input `TokenStream`.
+    pub fn span(&self) -> Span {
+        let cursor = self.cursor();
+        if cursor.eof() {
+            self.scope
+        } else {
+            crate::buffer::open_span_of_group(cursor)
+        }
+    }
+
+    /// Provides low-level access to the token representation underlying this
+    /// parse stream.
+    ///
+    /// Cursors are immutable so no operations you perform against the cursor
+    /// will affect the state of this parse stream.
+    ///
+    /// # Example
+    ///
+    /// ```
+    /// use proc_macro2::TokenStream;
+    /// use syn::buffer::Cursor;
+    /// use syn::parse::{ParseStream, Result};
+    ///
+    /// // Run a parser that returns T, but get its output as TokenStream instead of T.
+    /// // This works without T needing to implement ToTokens.
+    /// fn recognize_token_stream<T>(
+    ///     recognizer: fn(ParseStream) -> Result<T>,
+    /// ) -> impl Fn(ParseStream) -> Result<TokenStream> {
+    ///     move |input| {
+    ///         let begin = input.cursor();
+    ///         recognizer(input)?;
+    ///         let end = input.cursor();
+    ///         Ok(tokens_between(begin, end))
+    ///     }
+    /// }
+    ///
+    /// // Collect tokens between two cursors as a TokenStream.
+    /// fn tokens_between(begin: Cursor, end: Cursor) -> TokenStream {
+    ///     assert!(begin <= end);
+    ///
+    ///     let mut cursor = begin;
+    ///     let mut tokens = TokenStream::new();
+    ///     while cursor < end {
+    ///         let (token, next) = cursor.token_tree().unwrap();
+    ///         tokens.extend(std::iter::once(token));
+    ///         cursor = next;
+    ///     }
+    ///     tokens
+    /// }
+    ///
+    /// fn main() {
+    ///     use quote::quote;
+    ///     use syn::parse::{Parse, Parser};
+    ///     use syn::Token;
+    ///
+    ///     // Parse syn::Type as a TokenStream, surrounded by angle brackets.
+    ///     fn example(input: ParseStream) -> Result<TokenStream> {
+    ///         let _langle: Token![<] = input.parse()?;
+    ///         let ty = recognize_token_stream(syn::Type::parse)(input)?;
+    ///         let _rangle: Token![>] = input.parse()?;
+    ///         Ok(ty)
+    ///     }
+    ///
+    ///     let tokens = quote! { <fn() -> u8> };
+    ///     println!("{}", example.parse2(tokens).unwrap());
+    /// }
+    /// ```
+    pub fn cursor(&self) -> Cursor<'a> {
+        self.cell.get()
+    }
+
+    fn check_unexpected(&self) -> Result<()> {
+        match inner_unexpected(self).1 {
+            Some(span) => Err(Error::new(span, "unexpected token")),
+            None => Ok(()),
+        }
+    }
+}
+
+#[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+impl<T: Parse> Parse for Box<T> {
+    fn parse(input: ParseStream) -> Result<Self> {
+        input.parse().map(Box::new)
+    }
+}
+
+#[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+impl<T: Parse + Token> Parse for Option<T> {
+    fn parse(input: ParseStream) -> Result<Self> {
+        if T::peek(input.cursor()) {
+            Ok(Some(input.parse()?))
+        } else {
+            Ok(None)
+        }
+    }
+}
+
+#[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+impl Parse for TokenStream {
+    fn parse(input: ParseStream) -> Result<Self> {
+        input.step(|cursor| Ok((cursor.token_stream(), Cursor::empty())))
+    }
+}
+
+#[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+impl Parse for TokenTree {
+    fn parse(input: ParseStream) -> Result<Self> {
+        input.step(|cursor| match cursor.token_tree() {
+            Some((tt, rest)) => Ok((tt, rest)),
+            None => Err(cursor.error("expected token tree")),
+        })
+    }
+}
+
+#[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+impl Parse for Group {
+    fn parse(input: ParseStream) -> Result<Self> {
+        input.step(|cursor| {
+            if let Some((group, rest)) = cursor.any_group_token() {
+                if group.delimiter() != Delimiter::None {
+                    return Ok((group, rest));
+                }
+            }
+            Err(cursor.error("expected group token"))
+        })
+    }
+}
+
+#[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+impl Parse for Punct {
+    fn parse(input: ParseStream) -> Result<Self> {
+        input.step(|cursor| match cursor.punct() {
+            Some((punct, rest)) => Ok((punct, rest)),
+            None => Err(cursor.error("expected punctuation token")),
+        })
+    }
+}
+
+#[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+impl Parse for Literal {
+    fn parse(input: ParseStream) -> Result<Self> {
+        input.step(|cursor| match cursor.literal() {
+            Some((literal, rest)) => Ok((literal, rest)),
+            None => Err(cursor.error("expected literal token")),
+        })
+    }
+}
+
+/// Parser that can parse Rust tokens into a particular syntax tree node.
+///
+/// Refer to the [module documentation] for details about parsing in Syn.
+///
+/// [module documentation]: self
+pub trait Parser: Sized {
+    type Output;
+
+    /// Parse a proc-macro2 token stream into the chosen syntax tree node.
+    ///
+    /// This function will check that the input is fully parsed. If there are
+    /// any unparsed tokens at the end of the stream, an error is returned.
+    fn parse2(self, tokens: TokenStream) -> Result<Self::Output>;
+
+    /// Parse tokens of source code into the chosen syntax tree node.
+    ///
+    /// This function will check that the input is fully parsed. If there are
+    /// any unparsed tokens at the end of the stream, an error is returned.
+    #[cfg(feature = "proc-macro")]
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "proc-macro")))]
+    fn parse(self, tokens: proc_macro::TokenStream) -> Result<Self::Output> {
+        self.parse2(proc_macro2::TokenStream::from(tokens))
+    }
+
+    /// Parse a string of Rust code into the chosen syntax tree node.
+    ///
+    /// This function will check that the input is fully parsed. If there are
+    /// any unparsed tokens at the end of the string, an error is returned.
+    ///
+    /// # Hygiene
+    ///
+    /// Every span in the resulting syntax tree will be set to resolve at the
+    /// macro call site.
+    fn parse_str(self, s: &str) -> Result<Self::Output> {
+        self.parse2(proc_macro2::TokenStream::from_str(s)?)
+    }
+
+    // Not public API.
+    #[doc(hidden)]
+    fn __parse_scoped(self, scope: Span, tokens: TokenStream) -> Result<Self::Output> {
+        let _ = scope;
+        self.parse2(tokens)
+    }
+}
+
+fn tokens_to_parse_buffer(tokens: &TokenBuffer) -> ParseBuffer {
+    let scope = Span::call_site();
+    let cursor = tokens.begin();
+    let unexpected = Rc::new(Cell::new(Unexpected::None));
+    new_parse_buffer(scope, cursor, unexpected)
+}
+
+impl<F, T> Parser for F
+where
+    F: FnOnce(ParseStream) -> Result<T>,
+{
+    type Output = T;
+
+    fn parse2(self, tokens: TokenStream) -> Result<T> {
+        let buf = TokenBuffer::new2(tokens);
+        let state = tokens_to_parse_buffer(&buf);
+        let node = self(&state)?;
+        state.check_unexpected()?;
+        if let Some(unexpected_span) = span_of_unexpected_ignoring_nones(state.cursor()) {
+            Err(Error::new(unexpected_span, "unexpected token"))
+        } else {
+            Ok(node)
+        }
+    }
+
+    fn __parse_scoped(self, scope: Span, tokens: TokenStream) -> Result<Self::Output> {
+        let buf = TokenBuffer::new2(tokens);
+        let cursor = buf.begin();
+        let unexpected = Rc::new(Cell::new(Unexpected::None));
+        let state = new_parse_buffer(scope, cursor, unexpected);
+        let node = self(&state)?;
+        state.check_unexpected()?;
+        if let Some(unexpected_span) = span_of_unexpected_ignoring_nones(state.cursor()) {
+            Err(Error::new(unexpected_span, "unexpected token"))
+        } else {
+            Ok(node)
+        }
+    }
+}
+
+pub(crate) fn parse_scoped<F: Parser>(f: F, scope: Span, tokens: TokenStream) -> Result<F::Output> {
+    f.__parse_scoped(scope, tokens)
+}
+
+/// An empty syntax tree node that consumes no tokens when parsed.
+///
+/// This is useful for attribute macros that want to ensure they are not
+/// provided any attribute args.
+///
+/// ```
+/// # extern crate proc_macro;
+/// #
+/// use proc_macro::TokenStream;
+/// use syn::parse_macro_input;
+/// use syn::parse::Nothing;
+///
+/// # const IGNORE: &str = stringify! {
+/// #[proc_macro_attribute]
+/// # };
+/// pub fn my_attr(args: TokenStream, input: TokenStream) -> TokenStream {
+///     parse_macro_input!(args as Nothing);
+///
+///     /* ... */
+/// #   TokenStream::new()
+/// }
+/// ```
+///
+/// ```text
+/// error: unexpected token
+///  --> src/main.rs:3:19
+///   |
+/// 3 | #[my_attr(asdf)]
+///   |           ^^^^
+/// ```
+pub struct Nothing;
+
+impl Parse for Nothing {
+    fn parse(_input: ParseStream) -> Result<Self> {
+        Ok(Nothing)
+    }
+}
+
+#[cfg(feature = "printing")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+impl ToTokens for Nothing {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
+        let _ = tokens;
+    }
+}
+
+#[cfg(feature = "clone-impls")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for Nothing {
+    fn clone(&self) -> Self {
+        *self
+    }
+}
+
+#[cfg(feature = "clone-impls")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Copy for Nothing {}
+
+#[cfg(feature = "extra-traits")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))]
+impl Debug for Nothing {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        f.write_str("Nothing")
+    }
+}
+
+#[cfg(feature = "extra-traits")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))]
+impl Eq for Nothing {}
+
+#[cfg(feature = "extra-traits")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for Nothing {
+    fn eq(&self, _other: &Self) -> bool {
+        true
+    }
+}
+
+#[cfg(feature = "extra-traits")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))]
+impl Hash for Nothing {
+    fn hash<H: Hasher>(&self, _state: &mut H) {}
+}
+
\ No newline at end of file diff --git a/src/syn/parse_macro_input.rs.html b/src/syn/parse_macro_input.rs.html new file mode 100644 index 0000000..bdc3c33 --- /dev/null +++ b/src/syn/parse_macro_input.rs.html @@ -0,0 +1,257 @@ +parse_macro_input.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+
/// Parse the input TokenStream of a macro, triggering a compile error if the
+/// tokens fail to parse.
+///
+/// Refer to the [`parse` module] documentation for more details about parsing
+/// in Syn.
+///
+/// [`parse` module]: mod@crate::parse
+///
+/// <br>
+///
+/// # Intended usage
+///
+/// This macro must be called from a function that returns
+/// `proc_macro::TokenStream`. Usually this will be your proc macro entry point,
+/// the function that has the #\[proc_macro\] / #\[proc_macro_derive\] /
+/// #\[proc_macro_attribute\] attribute.
+///
+/// ```
+/// # extern crate proc_macro;
+/// #
+/// use proc_macro::TokenStream;
+/// use syn::{parse_macro_input, Result};
+/// use syn::parse::{Parse, ParseStream};
+///
+/// struct MyMacroInput {
+///     /* ... */
+/// }
+///
+/// impl Parse for MyMacroInput {
+///     fn parse(input: ParseStream) -> Result<Self> {
+///         /* ... */
+/// #       Ok(MyMacroInput {})
+///     }
+/// }
+///
+/// # const IGNORE: &str = stringify! {
+/// #[proc_macro]
+/// # };
+/// pub fn my_macro(tokens: TokenStream) -> TokenStream {
+///     let input = parse_macro_input!(tokens as MyMacroInput);
+///
+///     /* ... */
+/// #   TokenStream::new()
+/// }
+/// ```
+///
+/// <br>
+///
+/// # Usage with Parser
+///
+/// This macro can also be used with the [`Parser` trait] for types that have
+/// multiple ways that they can be parsed.
+///
+/// [`Parser` trait]: crate::parse::Parser
+///
+/// ```
+/// # extern crate proc_macro;
+/// #
+/// # use proc_macro::TokenStream;
+/// # use syn::{parse_macro_input, Result};
+/// # use syn::parse::ParseStream;
+/// #
+/// # struct MyMacroInput {}
+/// #
+/// impl MyMacroInput {
+///     fn parse_alternate(input: ParseStream) -> Result<Self> {
+///         /* ... */
+/// #       Ok(MyMacroInput {})
+///     }
+/// }
+///
+/// # const IGNORE: &str = stringify! {
+/// #[proc_macro]
+/// # };
+/// pub fn my_macro(tokens: TokenStream) -> TokenStream {
+///     let input = parse_macro_input!(tokens with MyMacroInput::parse_alternate);
+///
+///     /* ... */
+/// #   TokenStream::new()
+/// }
+/// ```
+///
+/// <br>
+///
+/// # Expansion
+///
+/// `parse_macro_input!($variable as $Type)` expands to something like:
+///
+/// ```no_run
+/// # extern crate proc_macro;
+/// #
+/// # macro_rules! doc_test {
+/// #     ($variable:ident as $Type:ty) => {
+/// match syn::parse::<$Type>($variable) {
+///     Ok(syntax_tree) => syntax_tree,
+///     Err(err) => return proc_macro::TokenStream::from(err.to_compile_error()),
+/// }
+/// #     };
+/// # }
+/// #
+/// # fn test(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
+/// #     let _ = doc_test!(input as syn::Ident);
+/// #     proc_macro::TokenStream::new()
+/// # }
+/// ```
+#[macro_export]
+#[cfg_attr(doc_cfg, doc(cfg(all(feature = "parsing", feature = "proc-macro"))))]
+macro_rules! parse_macro_input {
+    ($tokenstream:ident as $ty:ty) => {
+        match $crate::parse::<$ty>($tokenstream) {
+            $crate::__private::Ok(data) => data,
+            $crate::__private::Err(err) => {
+                return $crate::__private::TokenStream::from(err.to_compile_error());
+            }
+        }
+    };
+    ($tokenstream:ident with $parser:path) => {
+        match $crate::parse::Parser::parse($parser, $tokenstream) {
+            $crate::__private::Ok(data) => data,
+            $crate::__private::Err(err) => {
+                return $crate::__private::TokenStream::from(err.to_compile_error());
+            }
+        }
+    };
+    ($tokenstream:ident) => {
+        $crate::parse_macro_input!($tokenstream as _)
+    };
+}
+
\ No newline at end of file diff --git a/src/syn/parse_quote.rs.html b/src/syn/parse_quote.rs.html new file mode 100644 index 0000000..654a075 --- /dev/null +++ b/src/syn/parse_quote.rs.html @@ -0,0 +1,421 @@ +parse_quote.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+
/// Quasi-quotation macro that accepts input like the [`quote!`] macro but uses
+/// type inference to figure out a return type for those tokens.
+///
+/// [`quote!`]: https://docs.rs/quote/1.0/quote/index.html
+///
+/// The return type can be any syntax tree node that implements the [`Parse`]
+/// trait.
+///
+/// [`Parse`]: crate::parse::Parse
+///
+/// ```
+/// use quote::quote;
+/// use syn::{parse_quote, Stmt};
+///
+/// fn main() {
+///     let name = quote!(v);
+///     let ty = quote!(u8);
+///
+///     let stmt: Stmt = parse_quote! {
+///         let #name: #ty = Default::default();
+///     };
+///
+///     println!("{:#?}", stmt);
+/// }
+/// ```
+///
+/// *This macro is available only if Syn is built with both the `"parsing"` and
+/// `"printing"` features.*
+///
+/// # Example
+///
+/// The following helper function adds a bound `T: HeapSize` to every type
+/// parameter `T` in the input generics.
+///
+/// ```
+/// use syn::{parse_quote, Generics, GenericParam};
+///
+/// // Add a bound `T: HeapSize` to every type parameter T.
+/// fn add_trait_bounds(mut generics: Generics) -> Generics {
+///     for param in &mut generics.params {
+///         if let GenericParam::Type(type_param) = param {
+///             type_param.bounds.push(parse_quote!(HeapSize));
+///         }
+///     }
+///     generics
+/// }
+/// ```
+///
+/// # Special cases
+///
+/// This macro can parse the following additional types as a special case even
+/// though they do not implement the `Parse` trait.
+///
+/// - [`Attribute`] — parses one attribute, allowing either outer like `#[...]`
+///   or inner like `#![...]`
+/// - [`Punctuated<T, P>`] — parses zero or more `T` separated by punctuation
+///   `P` with optional trailing punctuation
+/// - [`Vec<Stmt>`] — parses the same as `Block::parse_within`
+///
+/// [`Vec<Stmt>`]: Block::parse_within
+///
+/// # Panics
+///
+/// Panics if the tokens fail to parse as the expected syntax tree type. The
+/// caller is responsible for ensuring that the input tokens are syntactically
+/// valid.
+#[cfg_attr(doc_cfg, doc(cfg(all(feature = "parsing", feature = "printing"))))]
+#[macro_export]
+macro_rules! parse_quote {
+    ($($tt:tt)*) => {
+        $crate::__private::parse_quote($crate::__private::quote::quote!($($tt)*))
+    };
+}
+
+/// This macro is [`parse_quote!`] + [`quote_spanned!`][quote::quote_spanned].
+///
+/// Please refer to each of their documentation.
+///
+/// # Example
+///
+/// ```
+/// use quote::{quote, quote_spanned};
+/// use syn::spanned::Spanned;
+/// use syn::{parse_quote_spanned, ReturnType, Signature};
+///
+/// // Changes `fn()` to `fn() -> Pin<Box<dyn Future<Output = ()>>>`,
+/// // and `fn() -> T` to `fn() -> Pin<Box<dyn Future<Output = T>>>`,
+/// // without introducing any call_site() spans.
+/// fn make_ret_pinned_future(sig: &mut Signature) {
+///     let ret = match &sig.output {
+///         ReturnType::Default => quote_spanned!(sig.paren_token.span=> ()),
+///         ReturnType::Type(_, ret) => quote!(#ret),
+///     };
+///     sig.output = parse_quote_spanned! {ret.span()=>
+///         -> ::std::pin::Pin<::std::boxed::Box<dyn ::std::future::Future<Output = #ret>>>
+///     };
+/// }
+/// ```
+#[cfg_attr(doc_cfg, doc(cfg(all(feature = "parsing", feature = "printing"))))]
+#[macro_export]
+macro_rules! parse_quote_spanned {
+    ($span:expr=> $($tt:tt)*) => {
+        $crate::__private::parse_quote($crate::__private::quote::quote_spanned!($span=> $($tt)*))
+    };
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// Can parse any type that implements Parse.
+
+use crate::error::Result;
+use crate::parse::{Parse, ParseStream, Parser};
+use proc_macro2::TokenStream;
+
+// Not public API.
+#[doc(hidden)]
+pub fn parse<T: ParseQuote>(token_stream: TokenStream) -> T {
+    let parser = T::parse;
+    match parser.parse2(token_stream) {
+        Ok(t) => t,
+        Err(err) => panic!("{}", err),
+    }
+}
+
+#[doc(hidden)]
+pub trait ParseQuote: Sized {
+    fn parse(input: ParseStream) -> Result<Self>;
+}
+
+impl<T: Parse> ParseQuote for T {
+    fn parse(input: ParseStream) -> Result<Self> {
+        <T as Parse>::parse(input)
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// Any other types that we want `parse_quote!` to be able to parse.
+
+use crate::punctuated::Punctuated;
+#[cfg(any(feature = "full", feature = "derive"))]
+use crate::{attr, Attribute, Field, FieldMutability, Ident, Type, Visibility};
+#[cfg(feature = "full")]
+use crate::{Block, Pat, Stmt};
+
+#[cfg(any(feature = "full", feature = "derive"))]
+impl ParseQuote for Attribute {
+    fn parse(input: ParseStream) -> Result<Self> {
+        if input.peek(Token![#]) && input.peek2(Token![!]) {
+            attr::parsing::single_parse_inner(input)
+        } else {
+            attr::parsing::single_parse_outer(input)
+        }
+    }
+}
+
+#[cfg(any(feature = "full", feature = "derive"))]
+impl ParseQuote for Field {
+    fn parse(input: ParseStream) -> Result<Self> {
+        let attrs = input.call(Attribute::parse_outer)?;
+        let vis: Visibility = input.parse()?;
+
+        let ident: Option<Ident>;
+        let colon_token: Option<Token![:]>;
+        let is_named = input.peek(Ident) && input.peek2(Token![:]) && !input.peek2(Token![::]);
+        if is_named {
+            ident = Some(input.parse()?);
+            colon_token = Some(input.parse()?);
+        } else {
+            ident = None;
+            colon_token = None;
+        }
+
+        let ty: Type = input.parse()?;
+
+        Ok(Field {
+            attrs,
+            vis,
+            mutability: FieldMutability::None,
+            ident,
+            colon_token,
+            ty,
+        })
+    }
+}
+
+#[cfg(feature = "full")]
+impl ParseQuote for Pat {
+    fn parse(input: ParseStream) -> Result<Self> {
+        Pat::parse_multi_with_leading_vert(input)
+    }
+}
+
+#[cfg(feature = "full")]
+impl ParseQuote for Box<Pat> {
+    fn parse(input: ParseStream) -> Result<Self> {
+        <Pat as ParseQuote>::parse(input).map(Box::new)
+    }
+}
+
+impl<T: Parse, P: Parse> ParseQuote for Punctuated<T, P> {
+    fn parse(input: ParseStream) -> Result<Self> {
+        Self::parse_terminated(input)
+    }
+}
+
+#[cfg(feature = "full")]
+impl ParseQuote for Vec<Stmt> {
+    fn parse(input: ParseStream) -> Result<Self> {
+        Block::parse_within(input)
+    }
+}
+
\ No newline at end of file diff --git a/src/syn/pat.rs.html b/src/syn/pat.rs.html new file mode 100644 index 0000000..7934763 --- /dev/null +++ b/src/syn/pat.rs.html @@ -0,0 +1,1907 @@ +pat.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+753
+754
+755
+756
+757
+758
+759
+760
+761
+762
+763
+764
+765
+766
+767
+768
+769
+770
+771
+772
+773
+774
+775
+776
+777
+778
+779
+780
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+794
+795
+796
+797
+798
+799
+800
+801
+802
+803
+804
+805
+806
+807
+808
+809
+810
+811
+812
+813
+814
+815
+816
+817
+818
+819
+820
+821
+822
+823
+824
+825
+826
+827
+828
+829
+830
+831
+832
+833
+834
+835
+836
+837
+838
+839
+840
+841
+842
+843
+844
+845
+846
+847
+848
+849
+850
+851
+852
+853
+854
+855
+856
+857
+858
+859
+860
+861
+862
+863
+864
+865
+866
+867
+868
+869
+870
+871
+872
+873
+874
+875
+876
+877
+878
+879
+880
+881
+882
+883
+884
+885
+886
+887
+888
+889
+890
+891
+892
+893
+894
+895
+896
+897
+898
+899
+900
+901
+902
+903
+904
+905
+906
+907
+908
+909
+910
+911
+912
+913
+914
+915
+916
+917
+918
+919
+920
+921
+922
+923
+924
+925
+926
+927
+928
+929
+930
+931
+932
+933
+934
+935
+936
+937
+938
+939
+940
+941
+942
+943
+944
+945
+946
+947
+948
+949
+950
+951
+952
+953
+
use crate::attr::Attribute;
+use crate::expr::Member;
+use crate::ident::Ident;
+use crate::path::{Path, QSelf};
+use crate::punctuated::Punctuated;
+use crate::token;
+use crate::ty::Type;
+use proc_macro2::TokenStream;
+
+pub use crate::expr::{
+    ExprConst as PatConst, ExprLit as PatLit, ExprMacro as PatMacro, ExprPath as PatPath,
+    ExprRange as PatRange,
+};
+
+ast_enum_of_structs! {
+    /// A pattern in a local binding, function signature, match expression, or
+    /// various other places.
+    ///
+    /// # Syntax tree enum
+    ///
+    /// This type is a [syntax tree enum].
+    ///
+    /// [syntax tree enum]: crate::expr::Expr#syntax-tree-enums
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    #[non_exhaustive]
+    pub enum Pat {
+        /// A const block: `const { ... }`.
+        Const(PatConst),
+
+        /// A pattern that binds a new variable: `ref mut binding @ SUBPATTERN`.
+        Ident(PatIdent),
+
+        /// A literal pattern: `0`.
+        Lit(PatLit),
+
+        /// A macro in pattern position.
+        Macro(PatMacro),
+
+        /// A pattern that matches any one of a set of cases.
+        Or(PatOr),
+
+        /// A parenthesized pattern: `(A | B)`.
+        Paren(PatParen),
+
+        /// A path pattern like `Color::Red`, optionally qualified with a
+        /// self-type.
+        ///
+        /// Unqualified path patterns can legally refer to variants, structs,
+        /// constants or associated constants. Qualified path patterns like
+        /// `<A>::B::C` and `<A as Trait>::B::C` can only legally refer to
+        /// associated constants.
+        Path(PatPath),
+
+        /// A range pattern: `1..=2`.
+        Range(PatRange),
+
+        /// A reference pattern: `&mut var`.
+        Reference(PatReference),
+
+        /// The dots in a tuple or slice pattern: `[0, 1, ..]`.
+        Rest(PatRest),
+
+        /// A dynamically sized slice pattern: `[a, b, ref i @ .., y, z]`.
+        Slice(PatSlice),
+
+        /// A struct or struct variant pattern: `Variant { x, y, .. }`.
+        Struct(PatStruct),
+
+        /// A tuple pattern: `(a, b)`.
+        Tuple(PatTuple),
+
+        /// A tuple struct or tuple variant pattern: `Variant(x, y, .., z)`.
+        TupleStruct(PatTupleStruct),
+
+        /// A type ascription pattern: `foo: f64`.
+        Type(PatType),
+
+        /// Tokens in pattern position not interpreted by Syn.
+        Verbatim(TokenStream),
+
+        /// A pattern that matches any value: `_`.
+        Wild(PatWild),
+
+        // For testing exhaustiveness in downstream code, use the following idiom:
+        //
+        //     match pat {
+        //         #![cfg_attr(test, deny(non_exhaustive_omitted_patterns))]
+        //
+        //         Pat::Box(pat) => {...}
+        //         Pat::Ident(pat) => {...}
+        //         ...
+        //         Pat::Wild(pat) => {...}
+        //
+        //         _ => { /* some sane fallback */ }
+        //     }
+        //
+        // This way we fail your tests but don't break your library when adding
+        // a variant. You will be notified by a test failure when a variant is
+        // added, so that you can add code to handle it, but your library will
+        // continue to compile and work for downstream users in the interim.
+    }
+}
+
+ast_struct! {
+    /// A pattern that binds a new variable: `ref mut binding @ SUBPATTERN`.
+    ///
+    /// It may also be a unit struct or struct variant (e.g. `None`), or a
+    /// constant; these cannot be distinguished syntactically.
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    pub struct PatIdent {
+        pub attrs: Vec<Attribute>,
+        pub by_ref: Option<Token![ref]>,
+        pub mutability: Option<Token![mut]>,
+        pub ident: Ident,
+        pub subpat: Option<(Token![@], Box<Pat>)>,
+    }
+}
+
+ast_struct! {
+    /// A pattern that matches any one of a set of cases.
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    pub struct PatOr {
+        pub attrs: Vec<Attribute>,
+        pub leading_vert: Option<Token![|]>,
+        pub cases: Punctuated<Pat, Token![|]>,
+    }
+}
+
+ast_struct! {
+    /// A parenthesized pattern: `(A | B)`.
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    pub struct PatParen {
+        pub attrs: Vec<Attribute>,
+        pub paren_token: token::Paren,
+        pub pat: Box<Pat>,
+    }
+}
+
+ast_struct! {
+    /// A reference pattern: `&mut var`.
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    pub struct PatReference {
+        pub attrs: Vec<Attribute>,
+        pub and_token: Token![&],
+        pub mutability: Option<Token![mut]>,
+        pub pat: Box<Pat>,
+    }
+}
+
+ast_struct! {
+    /// The dots in a tuple or slice pattern: `[0, 1, ..]`.
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    pub struct PatRest {
+        pub attrs: Vec<Attribute>,
+        pub dot2_token: Token![..],
+    }
+}
+
+ast_struct! {
+    /// A dynamically sized slice pattern: `[a, b, ref i @ .., y, z]`.
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    pub struct PatSlice {
+        pub attrs: Vec<Attribute>,
+        pub bracket_token: token::Bracket,
+        pub elems: Punctuated<Pat, Token![,]>,
+    }
+}
+
+ast_struct! {
+    /// A struct or struct variant pattern: `Variant { x, y, .. }`.
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    pub struct PatStruct {
+        pub attrs: Vec<Attribute>,
+        pub qself: Option<QSelf>,
+        pub path: Path,
+        pub brace_token: token::Brace,
+        pub fields: Punctuated<FieldPat, Token![,]>,
+        pub rest: Option<PatRest>,
+    }
+}
+
+ast_struct! {
+    /// A tuple pattern: `(a, b)`.
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    pub struct PatTuple {
+        pub attrs: Vec<Attribute>,
+        pub paren_token: token::Paren,
+        pub elems: Punctuated<Pat, Token![,]>,
+    }
+}
+
+ast_struct! {
+    /// A tuple struct or tuple variant pattern: `Variant(x, y, .., z)`.
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    pub struct PatTupleStruct {
+        pub attrs: Vec<Attribute>,
+        pub qself: Option<QSelf>,
+        pub path: Path,
+        pub paren_token: token::Paren,
+        pub elems: Punctuated<Pat, Token![,]>,
+    }
+}
+
+ast_struct! {
+    /// A type ascription pattern: `foo: f64`.
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    pub struct PatType {
+        pub attrs: Vec<Attribute>,
+        pub pat: Box<Pat>,
+        pub colon_token: Token![:],
+        pub ty: Box<Type>,
+    }
+}
+
+ast_struct! {
+    /// A pattern that matches any value: `_`.
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    pub struct PatWild {
+        pub attrs: Vec<Attribute>,
+        pub underscore_token: Token![_],
+    }
+}
+
+ast_struct! {
+    /// A single field in a struct pattern.
+    ///
+    /// Patterns like the fields of Foo `{ x, ref y, ref mut z }` are treated
+    /// the same as `x: x, y: ref y, z: ref mut z` but there is no colon token.
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    pub struct FieldPat {
+        pub attrs: Vec<Attribute>,
+        pub member: Member,
+        pub colon_token: Option<Token![:]>,
+        pub pat: Box<Pat>,
+    }
+}
+
+#[cfg(feature = "parsing")]
+pub(crate) mod parsing {
+    use crate::attr::Attribute;
+    use crate::error::{self, Result};
+    use crate::expr::{
+        Expr, ExprConst, ExprLit, ExprMacro, ExprPath, ExprRange, Member, RangeLimits,
+    };
+    use crate::ext::IdentExt as _;
+    use crate::ident::Ident;
+    use crate::lit::Lit;
+    use crate::mac::{self, Macro};
+    use crate::parse::{Parse, ParseBuffer, ParseStream};
+    use crate::pat::{
+        FieldPat, Pat, PatIdent, PatOr, PatParen, PatReference, PatRest, PatSlice, PatStruct,
+        PatTuple, PatTupleStruct, PatType, PatWild,
+    };
+    use crate::path::{self, Path, QSelf};
+    use crate::punctuated::Punctuated;
+    use crate::stmt::Block;
+    use crate::token;
+    use crate::verbatim;
+    use proc_macro2::TokenStream;
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Pat {
+        /// Parse a pattern that does _not_ involve `|` at the top level.
+        ///
+        /// This parser matches the behavior of the `$:pat_param` macro_rules
+        /// matcher, and on editions prior to Rust 2021, the behavior of
+        /// `$:pat`.
+        ///
+        /// In Rust syntax, some examples of where this syntax would occur are
+        /// in the argument pattern of functions and closures. Patterns using
+        /// `|` are not allowed to occur in these positions.
+        ///
+        /// ```compile_fail
+        /// fn f(Some(_) | None: Option<T>) {
+        ///     let _ = |Some(_) | None: Option<T>| {};
+        ///     //       ^^^^^^^^^^^^^^^^^^^^^^^^^??? :(
+        /// }
+        /// ```
+        ///
+        /// ```console
+        /// error: top-level or-patterns are not allowed in function parameters
+        ///  --> src/main.rs:1:6
+        ///   |
+        /// 1 | fn f(Some(_) | None: Option<T>) {
+        ///   |      ^^^^^^^^^^^^^^ help: wrap the pattern in parentheses: `(Some(_) | None)`
+        /// ```
+        pub fn parse_single(input: ParseStream) -> Result<Self> {
+            let begin = input.fork();
+            let lookahead = input.lookahead1();
+            if lookahead.peek(Ident)
+                && (input.peek2(Token![::])
+                    || input.peek2(Token![!])
+                    || input.peek2(token::Brace)
+                    || input.peek2(token::Paren)
+                    || input.peek2(Token![..]))
+                || input.peek(Token![self]) && input.peek2(Token![::])
+                || lookahead.peek(Token![::])
+                || lookahead.peek(Token![<])
+                || input.peek(Token![Self])
+                || input.peek(Token![super])
+                || input.peek(Token![crate])
+            {
+                pat_path_or_macro_or_struct_or_range(input)
+            } else if lookahead.peek(Token![_]) {
+                input.call(pat_wild).map(Pat::Wild)
+            } else if input.peek(Token![box]) {
+                pat_box(begin, input)
+            } else if input.peek(Token![-]) || lookahead.peek(Lit) || lookahead.peek(Token![const])
+            {
+                pat_lit_or_range(input)
+            } else if lookahead.peek(Token![ref])
+                || lookahead.peek(Token![mut])
+                || input.peek(Token![self])
+                || input.peek(Ident)
+            {
+                input.call(pat_ident).map(Pat::Ident)
+            } else if lookahead.peek(Token![&]) {
+                input.call(pat_reference).map(Pat::Reference)
+            } else if lookahead.peek(token::Paren) {
+                input.call(pat_paren_or_tuple)
+            } else if lookahead.peek(token::Bracket) {
+                input.call(pat_slice).map(Pat::Slice)
+            } else if lookahead.peek(Token![..]) && !input.peek(Token![...]) {
+                pat_range_half_open(input)
+            } else if lookahead.peek(Token![const]) {
+                input.call(pat_const).map(Pat::Verbatim)
+            } else {
+                Err(lookahead.error())
+            }
+        }
+
+        /// Parse a pattern, possibly involving `|`, but not a leading `|`.
+        pub fn parse_multi(input: ParseStream) -> Result<Self> {
+            multi_pat_impl(input, None)
+        }
+
+        /// Parse a pattern, possibly involving `|`, possibly including a
+        /// leading `|`.
+        ///
+        /// This parser matches the behavior of the Rust 2021 edition's `$:pat`
+        /// macro_rules matcher.
+        ///
+        /// In Rust syntax, an example of where this syntax would occur is in
+        /// the pattern of a `match` arm, where the language permits an optional
+        /// leading `|`, although it is not idiomatic to write one there in
+        /// handwritten code.
+        ///
+        /// ```
+        /// # let wat = None;
+        /// match wat {
+        ///     | None | Some(false) => {}
+        ///     | Some(true) => {}
+        /// }
+        /// ```
+        ///
+        /// The compiler accepts it only to facilitate some situations in
+        /// macro-generated code where a macro author might need to write:
+        ///
+        /// ```
+        /// # macro_rules! doc {
+        /// #     ($value:expr, ($($conditions1:pat),*), ($($conditions2:pat),*), $then:expr) => {
+        /// match $value {
+        ///     $(| $conditions1)* $(| $conditions2)* => $then
+        /// }
+        /// #     };
+        /// # }
+        /// #
+        /// # doc!(true, (true), (false), {});
+        /// # doc!(true, (), (true, false), {});
+        /// # doc!(true, (true, false), (), {});
+        /// ```
+        ///
+        /// Expressing the same thing correctly in the case that either one (but
+        /// not both) of `$conditions1` and `$conditions2` might be empty,
+        /// without leading `|`, is complex.
+        ///
+        /// Use [`Pat::parse_multi`] instead if you are not intending to support
+        /// macro-generated macro input.
+        pub fn parse_multi_with_leading_vert(input: ParseStream) -> Result<Self> {
+            let leading_vert: Option<Token![|]> = input.parse()?;
+            multi_pat_impl(input, leading_vert)
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for PatType {
+        fn parse(input: ParseStream) -> Result<Self> {
+            Ok(PatType {
+                attrs: Vec::new(),
+                pat: Box::new(Pat::parse_single(input)?),
+                colon_token: input.parse()?,
+                ty: input.parse()?,
+            })
+        }
+    }
+
+    fn multi_pat_impl(input: ParseStream, leading_vert: Option<Token![|]>) -> Result<Pat> {
+        let mut pat = Pat::parse_single(input)?;
+        if leading_vert.is_some()
+            || input.peek(Token![|]) && !input.peek(Token![||]) && !input.peek(Token![|=])
+        {
+            let mut cases = Punctuated::new();
+            cases.push_value(pat);
+            while input.peek(Token![|]) && !input.peek(Token![||]) && !input.peek(Token![|=]) {
+                let punct = input.parse()?;
+                cases.push_punct(punct);
+                let pat = Pat::parse_single(input)?;
+                cases.push_value(pat);
+            }
+            pat = Pat::Or(PatOr {
+                attrs: Vec::new(),
+                leading_vert,
+                cases,
+            });
+        }
+        Ok(pat)
+    }
+
+    fn pat_path_or_macro_or_struct_or_range(input: ParseStream) -> Result<Pat> {
+        let (qself, path) = path::parsing::qpath(input, true)?;
+
+        if qself.is_none()
+            && input.peek(Token![!])
+            && !input.peek(Token![!=])
+            && path.is_mod_style()
+        {
+            let bang_token: Token![!] = input.parse()?;
+            let (delimiter, tokens) = mac::parse_delimiter(input)?;
+            return Ok(Pat::Macro(ExprMacro {
+                attrs: Vec::new(),
+                mac: Macro {
+                    path,
+                    bang_token,
+                    delimiter,
+                    tokens,
+                },
+            }));
+        }
+
+        if input.peek(token::Brace) {
+            pat_struct(input, qself, path).map(Pat::Struct)
+        } else if input.peek(token::Paren) {
+            pat_tuple_struct(input, qself, path).map(Pat::TupleStruct)
+        } else if input.peek(Token![..]) {
+            pat_range(input, qself, path)
+        } else {
+            Ok(Pat::Path(ExprPath {
+                attrs: Vec::new(),
+                qself,
+                path,
+            }))
+        }
+    }
+
+    fn pat_wild(input: ParseStream) -> Result<PatWild> {
+        Ok(PatWild {
+            attrs: Vec::new(),
+            underscore_token: input.parse()?,
+        })
+    }
+
+    fn pat_box(begin: ParseBuffer, input: ParseStream) -> Result<Pat> {
+        input.parse::<Token![box]>()?;
+        Pat::parse_single(input)?;
+        Ok(Pat::Verbatim(verbatim::between(&begin, input)))
+    }
+
+    fn pat_ident(input: ParseStream) -> Result<PatIdent> {
+        Ok(PatIdent {
+            attrs: Vec::new(),
+            by_ref: input.parse()?,
+            mutability: input.parse()?,
+            ident: {
+                if input.peek(Token![self]) {
+                    input.call(Ident::parse_any)?
+                } else {
+                    input.parse()?
+                }
+            },
+            subpat: {
+                if input.peek(Token![@]) {
+                    let at_token: Token![@] = input.parse()?;
+                    let subpat = Pat::parse_single(input)?;
+                    Some((at_token, Box::new(subpat)))
+                } else {
+                    None
+                }
+            },
+        })
+    }
+
+    fn pat_tuple_struct(
+        input: ParseStream,
+        qself: Option<QSelf>,
+        path: Path,
+    ) -> Result<PatTupleStruct> {
+        let content;
+        let paren_token = parenthesized!(content in input);
+
+        let mut elems = Punctuated::new();
+        while !content.is_empty() {
+            let value = Pat::parse_multi_with_leading_vert(&content)?;
+            elems.push_value(value);
+            if content.is_empty() {
+                break;
+            }
+            let punct = content.parse()?;
+            elems.push_punct(punct);
+        }
+
+        Ok(PatTupleStruct {
+            attrs: Vec::new(),
+            qself,
+            path,
+            paren_token,
+            elems,
+        })
+    }
+
+    fn pat_struct(input: ParseStream, qself: Option<QSelf>, path: Path) -> Result<PatStruct> {
+        let content;
+        let brace_token = braced!(content in input);
+
+        let mut fields = Punctuated::new();
+        let mut rest = None;
+        while !content.is_empty() {
+            let attrs = content.call(Attribute::parse_outer)?;
+            if content.peek(Token![..]) {
+                rest = Some(PatRest {
+                    attrs,
+                    dot2_token: content.parse()?,
+                });
+                break;
+            }
+            let mut value = content.call(field_pat)?;
+            value.attrs = attrs;
+            fields.push_value(value);
+            if content.is_empty() {
+                break;
+            }
+            let punct: Token![,] = content.parse()?;
+            fields.push_punct(punct);
+        }
+
+        Ok(PatStruct {
+            attrs: Vec::new(),
+            qself,
+            path,
+            brace_token,
+            fields,
+            rest,
+        })
+    }
+
+    fn field_pat(input: ParseStream) -> Result<FieldPat> {
+        let begin = input.fork();
+        let boxed: Option<Token![box]> = input.parse()?;
+        let by_ref: Option<Token![ref]> = input.parse()?;
+        let mutability: Option<Token![mut]> = input.parse()?;
+
+        let member = if boxed.is_some() || by_ref.is_some() || mutability.is_some() {
+            input.parse().map(Member::Named)
+        } else {
+            input.parse()
+        }?;
+
+        if boxed.is_none() && by_ref.is_none() && mutability.is_none() && input.peek(Token![:])
+            || !member.is_named()
+        {
+            return Ok(FieldPat {
+                attrs: Vec::new(),
+                member,
+                colon_token: Some(input.parse()?),
+                pat: Box::new(Pat::parse_multi_with_leading_vert(input)?),
+            });
+        }
+
+        let ident = match member {
+            Member::Named(ident) => ident,
+            Member::Unnamed(_) => unreachable!(),
+        };
+
+        let pat = if boxed.is_some() {
+            Pat::Verbatim(verbatim::between(&begin, input))
+        } else {
+            Pat::Ident(PatIdent {
+                attrs: Vec::new(),
+                by_ref,
+                mutability,
+                ident: ident.clone(),
+                subpat: None,
+            })
+        };
+
+        Ok(FieldPat {
+            attrs: Vec::new(),
+            member: Member::Named(ident),
+            colon_token: None,
+            pat: Box::new(pat),
+        })
+    }
+
+    fn pat_range(input: ParseStream, qself: Option<QSelf>, path: Path) -> Result<Pat> {
+        let limits = RangeLimits::parse_obsolete(input)?;
+        let end = input.call(pat_range_bound)?;
+        if let (RangeLimits::Closed(_), None) = (&limits, &end) {
+            return Err(input.error("expected range upper bound"));
+        }
+        Ok(Pat::Range(ExprRange {
+            attrs: Vec::new(),
+            start: Some(Box::new(Expr::Path(ExprPath {
+                attrs: Vec::new(),
+                qself,
+                path,
+            }))),
+            limits,
+            end: end.map(PatRangeBound::into_expr),
+        }))
+    }
+
+    fn pat_range_half_open(input: ParseStream) -> Result<Pat> {
+        let limits: RangeLimits = input.parse()?;
+        let end = input.call(pat_range_bound)?;
+        if end.is_some() {
+            Ok(Pat::Range(ExprRange {
+                attrs: Vec::new(),
+                start: None,
+                limits,
+                end: end.map(PatRangeBound::into_expr),
+            }))
+        } else {
+            match limits {
+                RangeLimits::HalfOpen(dot2_token) => Ok(Pat::Rest(PatRest {
+                    attrs: Vec::new(),
+                    dot2_token,
+                })),
+                RangeLimits::Closed(_) => Err(input.error("expected range upper bound")),
+            }
+        }
+    }
+
+    fn pat_paren_or_tuple(input: ParseStream) -> Result<Pat> {
+        let content;
+        let paren_token = parenthesized!(content in input);
+
+        let mut elems = Punctuated::new();
+        while !content.is_empty() {
+            let value = Pat::parse_multi_with_leading_vert(&content)?;
+            if content.is_empty() {
+                if elems.is_empty() && !matches!(value, Pat::Rest(_)) {
+                    return Ok(Pat::Paren(PatParen {
+                        attrs: Vec::new(),
+                        paren_token,
+                        pat: Box::new(value),
+                    }));
+                }
+                elems.push_value(value);
+                break;
+            }
+            elems.push_value(value);
+            let punct = content.parse()?;
+            elems.push_punct(punct);
+        }
+
+        Ok(Pat::Tuple(PatTuple {
+            attrs: Vec::new(),
+            paren_token,
+            elems,
+        }))
+    }
+
+    fn pat_reference(input: ParseStream) -> Result<PatReference> {
+        Ok(PatReference {
+            attrs: Vec::new(),
+            and_token: input.parse()?,
+            mutability: input.parse()?,
+            pat: Box::new(Pat::parse_single(input)?),
+        })
+    }
+
+    fn pat_lit_or_range(input: ParseStream) -> Result<Pat> {
+        let start = input.call(pat_range_bound)?.unwrap();
+        if input.peek(Token![..]) {
+            let limits = RangeLimits::parse_obsolete(input)?;
+            let end = input.call(pat_range_bound)?;
+            if let (RangeLimits::Closed(_), None) = (&limits, &end) {
+                return Err(input.error("expected range upper bound"));
+            }
+            Ok(Pat::Range(ExprRange {
+                attrs: Vec::new(),
+                start: Some(start.into_expr()),
+                limits,
+                end: end.map(PatRangeBound::into_expr),
+            }))
+        } else {
+            Ok(start.into_pat())
+        }
+    }
+
+    // Patterns that can appear on either side of a range pattern.
+    enum PatRangeBound {
+        Const(ExprConst),
+        Lit(ExprLit),
+        Path(ExprPath),
+    }
+
+    impl PatRangeBound {
+        fn into_expr(self) -> Box<Expr> {
+            Box::new(match self {
+                PatRangeBound::Const(pat) => Expr::Const(pat),
+                PatRangeBound::Lit(pat) => Expr::Lit(pat),
+                PatRangeBound::Path(pat) => Expr::Path(pat),
+            })
+        }
+
+        fn into_pat(self) -> Pat {
+            match self {
+                PatRangeBound::Const(pat) => Pat::Const(pat),
+                PatRangeBound::Lit(pat) => Pat::Lit(pat),
+                PatRangeBound::Path(pat) => Pat::Path(pat),
+            }
+        }
+    }
+
+    fn pat_range_bound(input: ParseStream) -> Result<Option<PatRangeBound>> {
+        if input.is_empty()
+            || input.peek(Token![|])
+            || input.peek(Token![=])
+            || input.peek(Token![:]) && !input.peek(Token![::])
+            || input.peek(Token![,])
+            || input.peek(Token![;])
+            || input.peek(Token![if])
+        {
+            return Ok(None);
+        }
+
+        let lookahead = input.lookahead1();
+        let expr = if lookahead.peek(Lit) {
+            PatRangeBound::Lit(input.parse()?)
+        } else if lookahead.peek(Ident)
+            || lookahead.peek(Token![::])
+            || lookahead.peek(Token![<])
+            || lookahead.peek(Token![self])
+            || lookahead.peek(Token![Self])
+            || lookahead.peek(Token![super])
+            || lookahead.peek(Token![crate])
+        {
+            PatRangeBound::Path(input.parse()?)
+        } else if lookahead.peek(Token![const]) {
+            PatRangeBound::Const(input.parse()?)
+        } else {
+            return Err(lookahead.error());
+        };
+
+        Ok(Some(expr))
+    }
+
+    fn pat_slice(input: ParseStream) -> Result<PatSlice> {
+        let content;
+        let bracket_token = bracketed!(content in input);
+
+        let mut elems = Punctuated::new();
+        while !content.is_empty() {
+            let value = Pat::parse_multi_with_leading_vert(&content)?;
+            match value {
+                Pat::Range(pat) if pat.start.is_none() || pat.end.is_none() => {
+                    let (start, end) = match pat.limits {
+                        RangeLimits::HalfOpen(dot_dot) => (dot_dot.spans[0], dot_dot.spans[1]),
+                        RangeLimits::Closed(dot_dot_eq) => {
+                            (dot_dot_eq.spans[0], dot_dot_eq.spans[2])
+                        }
+                    };
+                    let msg = "range pattern is not allowed unparenthesized inside slice pattern";
+                    return Err(error::new2(start, end, msg));
+                }
+                _ => {}
+            }
+            elems.push_value(value);
+            if content.is_empty() {
+                break;
+            }
+            let punct = content.parse()?;
+            elems.push_punct(punct);
+        }
+
+        Ok(PatSlice {
+            attrs: Vec::new(),
+            bracket_token,
+            elems,
+        })
+    }
+
+    fn pat_const(input: ParseStream) -> Result<TokenStream> {
+        let begin = input.fork();
+        input.parse::<Token![const]>()?;
+
+        let content;
+        braced!(content in input);
+        content.call(Attribute::parse_inner)?;
+        content.call(Block::parse_within)?;
+
+        Ok(verbatim::between(&begin, input))
+    }
+}
+
+#[cfg(feature = "printing")]
+mod printing {
+    use crate::attr::FilterAttrs;
+    use crate::pat::{
+        FieldPat, Pat, PatIdent, PatOr, PatParen, PatReference, PatRest, PatSlice, PatStruct,
+        PatTuple, PatTupleStruct, PatType, PatWild,
+    };
+    use crate::path;
+    use proc_macro2::TokenStream;
+    use quote::{ToTokens, TokenStreamExt};
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for PatIdent {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            self.by_ref.to_tokens(tokens);
+            self.mutability.to_tokens(tokens);
+            self.ident.to_tokens(tokens);
+            if let Some((at_token, subpat)) = &self.subpat {
+                at_token.to_tokens(tokens);
+                subpat.to_tokens(tokens);
+            }
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for PatOr {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            self.leading_vert.to_tokens(tokens);
+            self.cases.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for PatParen {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            self.paren_token.surround(tokens, |tokens| {
+                self.pat.to_tokens(tokens);
+            });
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for PatReference {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            self.and_token.to_tokens(tokens);
+            self.mutability.to_tokens(tokens);
+            self.pat.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for PatRest {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            self.dot2_token.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for PatSlice {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            self.bracket_token.surround(tokens, |tokens| {
+                self.elems.to_tokens(tokens);
+            });
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for PatStruct {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            path::printing::print_path(tokens, &self.qself, &self.path);
+            self.brace_token.surround(tokens, |tokens| {
+                self.fields.to_tokens(tokens);
+                // NOTE: We need a comma before the dot2 token if it is present.
+                if !self.fields.empty_or_trailing() && self.rest.is_some() {
+                    <Token![,]>::default().to_tokens(tokens);
+                }
+                self.rest.to_tokens(tokens);
+            });
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for PatTuple {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            self.paren_token.surround(tokens, |tokens| {
+                self.elems.to_tokens(tokens);
+                // If there is only one element, a trailing comma is needed to
+                // distinguish PatTuple from PatParen, unless this is `(..)`
+                // which is a tuple pattern even without comma.
+                if self.elems.len() == 1
+                    && !self.elems.trailing_punct()
+                    && !matches!(self.elems[0], Pat::Rest { .. })
+                {
+                    <Token![,]>::default().to_tokens(tokens);
+                }
+            });
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for PatTupleStruct {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            path::printing::print_path(tokens, &self.qself, &self.path);
+            self.paren_token.surround(tokens, |tokens| {
+                self.elems.to_tokens(tokens);
+            });
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for PatType {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            self.pat.to_tokens(tokens);
+            self.colon_token.to_tokens(tokens);
+            self.ty.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for PatWild {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            self.underscore_token.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for FieldPat {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            if let Some(colon_token) = &self.colon_token {
+                self.member.to_tokens(tokens);
+                colon_token.to_tokens(tokens);
+            }
+            self.pat.to_tokens(tokens);
+        }
+    }
+}
+
\ No newline at end of file diff --git a/src/syn/path.rs.html b/src/syn/path.rs.html new file mode 100644 index 0000000..8da42da --- /dev/null +++ b/src/syn/path.rs.html @@ -0,0 +1,1815 @@ +path.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+753
+754
+755
+756
+757
+758
+759
+760
+761
+762
+763
+764
+765
+766
+767
+768
+769
+770
+771
+772
+773
+774
+775
+776
+777
+778
+779
+780
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+794
+795
+796
+797
+798
+799
+800
+801
+802
+803
+804
+805
+806
+807
+808
+809
+810
+811
+812
+813
+814
+815
+816
+817
+818
+819
+820
+821
+822
+823
+824
+825
+826
+827
+828
+829
+830
+831
+832
+833
+834
+835
+836
+837
+838
+839
+840
+841
+842
+843
+844
+845
+846
+847
+848
+849
+850
+851
+852
+853
+854
+855
+856
+857
+858
+859
+860
+861
+862
+863
+864
+865
+866
+867
+868
+869
+870
+871
+872
+873
+874
+875
+876
+877
+878
+879
+880
+881
+882
+883
+884
+885
+886
+887
+888
+889
+890
+891
+892
+893
+894
+895
+896
+897
+898
+899
+900
+901
+902
+903
+904
+905
+906
+907
+
#[cfg(feature = "parsing")]
+use crate::error::Result;
+use crate::expr::Expr;
+use crate::generics::TypeParamBound;
+use crate::ident::Ident;
+use crate::lifetime::Lifetime;
+use crate::punctuated::Punctuated;
+use crate::token;
+use crate::ty::{ReturnType, Type};
+
+ast_struct! {
+    /// A path at which a named item is exported (e.g. `std::collections::HashMap`).
+    #[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct Path {
+        pub leading_colon: Option<Token![::]>,
+        pub segments: Punctuated<PathSegment, Token![::]>,
+    }
+}
+
+impl<T> From<T> for Path
+where
+    T: Into<PathSegment>,
+{
+    fn from(segment: T) -> Self {
+        let mut path = Path {
+            leading_colon: None,
+            segments: Punctuated::new(),
+        };
+        path.segments.push_value(segment.into());
+        path
+    }
+}
+
+impl Path {
+    /// Determines whether this is a path of length 1 equal to the given
+    /// ident.
+    ///
+    /// For them to compare equal, it must be the case that:
+    ///
+    /// - the path has no leading colon,
+    /// - the number of path segments is 1,
+    /// - the first path segment has no angle bracketed or parenthesized
+    ///   path arguments, and
+    /// - the ident of the first path segment is equal to the given one.
+    ///
+    /// # Example
+    ///
+    /// ```
+    /// use proc_macro2::TokenStream;
+    /// use syn::{Attribute, Error, Meta, Result};
+    ///
+    /// fn get_serde_meta_item(attr: &Attribute) -> Result<Option<&TokenStream>> {
+    ///     if attr.path().is_ident("serde") {
+    ///         match &attr.meta {
+    ///             Meta::List(meta) => Ok(Some(&meta.tokens)),
+    ///             bad => Err(Error::new_spanned(bad, "unrecognized attribute")),
+    ///         }
+    ///     } else {
+    ///         Ok(None)
+    ///     }
+    /// }
+    /// ```
+    pub fn is_ident<I>(&self, ident: &I) -> bool
+    where
+        I: ?Sized,
+        Ident: PartialEq<I>,
+    {
+        match self.get_ident() {
+            Some(id) => id == ident,
+            None => false,
+        }
+    }
+
+    /// If this path consists of a single ident, returns the ident.
+    ///
+    /// A path is considered an ident if:
+    ///
+    /// - the path has no leading colon,
+    /// - the number of path segments is 1, and
+    /// - the first path segment has no angle bracketed or parenthesized
+    ///   path arguments.
+    pub fn get_ident(&self) -> Option<&Ident> {
+        if self.leading_colon.is_none()
+            && self.segments.len() == 1
+            && self.segments[0].arguments.is_none()
+        {
+            Some(&self.segments[0].ident)
+        } else {
+            None
+        }
+    }
+
+    /// An error if this path is not a single ident, as defined in `get_ident`.
+    #[cfg(feature = "parsing")]
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    pub fn require_ident(&self) -> Result<&Ident> {
+        self.get_ident().ok_or_else(|| {
+            crate::error::new2(
+                self.segments.first().unwrap().ident.span(),
+                self.segments.last().unwrap().ident.span(),
+                "expected this path to be an identifier",
+            )
+        })
+    }
+}
+
+ast_struct! {
+    /// A segment of a path together with any path arguments on that segment.
+    #[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct PathSegment {
+        pub ident: Ident,
+        pub arguments: PathArguments,
+    }
+}
+
+impl<T> From<T> for PathSegment
+where
+    T: Into<Ident>,
+{
+    fn from(ident: T) -> Self {
+        PathSegment {
+            ident: ident.into(),
+            arguments: PathArguments::None,
+        }
+    }
+}
+
+ast_enum! {
+    /// Angle bracketed or parenthesized arguments of a path segment.
+    ///
+    /// ## Angle bracketed
+    ///
+    /// The `<'a, T>` in `std::slice::iter<'a, T>`.
+    ///
+    /// ## Parenthesized
+    ///
+    /// The `(A, B) -> C` in `Fn(A, B) -> C`.
+    #[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub enum PathArguments {
+        None,
+        /// The `<'a, T>` in `std::slice::iter<'a, T>`.
+        AngleBracketed(AngleBracketedGenericArguments),
+        /// The `(A, B) -> C` in `Fn(A, B) -> C`.
+        Parenthesized(ParenthesizedGenericArguments),
+    }
+}
+
+impl Default for PathArguments {
+    fn default() -> Self {
+        PathArguments::None
+    }
+}
+
+impl PathArguments {
+    pub fn is_empty(&self) -> bool {
+        match self {
+            PathArguments::None => true,
+            PathArguments::AngleBracketed(bracketed) => bracketed.args.is_empty(),
+            PathArguments::Parenthesized(_) => false,
+        }
+    }
+
+    pub fn is_none(&self) -> bool {
+        match self {
+            PathArguments::None => true,
+            PathArguments::AngleBracketed(_) | PathArguments::Parenthesized(_) => false,
+        }
+    }
+}
+
+ast_enum! {
+    /// An individual generic argument, like `'a`, `T`, or `Item = T`.
+    #[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
+    #[non_exhaustive]
+    pub enum GenericArgument {
+        /// A lifetime argument.
+        Lifetime(Lifetime),
+        /// A type argument.
+        Type(Type),
+        /// A const expression. Must be inside of a block.
+        ///
+        /// NOTE: Identity expressions are represented as Type arguments, as
+        /// they are indistinguishable syntactically.
+        Const(Expr),
+        /// A binding (equality constraint) on an associated type: the `Item =
+        /// u8` in `Iterator<Item = u8>`.
+        AssocType(AssocType),
+        /// An equality constraint on an associated constant: the `PANIC =
+        /// false` in `Trait<PANIC = false>`.
+        AssocConst(AssocConst),
+        /// An associated type bound: `Iterator<Item: Display>`.
+        Constraint(Constraint),
+    }
+}
+
+ast_struct! {
+    /// Angle bracketed arguments of a path segment: the `<K, V>` in `HashMap<K,
+    /// V>`.
+    #[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct AngleBracketedGenericArguments {
+        pub colon2_token: Option<Token![::]>,
+        pub lt_token: Token![<],
+        pub args: Punctuated<GenericArgument, Token![,]>,
+        pub gt_token: Token![>],
+    }
+}
+
+ast_struct! {
+    /// A binding (equality constraint) on an associated type: the `Item = u8`
+    /// in `Iterator<Item = u8>`.
+    #[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct AssocType {
+        pub ident: Ident,
+        pub generics: Option<AngleBracketedGenericArguments>,
+        pub eq_token: Token![=],
+        pub ty: Type,
+    }
+}
+
+ast_struct! {
+    /// An equality constraint on an associated constant: the `PANIC = false` in
+    /// `Trait<PANIC = false>`.
+    #[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct AssocConst {
+        pub ident: Ident,
+        pub generics: Option<AngleBracketedGenericArguments>,
+        pub eq_token: Token![=],
+        pub value: Expr,
+    }
+}
+
+ast_struct! {
+    /// An associated type bound: `Iterator<Item: Display>`.
+    #[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct Constraint {
+        pub ident: Ident,
+        pub generics: Option<AngleBracketedGenericArguments>,
+        pub colon_token: Token![:],
+        pub bounds: Punctuated<TypeParamBound, Token![+]>,
+    }
+}
+
+ast_struct! {
+    /// Arguments of a function path segment: the `(A, B) -> C` in `Fn(A,B) ->
+    /// C`.
+    #[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct ParenthesizedGenericArguments {
+        pub paren_token: token::Paren,
+        /// `(A, B)`
+        pub inputs: Punctuated<Type, Token![,]>,
+        /// `C`
+        pub output: ReturnType,
+    }
+}
+
+ast_struct! {
+    /// The explicit Self type in a qualified path: the `T` in `<T as
+    /// Display>::fmt`.
+    ///
+    /// The actual path, including the trait and the associated item, is stored
+    /// separately. The `position` field represents the index of the associated
+    /// item qualified with this Self type.
+    ///
+    /// ```text
+    /// <Vec<T> as a::b::Trait>::AssociatedItem
+    ///  ^~~~~~    ~~~~~~~~~~~~~~^
+    ///  ty        position = 3
+    ///
+    /// <Vec<T>>::AssociatedItem
+    ///  ^~~~~~   ^
+    ///  ty       position = 0
+    /// ```
+    #[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct QSelf {
+        pub lt_token: Token![<],
+        pub ty: Box<Type>,
+        pub position: usize,
+        pub as_token: Option<Token![as]>,
+        pub gt_token: Token![>],
+    }
+}
+
+#[cfg(feature = "parsing")]
+pub(crate) mod parsing {
+    use crate::error::Result;
+    #[cfg(feature = "full")]
+    use crate::expr::ExprBlock;
+    use crate::expr::{Expr, ExprPath};
+    use crate::ext::IdentExt as _;
+    #[cfg(feature = "full")]
+    use crate::generics::TypeParamBound;
+    use crate::ident::Ident;
+    use crate::lifetime::Lifetime;
+    use crate::lit::Lit;
+    use crate::parse::{Parse, ParseStream};
+    #[cfg(feature = "full")]
+    use crate::path::Constraint;
+    use crate::path::{
+        AngleBracketedGenericArguments, AssocConst, AssocType, GenericArgument,
+        ParenthesizedGenericArguments, Path, PathArguments, PathSegment, QSelf,
+    };
+    use crate::punctuated::Punctuated;
+    use crate::token;
+    use crate::ty::{ReturnType, Type};
+    #[cfg(not(feature = "full"))]
+    use crate::verbatim;
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for Path {
+        fn parse(input: ParseStream) -> Result<Self> {
+            Self::parse_helper(input, false)
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for GenericArgument {
+        fn parse(input: ParseStream) -> Result<Self> {
+            if input.peek(Lifetime) && !input.peek2(Token![+]) {
+                return Ok(GenericArgument::Lifetime(input.parse()?));
+            }
+
+            if input.peek(Lit) || input.peek(token::Brace) {
+                return const_argument(input).map(GenericArgument::Const);
+            }
+
+            let mut argument: Type = input.parse()?;
+
+            match argument {
+                Type::Path(mut ty)
+                    if ty.qself.is_none()
+                        && ty.path.leading_colon.is_none()
+                        && ty.path.segments.len() == 1
+                        && match &ty.path.segments[0].arguments {
+                            PathArguments::None | PathArguments::AngleBracketed(_) => true,
+                            PathArguments::Parenthesized(_) => false,
+                        } =>
+                {
+                    if let Some(eq_token) = input.parse::<Option<Token![=]>>()? {
+                        let segment = ty.path.segments.pop().unwrap().into_value();
+                        let ident = segment.ident;
+                        let generics = match segment.arguments {
+                            PathArguments::None => None,
+                            PathArguments::AngleBracketed(arguments) => Some(arguments),
+                            PathArguments::Parenthesized(_) => unreachable!(),
+                        };
+                        return if input.peek(Lit) || input.peek(token::Brace) {
+                            Ok(GenericArgument::AssocConst(AssocConst {
+                                ident,
+                                generics,
+                                eq_token,
+                                value: const_argument(input)?,
+                            }))
+                        } else {
+                            Ok(GenericArgument::AssocType(AssocType {
+                                ident,
+                                generics,
+                                eq_token,
+                                ty: input.parse()?,
+                            }))
+                        };
+                    }
+
+                    #[cfg(feature = "full")]
+                    if let Some(colon_token) = input.parse::<Option<Token![:]>>()? {
+                        let segment = ty.path.segments.pop().unwrap().into_value();
+                        return Ok(GenericArgument::Constraint(Constraint {
+                            ident: segment.ident,
+                            generics: match segment.arguments {
+                                PathArguments::None => None,
+                                PathArguments::AngleBracketed(arguments) => Some(arguments),
+                                PathArguments::Parenthesized(_) => unreachable!(),
+                            },
+                            colon_token,
+                            bounds: {
+                                let mut bounds = Punctuated::new();
+                                loop {
+                                    if input.peek(Token![,]) || input.peek(Token![>]) {
+                                        break;
+                                    }
+                                    let value: TypeParamBound = input.parse()?;
+                                    bounds.push_value(value);
+                                    if !input.peek(Token![+]) {
+                                        break;
+                                    }
+                                    let punct: Token![+] = input.parse()?;
+                                    bounds.push_punct(punct);
+                                }
+                                bounds
+                            },
+                        }));
+                    }
+
+                    argument = Type::Path(ty);
+                }
+                _ => {}
+            }
+
+            Ok(GenericArgument::Type(argument))
+        }
+    }
+
+    pub(crate) fn const_argument(input: ParseStream) -> Result<Expr> {
+        let lookahead = input.lookahead1();
+
+        if input.peek(Lit) {
+            let lit = input.parse()?;
+            return Ok(Expr::Lit(lit));
+        }
+
+        if input.peek(Ident) {
+            let ident: Ident = input.parse()?;
+            return Ok(Expr::Path(ExprPath {
+                attrs: Vec::new(),
+                qself: None,
+                path: Path::from(ident),
+            }));
+        }
+
+        if input.peek(token::Brace) {
+            #[cfg(feature = "full")]
+            {
+                let block: ExprBlock = input.parse()?;
+                return Ok(Expr::Block(block));
+            }
+
+            #[cfg(not(feature = "full"))]
+            {
+                let begin = input.fork();
+                let content;
+                braced!(content in input);
+                content.parse::<Expr>()?;
+                let verbatim = verbatim::between(&begin, input);
+                return Ok(Expr::Verbatim(verbatim));
+            }
+        }
+
+        Err(lookahead.error())
+    }
+
+    impl AngleBracketedGenericArguments {
+        /// Parse `::<…>` with mandatory leading `::`.
+        ///
+        /// The ordinary [`Parse`] impl for `AngleBracketedGenericArguments`
+        /// parses optional leading `::`.
+        #[cfg(feature = "full")]
+        #[cfg_attr(doc_cfg, doc(cfg(all(feature = "parsing", feature = "full"))))]
+        pub fn parse_turbofish(input: ParseStream) -> Result<Self> {
+            let colon2_token: Token![::] = input.parse()?;
+            Self::do_parse(Some(colon2_token), input)
+        }
+
+        pub(crate) fn do_parse(
+            colon2_token: Option<Token![::]>,
+            input: ParseStream,
+        ) -> Result<Self> {
+            Ok(AngleBracketedGenericArguments {
+                colon2_token,
+                lt_token: input.parse()?,
+                args: {
+                    let mut args = Punctuated::new();
+                    loop {
+                        if input.peek(Token![>]) {
+                            break;
+                        }
+                        let value: GenericArgument = input.parse()?;
+                        args.push_value(value);
+                        if input.peek(Token![>]) {
+                            break;
+                        }
+                        let punct: Token![,] = input.parse()?;
+                        args.push_punct(punct);
+                    }
+                    args
+                },
+                gt_token: input.parse()?,
+            })
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for AngleBracketedGenericArguments {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let colon2_token: Option<Token![::]> = input.parse()?;
+            Self::do_parse(colon2_token, input)
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for ParenthesizedGenericArguments {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let content;
+            Ok(ParenthesizedGenericArguments {
+                paren_token: parenthesized!(content in input),
+                inputs: content.parse_terminated(Type::parse, Token![,])?,
+                output: input.call(ReturnType::without_plus)?,
+            })
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for PathSegment {
+        fn parse(input: ParseStream) -> Result<Self> {
+            Self::parse_helper(input, false)
+        }
+    }
+
+    impl PathSegment {
+        fn parse_helper(input: ParseStream, expr_style: bool) -> Result<Self> {
+            if input.peek(Token![super])
+                || input.peek(Token![self])
+                || input.peek(Token![crate])
+                || cfg!(feature = "full") && input.peek(Token![try])
+            {
+                let ident = input.call(Ident::parse_any)?;
+                return Ok(PathSegment::from(ident));
+            }
+
+            let ident = if input.peek(Token![Self]) {
+                input.call(Ident::parse_any)?
+            } else {
+                input.parse()?
+            };
+
+            if !expr_style && input.peek(Token![<]) && !input.peek(Token![<=])
+                || input.peek(Token![::]) && input.peek3(Token![<])
+            {
+                Ok(PathSegment {
+                    ident,
+                    arguments: PathArguments::AngleBracketed(input.parse()?),
+                })
+            } else {
+                Ok(PathSegment::from(ident))
+            }
+        }
+    }
+
+    impl Path {
+        /// Parse a `Path` containing no path arguments on any of its segments.
+        ///
+        /// # Example
+        ///
+        /// ```
+        /// use syn::{Path, Result, Token};
+        /// use syn::parse::{Parse, ParseStream};
+        ///
+        /// // A simplified single `use` statement like:
+        /// //
+        /// //     use std::collections::HashMap;
+        /// //
+        /// // Note that generic parameters are not allowed in a `use` statement
+        /// // so the following must not be accepted.
+        /// //
+        /// //     use a::<b>::c;
+        /// struct SingleUse {
+        ///     use_token: Token![use],
+        ///     path: Path,
+        /// }
+        ///
+        /// impl Parse for SingleUse {
+        ///     fn parse(input: ParseStream) -> Result<Self> {
+        ///         Ok(SingleUse {
+        ///             use_token: input.parse()?,
+        ///             path: input.call(Path::parse_mod_style)?,
+        ///         })
+        ///     }
+        /// }
+        /// ```
+        #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+        pub fn parse_mod_style(input: ParseStream) -> Result<Self> {
+            Ok(Path {
+                leading_colon: input.parse()?,
+                segments: {
+                    let mut segments = Punctuated::new();
+                    loop {
+                        if !input.peek(Ident)
+                            && !input.peek(Token![super])
+                            && !input.peek(Token![self])
+                            && !input.peek(Token![Self])
+                            && !input.peek(Token![crate])
+                        {
+                            break;
+                        }
+                        let ident = Ident::parse_any(input)?;
+                        segments.push_value(PathSegment::from(ident));
+                        if !input.peek(Token![::]) {
+                            break;
+                        }
+                        let punct = input.parse()?;
+                        segments.push_punct(punct);
+                    }
+                    if segments.is_empty() {
+                        return Err(input.parse::<Ident>().unwrap_err());
+                    } else if segments.trailing_punct() {
+                        return Err(input.error("expected path segment after `::`"));
+                    }
+                    segments
+                },
+            })
+        }
+
+        pub(crate) fn parse_helper(input: ParseStream, expr_style: bool) -> Result<Self> {
+            let mut path = Path {
+                leading_colon: input.parse()?,
+                segments: {
+                    let mut segments = Punctuated::new();
+                    let value = PathSegment::parse_helper(input, expr_style)?;
+                    segments.push_value(value);
+                    segments
+                },
+            };
+            Path::parse_rest(input, &mut path, expr_style)?;
+            Ok(path)
+        }
+
+        pub(crate) fn parse_rest(
+            input: ParseStream,
+            path: &mut Self,
+            expr_style: bool,
+        ) -> Result<()> {
+            while input.peek(Token![::]) && !input.peek3(token::Paren) {
+                let punct: Token![::] = input.parse()?;
+                path.segments.push_punct(punct);
+                let value = PathSegment::parse_helper(input, expr_style)?;
+                path.segments.push_value(value);
+            }
+            Ok(())
+        }
+
+        pub(crate) fn is_mod_style(&self) -> bool {
+            self.segments
+                .iter()
+                .all(|segment| segment.arguments.is_none())
+        }
+    }
+
+    pub(crate) fn qpath(input: ParseStream, expr_style: bool) -> Result<(Option<QSelf>, Path)> {
+        if input.peek(Token![<]) {
+            let lt_token: Token![<] = input.parse()?;
+            let this: Type = input.parse()?;
+            let path = if input.peek(Token![as]) {
+                let as_token: Token![as] = input.parse()?;
+                let path: Path = input.parse()?;
+                Some((as_token, path))
+            } else {
+                None
+            };
+            let gt_token: Token![>] = input.parse()?;
+            let colon2_token: Token![::] = input.parse()?;
+            let mut rest = Punctuated::new();
+            loop {
+                let path = PathSegment::parse_helper(input, expr_style)?;
+                rest.push_value(path);
+                if !input.peek(Token![::]) {
+                    break;
+                }
+                let punct: Token![::] = input.parse()?;
+                rest.push_punct(punct);
+            }
+            let (position, as_token, path) = match path {
+                Some((as_token, mut path)) => {
+                    let pos = path.segments.len();
+                    path.segments.push_punct(colon2_token);
+                    path.segments.extend(rest.into_pairs());
+                    (pos, Some(as_token), path)
+                }
+                None => {
+                    let path = Path {
+                        leading_colon: Some(colon2_token),
+                        segments: rest,
+                    };
+                    (0, None, path)
+                }
+            };
+            let qself = QSelf {
+                lt_token,
+                ty: Box::new(this),
+                position,
+                as_token,
+                gt_token,
+            };
+            Ok((Some(qself), path))
+        } else {
+            let path = Path::parse_helper(input, expr_style)?;
+            Ok((None, path))
+        }
+    }
+}
+
+#[cfg(feature = "printing")]
+pub(crate) mod printing {
+    use crate::expr::Expr;
+    use crate::path::{
+        AngleBracketedGenericArguments, AssocConst, AssocType, Constraint, GenericArgument,
+        ParenthesizedGenericArguments, Path, PathArguments, PathSegment, QSelf,
+    };
+    use crate::print::TokensOrDefault;
+    #[cfg(feature = "parsing")]
+    use crate::spanned::Spanned;
+    use crate::token;
+    #[cfg(feature = "parsing")]
+    use proc_macro2::Span;
+    use proc_macro2::TokenStream;
+    use quote::ToTokens;
+    use std::cmp;
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for Path {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.leading_colon.to_tokens(tokens);
+            self.segments.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for PathSegment {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.ident.to_tokens(tokens);
+            self.arguments.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for PathArguments {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            match self {
+                PathArguments::None => {}
+                PathArguments::AngleBracketed(arguments) => {
+                    arguments.to_tokens(tokens);
+                }
+                PathArguments::Parenthesized(arguments) => {
+                    arguments.to_tokens(tokens);
+                }
+            }
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for GenericArgument {
+        #[allow(clippy::match_same_arms)]
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            match self {
+                GenericArgument::Lifetime(lt) => lt.to_tokens(tokens),
+                GenericArgument::Type(ty) => ty.to_tokens(tokens),
+                GenericArgument::Const(expr) => match expr {
+                    Expr::Lit(expr) => expr.to_tokens(tokens),
+
+                    Expr::Path(expr)
+                        if expr.attrs.is_empty()
+                            && expr.qself.is_none()
+                            && expr.path.get_ident().is_some() =>
+                    {
+                        expr.to_tokens(tokens);
+                    }
+
+                    #[cfg(feature = "full")]
+                    Expr::Block(expr) => expr.to_tokens(tokens),
+
+                    #[cfg(not(feature = "full"))]
+                    Expr::Verbatim(expr) => expr.to_tokens(tokens),
+
+                    // ERROR CORRECTION: Add braces to make sure that the
+                    // generated code is valid.
+                    _ => token::Brace::default().surround(tokens, |tokens| {
+                        expr.to_tokens(tokens);
+                    }),
+                },
+                GenericArgument::AssocType(assoc) => assoc.to_tokens(tokens),
+                GenericArgument::AssocConst(assoc) => assoc.to_tokens(tokens),
+                GenericArgument::Constraint(constraint) => constraint.to_tokens(tokens),
+            }
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for AngleBracketedGenericArguments {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.colon2_token.to_tokens(tokens);
+            self.lt_token.to_tokens(tokens);
+
+            // Print lifetimes before types/consts/bindings, regardless of their
+            // order in self.args.
+            let mut trailing_or_empty = true;
+            for param in self.args.pairs() {
+                match param.value() {
+                    GenericArgument::Lifetime(_) => {
+                        param.to_tokens(tokens);
+                        trailing_or_empty = param.punct().is_some();
+                    }
+                    GenericArgument::Type(_)
+                    | GenericArgument::Const(_)
+                    | GenericArgument::AssocType(_)
+                    | GenericArgument::AssocConst(_)
+                    | GenericArgument::Constraint(_) => {}
+                }
+            }
+            for param in self.args.pairs() {
+                match param.value() {
+                    GenericArgument::Type(_)
+                    | GenericArgument::Const(_)
+                    | GenericArgument::AssocType(_)
+                    | GenericArgument::AssocConst(_)
+                    | GenericArgument::Constraint(_) => {
+                        if !trailing_or_empty {
+                            <Token![,]>::default().to_tokens(tokens);
+                        }
+                        param.to_tokens(tokens);
+                        trailing_or_empty = param.punct().is_some();
+                    }
+                    GenericArgument::Lifetime(_) => {}
+                }
+            }
+
+            self.gt_token.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for AssocType {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.ident.to_tokens(tokens);
+            self.generics.to_tokens(tokens);
+            self.eq_token.to_tokens(tokens);
+            self.ty.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for AssocConst {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.ident.to_tokens(tokens);
+            self.generics.to_tokens(tokens);
+            self.eq_token.to_tokens(tokens);
+            self.value.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for Constraint {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.ident.to_tokens(tokens);
+            self.generics.to_tokens(tokens);
+            self.colon_token.to_tokens(tokens);
+            self.bounds.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for ParenthesizedGenericArguments {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.paren_token.surround(tokens, |tokens| {
+                self.inputs.to_tokens(tokens);
+            });
+            self.output.to_tokens(tokens);
+        }
+    }
+
+    pub(crate) fn print_path(tokens: &mut TokenStream, qself: &Option<QSelf>, path: &Path) {
+        let qself = match qself {
+            Some(qself) => qself,
+            None => {
+                path.to_tokens(tokens);
+                return;
+            }
+        };
+        qself.lt_token.to_tokens(tokens);
+        qself.ty.to_tokens(tokens);
+
+        let pos = cmp::min(qself.position, path.segments.len());
+        let mut segments = path.segments.pairs();
+        if pos > 0 {
+            TokensOrDefault(&qself.as_token).to_tokens(tokens);
+            path.leading_colon.to_tokens(tokens);
+            for (i, segment) in segments.by_ref().take(pos).enumerate() {
+                if i + 1 == pos {
+                    segment.value().to_tokens(tokens);
+                    qself.gt_token.to_tokens(tokens);
+                    segment.punct().to_tokens(tokens);
+                } else {
+                    segment.to_tokens(tokens);
+                }
+            }
+        } else {
+            qself.gt_token.to_tokens(tokens);
+            path.leading_colon.to_tokens(tokens);
+        }
+        for segment in segments {
+            segment.to_tokens(tokens);
+        }
+    }
+
+    #[cfg(feature = "parsing")]
+    #[cfg_attr(doc_cfg, doc(cfg(all(feature = "parsing", feature = "printing"))))]
+    impl Spanned for QSelf {
+        fn span(&self) -> Span {
+            struct QSelfDelimiters<'a>(&'a QSelf);
+
+            impl<'a> ToTokens for QSelfDelimiters<'a> {
+                fn to_tokens(&self, tokens: &mut TokenStream) {
+                    self.0.lt_token.to_tokens(tokens);
+                    self.0.gt_token.to_tokens(tokens);
+                }
+            }
+
+            QSelfDelimiters(self).span()
+        }
+    }
+}
+
\ No newline at end of file diff --git a/src/syn/print.rs.html b/src/syn/print.rs.html new file mode 100644 index 0000000..5a94d44 --- /dev/null +++ b/src/syn/print.rs.html @@ -0,0 +1,33 @@ +print.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+
use proc_macro2::TokenStream;
+use quote::ToTokens;
+
+pub(crate) struct TokensOrDefault<'a, T: 'a>(pub &'a Option<T>);
+
+impl<'a, T> ToTokens for TokensOrDefault<'a, T>
+where
+    T: ToTokens + Default,
+{
+    fn to_tokens(&self, tokens: &mut TokenStream) {
+        match self.0 {
+            Some(t) => t.to_tokens(tokens),
+            None => T::default().to_tokens(tokens),
+        }
+    }
+}
+
\ No newline at end of file diff --git a/src/syn/punctuated.rs.html b/src/syn/punctuated.rs.html new file mode 100644 index 0000000..dd30c4f --- /dev/null +++ b/src/syn/punctuated.rs.html @@ -0,0 +1,2219 @@ +punctuated.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+753
+754
+755
+756
+757
+758
+759
+760
+761
+762
+763
+764
+765
+766
+767
+768
+769
+770
+771
+772
+773
+774
+775
+776
+777
+778
+779
+780
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+794
+795
+796
+797
+798
+799
+800
+801
+802
+803
+804
+805
+806
+807
+808
+809
+810
+811
+812
+813
+814
+815
+816
+817
+818
+819
+820
+821
+822
+823
+824
+825
+826
+827
+828
+829
+830
+831
+832
+833
+834
+835
+836
+837
+838
+839
+840
+841
+842
+843
+844
+845
+846
+847
+848
+849
+850
+851
+852
+853
+854
+855
+856
+857
+858
+859
+860
+861
+862
+863
+864
+865
+866
+867
+868
+869
+870
+871
+872
+873
+874
+875
+876
+877
+878
+879
+880
+881
+882
+883
+884
+885
+886
+887
+888
+889
+890
+891
+892
+893
+894
+895
+896
+897
+898
+899
+900
+901
+902
+903
+904
+905
+906
+907
+908
+909
+910
+911
+912
+913
+914
+915
+916
+917
+918
+919
+920
+921
+922
+923
+924
+925
+926
+927
+928
+929
+930
+931
+932
+933
+934
+935
+936
+937
+938
+939
+940
+941
+942
+943
+944
+945
+946
+947
+948
+949
+950
+951
+952
+953
+954
+955
+956
+957
+958
+959
+960
+961
+962
+963
+964
+965
+966
+967
+968
+969
+970
+971
+972
+973
+974
+975
+976
+977
+978
+979
+980
+981
+982
+983
+984
+985
+986
+987
+988
+989
+990
+991
+992
+993
+994
+995
+996
+997
+998
+999
+1000
+1001
+1002
+1003
+1004
+1005
+1006
+1007
+1008
+1009
+1010
+1011
+1012
+1013
+1014
+1015
+1016
+1017
+1018
+1019
+1020
+1021
+1022
+1023
+1024
+1025
+1026
+1027
+1028
+1029
+1030
+1031
+1032
+1033
+1034
+1035
+1036
+1037
+1038
+1039
+1040
+1041
+1042
+1043
+1044
+1045
+1046
+1047
+1048
+1049
+1050
+1051
+1052
+1053
+1054
+1055
+1056
+1057
+1058
+1059
+1060
+1061
+1062
+1063
+1064
+1065
+1066
+1067
+1068
+1069
+1070
+1071
+1072
+1073
+1074
+1075
+1076
+1077
+1078
+1079
+1080
+1081
+1082
+1083
+1084
+1085
+1086
+1087
+1088
+1089
+1090
+1091
+1092
+1093
+1094
+1095
+1096
+1097
+1098
+1099
+1100
+1101
+1102
+1103
+1104
+1105
+1106
+1107
+1108
+1109
+
//! A punctuated sequence of syntax tree nodes separated by punctuation.
+//!
+//! Lots of things in Rust are punctuated sequences.
+//!
+//! - The fields of a struct are `Punctuated<Field, Token![,]>`.
+//! - The segments of a path are `Punctuated<PathSegment, Token![::]>`.
+//! - The bounds on a generic parameter are `Punctuated<TypeParamBound,
+//!   Token![+]>`.
+//! - The arguments to a function call are `Punctuated<Expr, Token![,]>`.
+//!
+//! This module provides a common representation for these punctuated sequences
+//! in the form of the [`Punctuated<T, P>`] type. We store a vector of pairs of
+//! syntax tree node + punctuation, where every node in the sequence is followed
+//! by punctuation except for possibly the final one.
+//!
+//! [`Punctuated<T, P>`]: Punctuated
+//!
+//! ```text
+//! a_function_call(arg1, arg2, arg3);
+//!                 ~~~~^ ~~~~^ ~~~~
+//! ```
+
+use crate::drops::{NoDrop, TrivialDrop};
+#[cfg(feature = "parsing")]
+use crate::error::Result;
+#[cfg(feature = "parsing")]
+use crate::parse::{Parse, ParseStream};
+#[cfg(feature = "parsing")]
+use crate::token::Token;
+#[cfg(feature = "extra-traits")]
+use std::fmt::{self, Debug};
+#[cfg(feature = "extra-traits")]
+use std::hash::{Hash, Hasher};
+#[cfg(any(feature = "full", feature = "derive"))]
+use std::iter;
+use std::ops::{Index, IndexMut};
+use std::option;
+use std::slice;
+use std::vec;
+
+/// **A punctuated sequence of syntax tree nodes of type `T` separated by
+/// punctuation of type `P`.**
+///
+/// Refer to the [module documentation] for details about punctuated sequences.
+///
+/// [module documentation]: self
+pub struct Punctuated<T, P> {
+    inner: Vec<(T, P)>,
+    last: Option<Box<T>>,
+}
+
+impl<T, P> Punctuated<T, P> {
+    /// Creates an empty punctuated sequence.
+    pub const fn new() -> Self {
+        Punctuated {
+            inner: Vec::new(),
+            last: None,
+        }
+    }
+
+    /// Determines whether this punctuated sequence is empty, meaning it
+    /// contains no syntax tree nodes or punctuation.
+    pub fn is_empty(&self) -> bool {
+        self.inner.len() == 0 && self.last.is_none()
+    }
+
+    /// Returns the number of syntax tree nodes in this punctuated sequence.
+    ///
+    /// This is the number of nodes of type `T`, not counting the punctuation of
+    /// type `P`.
+    pub fn len(&self) -> usize {
+        self.inner.len() + if self.last.is_some() { 1 } else { 0 }
+    }
+
+    /// Borrows the first element in this sequence.
+    pub fn first(&self) -> Option<&T> {
+        self.iter().next()
+    }
+
+    /// Mutably borrows the first element in this sequence.
+    pub fn first_mut(&mut self) -> Option<&mut T> {
+        self.iter_mut().next()
+    }
+
+    /// Borrows the last element in this sequence.
+    pub fn last(&self) -> Option<&T> {
+        self.iter().next_back()
+    }
+
+    /// Mutably borrows the last element in this sequence.
+    pub fn last_mut(&mut self) -> Option<&mut T> {
+        self.iter_mut().next_back()
+    }
+
+    /// Returns an iterator over borrowed syntax tree nodes of type `&T`.
+    pub fn iter(&self) -> Iter<T> {
+        Iter {
+            inner: Box::new(NoDrop::new(PrivateIter {
+                inner: self.inner.iter(),
+                last: self.last.as_ref().map(Box::as_ref).into_iter(),
+            })),
+        }
+    }
+
+    /// Returns an iterator over mutably borrowed syntax tree nodes of type
+    /// `&mut T`.
+    pub fn iter_mut(&mut self) -> IterMut<T> {
+        IterMut {
+            inner: Box::new(NoDrop::new(PrivateIterMut {
+                inner: self.inner.iter_mut(),
+                last: self.last.as_mut().map(Box::as_mut).into_iter(),
+            })),
+        }
+    }
+
+    /// Returns an iterator over the contents of this sequence as borrowed
+    /// punctuated pairs.
+    pub fn pairs(&self) -> Pairs<T, P> {
+        Pairs {
+            inner: self.inner.iter(),
+            last: self.last.as_ref().map(Box::as_ref).into_iter(),
+        }
+    }
+
+    /// Returns an iterator over the contents of this sequence as mutably
+    /// borrowed punctuated pairs.
+    pub fn pairs_mut(&mut self) -> PairsMut<T, P> {
+        PairsMut {
+            inner: self.inner.iter_mut(),
+            last: self.last.as_mut().map(Box::as_mut).into_iter(),
+        }
+    }
+
+    /// Returns an iterator over the contents of this sequence as owned
+    /// punctuated pairs.
+    pub fn into_pairs(self) -> IntoPairs<T, P> {
+        IntoPairs {
+            inner: self.inner.into_iter(),
+            last: self.last.map(|t| *t).into_iter(),
+        }
+    }
+
+    /// Appends a syntax tree node onto the end of this punctuated sequence. The
+    /// sequence must already have a trailing punctuation, or be empty.
+    ///
+    /// Use [`push`] instead if the punctuated sequence may or may not already
+    /// have trailing punctuation.
+    ///
+    /// [`push`]: Punctuated::push
+    ///
+    /// # Panics
+    ///
+    /// Panics if the sequence is nonempty and does not already have a trailing
+    /// punctuation.
+    pub fn push_value(&mut self, value: T) {
+        assert!(
+            self.empty_or_trailing(),
+            "Punctuated::push_value: cannot push value if Punctuated is missing trailing punctuation",
+        );
+
+        self.last = Some(Box::new(value));
+    }
+
+    /// Appends a trailing punctuation onto the end of this punctuated sequence.
+    /// The sequence must be non-empty and must not already have trailing
+    /// punctuation.
+    ///
+    /// # Panics
+    ///
+    /// Panics if the sequence is empty or already has a trailing punctuation.
+    pub fn push_punct(&mut self, punctuation: P) {
+        assert!(
+            self.last.is_some(),
+            "Punctuated::push_punct: cannot push punctuation if Punctuated is empty or already has trailing punctuation",
+        );
+
+        let last = self.last.take().unwrap();
+        self.inner.push((*last, punctuation));
+    }
+
+    /// Removes the last punctuated pair from this sequence, or `None` if the
+    /// sequence is empty.
+    pub fn pop(&mut self) -> Option<Pair<T, P>> {
+        if self.last.is_some() {
+            self.last.take().map(|t| Pair::End(*t))
+        } else {
+            self.inner.pop().map(|(t, p)| Pair::Punctuated(t, p))
+        }
+    }
+
+    /// Removes the trailing punctuation from this punctuated sequence, or
+    /// `None` if there isn't any.
+    pub fn pop_punct(&mut self) -> Option<P> {
+        if self.last.is_some() {
+            None
+        } else {
+            let (t, p) = self.inner.pop()?;
+            self.last = Some(Box::new(t));
+            Some(p)
+        }
+    }
+
+    /// Determines whether this punctuated sequence ends with a trailing
+    /// punctuation.
+    pub fn trailing_punct(&self) -> bool {
+        self.last.is_none() && !self.is_empty()
+    }
+
+    /// Returns true if either this `Punctuated` is empty, or it has a trailing
+    /// punctuation.
+    ///
+    /// Equivalent to `punctuated.is_empty() || punctuated.trailing_punct()`.
+    pub fn empty_or_trailing(&self) -> bool {
+        self.last.is_none()
+    }
+
+    /// Appends a syntax tree node onto the end of this punctuated sequence.
+    ///
+    /// If there is not a trailing punctuation in this sequence when this method
+    /// is called, the default value of punctuation type `P` is inserted before
+    /// the given value of type `T`.
+    pub fn push(&mut self, value: T)
+    where
+        P: Default,
+    {
+        if !self.empty_or_trailing() {
+            self.push_punct(Default::default());
+        }
+        self.push_value(value);
+    }
+
+    /// Inserts an element at position `index`.
+    ///
+    /// # Panics
+    ///
+    /// Panics if `index` is greater than the number of elements previously in
+    /// this punctuated sequence.
+    pub fn insert(&mut self, index: usize, value: T)
+    where
+        P: Default,
+    {
+        assert!(
+            index <= self.len(),
+            "Punctuated::insert: index out of range",
+        );
+
+        if index == self.len() {
+            self.push(value);
+        } else {
+            self.inner.insert(index, (value, Default::default()));
+        }
+    }
+
+    /// Clears the sequence of all values and punctuation, making it empty.
+    pub fn clear(&mut self) {
+        self.inner.clear();
+        self.last = None;
+    }
+
+    /// Parses zero or more occurrences of `T` separated by punctuation of type
+    /// `P`, with optional trailing punctuation.
+    ///
+    /// Parsing continues until the end of this parse stream. The entire content
+    /// of this parse stream must consist of `T` and `P`.
+    #[cfg(feature = "parsing")]
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    pub fn parse_terminated(input: ParseStream) -> Result<Self>
+    where
+        T: Parse,
+        P: Parse,
+    {
+        Self::parse_terminated_with(input, T::parse)
+    }
+
+    /// Parses zero or more occurrences of `T` using the given parse function,
+    /// separated by punctuation of type `P`, with optional trailing
+    /// punctuation.
+    ///
+    /// Like [`parse_terminated`], the entire content of this stream is expected
+    /// to be parsed.
+    ///
+    /// [`parse_terminated`]: Punctuated::parse_terminated
+    #[cfg(feature = "parsing")]
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    pub fn parse_terminated_with(
+        input: ParseStream,
+        parser: fn(ParseStream) -> Result<T>,
+    ) -> Result<Self>
+    where
+        P: Parse,
+    {
+        let mut punctuated = Punctuated::new();
+
+        loop {
+            if input.is_empty() {
+                break;
+            }
+            let value = parser(input)?;
+            punctuated.push_value(value);
+            if input.is_empty() {
+                break;
+            }
+            let punct = input.parse()?;
+            punctuated.push_punct(punct);
+        }
+
+        Ok(punctuated)
+    }
+
+    /// Parses one or more occurrences of `T` separated by punctuation of type
+    /// `P`, not accepting trailing punctuation.
+    ///
+    /// Parsing continues as long as punctuation `P` is present at the head of
+    /// the stream. This method returns upon parsing a `T` and observing that it
+    /// is not followed by a `P`, even if there are remaining tokens in the
+    /// stream.
+    #[cfg(feature = "parsing")]
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    pub fn parse_separated_nonempty(input: ParseStream) -> Result<Self>
+    where
+        T: Parse,
+        P: Token + Parse,
+    {
+        Self::parse_separated_nonempty_with(input, T::parse)
+    }
+
+    /// Parses one or more occurrences of `T` using the given parse function,
+    /// separated by punctuation of type `P`, not accepting trailing
+    /// punctuation.
+    ///
+    /// Like [`parse_separated_nonempty`], may complete early without parsing
+    /// the entire content of this stream.
+    ///
+    /// [`parse_separated_nonempty`]: Punctuated::parse_separated_nonempty
+    #[cfg(feature = "parsing")]
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    pub fn parse_separated_nonempty_with(
+        input: ParseStream,
+        parser: fn(ParseStream) -> Result<T>,
+    ) -> Result<Self>
+    where
+        P: Token + Parse,
+    {
+        let mut punctuated = Punctuated::new();
+
+        loop {
+            let value = parser(input)?;
+            punctuated.push_value(value);
+            if !P::peek(input.cursor()) {
+                break;
+            }
+            let punct = input.parse()?;
+            punctuated.push_punct(punct);
+        }
+
+        Ok(punctuated)
+    }
+}
+
+#[cfg(feature = "clone-impls")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl<T, P> Clone for Punctuated<T, P>
+where
+    T: Clone,
+    P: Clone,
+{
+    fn clone(&self) -> Self {
+        Punctuated {
+            inner: self.inner.clone(),
+            last: self.last.clone(),
+        }
+    }
+
+    fn clone_from(&mut self, other: &Self) {
+        self.inner.clone_from(&other.inner);
+        self.last.clone_from(&other.last);
+    }
+}
+
+#[cfg(feature = "extra-traits")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))]
+impl<T, P> Eq for Punctuated<T, P>
+where
+    T: Eq,
+    P: Eq,
+{
+}
+
+#[cfg(feature = "extra-traits")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))]
+impl<T, P> PartialEq for Punctuated<T, P>
+where
+    T: PartialEq,
+    P: PartialEq,
+{
+    fn eq(&self, other: &Self) -> bool {
+        let Punctuated { inner, last } = self;
+        *inner == other.inner && *last == other.last
+    }
+}
+
+#[cfg(feature = "extra-traits")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))]
+impl<T, P> Hash for Punctuated<T, P>
+where
+    T: Hash,
+    P: Hash,
+{
+    fn hash<H: Hasher>(&self, state: &mut H) {
+        let Punctuated { inner, last } = self;
+        inner.hash(state);
+        last.hash(state);
+    }
+}
+
+#[cfg(feature = "extra-traits")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))]
+impl<T: Debug, P: Debug> Debug for Punctuated<T, P> {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        let mut list = f.debug_list();
+        for (t, p) in &self.inner {
+            list.entry(t);
+            list.entry(p);
+        }
+        if let Some(last) = &self.last {
+            list.entry(last);
+        }
+        list.finish()
+    }
+}
+
+impl<T, P> FromIterator<T> for Punctuated<T, P>
+where
+    P: Default,
+{
+    fn from_iter<I: IntoIterator<Item = T>>(i: I) -> Self {
+        let mut ret = Punctuated::new();
+        ret.extend(i);
+        ret
+    }
+}
+
+impl<T, P> Extend<T> for Punctuated<T, P>
+where
+    P: Default,
+{
+    fn extend<I: IntoIterator<Item = T>>(&mut self, i: I) {
+        for value in i {
+            self.push(value);
+        }
+    }
+}
+
+impl<T, P> FromIterator<Pair<T, P>> for Punctuated<T, P> {
+    fn from_iter<I: IntoIterator<Item = Pair<T, P>>>(i: I) -> Self {
+        let mut ret = Punctuated::new();
+        do_extend(&mut ret, i.into_iter());
+        ret
+    }
+}
+
+impl<T, P> Extend<Pair<T, P>> for Punctuated<T, P>
+where
+    P: Default,
+{
+    fn extend<I: IntoIterator<Item = Pair<T, P>>>(&mut self, i: I) {
+        if !self.empty_or_trailing() {
+            self.push_punct(P::default());
+        }
+        do_extend(self, i.into_iter());
+    }
+}
+
+fn do_extend<T, P, I>(punctuated: &mut Punctuated<T, P>, i: I)
+where
+    I: Iterator<Item = Pair<T, P>>,
+{
+    let mut nomore = false;
+    for pair in i {
+        if nomore {
+            panic!("punctuated extended with items after a Pair::End");
+        }
+        match pair {
+            Pair::Punctuated(a, b) => punctuated.inner.push((a, b)),
+            Pair::End(a) => {
+                punctuated.last = Some(Box::new(a));
+                nomore = true;
+            }
+        }
+    }
+}
+
+impl<T, P> IntoIterator for Punctuated<T, P> {
+    type Item = T;
+    type IntoIter = IntoIter<T>;
+
+    fn into_iter(self) -> Self::IntoIter {
+        let mut elements = Vec::with_capacity(self.len());
+        elements.extend(self.inner.into_iter().map(|pair| pair.0));
+        elements.extend(self.last.map(|t| *t));
+
+        IntoIter {
+            inner: elements.into_iter(),
+        }
+    }
+}
+
+impl<'a, T, P> IntoIterator for &'a Punctuated<T, P> {
+    type Item = &'a T;
+    type IntoIter = Iter<'a, T>;
+
+    fn into_iter(self) -> Self::IntoIter {
+        Punctuated::iter(self)
+    }
+}
+
+impl<'a, T, P> IntoIterator for &'a mut Punctuated<T, P> {
+    type Item = &'a mut T;
+    type IntoIter = IterMut<'a, T>;
+
+    fn into_iter(self) -> Self::IntoIter {
+        Punctuated::iter_mut(self)
+    }
+}
+
+impl<T, P> Default for Punctuated<T, P> {
+    fn default() -> Self {
+        Punctuated::new()
+    }
+}
+
+/// An iterator over borrowed pairs of type `Pair<&T, &P>`.
+///
+/// Refer to the [module documentation] for details about punctuated sequences.
+///
+/// [module documentation]: self
+pub struct Pairs<'a, T: 'a, P: 'a> {
+    inner: slice::Iter<'a, (T, P)>,
+    last: option::IntoIter<&'a T>,
+}
+
+impl<'a, T, P> Iterator for Pairs<'a, T, P> {
+    type Item = Pair<&'a T, &'a P>;
+
+    fn next(&mut self) -> Option<Self::Item> {
+        self.inner
+            .next()
+            .map(|(t, p)| Pair::Punctuated(t, p))
+            .or_else(|| self.last.next().map(Pair::End))
+    }
+
+    fn size_hint(&self) -> (usize, Option<usize>) {
+        (self.len(), Some(self.len()))
+    }
+}
+
+impl<'a, T, P> DoubleEndedIterator for Pairs<'a, T, P> {
+    fn next_back(&mut self) -> Option<Self::Item> {
+        self.last
+            .next()
+            .map(Pair::End)
+            .or_else(|| self.inner.next_back().map(|(t, p)| Pair::Punctuated(t, p)))
+    }
+}
+
+impl<'a, T, P> ExactSizeIterator for Pairs<'a, T, P> {
+    fn len(&self) -> usize {
+        self.inner.len() + self.last.len()
+    }
+}
+
+// No Clone bound on T or P.
+impl<'a, T, P> Clone for Pairs<'a, T, P> {
+    fn clone(&self) -> Self {
+        Pairs {
+            inner: self.inner.clone(),
+            last: self.last.clone(),
+        }
+    }
+}
+
+/// An iterator over mutably borrowed pairs of type `Pair<&mut T, &mut P>`.
+///
+/// Refer to the [module documentation] for details about punctuated sequences.
+///
+/// [module documentation]: self
+pub struct PairsMut<'a, T: 'a, P: 'a> {
+    inner: slice::IterMut<'a, (T, P)>,
+    last: option::IntoIter<&'a mut T>,
+}
+
+impl<'a, T, P> Iterator for PairsMut<'a, T, P> {
+    type Item = Pair<&'a mut T, &'a mut P>;
+
+    fn next(&mut self) -> Option<Self::Item> {
+        self.inner
+            .next()
+            .map(|(t, p)| Pair::Punctuated(t, p))
+            .or_else(|| self.last.next().map(Pair::End))
+    }
+
+    fn size_hint(&self) -> (usize, Option<usize>) {
+        (self.len(), Some(self.len()))
+    }
+}
+
+impl<'a, T, P> DoubleEndedIterator for PairsMut<'a, T, P> {
+    fn next_back(&mut self) -> Option<Self::Item> {
+        self.last
+            .next()
+            .map(Pair::End)
+            .or_else(|| self.inner.next_back().map(|(t, p)| Pair::Punctuated(t, p)))
+    }
+}
+
+impl<'a, T, P> ExactSizeIterator for PairsMut<'a, T, P> {
+    fn len(&self) -> usize {
+        self.inner.len() + self.last.len()
+    }
+}
+
+/// An iterator over owned pairs of type `Pair<T, P>`.
+///
+/// Refer to the [module documentation] for details about punctuated sequences.
+///
+/// [module documentation]: self
+pub struct IntoPairs<T, P> {
+    inner: vec::IntoIter<(T, P)>,
+    last: option::IntoIter<T>,
+}
+
+impl<T, P> Iterator for IntoPairs<T, P> {
+    type Item = Pair<T, P>;
+
+    fn next(&mut self) -> Option<Self::Item> {
+        self.inner
+            .next()
+            .map(|(t, p)| Pair::Punctuated(t, p))
+            .or_else(|| self.last.next().map(Pair::End))
+    }
+
+    fn size_hint(&self) -> (usize, Option<usize>) {
+        (self.len(), Some(self.len()))
+    }
+}
+
+impl<T, P> DoubleEndedIterator for IntoPairs<T, P> {
+    fn next_back(&mut self) -> Option<Self::Item> {
+        self.last
+            .next()
+            .map(Pair::End)
+            .or_else(|| self.inner.next_back().map(|(t, p)| Pair::Punctuated(t, p)))
+    }
+}
+
+impl<T, P> ExactSizeIterator for IntoPairs<T, P> {
+    fn len(&self) -> usize {
+        self.inner.len() + self.last.len()
+    }
+}
+
+impl<T, P> Clone for IntoPairs<T, P>
+where
+    T: Clone,
+    P: Clone,
+{
+    fn clone(&self) -> Self {
+        IntoPairs {
+            inner: self.inner.clone(),
+            last: self.last.clone(),
+        }
+    }
+}
+
+/// An iterator over owned values of type `T`.
+///
+/// Refer to the [module documentation] for details about punctuated sequences.
+///
+/// [module documentation]: self
+pub struct IntoIter<T> {
+    inner: vec::IntoIter<T>,
+}
+
+impl<T> Iterator for IntoIter<T> {
+    type Item = T;
+
+    fn next(&mut self) -> Option<Self::Item> {
+        self.inner.next()
+    }
+
+    fn size_hint(&self) -> (usize, Option<usize>) {
+        (self.len(), Some(self.len()))
+    }
+}
+
+impl<T> DoubleEndedIterator for IntoIter<T> {
+    fn next_back(&mut self) -> Option<Self::Item> {
+        self.inner.next_back()
+    }
+}
+
+impl<T> ExactSizeIterator for IntoIter<T> {
+    fn len(&self) -> usize {
+        self.inner.len()
+    }
+}
+
+impl<T> Clone for IntoIter<T>
+where
+    T: Clone,
+{
+    fn clone(&self) -> Self {
+        IntoIter {
+            inner: self.inner.clone(),
+        }
+    }
+}
+
+/// An iterator over borrowed values of type `&T`.
+///
+/// Refer to the [module documentation] for details about punctuated sequences.
+///
+/// [module documentation]: self
+pub struct Iter<'a, T: 'a> {
+    inner: Box<NoDrop<dyn IterTrait<'a, T> + 'a>>,
+}
+
+trait IterTrait<'a, T: 'a>: Iterator<Item = &'a T> + DoubleEndedIterator + ExactSizeIterator {
+    fn clone_box(&self) -> Box<NoDrop<dyn IterTrait<'a, T> + 'a>>;
+}
+
+struct PrivateIter<'a, T: 'a, P: 'a> {
+    inner: slice::Iter<'a, (T, P)>,
+    last: option::IntoIter<&'a T>,
+}
+
+impl<'a, T, P> TrivialDrop for PrivateIter<'a, T, P>
+where
+    slice::Iter<'a, (T, P)>: TrivialDrop,
+    option::IntoIter<&'a T>: TrivialDrop,
+{
+}
+
+#[cfg(any(feature = "full", feature = "derive"))]
+pub(crate) fn empty_punctuated_iter<'a, T>() -> Iter<'a, T> {
+    Iter {
+        inner: Box::new(NoDrop::new(iter::empty())),
+    }
+}
+
+// No Clone bound on T.
+impl<'a, T> Clone for Iter<'a, T> {
+    fn clone(&self) -> Self {
+        Iter {
+            inner: self.inner.clone_box(),
+        }
+    }
+}
+
+impl<'a, T> Iterator for Iter<'a, T> {
+    type Item = &'a T;
+
+    fn next(&mut self) -> Option<Self::Item> {
+        self.inner.next()
+    }
+
+    fn size_hint(&self) -> (usize, Option<usize>) {
+        (self.len(), Some(self.len()))
+    }
+}
+
+impl<'a, T> DoubleEndedIterator for Iter<'a, T> {
+    fn next_back(&mut self) -> Option<Self::Item> {
+        self.inner.next_back()
+    }
+}
+
+impl<'a, T> ExactSizeIterator for Iter<'a, T> {
+    fn len(&self) -> usize {
+        self.inner.len()
+    }
+}
+
+impl<'a, T, P> Iterator for PrivateIter<'a, T, P> {
+    type Item = &'a T;
+
+    fn next(&mut self) -> Option<Self::Item> {
+        self.inner
+            .next()
+            .map(|pair| &pair.0)
+            .or_else(|| self.last.next())
+    }
+}
+
+impl<'a, T, P> DoubleEndedIterator for PrivateIter<'a, T, P> {
+    fn next_back(&mut self) -> Option<Self::Item> {
+        self.last
+            .next()
+            .or_else(|| self.inner.next_back().map(|pair| &pair.0))
+    }
+}
+
+impl<'a, T, P> ExactSizeIterator for PrivateIter<'a, T, P> {
+    fn len(&self) -> usize {
+        self.inner.len() + self.last.len()
+    }
+}
+
+// No Clone bound on T or P.
+impl<'a, T, P> Clone for PrivateIter<'a, T, P> {
+    fn clone(&self) -> Self {
+        PrivateIter {
+            inner: self.inner.clone(),
+            last: self.last.clone(),
+        }
+    }
+}
+
+impl<'a, T, I> IterTrait<'a, T> for I
+where
+    T: 'a,
+    I: DoubleEndedIterator<Item = &'a T>
+        + ExactSizeIterator<Item = &'a T>
+        + Clone
+        + TrivialDrop
+        + 'a,
+{
+    fn clone_box(&self) -> Box<NoDrop<dyn IterTrait<'a, T> + 'a>> {
+        Box::new(NoDrop::new(self.clone()))
+    }
+}
+
+/// An iterator over mutably borrowed values of type `&mut T`.
+///
+/// Refer to the [module documentation] for details about punctuated sequences.
+///
+/// [module documentation]: self
+pub struct IterMut<'a, T: 'a> {
+    inner: Box<NoDrop<dyn IterMutTrait<'a, T, Item = &'a mut T> + 'a>>,
+}
+
+trait IterMutTrait<'a, T: 'a>:
+    DoubleEndedIterator<Item = &'a mut T> + ExactSizeIterator<Item = &'a mut T>
+{
+}
+
+struct PrivateIterMut<'a, T: 'a, P: 'a> {
+    inner: slice::IterMut<'a, (T, P)>,
+    last: option::IntoIter<&'a mut T>,
+}
+
+impl<'a, T, P> TrivialDrop for PrivateIterMut<'a, T, P>
+where
+    slice::IterMut<'a, (T, P)>: TrivialDrop,
+    option::IntoIter<&'a mut T>: TrivialDrop,
+{
+}
+
+#[cfg(any(feature = "full", feature = "derive"))]
+pub(crate) fn empty_punctuated_iter_mut<'a, T>() -> IterMut<'a, T> {
+    IterMut {
+        inner: Box::new(NoDrop::new(iter::empty())),
+    }
+}
+
+impl<'a, T> Iterator for IterMut<'a, T> {
+    type Item = &'a mut T;
+
+    fn next(&mut self) -> Option<Self::Item> {
+        self.inner.next()
+    }
+
+    fn size_hint(&self) -> (usize, Option<usize>) {
+        (self.len(), Some(self.len()))
+    }
+}
+
+impl<'a, T> DoubleEndedIterator for IterMut<'a, T> {
+    fn next_back(&mut self) -> Option<Self::Item> {
+        self.inner.next_back()
+    }
+}
+
+impl<'a, T> ExactSizeIterator for IterMut<'a, T> {
+    fn len(&self) -> usize {
+        self.inner.len()
+    }
+}
+
+impl<'a, T, P> Iterator for PrivateIterMut<'a, T, P> {
+    type Item = &'a mut T;
+
+    fn next(&mut self) -> Option<Self::Item> {
+        self.inner
+            .next()
+            .map(|pair| &mut pair.0)
+            .or_else(|| self.last.next())
+    }
+}
+
+impl<'a, T, P> DoubleEndedIterator for PrivateIterMut<'a, T, P> {
+    fn next_back(&mut self) -> Option<Self::Item> {
+        self.last
+            .next()
+            .or_else(|| self.inner.next_back().map(|pair| &mut pair.0))
+    }
+}
+
+impl<'a, T, P> ExactSizeIterator for PrivateIterMut<'a, T, P> {
+    fn len(&self) -> usize {
+        self.inner.len() + self.last.len()
+    }
+}
+
+impl<'a, T, I> IterMutTrait<'a, T> for I
+where
+    T: 'a,
+    I: DoubleEndedIterator<Item = &'a mut T> + ExactSizeIterator<Item = &'a mut T> + 'a,
+{
+}
+
+/// A single syntax tree node of type `T` followed by its trailing punctuation
+/// of type `P` if any.
+///
+/// Refer to the [module documentation] for details about punctuated sequences.
+///
+/// [module documentation]: self
+pub enum Pair<T, P> {
+    Punctuated(T, P),
+    End(T),
+}
+
+impl<T, P> Pair<T, P> {
+    /// Extracts the syntax tree node from this punctuated pair, discarding the
+    /// following punctuation.
+    pub fn into_value(self) -> T {
+        match self {
+            Pair::Punctuated(t, _) | Pair::End(t) => t,
+        }
+    }
+
+    /// Borrows the syntax tree node from this punctuated pair.
+    pub fn value(&self) -> &T {
+        match self {
+            Pair::Punctuated(t, _) | Pair::End(t) => t,
+        }
+    }
+
+    /// Mutably borrows the syntax tree node from this punctuated pair.
+    pub fn value_mut(&mut self) -> &mut T {
+        match self {
+            Pair::Punctuated(t, _) | Pair::End(t) => t,
+        }
+    }
+
+    /// Borrows the punctuation from this punctuated pair, unless this pair is
+    /// the final one and there is no trailing punctuation.
+    pub fn punct(&self) -> Option<&P> {
+        match self {
+            Pair::Punctuated(_, p) => Some(p),
+            Pair::End(_) => None,
+        }
+    }
+
+    /// Mutably borrows the punctuation from this punctuated pair, unless the
+    /// pair is the final one and there is no trailing punctuation.
+    ///
+    /// # Example
+    ///
+    /// ```
+    /// # use proc_macro2::Span;
+    /// # use syn::punctuated::Punctuated;
+    /// # use syn::{parse_quote, Token, TypeParamBound};
+    /// #
+    /// # let mut punctuated = Punctuated::<TypeParamBound, Token![+]>::new();
+    /// # let span = Span::call_site();
+    /// #
+    /// punctuated.insert(0, parse_quote!('lifetime));
+    /// if let Some(punct) = punctuated.pairs_mut().next().unwrap().punct_mut() {
+    ///     punct.span = span;
+    /// }
+    /// ```
+    pub fn punct_mut(&mut self) -> Option<&mut P> {
+        match self {
+            Pair::Punctuated(_, p) => Some(p),
+            Pair::End(_) => None,
+        }
+    }
+
+    /// Creates a punctuated pair out of a syntax tree node and an optional
+    /// following punctuation.
+    pub fn new(t: T, p: Option<P>) -> Self {
+        match p {
+            Some(p) => Pair::Punctuated(t, p),
+            None => Pair::End(t),
+        }
+    }
+
+    /// Produces this punctuated pair as a tuple of syntax tree node and
+    /// optional following punctuation.
+    pub fn into_tuple(self) -> (T, Option<P>) {
+        match self {
+            Pair::Punctuated(t, p) => (t, Some(p)),
+            Pair::End(t) => (t, None),
+        }
+    }
+}
+
+#[cfg(feature = "clone-impls")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl<T, P> Pair<&T, &P> {
+    pub fn cloned(self) -> Pair<T, P>
+    where
+        T: Clone,
+        P: Clone,
+    {
+        match self {
+            Pair::Punctuated(t, p) => Pair::Punctuated(t.clone(), p.clone()),
+            Pair::End(t) => Pair::End(t.clone()),
+        }
+    }
+}
+
+#[cfg(feature = "clone-impls")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl<T, P> Clone for Pair<T, P>
+where
+    T: Clone,
+    P: Clone,
+{
+    fn clone(&self) -> Self {
+        match self {
+            Pair::Punctuated(t, p) => Pair::Punctuated(t.clone(), p.clone()),
+            Pair::End(t) => Pair::End(t.clone()),
+        }
+    }
+}
+
+#[cfg(feature = "clone-impls")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl<T, P> Copy for Pair<T, P>
+where
+    T: Copy,
+    P: Copy,
+{
+}
+
+impl<T, P> Index<usize> for Punctuated<T, P> {
+    type Output = T;
+
+    fn index(&self, index: usize) -> &Self::Output {
+        if index == self.len() - 1 {
+            match &self.last {
+                Some(t) => t,
+                None => &self.inner[index].0,
+            }
+        } else {
+            &self.inner[index].0
+        }
+    }
+}
+
+impl<T, P> IndexMut<usize> for Punctuated<T, P> {
+    fn index_mut(&mut self, index: usize) -> &mut Self::Output {
+        if index == self.len() - 1 {
+            match &mut self.last {
+                Some(t) => t,
+                None => &mut self.inner[index].0,
+            }
+        } else {
+            &mut self.inner[index].0
+        }
+    }
+}
+
+#[cfg(feature = "printing")]
+mod printing {
+    use crate::punctuated::{Pair, Punctuated};
+    use proc_macro2::TokenStream;
+    use quote::{ToTokens, TokenStreamExt};
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl<T, P> ToTokens for Punctuated<T, P>
+    where
+        T: ToTokens,
+        P: ToTokens,
+    {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.pairs());
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl<T, P> ToTokens for Pair<T, P>
+    where
+        T: ToTokens,
+        P: ToTokens,
+    {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            match self {
+                Pair::Punctuated(a, b) => {
+                    a.to_tokens(tokens);
+                    b.to_tokens(tokens);
+                }
+                Pair::End(a) => a.to_tokens(tokens),
+            }
+        }
+    }
+}
+
\ No newline at end of file diff --git a/src/syn/restriction.rs.html b/src/syn/restriction.rs.html new file mode 100644 index 0000000..5b41ab4 --- /dev/null +++ b/src/syn/restriction.rs.html @@ -0,0 +1,353 @@ +restriction.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+
use crate::path::Path;
+use crate::token;
+
+ast_enum! {
+    /// The visibility level of an item: inherited or `pub` or
+    /// `pub(restricted)`.
+    ///
+    /// # Syntax tree enum
+    ///
+    /// This type is a [syntax tree enum].
+    ///
+    /// [syntax tree enum]: crate::expr::Expr#syntax-tree-enums
+    #[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub enum Visibility {
+        /// A public visibility level: `pub`.
+        Public(Token![pub]),
+
+        /// A visibility level restricted to some path: `pub(self)` or
+        /// `pub(super)` or `pub(crate)` or `pub(in some::module)`.
+        Restricted(VisRestricted),
+
+        /// An inherited visibility, which usually means private.
+        Inherited,
+    }
+}
+
+ast_struct! {
+    /// A visibility level restricted to some path: `pub(self)` or
+    /// `pub(super)` or `pub(crate)` or `pub(in some::module)`.
+    #[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct VisRestricted {
+        pub pub_token: Token![pub],
+        pub paren_token: token::Paren,
+        pub in_token: Option<Token![in]>,
+        pub path: Box<Path>,
+    }
+}
+
+ast_enum! {
+    /// Unused, but reserved for RFC 3323 restrictions.
+    #[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
+    #[non_exhaustive]
+    pub enum FieldMutability {
+        None,
+
+        // TODO: https://rust-lang.github.io/rfcs/3323-restrictions.html
+        //
+        // FieldMutability::Restricted(MutRestricted)
+        //
+        // pub struct MutRestricted {
+        //     pub mut_token: Token![mut],
+        //     pub paren_token: token::Paren,
+        //     pub in_token: Option<Token![in]>,
+        //     pub path: Box<Path>,
+        // }
+    }
+}
+
+#[cfg(feature = "parsing")]
+pub(crate) mod parsing {
+    use crate::error::Result;
+    use crate::ext::IdentExt as _;
+    use crate::ident::Ident;
+    use crate::parse::discouraged::Speculative as _;
+    use crate::parse::{Parse, ParseStream};
+    use crate::path::Path;
+    use crate::restriction::{VisRestricted, Visibility};
+    use crate::token;
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for Visibility {
+        fn parse(input: ParseStream) -> Result<Self> {
+            // Recognize an empty None-delimited group, as produced by a $:vis
+            // matcher that matched no tokens.
+            if input.peek(token::Group) {
+                let ahead = input.fork();
+                let group = crate::group::parse_group(&ahead)?;
+                if group.content.is_empty() {
+                    input.advance_to(&ahead);
+                    return Ok(Visibility::Inherited);
+                }
+            }
+
+            if input.peek(Token![pub]) {
+                Self::parse_pub(input)
+            } else {
+                Ok(Visibility::Inherited)
+            }
+        }
+    }
+
+    impl Visibility {
+        fn parse_pub(input: ParseStream) -> Result<Self> {
+            let pub_token = input.parse::<Token![pub]>()?;
+
+            if input.peek(token::Paren) {
+                let ahead = input.fork();
+
+                let content;
+                let paren_token = parenthesized!(content in ahead);
+                if content.peek(Token![crate])
+                    || content.peek(Token![self])
+                    || content.peek(Token![super])
+                {
+                    let path = content.call(Ident::parse_any)?;
+
+                    // Ensure there are no additional tokens within `content`.
+                    // Without explicitly checking, we may misinterpret a tuple
+                    // field as a restricted visibility, causing a parse error.
+                    // e.g. `pub (crate::A, crate::B)` (Issue #720).
+                    if content.is_empty() {
+                        input.advance_to(&ahead);
+                        return Ok(Visibility::Restricted(VisRestricted {
+                            pub_token,
+                            paren_token,
+                            in_token: None,
+                            path: Box::new(Path::from(path)),
+                        }));
+                    }
+                } else if content.peek(Token![in]) {
+                    let in_token: Token![in] = content.parse()?;
+                    let path = content.call(Path::parse_mod_style)?;
+
+                    input.advance_to(&ahead);
+                    return Ok(Visibility::Restricted(VisRestricted {
+                        pub_token,
+                        paren_token,
+                        in_token: Some(in_token),
+                        path: Box::new(path),
+                    }));
+                }
+            }
+
+            Ok(Visibility::Public(pub_token))
+        }
+
+        #[cfg(feature = "full")]
+        pub(crate) fn is_some(&self) -> bool {
+            match self {
+                Visibility::Inherited => false,
+                _ => true,
+            }
+        }
+    }
+}
+
+#[cfg(feature = "printing")]
+mod printing {
+    use crate::restriction::{VisRestricted, Visibility};
+    use proc_macro2::TokenStream;
+    use quote::ToTokens;
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for Visibility {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            match self {
+                Visibility::Public(pub_token) => pub_token.to_tokens(tokens),
+                Visibility::Restricted(vis_restricted) => vis_restricted.to_tokens(tokens),
+                Visibility::Inherited => {}
+            }
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for VisRestricted {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.pub_token.to_tokens(tokens);
+            self.paren_token.surround(tokens, |tokens| {
+                // TODO: If we have a path which is not "self" or "super" or
+                // "crate", automatically add the "in" token.
+                self.in_token.to_tokens(tokens);
+                self.path.to_tokens(tokens);
+            });
+        }
+    }
+}
+
\ No newline at end of file diff --git a/src/syn/sealed.rs.html b/src/syn/sealed.rs.html new file mode 100644 index 0000000..454d028 --- /dev/null +++ b/src/syn/sealed.rs.html @@ -0,0 +1,9 @@ +sealed.rs - source
1
+2
+3
+4
+
#[cfg(feature = "parsing")]
+pub(crate) mod lookahead {
+    pub trait Sealed: Copy {}
+}
+
\ No newline at end of file diff --git a/src/syn/span.rs.html b/src/syn/span.rs.html new file mode 100644 index 0000000..a73110a --- /dev/null +++ b/src/syn/span.rs.html @@ -0,0 +1,127 @@ +span.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+
use proc_macro2::extra::DelimSpan;
+use proc_macro2::{Delimiter, Group, Span, TokenStream};
+
+#[doc(hidden)]
+pub trait IntoSpans<S> {
+    fn into_spans(self) -> S;
+}
+
+impl IntoSpans<Span> for Span {
+    fn into_spans(self) -> Span {
+        self
+    }
+}
+
+impl IntoSpans<[Span; 1]> for Span {
+    fn into_spans(self) -> [Span; 1] {
+        [self]
+    }
+}
+
+impl IntoSpans<[Span; 2]> for Span {
+    fn into_spans(self) -> [Span; 2] {
+        [self, self]
+    }
+}
+
+impl IntoSpans<[Span; 3]> for Span {
+    fn into_spans(self) -> [Span; 3] {
+        [self, self, self]
+    }
+}
+
+impl IntoSpans<[Span; 1]> for [Span; 1] {
+    fn into_spans(self) -> [Span; 1] {
+        self
+    }
+}
+
+impl IntoSpans<[Span; 2]> for [Span; 2] {
+    fn into_spans(self) -> [Span; 2] {
+        self
+    }
+}
+
+impl IntoSpans<[Span; 3]> for [Span; 3] {
+    fn into_spans(self) -> [Span; 3] {
+        self
+    }
+}
+
+impl IntoSpans<DelimSpan> for Span {
+    fn into_spans(self) -> DelimSpan {
+        let mut group = Group::new(Delimiter::None, TokenStream::new());
+        group.set_span(self);
+        group.delim_span()
+    }
+}
+
+impl IntoSpans<DelimSpan> for DelimSpan {
+    fn into_spans(self) -> DelimSpan {
+        self
+    }
+}
+
\ No newline at end of file diff --git a/src/syn/spanned.rs.html b/src/syn/spanned.rs.html new file mode 100644 index 0000000..0df7a51 --- /dev/null +++ b/src/syn/spanned.rs.html @@ -0,0 +1,237 @@ +spanned.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+
//! A trait that can provide the `Span` of the complete contents of a syntax
+//! tree node.
+//!
+//! <br>
+//!
+//! # Example
+//!
+//! Suppose in a procedural macro we have a [`Type`] that we want to assert
+//! implements the [`Sync`] trait. Maybe this is the type of one of the fields
+//! of a struct for which we are deriving a trait implementation, and we need to
+//! be able to pass a reference to one of those fields across threads.
+//!
+//! [`Type`]: crate::Type
+//! [`Sync`]: std::marker::Sync
+//!
+//! If the field type does *not* implement `Sync` as required, we want the
+//! compiler to report an error pointing out exactly which type it was.
+//!
+//! The following macro code takes a variable `ty` of type `Type` and produces a
+//! static assertion that `Sync` is implemented for that type.
+//!
+//! ```
+//! # extern crate proc_macro;
+//! #
+//! use proc_macro::TokenStream;
+//! use proc_macro2::Span;
+//! use quote::quote_spanned;
+//! use syn::Type;
+//! use syn::spanned::Spanned;
+//!
+//! # const IGNORE_TOKENS: &str = stringify! {
+//! #[proc_macro_derive(MyMacro)]
+//! # };
+//! pub fn my_macro(input: TokenStream) -> TokenStream {
+//!     # let ty = get_a_type();
+//!     /* ... */
+//!
+//!     let assert_sync = quote_spanned! {ty.span()=>
+//!         struct _AssertSync where #ty: Sync;
+//!     };
+//!
+//!     /* ... */
+//!     # input
+//! }
+//! #
+//! # fn get_a_type() -> Type {
+//! #     unimplemented!()
+//! # }
+//! ```
+//!
+//! By inserting this `assert_sync` fragment into the output code generated by
+//! our macro, the user's code will fail to compile if `ty` does not implement
+//! `Sync`. The errors they would see look like the following.
+//!
+//! ```text
+//! error[E0277]: the trait bound `*const i32: std::marker::Sync` is not satisfied
+//!   --> src/main.rs:10:21
+//!    |
+//! 10 |     bad_field: *const i32,
+//!    |                ^^^^^^^^^^ `*const i32` cannot be shared between threads safely
+//! ```
+//!
+//! In this technique, using the `Type`'s span for the error message makes the
+//! error appear in the correct place underlining the right type.
+//!
+//! <br>
+//!
+//! # Limitations
+//!
+//! The underlying [`proc_macro::Span::join`] method is nightly-only. When
+//! called from within a procedural macro in a nightly compiler, `Spanned` will
+//! use `join` to produce the intended span. When not using a nightly compiler,
+//! only the span of the *first token* of the syntax tree node is returned.
+//!
+//! In the common case of wanting to use the joined span as the span of a
+//! `syn::Error`, consider instead using [`syn::Error::new_spanned`] which is
+//! able to span the error correctly under the complete syntax tree node without
+//! needing the unstable `join`.
+//!
+//! [`syn::Error::new_spanned`]: crate::Error::new_spanned
+
+use proc_macro2::Span;
+use quote::spanned::Spanned as ToTokens;
+
+/// A trait that can provide the `Span` of the complete contents of a syntax
+/// tree node.
+///
+/// This trait is automatically implemented for all types that implement
+/// [`ToTokens`] from the `quote` crate, as well as for `Span` itself.
+///
+/// [`ToTokens`]: quote::ToTokens
+///
+/// See the [module documentation] for an example.
+///
+/// [module documentation]: self
+pub trait Spanned: private::Sealed {
+    /// Returns a `Span` covering the complete contents of this syntax tree
+    /// node, or [`Span::call_site()`] if this node is empty.
+    ///
+    /// [`Span::call_site()`]: proc_macro2::Span::call_site
+    fn span(&self) -> Span;
+}
+
+impl<T: ?Sized + ToTokens> Spanned for T {
+    fn span(&self) -> Span {
+        self.__span()
+    }
+}
+
+mod private {
+    use crate::spanned::ToTokens;
+
+    pub trait Sealed {}
+    impl<T: ?Sized + ToTokens> Sealed for T {}
+
+    #[cfg(any(feature = "full", feature = "derive"))]
+    impl Sealed for crate::QSelf {}
+}
+
\ No newline at end of file diff --git a/src/syn/stmt.rs.html b/src/syn/stmt.rs.html new file mode 100644 index 0000000..accf6e0 --- /dev/null +++ b/src/syn/stmt.rs.html @@ -0,0 +1,937 @@ +stmt.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+
use crate::attr::Attribute;
+use crate::expr::Expr;
+use crate::item::Item;
+use crate::mac::Macro;
+use crate::pat::Pat;
+use crate::token;
+
+ast_struct! {
+    /// A braced block containing Rust statements.
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    pub struct Block {
+        pub brace_token: token::Brace,
+        /// Statements in a block
+        pub stmts: Vec<Stmt>,
+    }
+}
+
+ast_enum! {
+    /// A statement, usually ending in a semicolon.
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    pub enum Stmt {
+        /// A local (let) binding.
+        Local(Local),
+
+        /// An item definition.
+        Item(Item),
+
+        /// Expression, with or without trailing semicolon.
+        Expr(Expr, Option<Token![;]>),
+
+        /// A macro invocation in statement position.
+        ///
+        /// Syntactically it's ambiguous which other kind of statement this
+        /// macro would expand to. It can be any of local variable (`let`),
+        /// item, or expression.
+        Macro(StmtMacro),
+    }
+}
+
+ast_struct! {
+    /// A local `let` binding: `let x: u64 = s.parse()?`.
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    pub struct Local {
+        pub attrs: Vec<Attribute>,
+        pub let_token: Token![let],
+        pub pat: Pat,
+        pub init: Option<LocalInit>,
+        pub semi_token: Token![;],
+    }
+}
+
+ast_struct! {
+    /// The expression assigned in a local `let` binding, including optional
+    /// diverging `else` block.
+    ///
+    /// `LocalInit` represents `= s.parse()?` in `let x: u64 = s.parse()?` and
+    /// `= r else { return }` in `let Ok(x) = r else { return }`.
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    pub struct LocalInit {
+        pub eq_token: Token![=],
+        pub expr: Box<Expr>,
+        pub diverge: Option<(Token![else], Box<Expr>)>,
+    }
+}
+
+ast_struct! {
+    /// A macro invocation in statement position.
+    ///
+    /// Syntactically it's ambiguous which other kind of statement this macro
+    /// would expand to. It can be any of local variable (`let`), item, or
+    /// expression.
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
+    pub struct StmtMacro {
+        pub attrs: Vec<Attribute>,
+        pub mac: Macro,
+        pub semi_token: Option<Token![;]>,
+    }
+}
+
+#[cfg(feature = "parsing")]
+pub(crate) mod parsing {
+    use crate::attr::Attribute;
+    use crate::error::Result;
+    use crate::expr::{self, Expr, ExprBlock, ExprMacro};
+    use crate::ident::Ident;
+    use crate::item;
+    use crate::mac::{self, Macro};
+    use crate::parse::discouraged::Speculative as _;
+    use crate::parse::{Parse, ParseStream};
+    use crate::pat::{Pat, PatType};
+    use crate::path::Path;
+    use crate::stmt::{Block, Local, LocalInit, Stmt, StmtMacro};
+    use crate::token;
+    use crate::ty::Type;
+    use proc_macro2::TokenStream;
+
+    struct AllowNoSemi(bool);
+
+    impl Block {
+        /// Parse the body of a block as zero or more statements, possibly
+        /// including one trailing expression.
+        ///
+        /// # Example
+        ///
+        /// ```
+        /// use syn::{braced, token, Attribute, Block, Ident, Result, Stmt, Token};
+        /// use syn::parse::{Parse, ParseStream};
+        ///
+        /// // Parse a function with no generics or parameter list.
+        /// //
+        /// //     fn playground {
+        /// //         let mut x = 1;
+        /// //         x += 1;
+        /// //         println!("{}", x);
+        /// //     }
+        /// struct MiniFunction {
+        ///     attrs: Vec<Attribute>,
+        ///     fn_token: Token![fn],
+        ///     name: Ident,
+        ///     brace_token: token::Brace,
+        ///     stmts: Vec<Stmt>,
+        /// }
+        ///
+        /// impl Parse for MiniFunction {
+        ///     fn parse(input: ParseStream) -> Result<Self> {
+        ///         let outer_attrs = input.call(Attribute::parse_outer)?;
+        ///         let fn_token: Token![fn] = input.parse()?;
+        ///         let name: Ident = input.parse()?;
+        ///
+        ///         let content;
+        ///         let brace_token = braced!(content in input);
+        ///         let inner_attrs = content.call(Attribute::parse_inner)?;
+        ///         let stmts = content.call(Block::parse_within)?;
+        ///
+        ///         Ok(MiniFunction {
+        ///             attrs: {
+        ///                 let mut attrs = outer_attrs;
+        ///                 attrs.extend(inner_attrs);
+        ///                 attrs
+        ///             },
+        ///             fn_token,
+        ///             name,
+        ///             brace_token,
+        ///             stmts,
+        ///         })
+        ///     }
+        /// }
+        /// ```
+        #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+        pub fn parse_within(input: ParseStream) -> Result<Vec<Stmt>> {
+            let mut stmts = Vec::new();
+            loop {
+                while let semi @ Some(_) = input.parse()? {
+                    stmts.push(Stmt::Expr(Expr::Verbatim(TokenStream::new()), semi));
+                }
+                if input.is_empty() {
+                    break;
+                }
+                let stmt = parse_stmt(input, AllowNoSemi(true))?;
+                let requires_semicolon = match &stmt {
+                    Stmt::Expr(stmt, None) => expr::requires_terminator(stmt),
+                    Stmt::Macro(stmt) => {
+                        stmt.semi_token.is_none() && !stmt.mac.delimiter.is_brace()
+                    }
+                    Stmt::Local(_) | Stmt::Item(_) | Stmt::Expr(_, Some(_)) => false,
+                };
+                stmts.push(stmt);
+                if input.is_empty() {
+                    break;
+                } else if requires_semicolon {
+                    return Err(input.error("unexpected token, expected `;`"));
+                }
+            }
+            Ok(stmts)
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for Block {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let content;
+            Ok(Block {
+                brace_token: braced!(content in input),
+                stmts: content.call(Block::parse_within)?,
+            })
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for Stmt {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let allow_nosemi = AllowNoSemi(false);
+            parse_stmt(input, allow_nosemi)
+        }
+    }
+
+    fn parse_stmt(input: ParseStream, allow_nosemi: AllowNoSemi) -> Result<Stmt> {
+        let begin = input.fork();
+        let attrs = input.call(Attribute::parse_outer)?;
+
+        // brace-style macros; paren and bracket macros get parsed as
+        // expression statements.
+        let ahead = input.fork();
+        let mut is_item_macro = false;
+        if let Ok(path) = ahead.call(Path::parse_mod_style) {
+            if ahead.peek(Token![!]) {
+                if ahead.peek2(Ident) || ahead.peek2(Token![try]) {
+                    is_item_macro = true;
+                } else if ahead.peek2(token::Brace)
+                    && !(ahead.peek3(Token![.]) || ahead.peek3(Token![?]))
+                {
+                    input.advance_to(&ahead);
+                    return stmt_mac(input, attrs, path).map(Stmt::Macro);
+                }
+            }
+        }
+
+        if input.peek(Token![let]) && !input.peek(token::Group) {
+            stmt_local(input, attrs).map(Stmt::Local)
+        } else if input.peek(Token![pub])
+            || input.peek(Token![crate]) && !input.peek2(Token![::])
+            || input.peek(Token![extern])
+            || input.peek(Token![use])
+            || input.peek(Token![static])
+                && (input.peek2(Token![mut])
+                    || input.peek2(Ident)
+                        && !(input.peek2(Token![async])
+                            && (input.peek3(Token![move]) || input.peek3(Token![|]))))
+            || input.peek(Token![const])
+                && !(input.peek2(token::Brace)
+                    || input.peek2(Token![static])
+                    || input.peek2(Token![async])
+                        && !(input.peek3(Token![unsafe])
+                            || input.peek3(Token![extern])
+                            || input.peek3(Token![fn]))
+                    || input.peek2(Token![move])
+                    || input.peek2(Token![|]))
+            || input.peek(Token![unsafe]) && !input.peek2(token::Brace)
+            || input.peek(Token![async])
+                && (input.peek2(Token![unsafe])
+                    || input.peek2(Token![extern])
+                    || input.peek2(Token![fn]))
+            || input.peek(Token![fn])
+            || input.peek(Token![mod])
+            || input.peek(Token![type])
+            || input.peek(Token![struct])
+            || input.peek(Token![enum])
+            || input.peek(Token![union]) && input.peek2(Ident)
+            || input.peek(Token![auto]) && input.peek2(Token![trait])
+            || input.peek(Token![trait])
+            || input.peek(Token![default])
+                && (input.peek2(Token![unsafe]) || input.peek2(Token![impl]))
+            || input.peek(Token![impl])
+            || input.peek(Token![macro])
+            || is_item_macro
+        {
+            let item = item::parsing::parse_rest_of_item(begin, attrs, input)?;
+            Ok(Stmt::Item(item))
+        } else {
+            stmt_expr(input, allow_nosemi, attrs)
+        }
+    }
+
+    fn stmt_mac(input: ParseStream, attrs: Vec<Attribute>, path: Path) -> Result<StmtMacro> {
+        let bang_token: Token![!] = input.parse()?;
+        let (delimiter, tokens) = mac::parse_delimiter(input)?;
+        let semi_token: Option<Token![;]> = input.parse()?;
+
+        Ok(StmtMacro {
+            attrs,
+            mac: Macro {
+                path,
+                bang_token,
+                delimiter,
+                tokens,
+            },
+            semi_token,
+        })
+    }
+
+    fn stmt_local(input: ParseStream, attrs: Vec<Attribute>) -> Result<Local> {
+        let let_token: Token![let] = input.parse()?;
+
+        let mut pat = Pat::parse_single(input)?;
+        if input.peek(Token![:]) {
+            let colon_token: Token![:] = input.parse()?;
+            let ty: Type = input.parse()?;
+            pat = Pat::Type(PatType {
+                attrs: Vec::new(),
+                pat: Box::new(pat),
+                colon_token,
+                ty: Box::new(ty),
+            });
+        }
+
+        let init = if let Some(eq_token) = input.parse()? {
+            let eq_token: Token![=] = eq_token;
+            let expr: Expr = input.parse()?;
+
+            let diverge = if let Some(else_token) = input.parse()? {
+                let else_token: Token![else] = else_token;
+                let diverge = ExprBlock {
+                    attrs: Vec::new(),
+                    label: None,
+                    block: input.parse()?,
+                };
+                Some((else_token, Box::new(Expr::Block(diverge))))
+            } else {
+                None
+            };
+
+            Some(LocalInit {
+                eq_token,
+                expr: Box::new(expr),
+                diverge,
+            })
+        } else {
+            None
+        };
+
+        let semi_token: Token![;] = input.parse()?;
+
+        Ok(Local {
+            attrs,
+            let_token,
+            pat,
+            init,
+            semi_token,
+        })
+    }
+
+    fn stmt_expr(
+        input: ParseStream,
+        allow_nosemi: AllowNoSemi,
+        mut attrs: Vec<Attribute>,
+    ) -> Result<Stmt> {
+        let mut e = Expr::parse_with_earlier_boundary_rule(input)?;
+
+        let mut attr_target = &mut e;
+        loop {
+            attr_target = match attr_target {
+                Expr::Assign(e) => &mut e.left,
+                Expr::Binary(e) => &mut e.left,
+                Expr::Cast(e) => &mut e.expr,
+                Expr::Array(_)
+                | Expr::Async(_)
+                | Expr::Await(_)
+                | Expr::Block(_)
+                | Expr::Break(_)
+                | Expr::Call(_)
+                | Expr::Closure(_)
+                | Expr::Const(_)
+                | Expr::Continue(_)
+                | Expr::Field(_)
+                | Expr::ForLoop(_)
+                | Expr::Group(_)
+                | Expr::If(_)
+                | Expr::Index(_)
+                | Expr::Infer(_)
+                | Expr::Let(_)
+                | Expr::Lit(_)
+                | Expr::Loop(_)
+                | Expr::Macro(_)
+                | Expr::Match(_)
+                | Expr::MethodCall(_)
+                | Expr::Paren(_)
+                | Expr::Path(_)
+                | Expr::Range(_)
+                | Expr::Reference(_)
+                | Expr::Repeat(_)
+                | Expr::Return(_)
+                | Expr::Struct(_)
+                | Expr::Try(_)
+                | Expr::TryBlock(_)
+                | Expr::Tuple(_)
+                | Expr::Unary(_)
+                | Expr::Unsafe(_)
+                | Expr::While(_)
+                | Expr::Yield(_)
+                | Expr::Verbatim(_) => break,
+            };
+        }
+        attrs.extend(attr_target.replace_attrs(Vec::new()));
+        attr_target.replace_attrs(attrs);
+
+        let semi_token: Option<Token![;]> = input.parse()?;
+
+        match e {
+            Expr::Macro(ExprMacro { attrs, mac })
+                if semi_token.is_some() || mac.delimiter.is_brace() =>
+            {
+                return Ok(Stmt::Macro(StmtMacro {
+                    attrs,
+                    mac,
+                    semi_token,
+                }));
+            }
+            _ => {}
+        }
+
+        if semi_token.is_some() {
+            Ok(Stmt::Expr(e, semi_token))
+        } else if allow_nosemi.0 || !expr::requires_terminator(&e) {
+            Ok(Stmt::Expr(e, None))
+        } else {
+            Err(input.error("expected semicolon"))
+        }
+    }
+}
+
+#[cfg(feature = "printing")]
+mod printing {
+    use crate::expr;
+    use crate::stmt::{Block, Local, Stmt, StmtMacro};
+    use proc_macro2::TokenStream;
+    use quote::{ToTokens, TokenStreamExt};
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for Block {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.brace_token.surround(tokens, |tokens| {
+                tokens.append_all(&self.stmts);
+            });
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for Stmt {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            match self {
+                Stmt::Local(local) => local.to_tokens(tokens),
+                Stmt::Item(item) => item.to_tokens(tokens),
+                Stmt::Expr(expr, semi) => {
+                    expr.to_tokens(tokens);
+                    semi.to_tokens(tokens);
+                }
+                Stmt::Macro(mac) => mac.to_tokens(tokens),
+            }
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for Local {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            expr::printing::outer_attrs_to_tokens(&self.attrs, tokens);
+            self.let_token.to_tokens(tokens);
+            self.pat.to_tokens(tokens);
+            if let Some(init) = &self.init {
+                init.eq_token.to_tokens(tokens);
+                init.expr.to_tokens(tokens);
+                if let Some((else_token, diverge)) = &init.diverge {
+                    else_token.to_tokens(tokens);
+                    diverge.to_tokens(tokens);
+                }
+            }
+            self.semi_token.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for StmtMacro {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            expr::printing::outer_attrs_to_tokens(&self.attrs, tokens);
+            self.mac.to_tokens(tokens);
+            self.semi_token.to_tokens(tokens);
+        }
+    }
+}
+
\ No newline at end of file diff --git a/src/syn/thread.rs.html b/src/syn/thread.rs.html new file mode 100644 index 0000000..413a601 --- /dev/null +++ b/src/syn/thread.rs.html @@ -0,0 +1,121 @@ +thread.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+
use std::fmt::{self, Debug};
+use std::thread::{self, ThreadId};
+
+/// ThreadBound is a Sync-maker and Send-maker that allows accessing a value
+/// of type T only from the original thread on which the ThreadBound was
+/// constructed.
+pub(crate) struct ThreadBound<T> {
+    value: T,
+    thread_id: ThreadId,
+}
+
+unsafe impl<T> Sync for ThreadBound<T> {}
+
+// Send bound requires Copy, as otherwise Drop could run in the wrong place.
+//
+// Today Copy and Drop are mutually exclusive so `T: Copy` implies `T: !Drop`.
+// This impl needs to be revisited if that restriction is relaxed in the future.
+unsafe impl<T: Copy> Send for ThreadBound<T> {}
+
+impl<T> ThreadBound<T> {
+    pub(crate) fn new(value: T) -> Self {
+        ThreadBound {
+            value,
+            thread_id: thread::current().id(),
+        }
+    }
+
+    pub(crate) fn get(&self) -> Option<&T> {
+        if thread::current().id() == self.thread_id {
+            Some(&self.value)
+        } else {
+            None
+        }
+    }
+}
+
+impl<T: Debug> Debug for ThreadBound<T> {
+    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+        match self.get() {
+            Some(value) => Debug::fmt(value, formatter),
+            None => formatter.write_str("unknown"),
+        }
+    }
+}
+
+// Copy the bytes of T, even if the currently running thread is the "wrong"
+// thread. This is fine as long as the original thread is not simultaneously
+// mutating this value via interior mutability, which would be a data race.
+//
+// Currently `T: Copy` is sufficient to guarantee that T contains no interior
+// mutability, because _all_ interior mutability in Rust is built on
+// std::cell::UnsafeCell, which has no Copy impl. This impl needs to be
+// revisited if that restriction is relaxed in the future.
+impl<T: Copy> Copy for ThreadBound<T> {}
+
+impl<T: Copy> Clone for ThreadBound<T> {
+    fn clone(&self) -> Self {
+        *self
+    }
+}
+
\ No newline at end of file diff --git a/src/syn/token.rs.html b/src/syn/token.rs.html new file mode 100644 index 0000000..b90bb47 --- /dev/null +++ b/src/syn/token.rs.html @@ -0,0 +1,2277 @@ +token.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+753
+754
+755
+756
+757
+758
+759
+760
+761
+762
+763
+764
+765
+766
+767
+768
+769
+770
+771
+772
+773
+774
+775
+776
+777
+778
+779
+780
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+794
+795
+796
+797
+798
+799
+800
+801
+802
+803
+804
+805
+806
+807
+808
+809
+810
+811
+812
+813
+814
+815
+816
+817
+818
+819
+820
+821
+822
+823
+824
+825
+826
+827
+828
+829
+830
+831
+832
+833
+834
+835
+836
+837
+838
+839
+840
+841
+842
+843
+844
+845
+846
+847
+848
+849
+850
+851
+852
+853
+854
+855
+856
+857
+858
+859
+860
+861
+862
+863
+864
+865
+866
+867
+868
+869
+870
+871
+872
+873
+874
+875
+876
+877
+878
+879
+880
+881
+882
+883
+884
+885
+886
+887
+888
+889
+890
+891
+892
+893
+894
+895
+896
+897
+898
+899
+900
+901
+902
+903
+904
+905
+906
+907
+908
+909
+910
+911
+912
+913
+914
+915
+916
+917
+918
+919
+920
+921
+922
+923
+924
+925
+926
+927
+928
+929
+930
+931
+932
+933
+934
+935
+936
+937
+938
+939
+940
+941
+942
+943
+944
+945
+946
+947
+948
+949
+950
+951
+952
+953
+954
+955
+956
+957
+958
+959
+960
+961
+962
+963
+964
+965
+966
+967
+968
+969
+970
+971
+972
+973
+974
+975
+976
+977
+978
+979
+980
+981
+982
+983
+984
+985
+986
+987
+988
+989
+990
+991
+992
+993
+994
+995
+996
+997
+998
+999
+1000
+1001
+1002
+1003
+1004
+1005
+1006
+1007
+1008
+1009
+1010
+1011
+1012
+1013
+1014
+1015
+1016
+1017
+1018
+1019
+1020
+1021
+1022
+1023
+1024
+1025
+1026
+1027
+1028
+1029
+1030
+1031
+1032
+1033
+1034
+1035
+1036
+1037
+1038
+1039
+1040
+1041
+1042
+1043
+1044
+1045
+1046
+1047
+1048
+1049
+1050
+1051
+1052
+1053
+1054
+1055
+1056
+1057
+1058
+1059
+1060
+1061
+1062
+1063
+1064
+1065
+1066
+1067
+1068
+1069
+1070
+1071
+1072
+1073
+1074
+1075
+1076
+1077
+1078
+1079
+1080
+1081
+1082
+1083
+1084
+1085
+1086
+1087
+1088
+1089
+1090
+1091
+1092
+1093
+1094
+1095
+1096
+1097
+1098
+1099
+1100
+1101
+1102
+1103
+1104
+1105
+1106
+1107
+1108
+1109
+1110
+1111
+1112
+1113
+1114
+1115
+1116
+1117
+1118
+1119
+1120
+1121
+1122
+1123
+1124
+1125
+1126
+1127
+1128
+1129
+1130
+1131
+1132
+1133
+1134
+1135
+1136
+1137
+1138
+
//! Tokens representing Rust punctuation, keywords, and delimiters.
+//!
+//! The type names in this module can be difficult to keep straight, so we
+//! prefer to use the [`Token!`] macro instead. This is a type-macro that
+//! expands to the token type of the given token.
+//!
+//! [`Token!`]: crate::Token
+//!
+//! # Example
+//!
+//! The [`ItemStatic`] syntax tree node is defined like this.
+//!
+//! [`ItemStatic`]: crate::ItemStatic
+//!
+//! ```
+//! # use syn::{Attribute, Expr, Ident, Token, Type, Visibility};
+//! #
+//! pub struct ItemStatic {
+//!     pub attrs: Vec<Attribute>,
+//!     pub vis: Visibility,
+//!     pub static_token: Token![static],
+//!     pub mutability: Option<Token![mut]>,
+//!     pub ident: Ident,
+//!     pub colon_token: Token![:],
+//!     pub ty: Box<Type>,
+//!     pub eq_token: Token![=],
+//!     pub expr: Box<Expr>,
+//!     pub semi_token: Token![;],
+//! }
+//! ```
+//!
+//! # Parsing
+//!
+//! Keywords and punctuation can be parsed through the [`ParseStream::parse`]
+//! method. Delimiter tokens are parsed using the [`parenthesized!`],
+//! [`bracketed!`] and [`braced!`] macros.
+//!
+//! [`ParseStream::parse`]: crate::parse::ParseBuffer::parse()
+//! [`parenthesized!`]: crate::parenthesized!
+//! [`bracketed!`]: crate::bracketed!
+//! [`braced!`]: crate::braced!
+//!
+//! ```
+//! use syn::{Attribute, Result};
+//! use syn::parse::{Parse, ParseStream};
+//! #
+//! # enum ItemStatic {}
+//!
+//! // Parse the ItemStatic struct shown above.
+//! impl Parse for ItemStatic {
+//!     fn parse(input: ParseStream) -> Result<Self> {
+//!         # use syn::ItemStatic;
+//!         # fn parse(input: ParseStream) -> Result<ItemStatic> {
+//!         Ok(ItemStatic {
+//!             attrs: input.call(Attribute::parse_outer)?,
+//!             vis: input.parse()?,
+//!             static_token: input.parse()?,
+//!             mutability: input.parse()?,
+//!             ident: input.parse()?,
+//!             colon_token: input.parse()?,
+//!             ty: input.parse()?,
+//!             eq_token: input.parse()?,
+//!             expr: input.parse()?,
+//!             semi_token: input.parse()?,
+//!         })
+//!         # }
+//!         # unimplemented!()
+//!     }
+//! }
+//! ```
+//!
+//! # Other operations
+//!
+//! Every keyword and punctuation token supports the following operations.
+//!
+//! - [Peeking] — `input.peek(Token![...])`
+//!
+//! - [Parsing] — `input.parse::<Token![...]>()?`
+//!
+//! - [Printing] — `quote!( ... #the_token ... )`
+//!
+//! - Construction from a [`Span`] — `let the_token = Token![...](sp)`
+//!
+//! - Field access to its span — `let sp = the_token.span`
+//!
+//! [Peeking]: crate::parse::ParseBuffer::peek()
+//! [Parsing]: crate::parse::ParseBuffer::parse()
+//! [Printing]: https://docs.rs/quote/1.0/quote/trait.ToTokens.html
+//! [`Span`]: https://docs.rs/proc-macro2/1.0/proc_macro2/struct.Span.html
+
+#[cfg(feature = "parsing")]
+pub(crate) use self::private::CustomToken;
+use self::private::WithSpan;
+#[cfg(feature = "parsing")]
+use crate::buffer::Cursor;
+#[cfg(feature = "parsing")]
+use crate::error::Result;
+#[cfg(feature = "parsing")]
+use crate::lifetime::Lifetime;
+#[cfg(feature = "parsing")]
+use crate::lit::{Lit, LitBool, LitByte, LitByteStr, LitChar, LitFloat, LitInt, LitStr};
+#[cfg(feature = "parsing")]
+use crate::lookahead;
+#[cfg(feature = "parsing")]
+use crate::parse::{Parse, ParseStream};
+use crate::span::IntoSpans;
+use proc_macro2::extra::DelimSpan;
+use proc_macro2::Span;
+#[cfg(feature = "printing")]
+use proc_macro2::TokenStream;
+#[cfg(any(feature = "parsing", feature = "printing"))]
+use proc_macro2::{Delimiter, Ident};
+#[cfg(feature = "parsing")]
+use proc_macro2::{Literal, Punct, TokenTree};
+#[cfg(feature = "printing")]
+use quote::{ToTokens, TokenStreamExt};
+#[cfg(feature = "extra-traits")]
+use std::cmp;
+#[cfg(feature = "extra-traits")]
+use std::fmt::{self, Debug};
+#[cfg(feature = "extra-traits")]
+use std::hash::{Hash, Hasher};
+use std::ops::{Deref, DerefMut};
+
+/// Marker trait for types that represent single tokens.
+///
+/// This trait is sealed and cannot be implemented for types outside of Syn.
+#[cfg(feature = "parsing")]
+pub trait Token: private::Sealed {
+    // Not public API.
+    #[doc(hidden)]
+    fn peek(cursor: Cursor) -> bool;
+
+    // Not public API.
+    #[doc(hidden)]
+    fn display() -> &'static str;
+}
+
+pub(crate) mod private {
+    #[cfg(feature = "parsing")]
+    use crate::buffer::Cursor;
+    use proc_macro2::Span;
+
+    #[cfg(feature = "parsing")]
+    pub trait Sealed {}
+
+    /// Support writing `token.span` rather than `token.spans[0]` on tokens that
+    /// hold a single span.
+    #[repr(transparent)]
+    #[allow(unknown_lints, repr_transparent_external_private_fields)] // False positive: https://github.com/rust-lang/rust/issues/78586#issuecomment-1722680482
+    pub struct WithSpan {
+        pub span: Span,
+    }
+
+    // Not public API.
+    #[doc(hidden)]
+    #[cfg(feature = "parsing")]
+    pub trait CustomToken {
+        fn peek(cursor: Cursor) -> bool;
+        fn display() -> &'static str;
+    }
+}
+
+#[cfg(feature = "parsing")]
+impl private::Sealed for Ident {}
+
+#[cfg(feature = "parsing")]
+fn peek_impl(cursor: Cursor, peek: fn(ParseStream) -> bool) -> bool {
+    use crate::parse::Unexpected;
+    use std::cell::Cell;
+    use std::rc::Rc;
+
+    let scope = Span::call_site();
+    let unexpected = Rc::new(Cell::new(Unexpected::None));
+    let buffer = crate::parse::new_parse_buffer(scope, cursor, unexpected);
+    peek(&buffer)
+}
+
+macro_rules! impl_token {
+    ($display:literal $name:ty) => {
+        #[cfg(feature = "parsing")]
+        impl Token for $name {
+            fn peek(cursor: Cursor) -> bool {
+                fn peek(input: ParseStream) -> bool {
+                    <$name as Parse>::parse(input).is_ok()
+                }
+                peek_impl(cursor, peek)
+            }
+
+            fn display() -> &'static str {
+                $display
+            }
+        }
+
+        #[cfg(feature = "parsing")]
+        impl private::Sealed for $name {}
+    };
+}
+
+impl_token!("lifetime" Lifetime);
+impl_token!("literal" Lit);
+impl_token!("string literal" LitStr);
+impl_token!("byte string literal" LitByteStr);
+impl_token!("byte literal" LitByte);
+impl_token!("character literal" LitChar);
+impl_token!("integer literal" LitInt);
+impl_token!("floating point literal" LitFloat);
+impl_token!("boolean literal" LitBool);
+impl_token!("group token" proc_macro2::Group);
+
+macro_rules! impl_low_level_token {
+    ($display:literal $ty:ident $get:ident) => {
+        #[cfg(feature = "parsing")]
+        impl Token for $ty {
+            fn peek(cursor: Cursor) -> bool {
+                cursor.$get().is_some()
+            }
+
+            fn display() -> &'static str {
+                $display
+            }
+        }
+
+        #[cfg(feature = "parsing")]
+        impl private::Sealed for $ty {}
+    };
+}
+
+impl_low_level_token!("punctuation token" Punct punct);
+impl_low_level_token!("literal" Literal literal);
+impl_low_level_token!("token" TokenTree token_tree);
+
+#[cfg(feature = "parsing")]
+impl<T: CustomToken> private::Sealed for T {}
+
+#[cfg(feature = "parsing")]
+impl<T: CustomToken> Token for T {
+    fn peek(cursor: Cursor) -> bool {
+        <Self as CustomToken>::peek(cursor)
+    }
+
+    fn display() -> &'static str {
+        <Self as CustomToken>::display()
+    }
+}
+
+macro_rules! define_keywords {
+    ($($token:literal pub struct $name:ident)*) => {
+        $(
+            #[doc = concat!('`', $token, '`')]
+            ///
+            /// Don't try to remember the name of this type &mdash; use the
+            /// [`Token!`] macro instead.
+            ///
+            /// [`Token!`]: crate::token
+            pub struct $name {
+                pub span: Span,
+            }
+
+            #[doc(hidden)]
+            #[allow(non_snake_case)]
+            pub fn $name<S: IntoSpans<Span>>(span: S) -> $name {
+                $name {
+                    span: span.into_spans(),
+                }
+            }
+
+            impl std::default::Default for $name {
+                fn default() -> Self {
+                    $name {
+                        span: Span::call_site(),
+                    }
+                }
+            }
+
+            #[cfg(feature = "clone-impls")]
+            #[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+            impl Copy for $name {}
+
+            #[cfg(feature = "clone-impls")]
+            #[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+            impl Clone for $name {
+                fn clone(&self) -> Self {
+                    *self
+                }
+            }
+
+            #[cfg(feature = "extra-traits")]
+            #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))]
+            impl Debug for $name {
+                fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+                    f.write_str(stringify!($name))
+                }
+            }
+
+            #[cfg(feature = "extra-traits")]
+            #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))]
+            impl cmp::Eq for $name {}
+
+            #[cfg(feature = "extra-traits")]
+            #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))]
+            impl PartialEq for $name {
+                fn eq(&self, _other: &$name) -> bool {
+                    true
+                }
+            }
+
+            #[cfg(feature = "extra-traits")]
+            #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))]
+            impl Hash for $name {
+                fn hash<H: Hasher>(&self, _state: &mut H) {}
+            }
+
+            #[cfg(feature = "printing")]
+            #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+            impl ToTokens for $name {
+                fn to_tokens(&self, tokens: &mut TokenStream) {
+                    printing::keyword($token, self.span, tokens);
+                }
+            }
+
+            #[cfg(feature = "parsing")]
+            #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+            impl Parse for $name {
+                fn parse(input: ParseStream) -> Result<Self> {
+                    Ok($name {
+                        span: parsing::keyword(input, $token)?,
+                    })
+                }
+            }
+
+            #[cfg(feature = "parsing")]
+            impl Token for $name {
+                fn peek(cursor: Cursor) -> bool {
+                    parsing::peek_keyword(cursor, $token)
+                }
+
+                fn display() -> &'static str {
+                    concat!("`", $token, "`")
+                }
+            }
+
+            #[cfg(feature = "parsing")]
+            impl private::Sealed for $name {}
+        )*
+    };
+}
+
+macro_rules! impl_deref_if_len_is_1 {
+    ($name:ident/1) => {
+        impl Deref for $name {
+            type Target = WithSpan;
+
+            fn deref(&self) -> &Self::Target {
+                unsafe { &*(self as *const Self).cast::<WithSpan>() }
+            }
+        }
+
+        impl DerefMut for $name {
+            fn deref_mut(&mut self) -> &mut Self::Target {
+                unsafe { &mut *(self as *mut Self).cast::<WithSpan>() }
+            }
+        }
+    };
+
+    ($name:ident/$len:literal) => {};
+}
+
+macro_rules! define_punctuation_structs {
+    ($($token:literal pub struct $name:ident/$len:tt #[doc = $usage:literal])*) => {
+        $(
+            #[cfg_attr(not(doc), repr(transparent))]
+            #[allow(unknown_lints, repr_transparent_external_private_fields)] // False positive: https://github.com/rust-lang/rust/issues/78586#issuecomment-1722680482
+            #[doc = concat!('`', $token, '`')]
+            ///
+            /// Usage:
+            #[doc = concat!($usage, '.')]
+            ///
+            /// Don't try to remember the name of this type &mdash; use the
+            /// [`Token!`] macro instead.
+            ///
+            /// [`Token!`]: crate::token
+            pub struct $name {
+                pub spans: [Span; $len],
+            }
+
+            #[doc(hidden)]
+            #[allow(non_snake_case)]
+            pub fn $name<S: IntoSpans<[Span; $len]>>(spans: S) -> $name {
+                $name {
+                    spans: spans.into_spans(),
+                }
+            }
+
+            impl std::default::Default for $name {
+                fn default() -> Self {
+                    $name {
+                        spans: [Span::call_site(); $len],
+                    }
+                }
+            }
+
+            #[cfg(feature = "clone-impls")]
+            #[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+            impl Copy for $name {}
+
+            #[cfg(feature = "clone-impls")]
+            #[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+            impl Clone for $name {
+                fn clone(&self) -> Self {
+                    *self
+                }
+            }
+
+            #[cfg(feature = "extra-traits")]
+            #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))]
+            impl Debug for $name {
+                fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+                    f.write_str(stringify!($name))
+                }
+            }
+
+            #[cfg(feature = "extra-traits")]
+            #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))]
+            impl cmp::Eq for $name {}
+
+            #[cfg(feature = "extra-traits")]
+            #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))]
+            impl PartialEq for $name {
+                fn eq(&self, _other: &$name) -> bool {
+                    true
+                }
+            }
+
+            #[cfg(feature = "extra-traits")]
+            #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))]
+            impl Hash for $name {
+                fn hash<H: Hasher>(&self, _state: &mut H) {}
+            }
+
+            impl_deref_if_len_is_1!($name/$len);
+        )*
+    };
+}
+
+macro_rules! define_punctuation {
+    ($($token:literal pub struct $name:ident/$len:tt #[doc = $usage:literal])*) => {
+        $(
+            define_punctuation_structs! {
+                $token pub struct $name/$len #[doc = $usage]
+            }
+
+            #[cfg(feature = "printing")]
+            #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+            impl ToTokens for $name {
+                fn to_tokens(&self, tokens: &mut TokenStream) {
+                    printing::punct($token, &self.spans, tokens);
+                }
+            }
+
+            #[cfg(feature = "parsing")]
+            #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+            impl Parse for $name {
+                fn parse(input: ParseStream) -> Result<Self> {
+                    Ok($name {
+                        spans: parsing::punct(input, $token)?,
+                    })
+                }
+            }
+
+            #[cfg(feature = "parsing")]
+            impl Token for $name {
+                fn peek(cursor: Cursor) -> bool {
+                    parsing::peek_punct(cursor, $token)
+                }
+
+                fn display() -> &'static str {
+                    concat!("`", $token, "`")
+                }
+            }
+
+            #[cfg(feature = "parsing")]
+            impl private::Sealed for $name {}
+        )*
+    };
+}
+
+macro_rules! define_delimiters {
+    ($($delim:ident pub struct $name:ident #[$doc:meta])*) => {
+        $(
+            #[$doc]
+            pub struct $name {
+                pub span: DelimSpan,
+            }
+
+            #[doc(hidden)]
+            #[allow(non_snake_case)]
+            pub fn $name<S: IntoSpans<DelimSpan>>(span: S) -> $name {
+                $name {
+                    span: span.into_spans(),
+                }
+            }
+
+            impl std::default::Default for $name {
+                fn default() -> Self {
+                    $name(Span::call_site())
+                }
+            }
+
+            #[cfg(feature = "clone-impls")]
+            #[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+            impl Copy for $name {}
+
+            #[cfg(feature = "clone-impls")]
+            #[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+            impl Clone for $name {
+                fn clone(&self) -> Self {
+                    *self
+                }
+            }
+
+            #[cfg(feature = "extra-traits")]
+            #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))]
+            impl Debug for $name {
+                fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+                    f.write_str(stringify!($name))
+                }
+            }
+
+            #[cfg(feature = "extra-traits")]
+            #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))]
+            impl cmp::Eq for $name {}
+
+            #[cfg(feature = "extra-traits")]
+            #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))]
+            impl PartialEq for $name {
+                fn eq(&self, _other: &$name) -> bool {
+                    true
+                }
+            }
+
+            #[cfg(feature = "extra-traits")]
+            #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))]
+            impl Hash for $name {
+                fn hash<H: Hasher>(&self, _state: &mut H) {}
+            }
+
+            impl $name {
+                #[cfg(feature = "printing")]
+                pub fn surround<F>(&self, tokens: &mut TokenStream, f: F)
+                where
+                    F: FnOnce(&mut TokenStream),
+                {
+                    let mut inner = TokenStream::new();
+                    f(&mut inner);
+                    printing::delim(Delimiter::$delim, self.span.join(), tokens, inner);
+                }
+            }
+
+            #[cfg(feature = "parsing")]
+            impl private::Sealed for $name {}
+        )*
+    };
+}
+
+define_punctuation_structs! {
+    "_" pub struct Underscore/1 /// wildcard patterns, inferred types, unnamed items in constants, extern crates, use declarations, and destructuring assignment
+}
+
+#[cfg(feature = "printing")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+impl ToTokens for Underscore {
+    fn to_tokens(&self, tokens: &mut TokenStream) {
+        tokens.append(Ident::new("_", self.span));
+    }
+}
+
+#[cfg(feature = "parsing")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+impl Parse for Underscore {
+    fn parse(input: ParseStream) -> Result<Self> {
+        input.step(|cursor| {
+            if let Some((ident, rest)) = cursor.ident() {
+                if ident == "_" {
+                    return Ok((Underscore(ident.span()), rest));
+                }
+            }
+            if let Some((punct, rest)) = cursor.punct() {
+                if punct.as_char() == '_' {
+                    return Ok((Underscore(punct.span()), rest));
+                }
+            }
+            Err(cursor.error("expected `_`"))
+        })
+    }
+}
+
+#[cfg(feature = "parsing")]
+impl Token for Underscore {
+    fn peek(cursor: Cursor) -> bool {
+        if let Some((ident, _rest)) = cursor.ident() {
+            return ident == "_";
+        }
+        if let Some((punct, _rest)) = cursor.punct() {
+            return punct.as_char() == '_';
+        }
+        false
+    }
+
+    fn display() -> &'static str {
+        "`_`"
+    }
+}
+
+#[cfg(feature = "parsing")]
+impl private::Sealed for Underscore {}
+
+/// None-delimited group
+pub struct Group {
+    pub span: Span,
+}
+
+#[doc(hidden)]
+#[allow(non_snake_case)]
+pub fn Group<S: IntoSpans<Span>>(span: S) -> Group {
+    Group {
+        span: span.into_spans(),
+    }
+}
+
+impl std::default::Default for Group {
+    fn default() -> Self {
+        Group {
+            span: Span::call_site(),
+        }
+    }
+}
+
+#[cfg(feature = "clone-impls")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Copy for Group {}
+
+#[cfg(feature = "clone-impls")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
+impl Clone for Group {
+    fn clone(&self) -> Self {
+        *self
+    }
+}
+
+#[cfg(feature = "extra-traits")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))]
+impl Debug for Group {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        f.write_str("Group")
+    }
+}
+
+#[cfg(feature = "extra-traits")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))]
+impl cmp::Eq for Group {}
+
+#[cfg(feature = "extra-traits")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))]
+impl PartialEq for Group {
+    fn eq(&self, _other: &Group) -> bool {
+        true
+    }
+}
+
+#[cfg(feature = "extra-traits")]
+#[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))]
+impl Hash for Group {
+    fn hash<H: Hasher>(&self, _state: &mut H) {}
+}
+
+impl Group {
+    #[cfg(feature = "printing")]
+    pub fn surround<F>(&self, tokens: &mut TokenStream, f: F)
+    where
+        F: FnOnce(&mut TokenStream),
+    {
+        let mut inner = TokenStream::new();
+        f(&mut inner);
+        printing::delim(Delimiter::None, self.span, tokens, inner);
+    }
+}
+
+#[cfg(feature = "parsing")]
+impl private::Sealed for Group {}
+
+#[cfg(feature = "parsing")]
+impl Token for Paren {
+    fn peek(cursor: Cursor) -> bool {
+        lookahead::is_delimiter(cursor, Delimiter::Parenthesis)
+    }
+
+    fn display() -> &'static str {
+        "parentheses"
+    }
+}
+
+#[cfg(feature = "parsing")]
+impl Token for Brace {
+    fn peek(cursor: Cursor) -> bool {
+        lookahead::is_delimiter(cursor, Delimiter::Brace)
+    }
+
+    fn display() -> &'static str {
+        "curly braces"
+    }
+}
+
+#[cfg(feature = "parsing")]
+impl Token for Bracket {
+    fn peek(cursor: Cursor) -> bool {
+        lookahead::is_delimiter(cursor, Delimiter::Bracket)
+    }
+
+    fn display() -> &'static str {
+        "square brackets"
+    }
+}
+
+#[cfg(feature = "parsing")]
+impl Token for Group {
+    fn peek(cursor: Cursor) -> bool {
+        lookahead::is_delimiter(cursor, Delimiter::None)
+    }
+
+    fn display() -> &'static str {
+        "invisible group"
+    }
+}
+
+define_keywords! {
+    "abstract"    pub struct Abstract
+    "as"          pub struct As
+    "async"       pub struct Async
+    "auto"        pub struct Auto
+    "await"       pub struct Await
+    "become"      pub struct Become
+    "box"         pub struct Box
+    "break"       pub struct Break
+    "const"       pub struct Const
+    "continue"    pub struct Continue
+    "crate"       pub struct Crate
+    "default"     pub struct Default
+    "do"          pub struct Do
+    "dyn"         pub struct Dyn
+    "else"        pub struct Else
+    "enum"        pub struct Enum
+    "extern"      pub struct Extern
+    "final"       pub struct Final
+    "fn"          pub struct Fn
+    "for"         pub struct For
+    "if"          pub struct If
+    "impl"        pub struct Impl
+    "in"          pub struct In
+    "let"         pub struct Let
+    "loop"        pub struct Loop
+    "macro"       pub struct Macro
+    "match"       pub struct Match
+    "mod"         pub struct Mod
+    "move"        pub struct Move
+    "mut"         pub struct Mut
+    "override"    pub struct Override
+    "priv"        pub struct Priv
+    "pub"         pub struct Pub
+    "ref"         pub struct Ref
+    "return"      pub struct Return
+    "Self"        pub struct SelfType
+    "self"        pub struct SelfValue
+    "static"      pub struct Static
+    "struct"      pub struct Struct
+    "super"       pub struct Super
+    "trait"       pub struct Trait
+    "try"         pub struct Try
+    "type"        pub struct Type
+    "typeof"      pub struct Typeof
+    "union"       pub struct Union
+    "unsafe"      pub struct Unsafe
+    "unsized"     pub struct Unsized
+    "use"         pub struct Use
+    "virtual"     pub struct Virtual
+    "where"       pub struct Where
+    "while"       pub struct While
+    "yield"       pub struct Yield
+}
+
+define_punctuation! {
+    "&"           pub struct And/1        /// bitwise and logical AND, borrow, references, reference patterns
+    "&&"          pub struct AndAnd/2     /// lazy AND, borrow, references, reference patterns
+    "&="          pub struct AndEq/2      /// bitwise AND assignment
+    "@"           pub struct At/1         /// subpattern binding
+    "^"           pub struct Caret/1      /// bitwise and logical XOR
+    "^="          pub struct CaretEq/2    /// bitwise XOR assignment
+    ":"           pub struct Colon/1      /// various separators
+    ","           pub struct Comma/1      /// various separators
+    "$"           pub struct Dollar/1     /// macros
+    "."           pub struct Dot/1        /// field access, tuple index
+    ".."          pub struct DotDot/2     /// range, struct expressions, patterns, range patterns
+    "..."         pub struct DotDotDot/3  /// variadic functions, range patterns
+    "..="         pub struct DotDotEq/3   /// inclusive range, range patterns
+    "="           pub struct Eq/1         /// assignment, attributes, various type definitions
+    "=="          pub struct EqEq/2       /// equal
+    "=>"          pub struct FatArrow/2   /// match arms, macros
+    ">="          pub struct Ge/2         /// greater than or equal to, generics
+    ">"           pub struct Gt/1         /// greater than, generics, paths
+    "<-"          pub struct LArrow/2     /// unused
+    "<="          pub struct Le/2         /// less than or equal to
+    "<"           pub struct Lt/1         /// less than, generics, paths
+    "-"           pub struct Minus/1      /// subtraction, negation
+    "-="          pub struct MinusEq/2    /// subtraction assignment
+    "!="          pub struct Ne/2         /// not equal
+    "!"           pub struct Not/1        /// bitwise and logical NOT, macro calls, inner attributes, never type, negative impls
+    "|"           pub struct Or/1         /// bitwise and logical OR, closures, patterns in match, if let, and while let
+    "|="          pub struct OrEq/2       /// bitwise OR assignment
+    "||"          pub struct OrOr/2       /// lazy OR, closures
+    "::"          pub struct PathSep/2    /// path separator
+    "%"           pub struct Percent/1    /// remainder
+    "%="          pub struct PercentEq/2  /// remainder assignment
+    "+"           pub struct Plus/1       /// addition, trait bounds, macro Kleene matcher
+    "+="          pub struct PlusEq/2     /// addition assignment
+    "#"           pub struct Pound/1      /// attributes
+    "?"           pub struct Question/1   /// question mark operator, questionably sized, macro Kleene matcher
+    "->"          pub struct RArrow/2     /// function return type, closure return type, function pointer type
+    ";"           pub struct Semi/1       /// terminator for various items and statements, array types
+    "<<"          pub struct Shl/2        /// shift left, nested generics
+    "<<="         pub struct ShlEq/3      /// shift left assignment
+    ">>"          pub struct Shr/2        /// shift right, nested generics
+    ">>="         pub struct ShrEq/3      /// shift right assignment, nested generics
+    "/"           pub struct Slash/1      /// division
+    "/="          pub struct SlashEq/2    /// division assignment
+    "*"           pub struct Star/1       /// multiplication, dereference, raw pointers, macro Kleene matcher, use wildcards
+    "*="          pub struct StarEq/2     /// multiplication assignment
+    "~"           pub struct Tilde/1      /// unused since before Rust 1.0
+}
+
+define_delimiters! {
+    Brace         pub struct Brace        /// `{`&hellip;`}`
+    Bracket       pub struct Bracket      /// `[`&hellip;`]`
+    Parenthesis   pub struct Paren        /// `(`&hellip;`)`
+}
+
+/// A type-macro that expands to the name of the Rust type representation of a
+/// given token.
+///
+/// As a type, `Token!` is commonly used in the type of struct fields, the type
+/// of a `let` statement, or in turbofish for a `parse` function.
+///
+/// ```
+/// use syn::{Ident, Token};
+/// use syn::parse::{Parse, ParseStream, Result};
+///
+/// // `struct Foo;`
+/// pub struct UnitStruct {
+///     struct_token: Token![struct],
+///     ident: Ident,
+///     semi_token: Token![;],
+/// }
+///
+/// impl Parse for UnitStruct {
+///     fn parse(input: ParseStream) -> Result<Self> {
+///         let struct_token: Token![struct] = input.parse()?;
+///         let ident: Ident = input.parse()?;
+///         let semi_token = input.parse::<Token![;]>()?;
+///         Ok(UnitStruct { struct_token, ident, semi_token })
+///     }
+/// }
+/// ```
+///
+/// As an expression, `Token!` is used for peeking tokens or instantiating
+/// tokens from a span.
+///
+/// ```
+/// # use syn::{Ident, Token};
+/// # use syn::parse::{Parse, ParseStream, Result};
+/// #
+/// # struct UnitStruct {
+/// #     struct_token: Token![struct],
+/// #     ident: Ident,
+/// #     semi_token: Token![;],
+/// # }
+/// #
+/// # impl Parse for UnitStruct {
+/// #     fn parse(input: ParseStream) -> Result<Self> {
+/// #         unimplemented!()
+/// #     }
+/// # }
+/// #
+/// fn make_unit_struct(name: Ident) -> UnitStruct {
+///     let span = name.span();
+///     UnitStruct {
+///         struct_token: Token![struct](span),
+///         ident: name,
+///         semi_token: Token![;](span),
+///     }
+/// }
+///
+/// # fn parse(input: ParseStream) -> Result<()> {
+/// if input.peek(Token![struct]) {
+///     let unit_struct: UnitStruct = input.parse()?;
+///     /* ... */
+/// }
+/// # Ok(())
+/// # }
+/// ```
+///
+/// See the [token module] documentation for details and examples.
+///
+/// [token module]: crate::token
+#[macro_export]
+macro_rules! Token {
+    [abstract]    => { $crate::token::Abstract };
+    [as]          => { $crate::token::As };
+    [async]       => { $crate::token::Async };
+    [auto]        => { $crate::token::Auto };
+    [await]       => { $crate::token::Await };
+    [become]      => { $crate::token::Become };
+    [box]         => { $crate::token::Box };
+    [break]       => { $crate::token::Break };
+    [const]       => { $crate::token::Const };
+    [continue]    => { $crate::token::Continue };
+    [crate]       => { $crate::token::Crate };
+    [default]     => { $crate::token::Default };
+    [do]          => { $crate::token::Do };
+    [dyn]         => { $crate::token::Dyn };
+    [else]        => { $crate::token::Else };
+    [enum]        => { $crate::token::Enum };
+    [extern]      => { $crate::token::Extern };
+    [final]       => { $crate::token::Final };
+    [fn]          => { $crate::token::Fn };
+    [for]         => { $crate::token::For };
+    [if]          => { $crate::token::If };
+    [impl]        => { $crate::token::Impl };
+    [in]          => { $crate::token::In };
+    [let]         => { $crate::token::Let };
+    [loop]        => { $crate::token::Loop };
+    [macro]       => { $crate::token::Macro };
+    [match]       => { $crate::token::Match };
+    [mod]         => { $crate::token::Mod };
+    [move]        => { $crate::token::Move };
+    [mut]         => { $crate::token::Mut };
+    [override]    => { $crate::token::Override };
+    [priv]        => { $crate::token::Priv };
+    [pub]         => { $crate::token::Pub };
+    [ref]         => { $crate::token::Ref };
+    [return]      => { $crate::token::Return };
+    [Self]        => { $crate::token::SelfType };
+    [self]        => { $crate::token::SelfValue };
+    [static]      => { $crate::token::Static };
+    [struct]      => { $crate::token::Struct };
+    [super]       => { $crate::token::Super };
+    [trait]       => { $crate::token::Trait };
+    [try]         => { $crate::token::Try };
+    [type]        => { $crate::token::Type };
+    [typeof]      => { $crate::token::Typeof };
+    [union]       => { $crate::token::Union };
+    [unsafe]      => { $crate::token::Unsafe };
+    [unsized]     => { $crate::token::Unsized };
+    [use]         => { $crate::token::Use };
+    [virtual]     => { $crate::token::Virtual };
+    [where]       => { $crate::token::Where };
+    [while]       => { $crate::token::While };
+    [yield]       => { $crate::token::Yield };
+    [&]           => { $crate::token::And };
+    [&&]          => { $crate::token::AndAnd };
+    [&=]          => { $crate::token::AndEq };
+    [@]           => { $crate::token::At };
+    [^]           => { $crate::token::Caret };
+    [^=]          => { $crate::token::CaretEq };
+    [:]           => { $crate::token::Colon };
+    [,]           => { $crate::token::Comma };
+    [$]           => { $crate::token::Dollar };
+    [.]           => { $crate::token::Dot };
+    [..]          => { $crate::token::DotDot };
+    [...]         => { $crate::token::DotDotDot };
+    [..=]         => { $crate::token::DotDotEq };
+    [=]           => { $crate::token::Eq };
+    [==]          => { $crate::token::EqEq };
+    [=>]          => { $crate::token::FatArrow };
+    [>=]          => { $crate::token::Ge };
+    [>]           => { $crate::token::Gt };
+    [<-]          => { $crate::token::LArrow };
+    [<=]          => { $crate::token::Le };
+    [<]           => { $crate::token::Lt };
+    [-]           => { $crate::token::Minus };
+    [-=]          => { $crate::token::MinusEq };
+    [!=]          => { $crate::token::Ne };
+    [!]           => { $crate::token::Not };
+    [|]           => { $crate::token::Or };
+    [|=]          => { $crate::token::OrEq };
+    [||]          => { $crate::token::OrOr };
+    [::]          => { $crate::token::PathSep };
+    [%]           => { $crate::token::Percent };
+    [%=]          => { $crate::token::PercentEq };
+    [+]           => { $crate::token::Plus };
+    [+=]          => { $crate::token::PlusEq };
+    [#]           => { $crate::token::Pound };
+    [?]           => { $crate::token::Question };
+    [->]          => { $crate::token::RArrow };
+    [;]           => { $crate::token::Semi };
+    [<<]          => { $crate::token::Shl };
+    [<<=]         => { $crate::token::ShlEq };
+    [>>]          => { $crate::token::Shr };
+    [>>=]         => { $crate::token::ShrEq };
+    [/]           => { $crate::token::Slash };
+    [/=]          => { $crate::token::SlashEq };
+    [*]           => { $crate::token::Star };
+    [*=]          => { $crate::token::StarEq };
+    [~]           => { $crate::token::Tilde };
+    [_]           => { $crate::token::Underscore };
+}
+
+// Not public API.
+#[doc(hidden)]
+#[cfg(feature = "parsing")]
+pub(crate) mod parsing {
+    use crate::buffer::Cursor;
+    use crate::error::{Error, Result};
+    use crate::parse::ParseStream;
+    use proc_macro2::{Spacing, Span};
+
+    pub(crate) fn keyword(input: ParseStream, token: &str) -> Result<Span> {
+        input.step(|cursor| {
+            if let Some((ident, rest)) = cursor.ident() {
+                if ident == token {
+                    return Ok((ident.span(), rest));
+                }
+            }
+            Err(cursor.error(format!("expected `{}`", token)))
+        })
+    }
+
+    pub(crate) fn peek_keyword(cursor: Cursor, token: &str) -> bool {
+        if let Some((ident, _rest)) = cursor.ident() {
+            ident == token
+        } else {
+            false
+        }
+    }
+
+    #[doc(hidden)]
+    pub fn punct<const N: usize>(input: ParseStream, token: &str) -> Result<[Span; N]> {
+        let mut spans = [input.span(); N];
+        punct_helper(input, token, &mut spans)?;
+        Ok(spans)
+    }
+
+    fn punct_helper(input: ParseStream, token: &str, spans: &mut [Span]) -> Result<()> {
+        input.step(|cursor| {
+            let mut cursor = *cursor;
+            assert_eq!(token.len(), spans.len());
+
+            for (i, ch) in token.chars().enumerate() {
+                match cursor.punct() {
+                    Some((punct, rest)) => {
+                        spans[i] = punct.span();
+                        if punct.as_char() != ch {
+                            break;
+                        } else if i == token.len() - 1 {
+                            return Ok(((), rest));
+                        } else if punct.spacing() != Spacing::Joint {
+                            break;
+                        }
+                        cursor = rest;
+                    }
+                    None => break,
+                }
+            }
+
+            Err(Error::new(spans[0], format!("expected `{}`", token)))
+        })
+    }
+
+    #[doc(hidden)]
+    pub fn peek_punct(mut cursor: Cursor, token: &str) -> bool {
+        for (i, ch) in token.chars().enumerate() {
+            match cursor.punct() {
+                Some((punct, rest)) => {
+                    if punct.as_char() != ch {
+                        break;
+                    } else if i == token.len() - 1 {
+                        return true;
+                    } else if punct.spacing() != Spacing::Joint {
+                        break;
+                    }
+                    cursor = rest;
+                }
+                None => break,
+            }
+        }
+        false
+    }
+}
+
+// Not public API.
+#[doc(hidden)]
+#[cfg(feature = "printing")]
+pub(crate) mod printing {
+    use proc_macro2::{Delimiter, Group, Ident, Punct, Spacing, Span, TokenStream};
+    use quote::TokenStreamExt;
+
+    #[doc(hidden)]
+    pub fn punct(s: &str, spans: &[Span], tokens: &mut TokenStream) {
+        assert_eq!(s.len(), spans.len());
+
+        let mut chars = s.chars();
+        let mut spans = spans.iter();
+        let ch = chars.next_back().unwrap();
+        let span = spans.next_back().unwrap();
+        for (ch, span) in chars.zip(spans) {
+            let mut op = Punct::new(ch, Spacing::Joint);
+            op.set_span(*span);
+            tokens.append(op);
+        }
+
+        let mut op = Punct::new(ch, Spacing::Alone);
+        op.set_span(*span);
+        tokens.append(op);
+    }
+
+    pub(crate) fn keyword(s: &str, span: Span, tokens: &mut TokenStream) {
+        tokens.append(Ident::new(s, span));
+    }
+
+    pub(crate) fn delim(
+        delim: Delimiter,
+        span: Span,
+        tokens: &mut TokenStream,
+        inner: TokenStream,
+    ) {
+        let mut g = Group::new(delim, inner);
+        g.set_span(span);
+        tokens.append(g);
+    }
+}
+
\ No newline at end of file diff --git a/src/syn/ty.rs.html b/src/syn/ty.rs.html new file mode 100644 index 0000000..12c3216 --- /dev/null +++ b/src/syn/ty.rs.html @@ -0,0 +1,2433 @@ +ty.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+652
+653
+654
+655
+656
+657
+658
+659
+660
+661
+662
+663
+664
+665
+666
+667
+668
+669
+670
+671
+672
+673
+674
+675
+676
+677
+678
+679
+680
+681
+682
+683
+684
+685
+686
+687
+688
+689
+690
+691
+692
+693
+694
+695
+696
+697
+698
+699
+700
+701
+702
+703
+704
+705
+706
+707
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+753
+754
+755
+756
+757
+758
+759
+760
+761
+762
+763
+764
+765
+766
+767
+768
+769
+770
+771
+772
+773
+774
+775
+776
+777
+778
+779
+780
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+794
+795
+796
+797
+798
+799
+800
+801
+802
+803
+804
+805
+806
+807
+808
+809
+810
+811
+812
+813
+814
+815
+816
+817
+818
+819
+820
+821
+822
+823
+824
+825
+826
+827
+828
+829
+830
+831
+832
+833
+834
+835
+836
+837
+838
+839
+840
+841
+842
+843
+844
+845
+846
+847
+848
+849
+850
+851
+852
+853
+854
+855
+856
+857
+858
+859
+860
+861
+862
+863
+864
+865
+866
+867
+868
+869
+870
+871
+872
+873
+874
+875
+876
+877
+878
+879
+880
+881
+882
+883
+884
+885
+886
+887
+888
+889
+890
+891
+892
+893
+894
+895
+896
+897
+898
+899
+900
+901
+902
+903
+904
+905
+906
+907
+908
+909
+910
+911
+912
+913
+914
+915
+916
+917
+918
+919
+920
+921
+922
+923
+924
+925
+926
+927
+928
+929
+930
+931
+932
+933
+934
+935
+936
+937
+938
+939
+940
+941
+942
+943
+944
+945
+946
+947
+948
+949
+950
+951
+952
+953
+954
+955
+956
+957
+958
+959
+960
+961
+962
+963
+964
+965
+966
+967
+968
+969
+970
+971
+972
+973
+974
+975
+976
+977
+978
+979
+980
+981
+982
+983
+984
+985
+986
+987
+988
+989
+990
+991
+992
+993
+994
+995
+996
+997
+998
+999
+1000
+1001
+1002
+1003
+1004
+1005
+1006
+1007
+1008
+1009
+1010
+1011
+1012
+1013
+1014
+1015
+1016
+1017
+1018
+1019
+1020
+1021
+1022
+1023
+1024
+1025
+1026
+1027
+1028
+1029
+1030
+1031
+1032
+1033
+1034
+1035
+1036
+1037
+1038
+1039
+1040
+1041
+1042
+1043
+1044
+1045
+1046
+1047
+1048
+1049
+1050
+1051
+1052
+1053
+1054
+1055
+1056
+1057
+1058
+1059
+1060
+1061
+1062
+1063
+1064
+1065
+1066
+1067
+1068
+1069
+1070
+1071
+1072
+1073
+1074
+1075
+1076
+1077
+1078
+1079
+1080
+1081
+1082
+1083
+1084
+1085
+1086
+1087
+1088
+1089
+1090
+1091
+1092
+1093
+1094
+1095
+1096
+1097
+1098
+1099
+1100
+1101
+1102
+1103
+1104
+1105
+1106
+1107
+1108
+1109
+1110
+1111
+1112
+1113
+1114
+1115
+1116
+1117
+1118
+1119
+1120
+1121
+1122
+1123
+1124
+1125
+1126
+1127
+1128
+1129
+1130
+1131
+1132
+1133
+1134
+1135
+1136
+1137
+1138
+1139
+1140
+1141
+1142
+1143
+1144
+1145
+1146
+1147
+1148
+1149
+1150
+1151
+1152
+1153
+1154
+1155
+1156
+1157
+1158
+1159
+1160
+1161
+1162
+1163
+1164
+1165
+1166
+1167
+1168
+1169
+1170
+1171
+1172
+1173
+1174
+1175
+1176
+1177
+1178
+1179
+1180
+1181
+1182
+1183
+1184
+1185
+1186
+1187
+1188
+1189
+1190
+1191
+1192
+1193
+1194
+1195
+1196
+1197
+1198
+1199
+1200
+1201
+1202
+1203
+1204
+1205
+1206
+1207
+1208
+1209
+1210
+1211
+1212
+1213
+1214
+1215
+1216
+
use crate::attr::Attribute;
+use crate::expr::Expr;
+use crate::generics::{BoundLifetimes, TypeParamBound};
+use crate::ident::Ident;
+use crate::lifetime::Lifetime;
+use crate::lit::LitStr;
+use crate::mac::Macro;
+use crate::path::{Path, QSelf};
+use crate::punctuated::Punctuated;
+use crate::token;
+use proc_macro2::TokenStream;
+
+ast_enum_of_structs! {
+    /// The possible types that a Rust value could have.
+    ///
+    /// # Syntax tree enum
+    ///
+    /// This type is a [syntax tree enum].
+    ///
+    /// [syntax tree enum]: crate::expr::Expr#syntax-tree-enums
+    #[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
+    #[non_exhaustive]
+    pub enum Type {
+        /// A fixed size array type: `[T; n]`.
+        Array(TypeArray),
+
+        /// A bare function type: `fn(usize) -> bool`.
+        BareFn(TypeBareFn),
+
+        /// A type contained within invisible delimiters.
+        Group(TypeGroup),
+
+        /// An `impl Bound1 + Bound2 + Bound3` type where `Bound` is a trait or
+        /// a lifetime.
+        ImplTrait(TypeImplTrait),
+
+        /// Indication that a type should be inferred by the compiler: `_`.
+        Infer(TypeInfer),
+
+        /// A macro in the type position.
+        Macro(TypeMacro),
+
+        /// The never type: `!`.
+        Never(TypeNever),
+
+        /// A parenthesized type equivalent to the inner type.
+        Paren(TypeParen),
+
+        /// A path like `std::slice::Iter`, optionally qualified with a
+        /// self-type as in `<Vec<T> as SomeTrait>::Associated`.
+        Path(TypePath),
+
+        /// A raw pointer type: `*const T` or `*mut T`.
+        Ptr(TypePtr),
+
+        /// A reference type: `&'a T` or `&'a mut T`.
+        Reference(TypeReference),
+
+        /// A dynamically sized slice type: `[T]`.
+        Slice(TypeSlice),
+
+        /// A trait object type `dyn Bound1 + Bound2 + Bound3` where `Bound` is a
+        /// trait or a lifetime.
+        TraitObject(TypeTraitObject),
+
+        /// A tuple type: `(A, B, C, String)`.
+        Tuple(TypeTuple),
+
+        /// Tokens in type position not interpreted by Syn.
+        Verbatim(TokenStream),
+
+        // For testing exhaustiveness in downstream code, use the following idiom:
+        //
+        //     match ty {
+        //         #![cfg_attr(test, deny(non_exhaustive_omitted_patterns))]
+        //
+        //         Type::Array(ty) => {...}
+        //         Type::BareFn(ty) => {...}
+        //         ...
+        //         Type::Verbatim(ty) => {...}
+        //
+        //         _ => { /* some sane fallback */ }
+        //     }
+        //
+        // This way we fail your tests but don't break your library when adding
+        // a variant. You will be notified by a test failure when a variant is
+        // added, so that you can add code to handle it, but your library will
+        // continue to compile and work for downstream users in the interim.
+    }
+}
+
+ast_struct! {
+    /// A fixed size array type: `[T; n]`.
+    #[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct TypeArray {
+        pub bracket_token: token::Bracket,
+        pub elem: Box<Type>,
+        pub semi_token: Token![;],
+        pub len: Expr,
+    }
+}
+
+ast_struct! {
+    /// A bare function type: `fn(usize) -> bool`.
+    #[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct TypeBareFn {
+        pub lifetimes: Option<BoundLifetimes>,
+        pub unsafety: Option<Token![unsafe]>,
+        pub abi: Option<Abi>,
+        pub fn_token: Token![fn],
+        pub paren_token: token::Paren,
+        pub inputs: Punctuated<BareFnArg, Token![,]>,
+        pub variadic: Option<BareVariadic>,
+        pub output: ReturnType,
+    }
+}
+
+ast_struct! {
+    /// A type contained within invisible delimiters.
+    #[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct TypeGroup {
+        pub group_token: token::Group,
+        pub elem: Box<Type>,
+    }
+}
+
+ast_struct! {
+    /// An `impl Bound1 + Bound2 + Bound3` type where `Bound` is a trait or
+    /// a lifetime.
+    #[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct TypeImplTrait {
+        pub impl_token: Token![impl],
+        pub bounds: Punctuated<TypeParamBound, Token![+]>,
+    }
+}
+
+ast_struct! {
+    /// Indication that a type should be inferred by the compiler: `_`.
+    #[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct TypeInfer {
+        pub underscore_token: Token![_],
+    }
+}
+
+ast_struct! {
+    /// A macro in the type position.
+    #[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct TypeMacro {
+        pub mac: Macro,
+    }
+}
+
+ast_struct! {
+    /// The never type: `!`.
+    #[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct TypeNever {
+        pub bang_token: Token![!],
+    }
+}
+
+ast_struct! {
+    /// A parenthesized type equivalent to the inner type.
+    #[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct TypeParen {
+        pub paren_token: token::Paren,
+        pub elem: Box<Type>,
+    }
+}
+
+ast_struct! {
+    /// A path like `std::slice::Iter`, optionally qualified with a
+    /// self-type as in `<Vec<T> as SomeTrait>::Associated`.
+    #[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct TypePath {
+        pub qself: Option<QSelf>,
+        pub path: Path,
+    }
+}
+
+ast_struct! {
+    /// A raw pointer type: `*const T` or `*mut T`.
+    #[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct TypePtr {
+        pub star_token: Token![*],
+        pub const_token: Option<Token![const]>,
+        pub mutability: Option<Token![mut]>,
+        pub elem: Box<Type>,
+    }
+}
+
+ast_struct! {
+    /// A reference type: `&'a T` or `&'a mut T`.
+    #[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct TypeReference {
+        pub and_token: Token![&],
+        pub lifetime: Option<Lifetime>,
+        pub mutability: Option<Token![mut]>,
+        pub elem: Box<Type>,
+    }
+}
+
+ast_struct! {
+    /// A dynamically sized slice type: `[T]`.
+    #[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct TypeSlice {
+        pub bracket_token: token::Bracket,
+        pub elem: Box<Type>,
+    }
+}
+
+ast_struct! {
+    /// A trait object type `dyn Bound1 + Bound2 + Bound3` where `Bound` is a
+    /// trait or a lifetime.
+    #[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct TypeTraitObject {
+        pub dyn_token: Option<Token![dyn]>,
+        pub bounds: Punctuated<TypeParamBound, Token![+]>,
+    }
+}
+
+ast_struct! {
+    /// A tuple type: `(A, B, C, String)`.
+    #[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct TypeTuple {
+        pub paren_token: token::Paren,
+        pub elems: Punctuated<Type, Token![,]>,
+    }
+}
+
+ast_struct! {
+    /// The binary interface of a function: `extern "C"`.
+    #[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct Abi {
+        pub extern_token: Token![extern],
+        pub name: Option<LitStr>,
+    }
+}
+
+ast_struct! {
+    /// An argument in a function type: the `usize` in `fn(usize) -> bool`.
+    #[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct BareFnArg {
+        pub attrs: Vec<Attribute>,
+        pub name: Option<(Ident, Token![:])>,
+        pub ty: Type,
+    }
+}
+
+ast_struct! {
+    /// The variadic argument of a function pointer like `fn(usize, ...)`.
+    #[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub struct BareVariadic {
+        pub attrs: Vec<Attribute>,
+        pub name: Option<(Ident, Token![:])>,
+        pub dots: Token![...],
+        pub comma: Option<Token![,]>,
+    }
+}
+
+ast_enum! {
+    /// Return type of a function signature.
+    #[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
+    pub enum ReturnType {
+        /// Return type is not specified.
+        ///
+        /// Functions default to `()` and closures default to type inference.
+        Default,
+        /// A particular type is returned.
+        Type(Token![->], Box<Type>),
+    }
+}
+
+#[cfg(feature = "parsing")]
+pub(crate) mod parsing {
+    use crate::attr::Attribute;
+    use crate::error::{self, Result};
+    use crate::ext::IdentExt as _;
+    use crate::generics::{BoundLifetimes, TraitBound, TraitBoundModifier, TypeParamBound};
+    use crate::ident::Ident;
+    use crate::lifetime::Lifetime;
+    use crate::mac::{self, Macro};
+    use crate::parse::{Parse, ParseStream};
+    use crate::path;
+    use crate::path::{Path, PathArguments, QSelf};
+    use crate::punctuated::Punctuated;
+    use crate::token;
+    use crate::ty::{
+        Abi, BareFnArg, BareVariadic, ReturnType, Type, TypeArray, TypeBareFn, TypeGroup,
+        TypeImplTrait, TypeInfer, TypeMacro, TypeNever, TypeParen, TypePath, TypePtr,
+        TypeReference, TypeSlice, TypeTraitObject, TypeTuple,
+    };
+    use crate::verbatim;
+    use proc_macro2::Span;
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for Type {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let allow_plus = true;
+            let allow_group_generic = true;
+            ambig_ty(input, allow_plus, allow_group_generic)
+        }
+    }
+
+    impl Type {
+        /// In some positions, types may not contain the `+` character, to
+        /// disambiguate them. For example in the expression `1 as T`, T may not
+        /// contain a `+` character.
+        ///
+        /// This parser does not allow a `+`, while the default parser does.
+        #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+        pub fn without_plus(input: ParseStream) -> Result<Self> {
+            let allow_plus = false;
+            let allow_group_generic = true;
+            ambig_ty(input, allow_plus, allow_group_generic)
+        }
+    }
+
+    pub(crate) fn ambig_ty(
+        input: ParseStream,
+        allow_plus: bool,
+        allow_group_generic: bool,
+    ) -> Result<Type> {
+        let begin = input.fork();
+
+        if input.peek(token::Group) {
+            let mut group: TypeGroup = input.parse()?;
+            if input.peek(Token![::]) && input.peek3(Ident::peek_any) {
+                if let Type::Path(mut ty) = *group.elem {
+                    Path::parse_rest(input, &mut ty.path, false)?;
+                    return Ok(Type::Path(ty));
+                } else {
+                    return Ok(Type::Path(TypePath {
+                        qself: Some(QSelf {
+                            lt_token: Token![<](group.group_token.span),
+                            position: 0,
+                            as_token: None,
+                            gt_token: Token![>](group.group_token.span),
+                            ty: group.elem,
+                        }),
+                        path: Path::parse_helper(input, false)?,
+                    }));
+                }
+            } else if input.peek(Token![<]) && allow_group_generic
+                || input.peek(Token![::]) && input.peek3(Token![<])
+            {
+                if let Type::Path(mut ty) = *group.elem {
+                    let arguments = &mut ty.path.segments.last_mut().unwrap().arguments;
+                    if arguments.is_none() {
+                        *arguments = PathArguments::AngleBracketed(input.parse()?);
+                        Path::parse_rest(input, &mut ty.path, false)?;
+                        return Ok(Type::Path(ty));
+                    } else {
+                        group.elem = Box::new(Type::Path(ty));
+                    }
+                }
+            }
+            return Ok(Type::Group(group));
+        }
+
+        let mut lifetimes = None::<BoundLifetimes>;
+        let mut lookahead = input.lookahead1();
+        if lookahead.peek(Token![for]) {
+            lifetimes = input.parse()?;
+            lookahead = input.lookahead1();
+            if !lookahead.peek(Ident)
+                && !lookahead.peek(Token![fn])
+                && !lookahead.peek(Token![unsafe])
+                && !lookahead.peek(Token![extern])
+                && !lookahead.peek(Token![super])
+                && !lookahead.peek(Token![self])
+                && !lookahead.peek(Token![Self])
+                && !lookahead.peek(Token![crate])
+                || input.peek(Token![dyn])
+            {
+                return Err(lookahead.error());
+            }
+        }
+
+        if lookahead.peek(token::Paren) {
+            let content;
+            let paren_token = parenthesized!(content in input);
+            if content.is_empty() {
+                return Ok(Type::Tuple(TypeTuple {
+                    paren_token,
+                    elems: Punctuated::new(),
+                }));
+            }
+            if content.peek(Lifetime) {
+                return Ok(Type::Paren(TypeParen {
+                    paren_token,
+                    elem: Box::new(Type::TraitObject(content.parse()?)),
+                }));
+            }
+            if content.peek(Token![?]) {
+                return Ok(Type::TraitObject(TypeTraitObject {
+                    dyn_token: None,
+                    bounds: {
+                        let mut bounds = Punctuated::new();
+                        bounds.push_value(TypeParamBound::Trait(TraitBound {
+                            paren_token: Some(paren_token),
+                            ..content.parse()?
+                        }));
+                        while let Some(plus) = input.parse()? {
+                            bounds.push_punct(plus);
+                            bounds.push_value(input.parse()?);
+                        }
+                        bounds
+                    },
+                }));
+            }
+            let mut first: Type = content.parse()?;
+            if content.peek(Token![,]) {
+                return Ok(Type::Tuple(TypeTuple {
+                    paren_token,
+                    elems: {
+                        let mut elems = Punctuated::new();
+                        elems.push_value(first);
+                        elems.push_punct(content.parse()?);
+                        while !content.is_empty() {
+                            elems.push_value(content.parse()?);
+                            if content.is_empty() {
+                                break;
+                            }
+                            elems.push_punct(content.parse()?);
+                        }
+                        elems
+                    },
+                }));
+            }
+            if allow_plus && input.peek(Token![+]) {
+                loop {
+                    let first = match first {
+                        Type::Path(TypePath { qself: None, path }) => {
+                            TypeParamBound::Trait(TraitBound {
+                                paren_token: Some(paren_token),
+                                modifier: TraitBoundModifier::None,
+                                lifetimes: None,
+                                path,
+                            })
+                        }
+                        Type::TraitObject(TypeTraitObject {
+                            dyn_token: None,
+                            bounds,
+                        }) => {
+                            if bounds.len() > 1 || bounds.trailing_punct() {
+                                first = Type::TraitObject(TypeTraitObject {
+                                    dyn_token: None,
+                                    bounds,
+                                });
+                                break;
+                            }
+                            match bounds.into_iter().next().unwrap() {
+                                TypeParamBound::Trait(trait_bound) => {
+                                    TypeParamBound::Trait(TraitBound {
+                                        paren_token: Some(paren_token),
+                                        ..trait_bound
+                                    })
+                                }
+                                other @ (TypeParamBound::Lifetime(_)
+                                | TypeParamBound::Verbatim(_)) => other,
+                            }
+                        }
+                        _ => break,
+                    };
+                    return Ok(Type::TraitObject(TypeTraitObject {
+                        dyn_token: None,
+                        bounds: {
+                            let mut bounds = Punctuated::new();
+                            bounds.push_value(first);
+                            while let Some(plus) = input.parse()? {
+                                bounds.push_punct(plus);
+                                bounds.push_value(input.parse()?);
+                            }
+                            bounds
+                        },
+                    }));
+                }
+            }
+            Ok(Type::Paren(TypeParen {
+                paren_token,
+                elem: Box::new(first),
+            }))
+        } else if lookahead.peek(Token![fn])
+            || lookahead.peek(Token![unsafe])
+            || lookahead.peek(Token![extern])
+        {
+            let mut bare_fn: TypeBareFn = input.parse()?;
+            bare_fn.lifetimes = lifetimes;
+            Ok(Type::BareFn(bare_fn))
+        } else if lookahead.peek(Ident)
+            || input.peek(Token![super])
+            || input.peek(Token![self])
+            || input.peek(Token![Self])
+            || input.peek(Token![crate])
+            || lookahead.peek(Token![::])
+            || lookahead.peek(Token![<])
+        {
+            let ty: TypePath = input.parse()?;
+            if ty.qself.is_some() {
+                return Ok(Type::Path(ty));
+            }
+
+            if input.peek(Token![!]) && !input.peek(Token![!=]) && ty.path.is_mod_style() {
+                let bang_token: Token![!] = input.parse()?;
+                let (delimiter, tokens) = mac::parse_delimiter(input)?;
+                return Ok(Type::Macro(TypeMacro {
+                    mac: Macro {
+                        path: ty.path,
+                        bang_token,
+                        delimiter,
+                        tokens,
+                    },
+                }));
+            }
+
+            if lifetimes.is_some() || allow_plus && input.peek(Token![+]) {
+                let mut bounds = Punctuated::new();
+                bounds.push_value(TypeParamBound::Trait(TraitBound {
+                    paren_token: None,
+                    modifier: TraitBoundModifier::None,
+                    lifetimes,
+                    path: ty.path,
+                }));
+                if allow_plus {
+                    while input.peek(Token![+]) {
+                        bounds.push_punct(input.parse()?);
+                        if !(input.peek(Ident::peek_any)
+                            || input.peek(Token![::])
+                            || input.peek(Token![?])
+                            || input.peek(Lifetime)
+                            || input.peek(token::Paren))
+                        {
+                            break;
+                        }
+                        bounds.push_value(input.parse()?);
+                    }
+                }
+                return Ok(Type::TraitObject(TypeTraitObject {
+                    dyn_token: None,
+                    bounds,
+                }));
+            }
+
+            Ok(Type::Path(ty))
+        } else if lookahead.peek(Token![dyn]) {
+            let dyn_token: Token![dyn] = input.parse()?;
+            let dyn_span = dyn_token.span;
+            let star_token: Option<Token![*]> = input.parse()?;
+            let bounds = TypeTraitObject::parse_bounds(dyn_span, input, allow_plus)?;
+            return Ok(if star_token.is_some() {
+                Type::Verbatim(verbatim::between(&begin, input))
+            } else {
+                Type::TraitObject(TypeTraitObject {
+                    dyn_token: Some(dyn_token),
+                    bounds,
+                })
+            });
+        } else if lookahead.peek(token::Bracket) {
+            let content;
+            let bracket_token = bracketed!(content in input);
+            let elem: Type = content.parse()?;
+            if content.peek(Token![;]) {
+                Ok(Type::Array(TypeArray {
+                    bracket_token,
+                    elem: Box::new(elem),
+                    semi_token: content.parse()?,
+                    len: content.parse()?,
+                }))
+            } else {
+                Ok(Type::Slice(TypeSlice {
+                    bracket_token,
+                    elem: Box::new(elem),
+                }))
+            }
+        } else if lookahead.peek(Token![*]) {
+            input.parse().map(Type::Ptr)
+        } else if lookahead.peek(Token![&]) {
+            input.parse().map(Type::Reference)
+        } else if lookahead.peek(Token![!]) && !input.peek(Token![=]) {
+            input.parse().map(Type::Never)
+        } else if lookahead.peek(Token![impl]) {
+            TypeImplTrait::parse(input, allow_plus).map(Type::ImplTrait)
+        } else if lookahead.peek(Token![_]) {
+            input.parse().map(Type::Infer)
+        } else if lookahead.peek(Lifetime) {
+            input.parse().map(Type::TraitObject)
+        } else {
+            Err(lookahead.error())
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for TypeSlice {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let content;
+            Ok(TypeSlice {
+                bracket_token: bracketed!(content in input),
+                elem: content.parse()?,
+            })
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for TypeArray {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let content;
+            Ok(TypeArray {
+                bracket_token: bracketed!(content in input),
+                elem: content.parse()?,
+                semi_token: content.parse()?,
+                len: content.parse()?,
+            })
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for TypePtr {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let star_token: Token![*] = input.parse()?;
+
+            let lookahead = input.lookahead1();
+            let (const_token, mutability) = if lookahead.peek(Token![const]) {
+                (Some(input.parse()?), None)
+            } else if lookahead.peek(Token![mut]) {
+                (None, Some(input.parse()?))
+            } else {
+                return Err(lookahead.error());
+            };
+
+            Ok(TypePtr {
+                star_token,
+                const_token,
+                mutability,
+                elem: Box::new(input.call(Type::without_plus)?),
+            })
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for TypeReference {
+        fn parse(input: ParseStream) -> Result<Self> {
+            Ok(TypeReference {
+                and_token: input.parse()?,
+                lifetime: input.parse()?,
+                mutability: input.parse()?,
+                // & binds tighter than +, so we don't allow + here.
+                elem: Box::new(input.call(Type::without_plus)?),
+            })
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for TypeBareFn {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let args;
+            let mut variadic = None;
+
+            Ok(TypeBareFn {
+                lifetimes: input.parse()?,
+                unsafety: input.parse()?,
+                abi: input.parse()?,
+                fn_token: input.parse()?,
+                paren_token: parenthesized!(args in input),
+                inputs: {
+                    let mut inputs = Punctuated::new();
+
+                    while !args.is_empty() {
+                        let attrs = args.call(Attribute::parse_outer)?;
+
+                        if inputs.empty_or_trailing()
+                            && (args.peek(Token![...])
+                                || args.peek(Ident)
+                                    && args.peek2(Token![:])
+                                    && args.peek3(Token![...]))
+                        {
+                            variadic = Some(parse_bare_variadic(&args, attrs)?);
+                            break;
+                        }
+
+                        let allow_self = inputs.is_empty();
+                        let arg = parse_bare_fn_arg(&args, allow_self)?;
+                        inputs.push_value(BareFnArg { attrs, ..arg });
+                        if args.is_empty() {
+                            break;
+                        }
+
+                        let comma = args.parse()?;
+                        inputs.push_punct(comma);
+                    }
+
+                    inputs
+                },
+                variadic,
+                output: input.call(ReturnType::without_plus)?,
+            })
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for TypeNever {
+        fn parse(input: ParseStream) -> Result<Self> {
+            Ok(TypeNever {
+                bang_token: input.parse()?,
+            })
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for TypeInfer {
+        fn parse(input: ParseStream) -> Result<Self> {
+            Ok(TypeInfer {
+                underscore_token: input.parse()?,
+            })
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for TypeTuple {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let content;
+            let paren_token = parenthesized!(content in input);
+
+            if content.is_empty() {
+                return Ok(TypeTuple {
+                    paren_token,
+                    elems: Punctuated::new(),
+                });
+            }
+
+            let first: Type = content.parse()?;
+            Ok(TypeTuple {
+                paren_token,
+                elems: {
+                    let mut elems = Punctuated::new();
+                    elems.push_value(first);
+                    elems.push_punct(content.parse()?);
+                    while !content.is_empty() {
+                        elems.push_value(content.parse()?);
+                        if content.is_empty() {
+                            break;
+                        }
+                        elems.push_punct(content.parse()?);
+                    }
+                    elems
+                },
+            })
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for TypeMacro {
+        fn parse(input: ParseStream) -> Result<Self> {
+            Ok(TypeMacro {
+                mac: input.parse()?,
+            })
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for TypePath {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let expr_style = false;
+            let (qself, path) = path::parsing::qpath(input, expr_style)?;
+            Ok(TypePath { qself, path })
+        }
+    }
+
+    impl ReturnType {
+        #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+        pub fn without_plus(input: ParseStream) -> Result<Self> {
+            let allow_plus = false;
+            Self::parse(input, allow_plus)
+        }
+
+        pub(crate) fn parse(input: ParseStream, allow_plus: bool) -> Result<Self> {
+            if input.peek(Token![->]) {
+                let arrow = input.parse()?;
+                let allow_group_generic = true;
+                let ty = ambig_ty(input, allow_plus, allow_group_generic)?;
+                Ok(ReturnType::Type(arrow, Box::new(ty)))
+            } else {
+                Ok(ReturnType::Default)
+            }
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for ReturnType {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let allow_plus = true;
+            Self::parse(input, allow_plus)
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for TypeTraitObject {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let allow_plus = true;
+            Self::parse(input, allow_plus)
+        }
+    }
+
+    impl TypeTraitObject {
+        #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+        pub fn without_plus(input: ParseStream) -> Result<Self> {
+            let allow_plus = false;
+            Self::parse(input, allow_plus)
+        }
+
+        // Only allow multiple trait references if allow_plus is true.
+        pub(crate) fn parse(input: ParseStream, allow_plus: bool) -> Result<Self> {
+            let dyn_token: Option<Token![dyn]> = input.parse()?;
+            let dyn_span = match &dyn_token {
+                Some(token) => token.span,
+                None => input.span(),
+            };
+            let bounds = Self::parse_bounds(dyn_span, input, allow_plus)?;
+            Ok(TypeTraitObject { dyn_token, bounds })
+        }
+
+        fn parse_bounds(
+            dyn_span: Span,
+            input: ParseStream,
+            allow_plus: bool,
+        ) -> Result<Punctuated<TypeParamBound, Token![+]>> {
+            let bounds = TypeParamBound::parse_multiple(input, allow_plus)?;
+            let mut last_lifetime_span = None;
+            let mut at_least_one_trait = false;
+            for bound in &bounds {
+                match bound {
+                    TypeParamBound::Trait(_) | TypeParamBound::Verbatim(_) => {
+                        at_least_one_trait = true;
+                        break;
+                    }
+                    TypeParamBound::Lifetime(lifetime) => {
+                        last_lifetime_span = Some(lifetime.ident.span());
+                    }
+                }
+            }
+            // Just lifetimes like `'a + 'b` is not a TraitObject.
+            if !at_least_one_trait {
+                let msg = "at least one trait is required for an object type";
+                return Err(error::new2(dyn_span, last_lifetime_span.unwrap(), msg));
+            }
+            Ok(bounds)
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for TypeImplTrait {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let allow_plus = true;
+            Self::parse(input, allow_plus)
+        }
+    }
+
+    impl TypeImplTrait {
+        #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+        pub fn without_plus(input: ParseStream) -> Result<Self> {
+            let allow_plus = false;
+            Self::parse(input, allow_plus)
+        }
+
+        pub(crate) fn parse(input: ParseStream, allow_plus: bool) -> Result<Self> {
+            let impl_token: Token![impl] = input.parse()?;
+            let bounds = TypeParamBound::parse_multiple(input, allow_plus)?;
+            let mut last_lifetime_span = None;
+            let mut at_least_one_trait = false;
+            for bound in &bounds {
+                match bound {
+                    TypeParamBound::Trait(_) | TypeParamBound::Verbatim(_) => {
+                        at_least_one_trait = true;
+                        break;
+                    }
+                    TypeParamBound::Lifetime(lifetime) => {
+                        last_lifetime_span = Some(lifetime.ident.span());
+                    }
+                }
+            }
+            if !at_least_one_trait {
+                let msg = "at least one trait must be specified";
+                return Err(error::new2(
+                    impl_token.span,
+                    last_lifetime_span.unwrap(),
+                    msg,
+                ));
+            }
+            Ok(TypeImplTrait { impl_token, bounds })
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for TypeGroup {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let group = crate::group::parse_group(input)?;
+            Ok(TypeGroup {
+                group_token: group.token,
+                elem: group.content.parse()?,
+            })
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for TypeParen {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let allow_plus = false;
+            Self::parse(input, allow_plus)
+        }
+    }
+
+    impl TypeParen {
+        fn parse(input: ParseStream, allow_plus: bool) -> Result<Self> {
+            let content;
+            Ok(TypeParen {
+                paren_token: parenthesized!(content in input),
+                elem: Box::new({
+                    let allow_group_generic = true;
+                    ambig_ty(&content, allow_plus, allow_group_generic)?
+                }),
+            })
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for BareFnArg {
+        fn parse(input: ParseStream) -> Result<Self> {
+            let allow_self = false;
+            parse_bare_fn_arg(input, allow_self)
+        }
+    }
+
+    fn parse_bare_fn_arg(input: ParseStream, allow_self: bool) -> Result<BareFnArg> {
+        let attrs = input.call(Attribute::parse_outer)?;
+
+        let begin = input.fork();
+
+        let has_mut_self = allow_self && input.peek(Token![mut]) && input.peek2(Token![self]);
+        if has_mut_self {
+            input.parse::<Token![mut]>()?;
+        }
+
+        let mut has_self = false;
+        let mut name = if (input.peek(Ident) || input.peek(Token![_]) || {
+            has_self = allow_self && input.peek(Token![self]);
+            has_self
+        }) && input.peek2(Token![:])
+            && !input.peek2(Token![::])
+        {
+            let name = input.call(Ident::parse_any)?;
+            let colon: Token![:] = input.parse()?;
+            Some((name, colon))
+        } else {
+            has_self = false;
+            None
+        };
+
+        let ty = if allow_self && !has_self && input.peek(Token![mut]) && input.peek2(Token![self])
+        {
+            input.parse::<Token![mut]>()?;
+            input.parse::<Token![self]>()?;
+            None
+        } else if has_mut_self && name.is_none() {
+            input.parse::<Token![self]>()?;
+            None
+        } else {
+            Some(input.parse()?)
+        };
+
+        let ty = match ty {
+            Some(ty) if !has_mut_self => ty,
+            _ => {
+                name = None;
+                Type::Verbatim(verbatim::between(&begin, input))
+            }
+        };
+
+        Ok(BareFnArg { attrs, name, ty })
+    }
+
+    fn parse_bare_variadic(input: ParseStream, attrs: Vec<Attribute>) -> Result<BareVariadic> {
+        Ok(BareVariadic {
+            attrs,
+            name: if input.peek(Ident) || input.peek(Token![_]) {
+                let name = input.call(Ident::parse_any)?;
+                let colon: Token![:] = input.parse()?;
+                Some((name, colon))
+            } else {
+                None
+            },
+            dots: input.parse()?,
+            comma: input.parse()?,
+        })
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for Abi {
+        fn parse(input: ParseStream) -> Result<Self> {
+            Ok(Abi {
+                extern_token: input.parse()?,
+                name: input.parse()?,
+            })
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
+    impl Parse for Option<Abi> {
+        fn parse(input: ParseStream) -> Result<Self> {
+            if input.peek(Token![extern]) {
+                input.parse().map(Some)
+            } else {
+                Ok(None)
+            }
+        }
+    }
+}
+
+#[cfg(feature = "printing")]
+mod printing {
+    use crate::attr::FilterAttrs;
+    use crate::path;
+    use crate::print::TokensOrDefault;
+    use crate::ty::{
+        Abi, BareFnArg, BareVariadic, ReturnType, TypeArray, TypeBareFn, TypeGroup, TypeImplTrait,
+        TypeInfer, TypeMacro, TypeNever, TypeParen, TypePath, TypePtr, TypeReference, TypeSlice,
+        TypeTraitObject, TypeTuple,
+    };
+    use proc_macro2::TokenStream;
+    use quote::{ToTokens, TokenStreamExt};
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for TypeSlice {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.bracket_token.surround(tokens, |tokens| {
+                self.elem.to_tokens(tokens);
+            });
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for TypeArray {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.bracket_token.surround(tokens, |tokens| {
+                self.elem.to_tokens(tokens);
+                self.semi_token.to_tokens(tokens);
+                self.len.to_tokens(tokens);
+            });
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for TypePtr {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.star_token.to_tokens(tokens);
+            match &self.mutability {
+                Some(tok) => tok.to_tokens(tokens),
+                None => {
+                    TokensOrDefault(&self.const_token).to_tokens(tokens);
+                }
+            }
+            self.elem.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for TypeReference {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.and_token.to_tokens(tokens);
+            self.lifetime.to_tokens(tokens);
+            self.mutability.to_tokens(tokens);
+            self.elem.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for TypeBareFn {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.lifetimes.to_tokens(tokens);
+            self.unsafety.to_tokens(tokens);
+            self.abi.to_tokens(tokens);
+            self.fn_token.to_tokens(tokens);
+            self.paren_token.surround(tokens, |tokens| {
+                self.inputs.to_tokens(tokens);
+                if let Some(variadic) = &self.variadic {
+                    if !self.inputs.empty_or_trailing() {
+                        let span = variadic.dots.spans[0];
+                        Token![,](span).to_tokens(tokens);
+                    }
+                    variadic.to_tokens(tokens);
+                }
+            });
+            self.output.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for TypeNever {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.bang_token.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for TypeTuple {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.paren_token.surround(tokens, |tokens| {
+                self.elems.to_tokens(tokens);
+                // If we only have one argument, we need a trailing comma to
+                // distinguish TypeTuple from TypeParen.
+                if self.elems.len() == 1 && !self.elems.trailing_punct() {
+                    <Token![,]>::default().to_tokens(tokens);
+                }
+            });
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for TypePath {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            path::printing::print_path(tokens, &self.qself, &self.path);
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for TypeTraitObject {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.dyn_token.to_tokens(tokens);
+            self.bounds.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for TypeImplTrait {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.impl_token.to_tokens(tokens);
+            self.bounds.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for TypeGroup {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.group_token.surround(tokens, |tokens| {
+                self.elem.to_tokens(tokens);
+            });
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for TypeParen {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.paren_token.surround(tokens, |tokens| {
+                self.elem.to_tokens(tokens);
+            });
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for TypeInfer {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.underscore_token.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for TypeMacro {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.mac.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for ReturnType {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            match self {
+                ReturnType::Default => {}
+                ReturnType::Type(arrow, ty) => {
+                    arrow.to_tokens(tokens);
+                    ty.to_tokens(tokens);
+                }
+            }
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for BareFnArg {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            if let Some((name, colon)) = &self.name {
+                name.to_tokens(tokens);
+                colon.to_tokens(tokens);
+            }
+            self.ty.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for BareVariadic {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            tokens.append_all(self.attrs.outer());
+            if let Some((name, colon)) = &self.name {
+                name.to_tokens(tokens);
+                colon.to_tokens(tokens);
+            }
+            self.dots.to_tokens(tokens);
+            self.comma.to_tokens(tokens);
+        }
+    }
+
+    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
+    impl ToTokens for Abi {
+        fn to_tokens(&self, tokens: &mut TokenStream) {
+            self.extern_token.to_tokens(tokens);
+            self.name.to_tokens(tokens);
+        }
+    }
+}
+
\ No newline at end of file diff --git a/src/syn/verbatim.rs.html b/src/syn/verbatim.rs.html new file mode 100644 index 0000000..5dd916a --- /dev/null +++ b/src/syn/verbatim.rs.html @@ -0,0 +1,67 @@ +verbatim.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+
use crate::parse::ParseStream;
+use proc_macro2::{Delimiter, TokenStream};
+use std::cmp::Ordering;
+use std::iter;
+
+pub(crate) fn between<'a>(begin: ParseStream<'a>, end: ParseStream<'a>) -> TokenStream {
+    let end = end.cursor();
+    let mut cursor = begin.cursor();
+    assert!(crate::buffer::same_buffer(end, cursor));
+
+    let mut tokens = TokenStream::new();
+    while cursor != end {
+        let (tt, next) = cursor.token_tree().unwrap();
+
+        if crate::buffer::cmp_assuming_same_buffer(end, next) == Ordering::Less {
+            // A syntax node can cross the boundary of a None-delimited group
+            // due to such groups being transparent to the parser in most cases.
+            // Any time this occurs the group is known to be semantically
+            // irrelevant. https://github.com/dtolnay/syn/issues/1235
+            if let Some((inside, _span, after)) = cursor.group(Delimiter::None) {
+                assert!(next == after);
+                cursor = inside;
+                continue;
+            } else {
+                panic!("verbatim end must not be inside a delimited group");
+            }
+        }
+
+        tokens.extend(iter::once(tt));
+        cursor = next;
+    }
+    tokens
+}
+
\ No newline at end of file diff --git a/src/syn/whitespace.rs.html b/src/syn/whitespace.rs.html new file mode 100644 index 0000000..8466da5 --- /dev/null +++ b/src/syn/whitespace.rs.html @@ -0,0 +1,131 @@ +whitespace.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+
pub(crate) fn skip(mut s: &str) -> &str {
+    'skip: while !s.is_empty() {
+        let byte = s.as_bytes()[0];
+        if byte == b'/' {
+            if s.starts_with("//")
+                && (!s.starts_with("///") || s.starts_with("////"))
+                && !s.starts_with("//!")
+            {
+                if let Some(i) = s.find('\n') {
+                    s = &s[i + 1..];
+                    continue;
+                } else {
+                    return "";
+                }
+            } else if s.starts_with("/**/") {
+                s = &s[4..];
+                continue;
+            } else if s.starts_with("/*")
+                && (!s.starts_with("/**") || s.starts_with("/***"))
+                && !s.starts_with("/*!")
+            {
+                let mut depth = 0;
+                let bytes = s.as_bytes();
+                let mut i = 0;
+                let upper = bytes.len() - 1;
+                while i < upper {
+                    if bytes[i] == b'/' && bytes[i + 1] == b'*' {
+                        depth += 1;
+                        i += 1; // eat '*'
+                    } else if bytes[i] == b'*' && bytes[i + 1] == b'/' {
+                        depth -= 1;
+                        if depth == 0 {
+                            s = &s[i + 2..];
+                            continue 'skip;
+                        }
+                        i += 1; // eat '/'
+                    }
+                    i += 1;
+                }
+                return s;
+            }
+        }
+        match byte {
+            b' ' | 0x09..=0x0D => {
+                s = &s[1..];
+                continue;
+            }
+            b if b <= 0x7F => {}
+            _ => {
+                let ch = s.chars().next().unwrap();
+                if is_whitespace(ch) {
+                    s = &s[ch.len_utf8()..];
+                    continue;
+                }
+            }
+        }
+        return s;
+    }
+    s
+}
+
+fn is_whitespace(ch: char) -> bool {
+    // Rust treats left-to-right mark and right-to-left mark as whitespace
+    ch.is_whitespace() || ch == '\u{200e}' || ch == '\u{200f}'
+}
+
\ No newline at end of file diff --git a/src/unicode_ident/lib.rs.html b/src/unicode_ident/lib.rs.html new file mode 100644 index 0000000..65ea1c9 --- /dev/null +++ b/src/unicode_ident/lib.rs.html @@ -0,0 +1,539 @@ +lib.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+
//! [![github]](https://github.com/dtolnay/unicode-ident)&ensp;[![crates-io]](https://crates.io/crates/unicode-ident)&ensp;[![docs-rs]](https://docs.rs/unicode-ident)
+//!
+//! [github]: https://img.shields.io/badge/github-8da0cb?style=for-the-badge&labelColor=555555&logo=github
+//! [crates-io]: https://img.shields.io/badge/crates.io-fc8d62?style=for-the-badge&labelColor=555555&logo=rust
+//! [docs-rs]: https://img.shields.io/badge/docs.rs-66c2a5?style=for-the-badge&labelColor=555555&logo=docs.rs
+//!
+//! <br>
+//!
+//! Implementation of [Unicode Standard Annex #31][tr31] for determining which
+//! `char` values are valid in programming language identifiers.
+//!
+//! [tr31]: https://www.unicode.org/reports/tr31/
+//!
+//! This crate is a better optimized implementation of the older `unicode-xid`
+//! crate. This crate uses less static storage, and is able to classify both
+//! ASCII and non-ASCII codepoints with better performance, 2&ndash;10&times;
+//! faster than `unicode-xid`.
+//!
+//! <br>
+//!
+//! ## Comparison of performance
+//!
+//! The following table shows a comparison between five Unicode identifier
+//! implementations.
+//!
+//! - `unicode-ident` is this crate;
+//! - [`unicode-xid`] is a widely used crate run by the "unicode-rs" org;
+//! - `ucd-trie` and `fst` are two data structures supported by the
+//!   [`ucd-generate`] tool;
+//! - [`roaring`] is a Rust implementation of Roaring bitmap.
+//!
+//! The *static storage* column shows the total size of `static` tables that the
+//! crate bakes into your binary, measured in 1000s of bytes.
+//!
+//! The remaining columns show the **cost per call** to evaluate whether a
+//! single `char` has the XID\_Start or XID\_Continue Unicode property,
+//! comparing across different ratios of ASCII to non-ASCII codepoints in the
+//! input data.
+//!
+//! [`unicode-xid`]: https://github.com/unicode-rs/unicode-xid
+//! [`ucd-generate`]: https://github.com/BurntSushi/ucd-generate
+//! [`roaring`]: https://github.com/RoaringBitmap/roaring-rs
+//!
+//! | | static storage | 0% nonascii | 1% | 10% | 100% nonascii |
+//! |---|---|---|---|---|---|
+//! | **`unicode-ident`** | 10.1 K | 0.96 ns | 0.95 ns | 1.09 ns | 1.55 ns |
+//! | **`unicode-xid`** | 11.5 K | 1.88 ns | 2.14 ns | 3.48 ns | 15.63 ns |
+//! | **`ucd-trie`** | 10.2 K | 1.29 ns | 1.28 ns | 1.36 ns | 2.15 ns |
+//! | **`fst`** | 139 K | 55.1 ns | 54.9 ns | 53.2 ns | 28.5 ns |
+//! | **`roaring`** | 66.1 K | 2.78 ns | 3.09 ns | 3.37 ns | 4.70 ns |
+//!
+//! Source code for the benchmark is provided in the *bench* directory of this
+//! repo and may be repeated by running `cargo criterion`.
+//!
+//! <br>
+//!
+//! ## Comparison of data structures
+//!
+//! #### unicode-xid
+//!
+//! They use a sorted array of character ranges, and do a binary search to look
+//! up whether a given character lands inside one of those ranges.
+//!
+//! ```rust
+//! # const _: &str = stringify! {
+//! static XID_Continue_table: [(char, char); 763] = [
+//!     ('\u{30}', '\u{39}'),  // 0-9
+//!     ('\u{41}', '\u{5a}'),  // A-Z
+//! # "
+//!     …
+//! # "
+//!     ('\u{e0100}', '\u{e01ef}'),
+//! ];
+//! # };
+//! ```
+//!
+//! The static storage used by this data structure scales with the number of
+//! contiguous ranges of identifier codepoints in Unicode. Every table entry
+//! consumes 8 bytes, because it consists of a pair of 32-bit `char` values.
+//!
+//! In some ranges of the Unicode codepoint space, this is quite a sparse
+//! representation &ndash; there are some ranges where tens of thousands of
+//! adjacent codepoints are all valid identifier characters. In other places,
+//! the representation is quite inefficient. A characater like `µ` (U+00B5)
+//! which is surrounded by non-identifier codepoints consumes 64 bits in the
+//! table, while it would be just 1 bit in a dense bitmap.
+//!
+//! On a system with 64-byte cache lines, binary searching the table touches 7
+//! cache lines on average. Each cache line fits only 8 table entries.
+//! Additionally, the branching performed during the binary search is probably
+//! mostly unpredictable to the branch predictor.
+//!
+//! Overall, the crate ends up being about 10&times; slower on non-ASCII input
+//! compared to the fastest crate.
+//!
+//! A potential improvement would be to pack the table entries more compactly.
+//! Rust's `char` type is a 21-bit integer padded to 32 bits, which means every
+//! table entry is holding 22 bits of wasted space, adding up to 3.9 K. They
+//! could instead fit every table entry into 6 bytes, leaving out some of the
+//! padding, for a 25% improvement in space used. With some cleverness it may be
+//! possible to fit in 5 bytes or even 4 bytes by storing a low char and an
+//! extent, instead of low char and high char. I don't expect that performance
+//! would improve much but this could be the most efficient for space across all
+//! the libraries, needing only about 7 K to store.
+//!
+//! #### ucd-trie
+//!
+//! Their data structure is a compressed trie set specifically tailored for
+//! Unicode codepoints. The design is credited to Raph Levien in
+//! [rust-lang/rust#33098].
+//!
+//! [rust-lang/rust#33098]: https://github.com/rust-lang/rust/pull/33098
+//!
+//! ```rust
+//! pub struct TrieSet {
+//!     tree1_level1: &'static [u64; 32],
+//!     tree2_level1: &'static [u8; 992],
+//!     tree2_level2: &'static [u64],
+//!     tree3_level1: &'static [u8; 256],
+//!     tree3_level2: &'static [u8],
+//!     tree3_level3: &'static [u64],
+//! }
+//! ```
+//!
+//! It represents codepoint sets using a trie to achieve prefix compression. The
+//! final states of the trie are embedded in leaves or "chunks", where each
+//! chunk is a 64-bit integer. Each bit position of the integer corresponds to
+//! whether a particular codepoint is in the set or not. These chunks are not
+//! just a compact representation of the final states of the trie, but are also
+//! a form of suffix compression. In particular, if multiple ranges of 64
+//! contiguous codepoints have the same Unicode properties, then they all map to
+//! the same chunk in the final level of the trie.
+//!
+//! Being tailored for Unicode codepoints, this trie is partitioned into three
+//! disjoint sets: tree1, tree2, tree3. The first set corresponds to codepoints
+//! \[0, 0x800), the second \[0x800, 0x10000) and the third \[0x10000,
+//! 0x110000). These partitions conveniently correspond to the space of 1 or 2
+//! byte UTF-8 encoded codepoints, 3 byte UTF-8 encoded codepoints and 4 byte
+//! UTF-8 encoded codepoints, respectively.
+//!
+//! Lookups in this data structure are significantly more efficient than binary
+//! search. A lookup touches either 1, 2, or 3 cache lines based on which of the
+//! trie partitions is being accessed.
+//!
+//! One possible performance improvement would be for this crate to expose a way
+//! to query based on a UTF-8 encoded string, returning the Unicode property
+//! corresponding to the first character in the string. Without such an API, the
+//! caller is required to tokenize their UTF-8 encoded input data into `char`,
+//! hand the `char` into `ucd-trie`, only for `ucd-trie` to undo that work by
+//! converting back into the variable-length representation for trie traversal.
+//!
+//! #### fst
+//!
+//! Uses a [finite state transducer][fst]. This representation is built into
+//! [ucd-generate] but I am not aware of any advantage over the `ucd-trie`
+//! representation. In particular `ucd-trie` is optimized for storing Unicode
+//! properties while `fst` is not.
+//!
+//! [fst]: https://github.com/BurntSushi/fst
+//! [ucd-generate]: https://github.com/BurntSushi/ucd-generate
+//!
+//! As far as I can tell, the main thing that causes `fst` to have large size
+//! and slow lookups for this use case relative to `ucd-trie` is that it does
+//! not specialize for the fact that only 21 of the 32 bits in a `char` are
+//! meaningful. There are some dense arrays in the structure with large ranges
+//! that could never possibly be used.
+//!
+//! #### roaring
+//!
+//! This crate is a pure-Rust implementation of [Roaring Bitmap], a data
+//! structure designed for storing sets of 32-bit unsigned integers.
+//!
+//! [Roaring Bitmap]: https://roaringbitmap.org/about/
+//!
+//! Roaring bitmaps are compressed bitmaps which tend to outperform conventional
+//! compressed bitmaps such as WAH, EWAH or Concise. In some instances, they can
+//! be hundreds of times faster and they often offer significantly better
+//! compression.
+//!
+//! In this use case the performance was reasonably competitive but still
+//! substantially slower than the Unicode-optimized crates. Meanwhile the
+//! compression was significantly worse, requiring 6&times; as much storage for
+//! the data structure.
+//!
+//! I also benchmarked the [`croaring`] crate which is an FFI wrapper around the
+//! C reference implementation of Roaring Bitmap. This crate was consistently
+//! about 15% slower than pure-Rust `roaring`, which could just be FFI overhead.
+//! I did not investigate further.
+//!
+//! [`croaring`]: https://crates.io/crates/croaring
+//!
+//! #### unicode-ident
+//!
+//! This crate is most similar to the `ucd-trie` library, in that it's based on
+//! bitmaps stored in the leafs of a trie representation, achieving both prefix
+//! compression and suffix compression.
+//!
+//! The key differences are:
+//!
+//! - Uses a single 2-level trie, rather than 3 disjoint partitions of different
+//!   depth each.
+//! - Uses significantly larger chunks: 512 bits rather than 64 bits.
+//! - Compresses the XID\_Start and XID\_Continue properties together
+//!   simultaneously, rather than duplicating identical trie leaf chunks across
+//!   the two.
+//!
+//! The following diagram show the XID\_Start and XID\_Continue Unicode boolean
+//! properties in uncompressed form, in row-major order:
+//!
+//! <table>
+//! <tr><th>XID_Start</th><th>XID_Continue</th></tr>
+//! <tr>
+//! <td><img alt="XID_Start bitmap" width="256" src="https://user-images.githubusercontent.com/1940490/168647353-c6eeb922-afec-49b2-9ef5-c03e9d1e0760.png"></td>
+//! <td><img alt="XID_Continue bitmap" width="256" src="https://user-images.githubusercontent.com/1940490/168647367-f447cca7-2362-4d7d-8cd7-d21c011d329b.png"></td>
+//! </tr>
+//! </table>
+//!
+//! Uncompressed, these would take 140 K to store, which is beyond what would be
+//! reasonable. However, as you can see there is a large degree of similarity
+//! between the two bitmaps and across the rows, which lends well to
+//! compression.
+//!
+//! This crate stores one 512-bit "row" of the above bitmaps in the leaf level
+//! of a trie, and a single additional level to index into the leafs. It turns
+//! out there are 124 unique 512-bit chunks across the two bitmaps so 7 bits are
+//! sufficient to index them.
+//!
+//! The chunk size of 512 bits is selected as the size that minimizes the total
+//! size of the data structure. A smaller chunk, like 256 or 128 bits, would
+//! achieve better deduplication but require a larger index. A larger chunk
+//! would increase redundancy in the leaf bitmaps. 512 bit chunks are the
+//! optimum for total size of the index plus leaf bitmaps.
+//!
+//! In fact since there are only 124 unique chunks, we can use an 8-bit index
+//! with a spare bit to index at the half-chunk level. This achieves an
+//! additional 8.5% compression by eliminating redundancies between the second
+//! half of any chunk and the first half of any other chunk. Note that this is
+//! not the same as using chunks which are half the size, because it does not
+//! necessitate raising the size of the trie's first level.
+//!
+//! In contrast to binary search or the `ucd-trie` crate, performing lookups in
+//! this data structure is straight-line code with no need for branching.
+
+#![no_std]
+#![doc(html_root_url = "https://docs.rs/unicode-ident/1.0.12")]
+#![allow(clippy::doc_markdown, clippy::must_use_candidate)]
+
+#[rustfmt::skip]
+mod tables;
+
+use crate::tables::{ASCII_CONTINUE, ASCII_START, CHUNK, LEAF, TRIE_CONTINUE, TRIE_START};
+
+pub fn is_xid_start(ch: char) -> bool {
+    if ch.is_ascii() {
+        return ASCII_START.0[ch as usize];
+    }
+    let chunk = *TRIE_START.0.get(ch as usize / 8 / CHUNK).unwrap_or(&0);
+    let offset = chunk as usize * CHUNK / 2 + ch as usize / 8 % CHUNK;
+    unsafe { LEAF.0.get_unchecked(offset) }.wrapping_shr(ch as u32 % 8) & 1 != 0
+}
+
+pub fn is_xid_continue(ch: char) -> bool {
+    if ch.is_ascii() {
+        return ASCII_CONTINUE.0[ch as usize];
+    }
+    let chunk = *TRIE_CONTINUE.0.get(ch as usize / 8 / CHUNK).unwrap_or(&0);
+    let offset = chunk as usize * CHUNK / 2 + ch as usize / 8 % CHUNK;
+    unsafe { LEAF.0.get_unchecked(offset) }.wrapping_shr(ch as u32 % 8) & 1 != 0
+}
+
\ No newline at end of file diff --git a/src/unicode_ident/tables.rs.html b/src/unicode_ident/tables.rs.html new file mode 100644 index 0000000..f1658da --- /dev/null +++ b/src/unicode_ident/tables.rs.html @@ -0,0 +1,1303 @@ +tables.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+387
+388
+389
+390
+391
+392
+393
+394
+395
+396
+397
+398
+399
+400
+401
+402
+403
+404
+405
+406
+407
+408
+409
+410
+411
+412
+413
+414
+415
+416
+417
+418
+419
+420
+421
+422
+423
+424
+425
+426
+427
+428
+429
+430
+431
+432
+433
+434
+435
+436
+437
+438
+439
+440
+441
+442
+443
+444
+445
+446
+447
+448
+449
+450
+451
+452
+453
+454
+455
+456
+457
+458
+459
+460
+461
+462
+463
+464
+465
+466
+467
+468
+469
+470
+471
+472
+473
+474
+475
+476
+477
+478
+479
+480
+481
+482
+483
+484
+485
+486
+487
+488
+489
+490
+491
+492
+493
+494
+495
+496
+497
+498
+499
+500
+501
+502
+503
+504
+505
+506
+507
+508
+509
+510
+511
+512
+513
+514
+515
+516
+517
+518
+519
+520
+521
+522
+523
+524
+525
+526
+527
+528
+529
+530
+531
+532
+533
+534
+535
+536
+537
+538
+539
+540
+541
+542
+543
+544
+545
+546
+547
+548
+549
+550
+551
+552
+553
+554
+555
+556
+557
+558
+559
+560
+561
+562
+563
+564
+565
+566
+567
+568
+569
+570
+571
+572
+573
+574
+575
+576
+577
+578
+579
+580
+581
+582
+583
+584
+585
+586
+587
+588
+589
+590
+591
+592
+593
+594
+595
+596
+597
+598
+599
+600
+601
+602
+603
+604
+605
+606
+607
+608
+609
+610
+611
+612
+613
+614
+615
+616
+617
+618
+619
+620
+621
+622
+623
+624
+625
+626
+627
+628
+629
+630
+631
+632
+633
+634
+635
+636
+637
+638
+639
+640
+641
+642
+643
+644
+645
+646
+647
+648
+649
+650
+651
+
// @generated by ../generate. To regenerate, run the following in the repo root:
+//
+// $ curl -LO https://www.unicode.org/Public/zipped/15.0.0/UCD.zip
+// $ unzip UCD.zip -d UCD
+// $ cargo run --manifest-path generate/Cargo.toml
+
+const T: bool = true;
+const F: bool = false;
+
+#[repr(C, align(8))]
+pub(crate) struct Align8<T>(pub(crate) T);
+#[repr(C, align(64))]
+pub(crate) struct Align64<T>(pub(crate) T);
+
+pub(crate) static ASCII_START: Align64<[bool; 128]> = Align64([
+    F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
+    F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
+    F, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, F, F, F, F, F,
+    F, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, F, F, F, F, F,
+]);
+
+pub(crate) static ASCII_CONTINUE: Align64<[bool; 128]> = Align64([
+    F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F,
+    F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, T, T, T, T, T, T, T, T, T, T, F, F, F, F, F, F,
+    F, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, F, F, F, F, T,
+    F, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, F, F, F, F, F,
+]);
+
+pub(crate) const CHUNK: usize = 64;
+
+pub(crate) static TRIE_START: Align8<[u8; 402]> = Align8([
+    0x04, 0x0B, 0x0F, 0x13, 0x17, 0x1B, 0x1F, 0x23, 0x27, 0x2D, 0x31, 0x34, 0x38, 0x3C, 0x40, 0x02,
+    0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x49, 0x00, 0x4D, 0x00, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05,
+    0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x06, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05,
+    0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05,
+    0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05,
+    0x05, 0x05, 0x51, 0x54, 0x58, 0x5C, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05,
+    0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x09, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x60, 0x64, 0x66,
+    0x6A, 0x6E, 0x72, 0x28, 0x76, 0x78, 0x7C, 0x80, 0x84, 0x88, 0x8C, 0x90, 0x94, 0x98, 0x9E, 0xA2,
+    0x05, 0x2B, 0xA6, 0x00, 0x00, 0x00, 0x00, 0x99, 0x05, 0x05, 0xA8, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x05, 0xAE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x05, 0xB1, 0x00, 0xB5, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05,
+    0x05, 0x05, 0x05, 0x32, 0x05, 0x05, 0xB9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9C, 0x43, 0xBB, 0x00, 0x00, 0x00, 0x00, 0xBE, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC6, 0xC8, 0x00, 0x00, 0x00, 0xAF,
+    0xCE, 0xD2, 0xD6, 0xBC, 0xDA, 0x00, 0x00, 0xDE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05,
+    0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05,
+    0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05,
+    0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05,
+    0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05,
+    0x05, 0x05, 0x05, 0xE0, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x52, 0xE3, 0x05, 0x05, 0x05,
+    0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0xE6, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05,
+    0x05, 0x05, 0x05, 0x05, 0x05, 0xE1, 0x05, 0xE9, 0x00, 0x00, 0x00, 0x00, 0x05, 0xEB, 0x00, 0x00,
+    0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0xE4, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05,
+    0x05, 0xE7,
+]);
+
+pub(crate) static TRIE_CONTINUE: Align8<[u8; 1793]> = Align8([
+    0x08, 0x0D, 0x11, 0x15, 0x19, 0x1D, 0x21, 0x25, 0x2A, 0x2F, 0x31, 0x36, 0x3A, 0x3E, 0x42, 0x02,
+    0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4B, 0x00, 0x4F, 0x00, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05,
+    0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x06, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05,
+    0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05,
+    0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05,
+    0x05, 0x05, 0x51, 0x56, 0x5A, 0x5E, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05,
+    0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x09, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x62, 0x64, 0x68,
+    0x6C, 0x70, 0x74, 0x28, 0x76, 0x7A, 0x7E, 0x82, 0x86, 0x8A, 0x8E, 0x92, 0x96, 0x9B, 0xA0, 0xA4,
+    0x05, 0x2B, 0xA6, 0x00, 0x00, 0x00, 0x00, 0x99, 0x05, 0x05, 0xAB, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x05, 0xAE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x05, 0xB3, 0x00, 0xB7, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05,
+    0x05, 0x05, 0x05, 0x32, 0x05, 0x05, 0xB9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9C, 0x43, 0xBB, 0x00, 0x00, 0x00, 0x00, 0xC1, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA9, 0xAC, 0xC4, 0xC6, 0xCA, 0x00, 0xCC, 0x00, 0xAF,
+    0xD0, 0xD4, 0xD8, 0xBC, 0xDC, 0x00, 0x00, 0xDE, 0x00, 0x00, 0x00, 0x00, 0x00, 0xBF, 0x00, 0x00,
+    0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05,
+    0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05,
+    0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05,
+    0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05,
+    0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05,
+    0x05, 0x05, 0x05, 0xE0, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x52, 0xE3, 0x05, 0x05, 0x05,
+    0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0xE6, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05,
+    0x05, 0x05, 0x05, 0x05, 0x05, 0xE1, 0x05, 0xE9, 0x00, 0x00, 0x00, 0x00, 0x05, 0xEB, 0x00, 0x00,
+    0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0xE4, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05,
+    0x05, 0xE7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xC2,
+]);
+
+pub(crate) static LEAF: Align64<[u8; 7584]> = Align64([
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0x3F, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0x3F, 0xFF, 0xAA, 0xFF, 0xFF, 0xFF, 0x3F,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDF, 0x5F, 0xDC, 0x1F, 0xCF, 0x0F, 0xFF, 0x1F, 0xDC, 0x1F,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x20, 0x04, 0xFF, 0xFF, 0x7F, 0xFF, 0xFF, 0xFF, 0x7F, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0xA0, 0x04, 0xFF, 0xFF, 0x7F, 0xFF, 0xFF, 0xFF, 0x7F, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x00, 0xFF, 0xFF, 0x7F, 0xF8, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC3, 0xFF, 0x03, 0x00, 0x1F, 0x50, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xDF, 0xB8,
+    0x40, 0xD7, 0xFF, 0xFF, 0xFB, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC3, 0xFF, 0x03, 0x00, 0x1F, 0x50, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDF, 0xB8,
+    0xC0, 0xD7, 0xFF, 0xFF, 0xFB, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0x03, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0x7F, 0x02, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x87, 0x07, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFB, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0x7F, 0x02, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0x01, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xBF, 0xB6, 0x00, 0xFF, 0xFF, 0xFF, 0x87, 0x07, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0x00, 0x00, 0x00, 0xC0, 0xFE, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x2F, 0x00, 0x60, 0xC0, 0x00, 0x9C,
+    0x00, 0x00, 0xFD, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0x00, 0x02, 0x00, 0x00, 0xFC, 0xFF, 0xFF, 0xFF, 0x07, 0x30, 0x04,
+    0x00, 0x00, 0xFF, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC3, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xEF, 0x9F, 0xFF, 0xFD, 0xFF, 0x9F,
+    0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE7, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x03, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0x24,
+    0xFF, 0xFF, 0x3F, 0x04, 0x10, 0x01, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x01, 0xFF, 0x07, 0xFF, 0xFF,
+    0xFF, 0x7E, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xF0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x23, 0x00, 0x00, 0x01, 0xFF, 0x03, 0x00, 0xFE, 0xFF,
+    0xE1, 0x9F, 0xF9, 0xFF, 0xFF, 0xFD, 0xC5, 0x23, 0x00, 0x40, 0x00, 0xB0, 0x03, 0x00, 0x03, 0x10,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x0F, 0xFF, 0x07, 0xFF, 0xFF,
+    0xFF, 0x7E, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFB, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xCF, 0xFF, 0xFE, 0xFF,
+    0xEF, 0x9F, 0xF9, 0xFF, 0xFF, 0xFD, 0xC5, 0xF3, 0x9F, 0x79, 0x80, 0xB0, 0xCF, 0xFF, 0x03, 0x50,
+    0xE0, 0x87, 0xF9, 0xFF, 0xFF, 0xFD, 0x6D, 0x03, 0x00, 0x00, 0x00, 0x5E, 0x00, 0x00, 0x1C, 0x00,
+    0xE0, 0xBF, 0xFB, 0xFF, 0xFF, 0xFD, 0xED, 0x23, 0x00, 0x00, 0x01, 0x00, 0x03, 0x00, 0x00, 0x02,
+    0xE0, 0x9F, 0xF9, 0xFF, 0xFF, 0xFD, 0xED, 0x23, 0x00, 0x00, 0x00, 0xB0, 0x03, 0x00, 0x02, 0x00,
+    0xE8, 0xC7, 0x3D, 0xD6, 0x18, 0xC7, 0xFF, 0x03, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xEE, 0x87, 0xF9, 0xFF, 0xFF, 0xFD, 0x6D, 0xD3, 0x87, 0x39, 0x02, 0x5E, 0xC0, 0xFF, 0x3F, 0x00,
+    0xEE, 0xBF, 0xFB, 0xFF, 0xFF, 0xFD, 0xED, 0xF3, 0xBF, 0x3B, 0x01, 0x00, 0xCF, 0xFF, 0x00, 0xFE,
+    0xEE, 0x9F, 0xF9, 0xFF, 0xFF, 0xFD, 0xED, 0xF3, 0x9F, 0x39, 0xE0, 0xB0, 0xCF, 0xFF, 0x02, 0x00,
+    0xEC, 0xC7, 0x3D, 0xD6, 0x18, 0xC7, 0xFF, 0xC3, 0xC7, 0x3D, 0x81, 0x00, 0xC0, 0xFF, 0x00, 0x00,
+    0xE0, 0xDF, 0xFD, 0xFF, 0xFF, 0xFD, 0xFF, 0x23, 0x00, 0x00, 0x00, 0x27, 0x03, 0x00, 0x00, 0x00,
+    0xE1, 0xDF, 0xFD, 0xFF, 0xFF, 0xFD, 0xEF, 0x23, 0x00, 0x00, 0x00, 0x60, 0x03, 0x00, 0x06, 0x00,
+    0xF0, 0xDF, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF, 0x27, 0x00, 0x40, 0x70, 0x80, 0x03, 0x00, 0x00, 0xFC,
+    0xE0, 0xFF, 0x7F, 0xFC, 0xFF, 0xFF, 0xFB, 0x2F, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xDF, 0xFD, 0xFF, 0xFF, 0xFD, 0xFF, 0xF3, 0xDF, 0x3D, 0x60, 0x27, 0xCF, 0xFF, 0x00, 0x00,
+    0xEF, 0xDF, 0xFD, 0xFF, 0xFF, 0xFD, 0xEF, 0xF3, 0xDF, 0x3D, 0x60, 0x60, 0xCF, 0xFF, 0x0E, 0x00,
+    0xFF, 0xDF, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDF, 0x7D, 0xF0, 0x80, 0xCF, 0xFF, 0x00, 0xFC,
+    0xEE, 0xFF, 0x7F, 0xFC, 0xFF, 0xFF, 0xFB, 0x2F, 0x7F, 0x84, 0x5F, 0xFF, 0xC0, 0xFF, 0x0C, 0x00,
+    0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x05, 0x00, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xD6, 0xF7, 0xFF, 0xFF, 0xAF, 0xFF, 0x05, 0x20, 0x5F, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00,
+    0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0x1F, 0x00, 0x00,
+    0x00, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0xFF, 0x7F, 0xFF, 0x03, 0x00, 0x00, 0x00, 0x00,
+    0xD6, 0xF7, 0xFF, 0xFF, 0xAF, 0xFF, 0xFF, 0x3F, 0x5F, 0x7F, 0xFF, 0xF3, 0x00, 0x00, 0x00, 0x00,
+    0x01, 0x00, 0x00, 0x03, 0xFF, 0x03, 0xA0, 0xC2, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0x1F, 0xFE, 0xFF,
+    0xDF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0x1F, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0x00, 0x80, 0x00, 0x00, 0x3F, 0x3C, 0x62, 0xC0, 0xE1, 0xFF,
+    0x03, 0x40, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xBF, 0x20, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF7,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0x00, 0xFF, 0xFF, 0x3F, 0x00, 0xFF, 0x00, 0x00, 0x00,
+    0xBF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x03, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xBF, 0x20, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF7,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x3D, 0x7F, 0x3D, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0x3D, 0xFF, 0xFF, 0xFF, 0xFF, 0x3D, 0x7F, 0x3D, 0xFF, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0x3D, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0x3F,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x3D, 0x7F, 0x3D, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0x3D, 0xFF, 0xFF, 0xFF, 0xFF, 0x3D, 0x7F, 0x3D, 0xFF, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0x3D, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE7, 0x00, 0xFE, 0x03, 0x00,
+    0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0x3F,
+    0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x9F, 0xFF, 0xFF,
+    0xFE, 0xFF, 0xFF, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC7, 0xFF, 0x01,
+    0xFF, 0xFF, 0x03, 0x80, 0xFF, 0xFF, 0x03, 0x00, 0xFF, 0xFF, 0x03, 0x00, 0xFF, 0xDF, 0x01, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x00, 0x00, 0x00, 0x80, 0x10, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x9F, 0xFF, 0xFF,
+    0xFE, 0xFF, 0xFF, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC7, 0xFF, 0x01,
+    0xFF, 0xFF, 0x3F, 0x80, 0xFF, 0xFF, 0x1F, 0x00, 0xFF, 0xFF, 0x0F, 0x00, 0xFF, 0xDF, 0x0D, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x8F, 0x30, 0xFF, 0x03, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x01,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x05, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0x00,
+    0xFF, 0xFF, 0xFF, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x3F, 0x1F, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0xFF, 0xFF, 0xFF, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0xB8, 0xFF, 0x03, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x01,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0x00,
+    0xFF, 0xFF, 0xFF, 0x7F, 0xFF, 0x0F, 0xFF, 0x0F, 0xC0, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0x1F, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0xFF, 0xFF, 0xFF, 0x03, 0xFF, 0x07, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0x7F, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xE0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x00, 0xE0, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xF8, 0xFF, 0xFF, 0xFF, 0x01, 0xC0, 0x00, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0xFF, 0xFF, 0xFF, 0x9F,
+    0xFF, 0x03, 0xFF, 0x03, 0x80, 0x00, 0xFF, 0xBF, 0xFF, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x1F, 0xFF, 0x03, 0x00, 0xF8, 0x0F, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x00, 0xFC, 0xFF, 0xFF, 0xFF, 0x3F,
+    0xFF, 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE7, 0x00, 0x00, 0x00, 0x00, 0x00, 0xDE, 0x6F, 0x04,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xE3, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F,
+    0xFF, 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE7, 0x00, 0x00, 0xF7, 0xFF, 0xFF, 0xFF, 0xFF, 0x07,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0x00, 0x04, 0x00, 0x00, 0x00, 0x27, 0x00, 0xF0, 0x00, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x80,
+    0x00, 0x00, 0xFF, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x84, 0xFC, 0x2F, 0x3F, 0x50, 0xFD, 0xFF, 0xF3, 0xE0, 0x43, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x10, 0x00, 0x00, 0x00, 0x02, 0x80,
+    0x00, 0x00, 0xFF, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x1F, 0xE2, 0xFF, 0x01, 0x00,
+    0x84, 0xFC, 0x2F, 0x3F, 0x50, 0xFD, 0xFF, 0xF3, 0xE0, 0x43, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x1F, 0x78, 0x0C, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xBF, 0x20, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x00, 0x00,
+    0xFF, 0xFF, 0x7F, 0x00, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x1F, 0xF8, 0x0F, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xBF, 0x20, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x00, 0x80,
+    0xFF, 0xFF, 0x7F, 0x00, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xE0, 0x00, 0x00, 0x00, 0xFE, 0x03, 0x3E, 0x1F, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0x7F, 0xE0, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF7,
+    0xE0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0x7F, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF,
+    0xE0, 0x00, 0x00, 0x00, 0xFE, 0xFF, 0x3E, 0x1F, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0x7F, 0xE6, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xE0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0x7F, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x03, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0x1F, 0xFF, 0xFF, 0x00, 0x0C, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0x00, 0x80,
+    0xFF, 0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00,
+    0x00, 0x00, 0x80, 0xFF, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xF9, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0xEB, 0x03, 0x00, 0x00, 0xFC, 0xFF,
+    0xFF, 0x1F, 0xFF, 0xFF, 0xFF, 0x0F, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0xBF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x03, 0x00,
+    0x00, 0x00, 0x80, 0xFF, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xF9, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0xEB, 0x03, 0x00, 0x00, 0xFC, 0xFF,
+    0xBB, 0xF7, 0xFF, 0xFF, 0x07, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x00,
+    0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0x68,
+    0x00, 0xFC, 0xFF, 0xFF, 0x3F, 0x00, 0xFF, 0xFF, 0x7F, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x1F,
+    0xF0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0x00, 0x00, 0x80, 0x00, 0x00, 0xDF, 0xFF, 0x00, 0x7C,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x10, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0x00, 0xFF, 0x03, 0xFF, 0xFF, 0xFF, 0xE8,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x00, 0xFF, 0xFF, 0xFF, 0x1F,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0x80, 0xFF, 0x03, 0xFF, 0xFF, 0xFF, 0x7F,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0x00, 0x00, 0xF7, 0x0F, 0x00, 0x00, 0xFF, 0xFF, 0x7F, 0xC4,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x62, 0x3E, 0x05, 0x00, 0x00, 0x38, 0xFF, 0x07, 0x1C, 0x00,
+    0x7E, 0x7E, 0x7E, 0x00, 0x7F, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF7, 0xFF, 0x03, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0x00, 0xFF, 0x3F, 0xFF, 0x03, 0xFF, 0xFF, 0x7F, 0xFC,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0x00, 0x00, 0x38, 0xFF, 0xFF, 0x7C, 0x00,
+    0x7E, 0x7E, 0x7E, 0x00, 0x7F, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF7, 0xFF, 0x03, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x37, 0xFF, 0x03,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x03, 0x00, 0x00, 0x00, 0x00,
+    0x7F, 0x00, 0xF8, 0xA0, 0xFF, 0xFD, 0x7F, 0x5F, 0xDB, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x03, 0x00, 0x00, 0x00, 0xF8, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x03, 0x00, 0x00, 0x00, 0x00,
+    0x7F, 0x00, 0xF8, 0xE0, 0xFF, 0xFD, 0x7F, 0x5F, 0xDB, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x03, 0x00, 0x00, 0x00, 0xF8, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0xF0, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x03,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8A, 0xAA,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x1F,
+    0x00, 0x00, 0x00, 0x00, 0xFE, 0xFF, 0xFF, 0x07, 0xFE, 0xFF, 0xFF, 0x07, 0xC0, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0xFF, 0x7F, 0xFC, 0xFC, 0xFC, 0x1C, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0x18, 0x00, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x8A, 0xAA,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x1F,
+    0x00, 0x00, 0xFF, 0x03, 0xFE, 0xFF, 0xFF, 0x87, 0xFE, 0xFF, 0xFF, 0x07, 0xE0, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0xFC, 0xFC, 0xFC, 0x1C, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xEF, 0xFF, 0xFF, 0x7F, 0xFF, 0xFF, 0xB7, 0xFF, 0x3F, 0xFF, 0x3F, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x07,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x1F, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xEF, 0xFF, 0xFF, 0x7F, 0xFF, 0xFF, 0xB7, 0xFF, 0x3F, 0xFF, 0x3F, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x07,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x1F, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0x1F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xE0, 0xFF, 0xFF, 0xFF, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0x00,
+    0xFF, 0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0xFF, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0x1F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xE0, 0xFF, 0xFF, 0xFF, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x07,
+    0xFF, 0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0xFF, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0x3F, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x00, 0xFF, 0xF7,
+    0xFF, 0xF7, 0xB7, 0xFF, 0xFB, 0xFF, 0xFB, 0x1B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0x3F, 0xFF, 0x03, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x00, 0xFF, 0xF7,
+    0xFF, 0xF7, 0xB7, 0xFF, 0xFB, 0xFF, 0xFB, 0x1B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x3F, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF, 0xBF, 0x91, 0xFF, 0xFF, 0x3F, 0x00, 0xFF, 0xFF, 0x7F, 0x00,
+    0xFF, 0xFF, 0xFF, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x37, 0x00,
+    0xFF, 0xFF, 0x3F, 0x00, 0xFF, 0xFF, 0xFF, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x01, 0x00, 0xEF, 0xFE, 0xFF, 0xFF, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x1F,
+    0xFF, 0xFF, 0xFF, 0x1F, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFE, 0xFF, 0xFF, 0x1F, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0x00, 0xFF, 0xFF, 0x3F, 0x00, 0xFF, 0xFF, 0x07, 0x00,
+    0xFF, 0xFF, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x6F, 0xF0, 0xEF, 0xFE, 0xFF, 0xFF, 0x3F, 0x87, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x1F,
+    0xFF, 0xFF, 0xFF, 0x1F, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFE, 0xFF, 0xFF, 0x7F, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0x00, 0xFF, 0xFF, 0x3F, 0x00, 0xFF, 0xFF, 0x07, 0x00,
+    0xFF, 0xFF, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0x1F, 0x80, 0x00, 0xFF, 0xFF, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF,
+    0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x1F, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x7F, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x1B, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0,
+    0xFF, 0xFF, 0xFF, 0x1F, 0x80, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0x00, 0x00, 0x00, 0xFF, 0xFF,
+    0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x1F, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x7F, 0x00,
+    0xF8, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x26, 0x00,
+    0xF8, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x01, 0x00, 0x00,
+    0xF8, 0xFF, 0xFF, 0xFF, 0x7F, 0x00, 0x00, 0x00, 0x90, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x47, 0x00,
+    0xF8, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0x00, 0x1E, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0x00, 0x00, 0x00, 0xC0, 0xFF, 0x3F, 0x80,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0x04, 0x00, 0xFF, 0xFF, 0xFF, 0x01, 0xFF, 0x03,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDF, 0xFF, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x4F, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x1F, 0xDE, 0xFF, 0x17, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFB, 0xFF, 0xFF, 0x0F, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x7F, 0xBD, 0xFF, 0xBF, 0xFF, 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0x00, 0x00, 0x00, 0x00,
+    0xE0, 0x9F, 0xF9, 0xFF, 0xFF, 0xFD, 0xED, 0x23, 0x00, 0x00, 0x01, 0xE0, 0x03, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFB, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x7F, 0xBD, 0xFF, 0xBF, 0xFF, 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0xFF, 0x03,
+    0xEF, 0x9F, 0xF9, 0xFF, 0xFF, 0xFD, 0xED, 0xFB, 0x9F, 0x39, 0x81, 0xE0, 0xCF, 0x1F, 0x1F, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x1F, 0x00, 0x80, 0x07, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0xB0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0xFF, 0xC3, 0x03, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBF, 0x00, 0xFF, 0x03, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0xFF, 0x01, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0x07, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x11, 0x00, 0xFF, 0x03, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0xFF, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xE7, 0xFF, 0x0F, 0xFF, 0x03, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x80,
+    0x7F, 0xF2, 0x6F, 0xFF, 0xFF, 0xFF, 0x00, 0x80, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0xFF, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0x00, 0x0A, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x03, 0x00, 0x80,
+    0x7F, 0xF2, 0x6F, 0xFF, 0xFF, 0xFF, 0xBF, 0xF9, 0x0F, 0x00, 0xFF, 0x03, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0xFF, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0x1B, 0x00, 0x00, 0x00,
+    0x01, 0xF8, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0x04, 0x00, 0x00, 0x01, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0x03, 0x00, 0x20, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x01,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0x80, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0x23, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x01,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xEF, 0x6F,
+    0xFF, 0xFD, 0xFF, 0xFF, 0xFF, 0x7F, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0xFF,
+    0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x7F, 0xFB, 0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0x00, 0x40, 0x00, 0x00, 0x00, 0xBF, 0xFD, 0xFF, 0xFF,
+    0xFF, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0xFF, 0x01, 0x00, 0xFF, 0x03, 0x00, 0x00, 0xFC, 0xFF,
+    0xFF, 0xFF, 0xFC, 0xFF, 0xFF, 0xFE, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x7F, 0xFB, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0xB4, 0xFF, 0x00, 0xFF, 0x03, 0xBF, 0xFD, 0xFF, 0xFF,
+    0xFF, 0x7F, 0xFB, 0x01, 0xFF, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x07, 0x00,
+    0xF4, 0xFF, 0xFD, 0xFF, 0xFF, 0xFF, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x7F, 0x00,
+    0xFF, 0xFF, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF, 0xC7, 0x07, 0x00, 0xFF, 0x03, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xE3, 0x07, 0xF8,
+    0xE7, 0x0F, 0x00, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0x7F, 0xE0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0xFF, 0xFF, 0xFF, 0x7F, 0x00, 0x00, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x3F, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0xF8, 0xFF, 0xFF, 0xE0,
+    0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0xFF, 0xFF, 0xFF, 0x7F, 0xFF, 0x03, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0xFF, 0x03, 0xFF, 0xFF, 0xFF, 0x3F, 0x1F, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0x00, 0x0F, 0x00, 0xFF, 0x03, 0xF8, 0xFF, 0xFF, 0xE0,
+    0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0xF8, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x87, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0x80, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1B, 0x00, 0x03, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x6F, 0xFF, 0x7F,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0xFF, 0x1F,
+    0xFF, 0x01, 0xFF, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x03,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0xFF, 0x1F,
+    0xFF, 0x01, 0xFF, 0x63, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xDF, 0x64, 0xDE, 0xFF, 0xEB, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xBF, 0xE7, 0xDF, 0xDF, 0xFF, 0xFF, 0xFF, 0x7B, 0x5F, 0xFC, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0xFF, 0xFD, 0xFF, 0xFF, 0xF7, 0xFF, 0xFF, 0xFF, 0xF7,
+    0xFF, 0xFF, 0xDF, 0xFF, 0xFF, 0xFF, 0xDF, 0xFF, 0xFF, 0x7F, 0xFF, 0xFF, 0xFF, 0x7F, 0xFF, 0xFF,
+    0xFF, 0xFD, 0xFF, 0xFF, 0xFF, 0xFD, 0xFF, 0xFF, 0xF7, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0xFF, 0xFD, 0xFF, 0xFF, 0xF7, 0xFF, 0xFF, 0xFF, 0xF7,
+    0xFF, 0xFF, 0xDF, 0xFF, 0xFF, 0xFF, 0xDF, 0xFF, 0xFF, 0x7F, 0xFF, 0xFF, 0xFF, 0x7F, 0xFF, 0xFF,
+    0xFF, 0xFD, 0xFF, 0xFF, 0xFF, 0xFD, 0xFF, 0xFF, 0xF7, 0xCF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0xF8, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x1F, 0x20, 0x00,
+    0x10, 0x00, 0x00, 0xF8, 0xFE, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x1F, 0x80, 0x3F, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x7F, 0xFF, 0xFF, 0xF9, 0xDB, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0x00, 0x00,
+    0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x1F, 0xFF, 0x3F, 0xFF, 0x43, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x3F, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x7F, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x03,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x0F, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x03,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x1F, 0x00, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0xFF, 0x03, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xEF, 0xFF, 0xFF, 0xFF, 0x96, 0xFE, 0xF7, 0x0A, 0x84, 0xEA, 0x96, 0xAA, 0x96, 0xF7, 0xF7, 0x5E,
+    0xFF, 0xFB, 0xFF, 0x0F, 0xEE, 0xFB, 0xFF, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0x00, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0x03, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0xFF, 0xFF, 0xFF, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+]);
+
\ No newline at end of file diff --git a/static.files/COPYRIGHT-23e9bde6c69aea69.txt b/static.files/COPYRIGHT-23e9bde6c69aea69.txt new file mode 100644 index 0000000..1447df7 --- /dev/null +++ b/static.files/COPYRIGHT-23e9bde6c69aea69.txt @@ -0,0 +1,50 @@ +# REUSE-IgnoreStart + +These documentation pages include resources by third parties. This copyright +file applies only to those resources. The following third party resources are +included, and carry their own copyright notices and license terms: + +* Fira Sans (FiraSans-Regular.woff2, FiraSans-Medium.woff2): + + Copyright (c) 2014, Mozilla Foundation https://mozilla.org/ + with Reserved Font Name Fira Sans. + + Copyright (c) 2014, Telefonica S.A. + + Licensed under the SIL Open Font License, Version 1.1. + See FiraSans-LICENSE.txt. + +* rustdoc.css, main.js, and playpen.js: + + Copyright 2015 The Rust Developers. + Licensed under the Apache License, Version 2.0 (see LICENSE-APACHE.txt) or + the MIT license (LICENSE-MIT.txt) at your option. + +* normalize.css: + + Copyright (c) Nicolas Gallagher and Jonathan Neal. + Licensed under the MIT license (see LICENSE-MIT.txt). + +* Source Code Pro (SourceCodePro-Regular.ttf.woff2, + SourceCodePro-Semibold.ttf.woff2, SourceCodePro-It.ttf.woff2): + + Copyright 2010, 2012 Adobe Systems Incorporated (http://www.adobe.com/), + with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark + of Adobe Systems Incorporated in the United States and/or other countries. + + Licensed under the SIL Open Font License, Version 1.1. + See SourceCodePro-LICENSE.txt. + +* Source Serif 4 (SourceSerif4-Regular.ttf.woff2, SourceSerif4-Bold.ttf.woff2, + SourceSerif4-It.ttf.woff2): + + Copyright 2014-2021 Adobe (http://www.adobe.com/), with Reserved Font Name + 'Source'. All Rights Reserved. Source is a trademark of Adobe in the United + States and/or other countries. + + Licensed under the SIL Open Font License, Version 1.1. + See SourceSerif4-LICENSE.md. + +This copyright file is intended to be distributed with rustdoc output. + +# REUSE-IgnoreEnd diff --git a/static.files/FiraSans-LICENSE-db4b642586e02d97.txt b/static.files/FiraSans-LICENSE-db4b642586e02d97.txt new file mode 100644 index 0000000..d7e9c14 --- /dev/null +++ b/static.files/FiraSans-LICENSE-db4b642586e02d97.txt @@ -0,0 +1,98 @@ +// REUSE-IgnoreStart + +Digitized data copyright (c) 2012-2015, The Mozilla Foundation and Telefonica S.A. +with Reserved Font Name < Fira >, + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. + +// REUSE-IgnoreEnd diff --git a/static.files/FiraSans-Medium-8f9a781e4970d388.woff2 b/static.files/FiraSans-Medium-8f9a781e4970d388.woff2 new file mode 100644 index 0000000..7a1e5fc Binary files /dev/null and b/static.files/FiraSans-Medium-8f9a781e4970d388.woff2 differ diff --git a/static.files/FiraSans-Regular-018c141bf0843ffd.woff2 b/static.files/FiraSans-Regular-018c141bf0843ffd.woff2 new file mode 100644 index 0000000..e766e06 Binary files /dev/null and b/static.files/FiraSans-Regular-018c141bf0843ffd.woff2 differ diff --git a/static.files/LICENSE-APACHE-b91fa81cba47b86a.txt b/static.files/LICENSE-APACHE-b91fa81cba47b86a.txt new file mode 100644 index 0000000..16fe87b --- /dev/null +++ b/static.files/LICENSE-APACHE-b91fa81cba47b86a.txt @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/static.files/LICENSE-MIT-65090b722b3f6c56.txt b/static.files/LICENSE-MIT-65090b722b3f6c56.txt new file mode 100644 index 0000000..31aa793 --- /dev/null +++ b/static.files/LICENSE-MIT-65090b722b3f6c56.txt @@ -0,0 +1,23 @@ +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. diff --git a/static.files/NanumBarunGothic-0f09457c7a19b7c6.ttf.woff2 b/static.files/NanumBarunGothic-0f09457c7a19b7c6.ttf.woff2 new file mode 100644 index 0000000..1866ad4 Binary files /dev/null and b/static.files/NanumBarunGothic-0f09457c7a19b7c6.ttf.woff2 differ diff --git a/static.files/NanumBarunGothic-LICENSE-18c5adf4b52b4041.txt b/static.files/NanumBarunGothic-LICENSE-18c5adf4b52b4041.txt new file mode 100644 index 0000000..4b3edc2 --- /dev/null +++ b/static.files/NanumBarunGothic-LICENSE-18c5adf4b52b4041.txt @@ -0,0 +1,103 @@ +// REUSE-IgnoreStart + +Copyright (c) 2010, NAVER Corporation (https://www.navercorp.com/), + +with Reserved Font Name Nanum, Naver Nanum, NanumGothic, Naver NanumGothic, +NanumMyeongjo, Naver NanumMyeongjo, NanumBrush, Naver NanumBrush, NanumPen, +Naver NanumPen, Naver NanumGothicEco, NanumGothicEco, Naver NanumMyeongjoEco, +NanumMyeongjoEco, Naver NanumGothicLight, NanumGothicLight, NanumBarunGothic, +Naver NanumBarunGothic, NanumSquareRound, NanumBarunPen, MaruBuri + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. + +// REUSE-IgnoreEnd diff --git a/static.files/SourceCodePro-It-1cc31594bf4f1f79.ttf.woff2 b/static.files/SourceCodePro-It-1cc31594bf4f1f79.ttf.woff2 new file mode 100644 index 0000000..462c34e Binary files /dev/null and b/static.files/SourceCodePro-It-1cc31594bf4f1f79.ttf.woff2 differ diff --git a/static.files/SourceCodePro-LICENSE-d180d465a756484a.txt b/static.files/SourceCodePro-LICENSE-d180d465a756484a.txt new file mode 100644 index 0000000..0d2941e --- /dev/null +++ b/static.files/SourceCodePro-LICENSE-d180d465a756484a.txt @@ -0,0 +1,97 @@ +// REUSE-IgnoreStart + +Copyright 2010, 2012 Adobe Systems Incorporated (http://www.adobe.com/), with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of Adobe Systems Incorporated in the United States and/or other countries. + +This Font Software is licensed under the SIL Open Font License, Version 1.1. + +This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. + +// REUSE-IgnoreEnd diff --git a/static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2 b/static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2 new file mode 100644 index 0000000..10b558e Binary files /dev/null and b/static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2 differ diff --git a/static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2 b/static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2 new file mode 100644 index 0000000..5ec64ee Binary files /dev/null and b/static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2 differ diff --git a/static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2 b/static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2 new file mode 100644 index 0000000..181a07f Binary files /dev/null and b/static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2 differ diff --git a/static.files/SourceSerif4-It-acdfaf1a8af734b1.ttf.woff2 b/static.files/SourceSerif4-It-acdfaf1a8af734b1.ttf.woff2 new file mode 100644 index 0000000..2ae08a7 Binary files /dev/null and b/static.files/SourceSerif4-It-acdfaf1a8af734b1.ttf.woff2 differ diff --git a/static.files/SourceSerif4-LICENSE-3bb119e13b1258b7.md b/static.files/SourceSerif4-LICENSE-3bb119e13b1258b7.md new file mode 100644 index 0000000..175fa4f --- /dev/null +++ b/static.files/SourceSerif4-LICENSE-3bb119e13b1258b7.md @@ -0,0 +1,98 @@ + + +Copyright 2014-2021 Adobe (http://www.adobe.com/), with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of Adobe in the United States and/or other countries. +Copyright 2014 - 2023 Adobe (http://www.adobe.com/), with Reserved Font Name ‘Source’. All Rights Reserved. Source is a trademark of Adobe in the United States and/or other countries. + +This Font Software is licensed under the SIL Open Font License, Version 1.1. + +This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. + + diff --git a/static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2 b/static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2 new file mode 100644 index 0000000..0263fc3 Binary files /dev/null and b/static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2 differ diff --git a/static.files/favicon-2c020d218678b618.svg b/static.files/favicon-2c020d218678b618.svg new file mode 100644 index 0000000..8b34b51 --- /dev/null +++ b/static.files/favicon-2c020d218678b618.svg @@ -0,0 +1,24 @@ + + + + + diff --git a/static.files/favicon-32x32-422f7d1d52889060.png b/static.files/favicon-32x32-422f7d1d52889060.png new file mode 100644 index 0000000..69b8613 Binary files /dev/null and b/static.files/favicon-32x32-422f7d1d52889060.png differ diff --git a/static.files/main-20a3ad099b048cf2.js b/static.files/main-20a3ad099b048cf2.js new file mode 100644 index 0000000..133116e --- /dev/null +++ b/static.files/main-20a3ad099b048cf2.js @@ -0,0 +1,11 @@ +"use strict";window.RUSTDOC_TOOLTIP_HOVER_MS=300;window.RUSTDOC_TOOLTIP_HOVER_EXIT_MS=450;function resourcePath(basename,extension){return getVar("root-path")+basename+getVar("resource-suffix")+extension}function hideMain(){addClass(document.getElementById(MAIN_ID),"hidden")}function showMain(){removeClass(document.getElementById(MAIN_ID),"hidden")}function blurHandler(event,parentElem,hideCallback){if(!parentElem.contains(document.activeElement)&&!parentElem.contains(event.relatedTarget)){hideCallback()}}window.rootPath=getVar("root-path");window.currentCrate=getVar("current-crate");function setMobileTopbar(){const mobileTopbar=document.querySelector(".mobile-topbar");const locationTitle=document.querySelector(".sidebar h2.location");if(mobileTopbar){const mobileTitle=document.createElement("h2");mobileTitle.className="location";if(hasClass(document.querySelector(".rustdoc"),"crate")){mobileTitle.innerHTML=`Crate ${window.currentCrate}`}else if(locationTitle){mobileTitle.innerHTML=locationTitle.innerHTML}mobileTopbar.appendChild(mobileTitle)}}function getVirtualKey(ev){if("key"in ev&&typeof ev.key!=="undefined"){return ev.key}const c=ev.charCode||ev.keyCode;if(c===27){return"Escape"}return String.fromCharCode(c)}const MAIN_ID="main-content";const SETTINGS_BUTTON_ID="settings-menu";const ALTERNATIVE_DISPLAY_ID="alternative-display";const NOT_DISPLAYED_ID="not-displayed";const HELP_BUTTON_ID="help-button";function getSettingsButton(){return document.getElementById(SETTINGS_BUTTON_ID)}function getHelpButton(){return document.getElementById(HELP_BUTTON_ID)}function getNakedUrl(){return window.location.href.split("?")[0].split("#")[0]}function insertAfter(newNode,referenceNode){referenceNode.parentNode.insertBefore(newNode,referenceNode.nextSibling)}function getOrCreateSection(id,classes){let el=document.getElementById(id);if(!el){el=document.createElement("section");el.id=id;el.className=classes;insertAfter(el,document.getElementById(MAIN_ID))}return el}function getAlternativeDisplayElem(){return getOrCreateSection(ALTERNATIVE_DISPLAY_ID,"content hidden")}function getNotDisplayedElem(){return getOrCreateSection(NOT_DISPLAYED_ID,"hidden")}function switchDisplayedElement(elemToDisplay){const el=getAlternativeDisplayElem();if(el.children.length>0){getNotDisplayedElem().appendChild(el.firstElementChild)}if(elemToDisplay===null){addClass(el,"hidden");showMain();return}el.appendChild(elemToDisplay);hideMain();removeClass(el,"hidden")}function browserSupportsHistoryApi(){return window.history&&typeof window.history.pushState==="function"}function preLoadCss(cssUrl){const link=document.createElement("link");link.href=cssUrl;link.rel="preload";link.as="style";document.getElementsByTagName("head")[0].appendChild(link)}(function(){const isHelpPage=window.location.pathname.endsWith("/help.html");function loadScript(url,errorCallback){const script=document.createElement("script");script.src=url;if(errorCallback!==undefined){script.onerror=errorCallback}document.head.append(script)}getSettingsButton().onclick=event=>{if(event.ctrlKey||event.altKey||event.metaKey){return}window.hideAllModals(false);addClass(getSettingsButton(),"rotate");event.preventDefault();loadScript(getVar("static-root-path")+getVar("settings-js"));setTimeout(()=>{const themes=getVar("themes").split(",");for(const theme of themes){if(theme!==""){preLoadCss(getVar("root-path")+theme+".css")}}},0)};window.searchState={loadingText:"Loading search results...",input:document.getElementsByClassName("search-input")[0],outputElement:()=>{let el=document.getElementById("search");if(!el){el=document.createElement("section");el.id="search";getNotDisplayedElem().appendChild(el)}return el},title:document.title,titleBeforeSearch:document.title,timeout:null,currentTab:0,focusedByTab:[null,null,null],clearInputTimeout:()=>{if(searchState.timeout!==null){clearTimeout(searchState.timeout);searchState.timeout=null}},isDisplayed:()=>searchState.outputElement().parentElement.id===ALTERNATIVE_DISPLAY_ID,focus:()=>{searchState.input.focus()},defocus:()=>{searchState.input.blur()},showResults:search=>{if(search===null||typeof search==="undefined"){search=searchState.outputElement()}switchDisplayedElement(search);searchState.mouseMovedAfterSearch=false;document.title=searchState.title},removeQueryParameters:()=>{document.title=searchState.titleBeforeSearch;if(browserSupportsHistoryApi()){history.replaceState(null,"",getNakedUrl()+window.location.hash)}},hideResults:()=>{switchDisplayedElement(null);searchState.removeQueryParameters()},getQueryStringParams:()=>{const params={};window.location.search.substring(1).split("&").map(s=>{const pair=s.split("=").map(x=>x.replace(/\+/g," "));params[decodeURIComponent(pair[0])]=typeof pair[1]==="undefined"?null:decodeURIComponent(pair[1])});return params},setup:()=>{const search_input=searchState.input;if(!searchState.input){return}let searchLoaded=false;function sendSearchForm(){document.getElementsByClassName("search-form")[0].submit()}function loadSearch(){if(!searchLoaded){searchLoaded=true;loadScript(getVar("static-root-path")+getVar("search-js"),sendSearchForm);loadScript(resourcePath("search-index",".js"),sendSearchForm)}}search_input.addEventListener("focus",()=>{search_input.origPlaceholder=search_input.placeholder;search_input.placeholder="Type your search here.";loadSearch()});if(search_input.value!==""){loadSearch()}const params=searchState.getQueryStringParams();if(params.search!==undefined){searchState.setLoadingSearch();loadSearch()}},setLoadingSearch:()=>{const search=searchState.outputElement();search.innerHTML="

"+searchState.loadingText+"

";searchState.showResults(search)},descShards:new Map(),loadDesc:async function({descShard,descIndex}){if(descShard.promise===null){descShard.promise=new Promise((resolve,reject)=>{descShard.resolve=resolve;const ds=descShard;const fname=`${ds.crate}-desc-${ds.shard}-`;const url=resourcePath(`search.desc/${descShard.crate}/${fname}`,".js",);loadScript(url,reject)})}const list=await descShard.promise;return list[descIndex]},loadedDescShard:function(crate,shard,data){this.descShards.get(crate)[shard].resolve(data.split("\n"))},};const toggleAllDocsId="toggle-all-docs";let savedHash="";function handleHashes(ev){if(ev!==null&&searchState.isDisplayed()&&ev.newURL){switchDisplayedElement(null);const hash=ev.newURL.slice(ev.newURL.indexOf("#")+1);if(browserSupportsHistoryApi()){history.replaceState(null,"",getNakedUrl()+window.location.search+"#"+hash)}const elem=document.getElementById(hash);if(elem){elem.scrollIntoView()}}const pageId=window.location.hash.replace(/^#/,"");if(savedHash!==pageId){savedHash=pageId;if(pageId!==""){expandSection(pageId)}}if(savedHash.startsWith("impl-")){const splitAt=savedHash.indexOf("/");if(splitAt!==-1){const implId=savedHash.slice(0,splitAt);const assocId=savedHash.slice(splitAt+1);const implElem=document.getElementById(implId);if(implElem&&implElem.parentElement.tagName==="SUMMARY"&&implElem.parentElement.parentElement.tagName==="DETAILS"){onEachLazy(implElem.parentElement.parentElement.querySelectorAll(`[id^="${assocId}"]`),item=>{const numbered=/([^-]+)-([0-9]+)/.exec(item.id);if(item.id===assocId||(numbered&&numbered[1]===assocId)){openParentDetails(item);item.scrollIntoView();setTimeout(()=>{window.location.replace("#"+item.id)},0)}},)}}}}function onHashChange(ev){hideSidebar();handleHashes(ev)}function openParentDetails(elem){while(elem){if(elem.tagName==="DETAILS"){elem.open=true}elem=elem.parentNode}}function expandSection(id){openParentDetails(document.getElementById(id))}function handleEscape(ev){searchState.clearInputTimeout();searchState.hideResults();ev.preventDefault();searchState.defocus();window.hideAllModals(true)}function handleShortcut(ev){const disableShortcuts=getSettingValue("disable-shortcuts")==="true";if(ev.ctrlKey||ev.altKey||ev.metaKey||disableShortcuts){return}if(document.activeElement.tagName==="INPUT"&&document.activeElement.type!=="checkbox"&&document.activeElement.type!=="radio"){switch(getVirtualKey(ev)){case"Escape":handleEscape(ev);break}}else{switch(getVirtualKey(ev)){case"Escape":handleEscape(ev);break;case"s":case"S":case"/":ev.preventDefault();searchState.focus();break;case"+":ev.preventDefault();expandAllDocs();break;case"-":ev.preventDefault();collapseAllDocs();break;case"?":showHelp();break;default:break}}}document.addEventListener("keypress",handleShortcut);document.addEventListener("keydown",handleShortcut);function addSidebarItems(){if(!window.SIDEBAR_ITEMS){return}const sidebar=document.getElementsByClassName("sidebar-elems")[0];function block(shortty,id,longty){const filtered=window.SIDEBAR_ITEMS[shortty];if(!filtered){return}const modpath=hasClass(document.querySelector(".rustdoc"),"mod")?"../":"";const h3=document.createElement("h3");h3.innerHTML=`${longty}`;const ul=document.createElement("ul");ul.className="block "+shortty;for(const name of filtered){let path;if(shortty==="mod"){path=`${modpath}${name}/index.html`}else{path=`${modpath}${shortty}.${name}.html`}let current_page=document.location.href.toString();if(current_page.endsWith("/")){current_page+="index.html"}const link=document.createElement("a");link.href=path;if(path===current_page){link.className="current"}link.textContent=name;const li=document.createElement("li");li.appendChild(link);ul.appendChild(li)}sidebar.appendChild(h3);sidebar.appendChild(ul)}if(sidebar){block("primitive","primitives","Primitive Types");block("mod","modules","Modules");block("macro","macros","Macros");block("struct","structs","Structs");block("enum","enums","Enums");block("constant","constants","Constants");block("static","static","Statics");block("trait","traits","Traits");block("fn","functions","Functions");block("type","types","Type Aliases");block("union","unions","Unions");block("foreigntype","foreign-types","Foreign Types");block("keyword","keywords","Keywords");block("opaque","opaque-types","Opaque Types");block("attr","attributes","Attribute Macros");block("derive","derives","Derive Macros");block("traitalias","trait-aliases","Trait Aliases")}}window.register_implementors=imp=>{const implementors=document.getElementById("implementors-list");const synthetic_implementors=document.getElementById("synthetic-implementors-list");const inlined_types=new Set();const TEXT_IDX=0;const SYNTHETIC_IDX=1;const TYPES_IDX=2;if(synthetic_implementors){onEachLazy(synthetic_implementors.getElementsByClassName("impl"),el=>{const aliases=el.getAttribute("data-aliases");if(!aliases){return}aliases.split(",").forEach(alias=>{inlined_types.add(alias)})})}let currentNbImpls=implementors.getElementsByClassName("impl").length;const traitName=document.querySelector(".main-heading h1 > .trait").textContent;const baseIdName="impl-"+traitName+"-";const libs=Object.getOwnPropertyNames(imp);const script=document.querySelector("script[data-ignore-extern-crates]");const ignoreExternCrates=new Set((script?script.getAttribute("data-ignore-extern-crates"):"").split(","),);for(const lib of libs){if(lib===window.currentCrate||ignoreExternCrates.has(lib)){continue}const structs=imp[lib];struct_loop:for(const struct of structs){const list=struct[SYNTHETIC_IDX]?synthetic_implementors:implementors;if(struct[SYNTHETIC_IDX]){for(const struct_type of struct[TYPES_IDX]){if(inlined_types.has(struct_type)){continue struct_loop}inlined_types.add(struct_type)}}const code=document.createElement("h3");code.innerHTML=struct[TEXT_IDX];addClass(code,"code-header");onEachLazy(code.getElementsByTagName("a"),elem=>{const href=elem.getAttribute("href");if(href&&!href.startsWith("#")&&!/^(?:[a-z+]+:)?\/\//.test(href)){elem.setAttribute("href",window.rootPath+href)}});const currentId=baseIdName+currentNbImpls;const anchor=document.createElement("a");anchor.href="#"+currentId;addClass(anchor,"anchor");const display=document.createElement("div");display.id=currentId;addClass(display,"impl");display.appendChild(anchor);display.appendChild(code);list.appendChild(display);currentNbImpls+=1}}};if(window.pending_implementors){window.register_implementors(window.pending_implementors)}window.register_type_impls=imp=>{if(!imp||!imp[window.currentCrate]){return}window.pending_type_impls=null;const idMap=new Map();let implementations=document.getElementById("implementations-list");let trait_implementations=document.getElementById("trait-implementations-list");let trait_implementations_header=document.getElementById("trait-implementations");const script=document.querySelector("script[data-self-path]");const selfPath=script?script.getAttribute("data-self-path"):null;const mainContent=document.querySelector("#main-content");const sidebarSection=document.querySelector(".sidebar section");let methods=document.querySelector(".sidebar .block.method");let associatedTypes=document.querySelector(".sidebar .block.associatedtype");let associatedConstants=document.querySelector(".sidebar .block.associatedconstant");let sidebarTraitList=document.querySelector(".sidebar .block.trait-implementation");for(const impList of imp[window.currentCrate]){const types=impList.slice(2);const text=impList[0];const isTrait=impList[1]!==0;const traitName=impList[1];if(types.indexOf(selfPath)===-1){continue}let outputList=isTrait?trait_implementations:implementations;if(outputList===null){const outputListName=isTrait?"Trait Implementations":"Implementations";const outputListId=isTrait?"trait-implementations-list":"implementations-list";const outputListHeaderId=isTrait?"trait-implementations":"implementations";const outputListHeader=document.createElement("h2");outputListHeader.id=outputListHeaderId;outputListHeader.innerText=outputListName;outputList=document.createElement("div");outputList.id=outputListId;if(isTrait){const link=document.createElement("a");link.href=`#${outputListHeaderId}`;link.innerText="Trait Implementations";const h=document.createElement("h3");h.appendChild(link);trait_implementations=outputList;trait_implementations_header=outputListHeader;sidebarSection.appendChild(h);sidebarTraitList=document.createElement("ul");sidebarTraitList.className="block trait-implementation";sidebarSection.appendChild(sidebarTraitList);mainContent.appendChild(outputListHeader);mainContent.appendChild(outputList)}else{implementations=outputList;if(trait_implementations){mainContent.insertBefore(outputListHeader,trait_implementations_header);mainContent.insertBefore(outputList,trait_implementations_header)}else{const mainContent=document.querySelector("#main-content");mainContent.appendChild(outputListHeader);mainContent.appendChild(outputList)}}}const template=document.createElement("template");template.innerHTML=text;onEachLazy(template.content.querySelectorAll("a"),elem=>{const href=elem.getAttribute("href");if(href&&!href.startsWith("#")&&!/^(?:[a-z+]+:)?\/\//.test(href)){elem.setAttribute("href",window.rootPath+href)}});onEachLazy(template.content.querySelectorAll("[id]"),el=>{let i=0;if(idMap.has(el.id)){i=idMap.get(el.id)}else if(document.getElementById(el.id)){i=1;while(document.getElementById(`${el.id}-${2 * i}`)){i=2*i}while(document.getElementById(`${el.id}-${i}`)){i+=1}}if(i!==0){const oldHref=`#${el.id}`;const newHref=`#${el.id}-${i}`;el.id=`${el.id}-${i}`;onEachLazy(template.content.querySelectorAll("a[href]"),link=>{if(link.getAttribute("href")===oldHref){link.href=newHref}})}idMap.set(el.id,i+1)});const templateAssocItems=template.content.querySelectorAll("section.tymethod, "+"section.method, section.associatedtype, section.associatedconstant");if(isTrait){const li=document.createElement("li");const a=document.createElement("a");a.href=`#${template.content.querySelector(".impl").id}`;a.textContent=traitName;li.appendChild(a);sidebarTraitList.append(li)}else{onEachLazy(templateAssocItems,item=>{let block=hasClass(item,"associatedtype")?associatedTypes:(hasClass(item,"associatedconstant")?associatedConstants:(methods));if(!block){const blockTitle=hasClass(item,"associatedtype")?"Associated Types":(hasClass(item,"associatedconstant")?"Associated Constants":("Methods"));const blockClass=hasClass(item,"associatedtype")?"associatedtype":(hasClass(item,"associatedconstant")?"associatedconstant":("method"));const blockHeader=document.createElement("h3");const blockLink=document.createElement("a");blockLink.href="#implementations";blockLink.innerText=blockTitle;blockHeader.appendChild(blockLink);block=document.createElement("ul");block.className=`block ${blockClass}`;const insertionReference=methods||sidebarTraitList;if(insertionReference){const insertionReferenceH=insertionReference.previousElementSibling;sidebarSection.insertBefore(blockHeader,insertionReferenceH);sidebarSection.insertBefore(block,insertionReferenceH)}else{sidebarSection.appendChild(blockHeader);sidebarSection.appendChild(block)}if(hasClass(item,"associatedtype")){associatedTypes=block}else if(hasClass(item,"associatedconstant")){associatedConstants=block}else{methods=block}}const li=document.createElement("li");const a=document.createElement("a");a.innerText=item.id.split("-")[0].split(".")[1];a.href=`#${item.id}`;li.appendChild(a);block.appendChild(li)})}outputList.appendChild(template.content)}for(const list of[methods,associatedTypes,associatedConstants,sidebarTraitList]){if(!list){continue}const newChildren=Array.prototype.slice.call(list.children);newChildren.sort((a,b)=>{const aI=a.innerText;const bI=b.innerText;return aIbI?1:0});list.replaceChildren(...newChildren)}};if(window.pending_type_impls){window.register_type_impls(window.pending_type_impls)}function addSidebarCrates(){if(!window.ALL_CRATES){return}const sidebarElems=document.getElementsByClassName("sidebar-elems")[0];if(!sidebarElems){return}const h3=document.createElement("h3");h3.innerHTML="Crates";const ul=document.createElement("ul");ul.className="block crate";for(const crate of window.ALL_CRATES){const link=document.createElement("a");link.href=window.rootPath+crate+"/index.html";link.textContent=crate;const li=document.createElement("li");if(window.rootPath!=="./"&&crate===window.currentCrate){li.className="current"}li.appendChild(link);ul.appendChild(li)}sidebarElems.appendChild(h3);sidebarElems.appendChild(ul)}function expandAllDocs(){const innerToggle=document.getElementById(toggleAllDocsId);removeClass(innerToggle,"will-expand");onEachLazy(document.getElementsByClassName("toggle"),e=>{if(!hasClass(e,"type-contents-toggle")&&!hasClass(e,"more-examples-toggle")){e.open=true}});innerToggle.title="collapse all docs";innerToggle.children[0].innerText="\u2212"}function collapseAllDocs(){const innerToggle=document.getElementById(toggleAllDocsId);addClass(innerToggle,"will-expand");onEachLazy(document.getElementsByClassName("toggle"),e=>{if(e.parentNode.id!=="implementations-list"||(!hasClass(e,"implementors-toggle")&&!hasClass(e,"type-contents-toggle"))){e.open=false}});innerToggle.title="expand all docs";innerToggle.children[0].innerText="+"}function toggleAllDocs(){const innerToggle=document.getElementById(toggleAllDocsId);if(!innerToggle){return}if(hasClass(innerToggle,"will-expand")){expandAllDocs()}else{collapseAllDocs()}}(function(){const toggles=document.getElementById(toggleAllDocsId);if(toggles){toggles.onclick=toggleAllDocs}const hideMethodDocs=getSettingValue("auto-hide-method-docs")==="true";const hideImplementations=getSettingValue("auto-hide-trait-implementations")==="true";const hideLargeItemContents=getSettingValue("auto-hide-large-items")!=="false";function setImplementorsTogglesOpen(id,open){const list=document.getElementById(id);if(list!==null){onEachLazy(list.getElementsByClassName("implementors-toggle"),e=>{e.open=open})}}if(hideImplementations){setImplementorsTogglesOpen("trait-implementations-list",false);setImplementorsTogglesOpen("blanket-implementations-list",false)}onEachLazy(document.getElementsByClassName("toggle"),e=>{if(!hideLargeItemContents&&hasClass(e,"type-contents-toggle")){e.open=true}if(hideMethodDocs&&hasClass(e,"method-toggle")){e.open=false}})}());window.rustdoc_add_line_numbers_to_examples=()=>{onEachLazy(document.getElementsByClassName("rust-example-rendered"),x=>{const parent=x.parentNode;const line_numbers=parent.querySelectorAll(".example-line-numbers");if(line_numbers.length>0){return}const count=x.textContent.split("\n").length;const elems=[];for(let i=0;i{onEachLazy(document.getElementsByClassName("rust-example-rendered"),x=>{const parent=x.parentNode;const line_numbers=parent.querySelectorAll(".example-line-numbers");for(const node of line_numbers){parent.removeChild(node)}})};if(getSettingValue("line-numbers")==="true"){window.rustdoc_add_line_numbers_to_examples()}function showSidebar(){window.hideAllModals(false);const sidebar=document.getElementsByClassName("sidebar")[0];addClass(sidebar,"shown")}function hideSidebar(){const sidebar=document.getElementsByClassName("sidebar")[0];removeClass(sidebar,"shown")}window.addEventListener("resize",()=>{if(window.CURRENT_TOOLTIP_ELEMENT){const base=window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE;const force_visible=base.TOOLTIP_FORCE_VISIBLE;hideTooltip(false);if(force_visible){showTooltip(base);base.TOOLTIP_FORCE_VISIBLE=true}}});const mainElem=document.getElementById(MAIN_ID);if(mainElem){mainElem.addEventListener("click",hideSidebar)}onEachLazy(document.querySelectorAll("a[href^='#']"),el=>{el.addEventListener("click",()=>{expandSection(el.hash.slice(1));hideSidebar()})});onEachLazy(document.querySelectorAll(".toggle > summary:not(.hideme)"),el=>{el.addEventListener("click",e=>{if(e.target.tagName!=="SUMMARY"&&e.target.tagName!=="A"){e.preventDefault()}})});function showTooltip(e){const notable_ty=e.getAttribute("data-notable-ty");if(!window.NOTABLE_TRAITS&¬able_ty){const data=document.getElementById("notable-traits-data");if(data){window.NOTABLE_TRAITS=JSON.parse(data.innerText)}else{throw new Error("showTooltip() called with notable without any notable traits!")}}if(window.CURRENT_TOOLTIP_ELEMENT&&window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE===e){clearTooltipHoverTimeout(window.CURRENT_TOOLTIP_ELEMENT);return}window.hideAllModals(false);const wrapper=document.createElement("div");if(notable_ty){wrapper.innerHTML="
"+window.NOTABLE_TRAITS[notable_ty]+"
"}else{if(e.getAttribute("title")!==null){e.setAttribute("data-title",e.getAttribute("title"));e.removeAttribute("title")}if(e.getAttribute("data-title")!==null){const titleContent=document.createElement("div");titleContent.className="content";titleContent.appendChild(document.createTextNode(e.getAttribute("data-title")));wrapper.appendChild(titleContent)}}wrapper.className="tooltip popover";const focusCatcher=document.createElement("div");focusCatcher.setAttribute("tabindex","0");focusCatcher.onfocus=hideTooltip;wrapper.appendChild(focusCatcher);const pos=e.getBoundingClientRect();wrapper.style.top=(pos.top+window.scrollY+pos.height)+"px";wrapper.style.left=0;wrapper.style.right="auto";wrapper.style.visibility="hidden";const body=document.getElementsByTagName("body")[0];body.appendChild(wrapper);const wrapperPos=wrapper.getBoundingClientRect();const finalPos=pos.left+window.scrollX-wrapperPos.width+24;if(finalPos>0){wrapper.style.left=finalPos+"px"}else{wrapper.style.setProperty("--popover-arrow-offset",(wrapperPos.right-pos.right+4)+"px",)}wrapper.style.visibility="";window.CURRENT_TOOLTIP_ELEMENT=wrapper;window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE=e;clearTooltipHoverTimeout(window.CURRENT_TOOLTIP_ELEMENT);wrapper.onpointerenter=ev=>{if(ev.pointerType!=="mouse"){return}clearTooltipHoverTimeout(e)};wrapper.onpointerleave=ev=>{if(ev.pointerType!=="mouse"){return}if(!e.TOOLTIP_FORCE_VISIBLE&&!e.contains(ev.relatedTarget)){setTooltipHoverTimeout(e,false);addClass(wrapper,"fade-out")}}}function setTooltipHoverTimeout(element,show){clearTooltipHoverTimeout(element);if(!show&&!window.CURRENT_TOOLTIP_ELEMENT){return}if(show&&window.CURRENT_TOOLTIP_ELEMENT){return}if(window.CURRENT_TOOLTIP_ELEMENT&&window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE!==element){return}element.TOOLTIP_HOVER_TIMEOUT=setTimeout(()=>{if(show){showTooltip(element)}else if(!element.TOOLTIP_FORCE_VISIBLE){hideTooltip(false)}},show?window.RUSTDOC_TOOLTIP_HOVER_MS:window.RUSTDOC_TOOLTIP_HOVER_EXIT_MS)}function clearTooltipHoverTimeout(element){if(element.TOOLTIP_HOVER_TIMEOUT!==undefined){removeClass(window.CURRENT_TOOLTIP_ELEMENT,"fade-out");clearTimeout(element.TOOLTIP_HOVER_TIMEOUT);delete element.TOOLTIP_HOVER_TIMEOUT}}function tooltipBlurHandler(event){if(window.CURRENT_TOOLTIP_ELEMENT&&!window.CURRENT_TOOLTIP_ELEMENT.contains(document.activeElement)&&!window.CURRENT_TOOLTIP_ELEMENT.contains(event.relatedTarget)&&!window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE.contains(document.activeElement)&&!window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE.contains(event.relatedTarget)){setTimeout(()=>hideTooltip(false),0)}}function hideTooltip(focus){if(window.CURRENT_TOOLTIP_ELEMENT){if(window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE.TOOLTIP_FORCE_VISIBLE){if(focus){window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE.focus()}window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE.TOOLTIP_FORCE_VISIBLE=false}const body=document.getElementsByTagName("body")[0];body.removeChild(window.CURRENT_TOOLTIP_ELEMENT);clearTooltipHoverTimeout(window.CURRENT_TOOLTIP_ELEMENT);window.CURRENT_TOOLTIP_ELEMENT=null}}onEachLazy(document.getElementsByClassName("tooltip"),e=>{e.onclick=()=>{e.TOOLTIP_FORCE_VISIBLE=e.TOOLTIP_FORCE_VISIBLE?false:true;if(window.CURRENT_TOOLTIP_ELEMENT&&!e.TOOLTIP_FORCE_VISIBLE){hideTooltip(true)}else{showTooltip(e);window.CURRENT_TOOLTIP_ELEMENT.setAttribute("tabindex","0");window.CURRENT_TOOLTIP_ELEMENT.focus();window.CURRENT_TOOLTIP_ELEMENT.onblur=tooltipBlurHandler}return false};e.onpointerenter=ev=>{if(ev.pointerType!=="mouse"){return}setTooltipHoverTimeout(e,true)};e.onpointermove=ev=>{if(ev.pointerType!=="mouse"){return}setTooltipHoverTimeout(e,true)};e.onpointerleave=ev=>{if(ev.pointerType!=="mouse"){return}if(!e.TOOLTIP_FORCE_VISIBLE&&window.CURRENT_TOOLTIP_ELEMENT&&!window.CURRENT_TOOLTIP_ELEMENT.contains(ev.relatedTarget)){setTooltipHoverTimeout(e,false);addClass(window.CURRENT_TOOLTIP_ELEMENT,"fade-out")}}});const sidebar_menu_toggle=document.getElementsByClassName("sidebar-menu-toggle")[0];if(sidebar_menu_toggle){sidebar_menu_toggle.addEventListener("click",()=>{const sidebar=document.getElementsByClassName("sidebar")[0];if(!hasClass(sidebar,"shown")){showSidebar()}else{hideSidebar()}})}function helpBlurHandler(event){blurHandler(event,getHelpButton(),window.hidePopoverMenus)}function buildHelpMenu(){const book_info=document.createElement("span");const channel=getVar("channel");book_info.className="top";book_info.innerHTML=`You can find more information in \ +the rustdoc book.`;const shortcuts=[["?","Show this help dialog"],["S / /","Focus the search field"],["↑","Move up in search results"],["↓","Move down in search results"],["← / →","Switch result tab (when results focused)"],["⏎","Go to active search result"],["+","Expand all sections"],["-","Collapse all sections"],].map(x=>"
"+x[0].split(" ").map((y,index)=>((index&1)===0?""+y+"":" "+y+" ")).join("")+"
"+x[1]+"
").join("");const div_shortcuts=document.createElement("div");addClass(div_shortcuts,"shortcuts");div_shortcuts.innerHTML="

Keyboard Shortcuts

"+shortcuts+"
";const infos=[`For a full list of all search features, take a look here.`,"Prefix searches with a type followed by a colon (e.g., fn:) to \ + restrict the search to a given item kind.","Accepted kinds are: fn, mod, struct, \ + enum, trait, type, macro, \ + and const.","Search functions by type signature (e.g., vec -> usize or \ + -> vec or String, enum:Cow -> bool)","You can look for items with an exact name by putting double quotes around \ + your request: \"string\"","Look for functions that accept or return \ + slices and \ + arrays by writing \ + square brackets (e.g., -> [u8] or [] -> Option)","Look for items inside another one by searching for a path: vec::Vec",].map(x=>"

"+x+"

").join("");const div_infos=document.createElement("div");addClass(div_infos,"infos");div_infos.innerHTML="

Search Tricks

"+infos;const rustdoc_version=document.createElement("span");rustdoc_version.className="bottom";const rustdoc_version_code=document.createElement("code");rustdoc_version_code.innerText="rustdoc "+getVar("rustdoc-version");rustdoc_version.appendChild(rustdoc_version_code);const container=document.createElement("div");if(!isHelpPage){container.className="popover"}container.id="help";container.style.display="none";const side_by_side=document.createElement("div");side_by_side.className="side-by-side";side_by_side.appendChild(div_shortcuts);side_by_side.appendChild(div_infos);container.appendChild(book_info);container.appendChild(side_by_side);container.appendChild(rustdoc_version);if(isHelpPage){const help_section=document.createElement("section");help_section.appendChild(container);document.getElementById("main-content").appendChild(help_section);container.style.display="block"}else{const help_button=getHelpButton();help_button.appendChild(container);container.onblur=helpBlurHandler;help_button.onblur=helpBlurHandler;help_button.children[0].onblur=helpBlurHandler}return container}window.hideAllModals=switchFocus=>{hideSidebar();window.hidePopoverMenus();hideTooltip(switchFocus)};window.hidePopoverMenus=()=>{onEachLazy(document.querySelectorAll(".search-form .popover"),elem=>{elem.style.display="none"})};function getHelpMenu(buildNeeded){let menu=getHelpButton().querySelector(".popover");if(!menu&&buildNeeded){menu=buildHelpMenu()}return menu}function showHelp(){getHelpButton().querySelector("a").focus();const menu=getHelpMenu(true);if(menu.style.display==="none"){window.hideAllModals();menu.style.display=""}}if(isHelpPage){showHelp();document.querySelector(`#${HELP_BUTTON_ID} > a`).addEventListener("click",event=>{const target=event.target;if(target.tagName!=="A"||target.parentElement.id!==HELP_BUTTON_ID||event.ctrlKey||event.altKey||event.metaKey){return}event.preventDefault()})}else{document.querySelector(`#${HELP_BUTTON_ID} > a`).addEventListener("click",event=>{const target=event.target;if(target.tagName!=="A"||target.parentElement.id!==HELP_BUTTON_ID||event.ctrlKey||event.altKey||event.metaKey){return}event.preventDefault();const menu=getHelpMenu(true);const shouldShowHelp=menu.style.display==="none";if(shouldShowHelp){showHelp()}else{window.hidePopoverMenus()}})}setMobileTopbar();addSidebarItems();addSidebarCrates();onHashChange(null);window.addEventListener("hashchange",onHashChange);searchState.setup()}());(function(){const SIDEBAR_MIN=100;const SIDEBAR_MAX=500;const RUSTDOC_MOBILE_BREAKPOINT=700;const BODY_MIN=400;const SIDEBAR_VANISH_THRESHOLD=SIDEBAR_MIN/2;const sidebarButton=document.getElementById("sidebar-button");if(sidebarButton){sidebarButton.addEventListener("click",e=>{removeClass(document.documentElement,"hide-sidebar");updateLocalStorage("hide-sidebar","false");if(document.querySelector(".rustdoc.src")){window.rustdocToggleSrcSidebar()}e.preventDefault()})}let currentPointerId=null;let desiredSidebarSize=null;let pendingSidebarResizingFrame=false;const resizer=document.querySelector(".sidebar-resizer");const sidebar=document.querySelector(".sidebar");if(!resizer||!sidebar){return}const isSrcPage=hasClass(document.body,"src");function hideSidebar(){if(isSrcPage){window.rustdocCloseSourceSidebar();updateLocalStorage("src-sidebar-width",null);document.documentElement.style.removeProperty("--src-sidebar-width");sidebar.style.removeProperty("--src-sidebar-width");resizer.style.removeProperty("--src-sidebar-width")}else{addClass(document.documentElement,"hide-sidebar");updateLocalStorage("hide-sidebar","true");updateLocalStorage("desktop-sidebar-width",null);document.documentElement.style.removeProperty("--desktop-sidebar-width");sidebar.style.removeProperty("--desktop-sidebar-width");resizer.style.removeProperty("--desktop-sidebar-width")}}function showSidebar(){if(isSrcPage){window.rustdocShowSourceSidebar()}else{removeClass(document.documentElement,"hide-sidebar");updateLocalStorage("hide-sidebar","false")}}function changeSidebarSize(size){if(isSrcPage){updateLocalStorage("src-sidebar-width",size);sidebar.style.setProperty("--src-sidebar-width",size+"px");resizer.style.setProperty("--src-sidebar-width",size+"px")}else{updateLocalStorage("desktop-sidebar-width",size);sidebar.style.setProperty("--desktop-sidebar-width",size+"px");resizer.style.setProperty("--desktop-sidebar-width",size+"px")}}function isSidebarHidden(){return isSrcPage?!hasClass(document.documentElement,"src-sidebar-expanded"):hasClass(document.documentElement,"hide-sidebar")}function resize(e){if(currentPointerId===null||currentPointerId!==e.pointerId){return}e.preventDefault();const pos=e.clientX-3;if(pos=SIDEBAR_MIN){if(isSidebarHidden()){showSidebar()}const constrainedPos=Math.min(pos,window.innerWidth-BODY_MIN,SIDEBAR_MAX);changeSidebarSize(constrainedPos);desiredSidebarSize=constrainedPos;if(pendingSidebarResizingFrame!==false){clearTimeout(pendingSidebarResizingFrame)}pendingSidebarResizingFrame=setTimeout(()=>{if(currentPointerId===null||pendingSidebarResizingFrame===false){return}pendingSidebarResizingFrame=false;document.documentElement.style.setProperty("--resizing-sidebar-width",desiredSidebarSize+"px",)},100)}}window.addEventListener("resize",()=>{if(window.innerWidth=(window.innerWidth-BODY_MIN)){changeSidebarSize(window.innerWidth-BODY_MIN)}else if(desiredSidebarSize!==null&&desiredSidebarSize>SIDEBAR_MIN){changeSidebarSize(desiredSidebarSize)}});function stopResize(e){if(currentPointerId===null){return}if(e){e.preventDefault()}desiredSidebarSize=sidebar.getBoundingClientRect().width;removeClass(resizer,"active");window.removeEventListener("pointermove",resize,false);window.removeEventListener("pointerup",stopResize,false);removeClass(document.documentElement,"sidebar-resizing");document.documentElement.style.removeProperty("--resizing-sidebar-width");if(resizer.releasePointerCapture){resizer.releasePointerCapture(currentPointerId);currentPointerId=null}}function initResize(e){if(currentPointerId!==null||e.altKey||e.ctrlKey||e.metaKey||e.button!==0){return}if(resizer.setPointerCapture){resizer.setPointerCapture(e.pointerId);if(!resizer.hasPointerCapture(e.pointerId)){resizer.releasePointerCapture(e.pointerId);return}currentPointerId=e.pointerId}window.hideAllModals(false);e.preventDefault();window.addEventListener("pointermove",resize,false);window.addEventListener("pointercancel",stopResize,false);window.addEventListener("pointerup",stopResize,false);addClass(resizer,"active");addClass(document.documentElement,"sidebar-resizing");const pos=e.clientX-sidebar.offsetLeft-3;document.documentElement.style.setProperty("--resizing-sidebar-width",pos+"px");desiredSidebarSize=null}resizer.addEventListener("pointerdown",initResize,false)}());(function(){let reset_button_timeout=null;const but=document.getElementById("copy-path");if(!but){return}but.onclick=()=>{const parent=but.parentElement;const path=[];onEach(parent.childNodes,child=>{if(child.tagName==="A"){path.push(child.textContent)}});const el=document.createElement("textarea");el.value=path.join("::");el.setAttribute("readonly","");el.style.position="absolute";el.style.left="-9999px";document.body.appendChild(el);el.select();document.execCommand("copy");document.body.removeChild(el);but.classList.add("clicked");if(reset_button_timeout!==null){window.clearTimeout(reset_button_timeout)}function reset_button(){reset_button_timeout=null;but.classList.remove("clicked")}reset_button_timeout=window.setTimeout(reset_button,1000)}}()) \ No newline at end of file diff --git a/static.files/normalize-76eba96aa4d2e634.css b/static.files/normalize-76eba96aa4d2e634.css new file mode 100644 index 0000000..469959f --- /dev/null +++ b/static.files/normalize-76eba96aa4d2e634.css @@ -0,0 +1,2 @@ + /*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */ +html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type="button"],[type="reset"],[type="submit"],button{-webkit-appearance:button}[type="button"]::-moz-focus-inner,[type="reset"]::-moz-focus-inner,[type="submit"]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type="button"]:-moz-focusring,[type="reset"]:-moz-focusring,[type="submit"]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type="checkbox"],[type="radio"]{box-sizing:border-box;padding:0}[type="number"]::-webkit-inner-spin-button,[type="number"]::-webkit-outer-spin-button{height:auto}[type="search"]{-webkit-appearance:textfield;outline-offset:-2px}[type="search"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none} \ No newline at end of file diff --git a/static.files/noscript-df360f571f6edeae.css b/static.files/noscript-df360f571f6edeae.css new file mode 100644 index 0000000..4c310ae --- /dev/null +++ b/static.files/noscript-df360f571f6edeae.css @@ -0,0 +1 @@ + #main-content .attributes{margin-left:0 !important;}#copy-path,#sidebar-button,.sidebar-resizer{display:none !important;}nav.sub{display:none;}.src .sidebar{display:none;}.notable-traits{display:none;}:root,:root:not([data-theme]){--main-background-color:white;--main-color:black;--settings-input-color:#2196f3;--settings-input-border-color:#717171;--settings-button-color:#000;--settings-button-border-focus:#717171;--sidebar-background-color:#f5f5f5;--sidebar-background-color-hover:#e0e0e0;--code-block-background-color:#f5f5f5;--scrollbar-track-background-color:#dcdcdc;--scrollbar-thumb-background-color:rgba(36,37,39,0.6);--scrollbar-color:rgba(36,37,39,0.6) #d9d9d9;--headings-border-bottom-color:#ddd;--border-color:#e0e0e0;--button-background-color:#fff;--right-side-color:grey;--code-attribute-color:#999;--toggles-color:#999;--toggle-filter:none;--mobile-sidebar-menu-filter:none;--search-input-focused-border-color:#66afe9;--copy-path-button-color:#999;--copy-path-img-filter:invert(50%);--copy-path-img-hover-filter:invert(35%);--codeblock-error-hover-color:rgb(255,0,0);--codeblock-error-color:rgba(255,0,0,.5);--codeblock-ignore-hover-color:rgb(255,142,0);--codeblock-ignore-color:rgba(255,142,0,.6);--warning-border-color:#ff8e00;--type-link-color:#ad378a;--trait-link-color:#6e4fc9;--assoc-item-link-color:#3873ad;--function-link-color:#ad7c37;--macro-link-color:#068000;--keyword-link-color:#3873ad;--mod-link-color:#3873ad;--link-color:#3873ad;--sidebar-link-color:#356da4;--sidebar-current-link-background-color:#fff;--search-result-link-focus-background-color:#ccc;--search-result-border-color:#aaa3;--search-color:#000;--search-error-code-background-color:#d0cccc;--search-results-alias-color:#000;--search-results-grey-color:#999;--search-tab-title-count-color:#888;--search-tab-button-not-selected-border-top-color:#e6e6e6;--search-tab-button-not-selected-background:#e6e6e6;--search-tab-button-selected-border-top-color:#0089ff;--search-tab-button-selected-background:#fff;--settings-menu-filter:none;--stab-background-color:#fff5d6;--stab-code-color:#000;--code-highlight-kw-color:#8959a8;--code-highlight-kw-2-color:#4271ae;--code-highlight-lifetime-color:#b76514;--code-highlight-prelude-color:#4271ae;--code-highlight-prelude-val-color:#c82829;--code-highlight-number-color:#718c00;--code-highlight-string-color:#718c00;--code-highlight-literal-color:#c82829;--code-highlight-attribute-color:#c82829;--code-highlight-self-color:#c82829;--code-highlight-macro-color:#3e999f;--code-highlight-question-mark-color:#ff9011;--code-highlight-comment-color:#8e908c;--code-highlight-doc-comment-color:#4d4d4c;--src-line-numbers-span-color:#c67e2d;--src-line-number-highlighted-background-color:#fdffd3;--test-arrow-color:#f5f5f5;--test-arrow-background-color:rgba(78,139,202,0.2);--test-arrow-hover-color:#f5f5f5;--test-arrow-hover-background-color:rgb(78,139,202);--target-background-color:#fdffd3;--target-border-color:#ad7c37;--kbd-color:#000;--kbd-background:#fafbfc;--kbd-box-shadow-color:#c6cbd1;--rust-logo-filter:initial;--crate-search-div-filter:invert(100%) sepia(0%) saturate(4223%) hue-rotate(289deg) brightness(114%) contrast(76%);--crate-search-div-hover-filter:invert(44%) sepia(18%) saturate(23%) hue-rotate(317deg) brightness(96%) contrast(93%);--crate-search-hover-border:#717171;--src-sidebar-background-selected:#fff;--src-sidebar-background-hover:#e0e0e0;--table-alt-row-background-color:#f5f5f5;--codeblock-link-background:#eee;--scrape-example-toggle-line-background:#ccc;--scrape-example-toggle-line-hover-background:#999;--scrape-example-code-line-highlight:#fcffd6;--scrape-example-code-line-highlight-focus:#f6fdb0;--scrape-example-help-border-color:#555;--scrape-example-help-color:#333;--scrape-example-help-hover-border-color:#000;--scrape-example-help-hover-color:#000;--scrape-example-code-wrapper-background-start:rgba(255,255,255,1);--scrape-example-code-wrapper-background-end:rgba(255,255,255,0);--sidebar-resizer-hover:hsl(207,90%,66%);--sidebar-resizer-active:hsl(207,90%,54%);}@media (prefers-color-scheme:dark){:root,:root:not([data-theme]){--main-background-color:#353535;--main-color:#ddd;--settings-input-color:#2196f3;--settings-input-border-color:#999;--settings-button-color:#000;--settings-button-border-focus:#ffb900;--sidebar-background-color:#505050;--sidebar-background-color-hover:#676767;--code-block-background-color:#2A2A2A;--scrollbar-track-background-color:#717171;--scrollbar-thumb-background-color:rgba(32,34,37,.6);--scrollbar-color:rgba(32,34,37,.6) #5a5a5a;--headings-border-bottom-color:#d2d2d2;--border-color:#e0e0e0;--button-background-color:#f0f0f0;--right-side-color:grey;--code-attribute-color:#999;--toggles-color:#999;--toggle-filter:invert(100%);--mobile-sidebar-menu-filter:invert(100%);--search-input-focused-border-color:#008dfd;--copy-path-button-color:#999;--copy-path-img-filter:invert(50%);--copy-path-img-hover-filter:invert(65%);--codeblock-error-hover-color:rgb(255,0,0);--codeblock-error-color:rgba(255,0,0,.5);--codeblock-ignore-hover-color:rgb(255,142,0);--codeblock-ignore-color:rgba(255,142,0,.6);--warning-border-color:#ff8e00;--type-link-color:#2dbfb8;--trait-link-color:#b78cf2;--assoc-item-link-color:#d2991d;--function-link-color:#2bab63;--macro-link-color:#09bd00;--keyword-link-color:#d2991d;--mod-link-color:#d2991d;--link-color:#d2991d;--sidebar-link-color:#fdbf35;--sidebar-current-link-background-color:#444;--search-result-link-focus-background-color:#616161;--search-result-border-color:#aaa3;--search-color:#111;--search-error-code-background-color:#484848;--search-results-alias-color:#fff;--search-results-grey-color:#ccc;--search-tab-title-count-color:#888;--search-tab-button-not-selected-border-top-color:#252525;--search-tab-button-not-selected-background:#252525;--search-tab-button-selected-border-top-color:#0089ff;--search-tab-button-selected-background:#353535;--stab-background-color:#314559;--stab-code-color:#e6e1cf;--code-highlight-kw-color:#ab8ac1;--code-highlight-kw-2-color:#769acb;--code-highlight-lifetime-color:#d97f26;--code-highlight-prelude-color:#769acb;--code-highlight-prelude-val-color:#ee6868;--code-highlight-number-color:#83a300;--code-highlight-string-color:#83a300;--code-highlight-literal-color:#ee6868;--code-highlight-attribute-color:#ee6868;--code-highlight-self-color:#ee6868;--code-highlight-macro-color:#3e999f;--code-highlight-question-mark-color:#ff9011;--code-highlight-comment-color:#8d8d8b;--code-highlight-doc-comment-color:#8ca375;--src-line-numbers-span-color:#3b91e2;--src-line-number-highlighted-background-color:#0a042f;--test-arrow-color:#dedede;--test-arrow-background-color:rgba(78,139,202,0.2);--test-arrow-hover-color:#dedede;--test-arrow-hover-background-color:#4e8bca;--target-background-color:#494a3d;--target-border-color:#bb7410;--kbd-color:#000;--kbd-background:#fafbfc;--kbd-box-shadow-color:#c6cbd1;--rust-logo-filter:drop-shadow(1px 0 0px #fff) drop-shadow(0 1px 0 #fff) drop-shadow(-1px 0 0 #fff) drop-shadow(0 -1px 0 #fff);--crate-search-div-filter:invert(94%) sepia(0%) saturate(721%) hue-rotate(255deg) brightness(90%) contrast(90%);--crate-search-div-hover-filter:invert(69%) sepia(60%) saturate(6613%) hue-rotate(184deg) brightness(100%) contrast(91%);--crate-search-hover-border:#2196f3;--src-sidebar-background-selected:#333;--src-sidebar-background-hover:#444;--table-alt-row-background-color:#2a2a2a;--codeblock-link-background:#333;--scrape-example-toggle-line-background:#999;--scrape-example-toggle-line-hover-background:#c5c5c5;--scrape-example-code-line-highlight:#5b3b01;--scrape-example-code-line-highlight-focus:#7c4b0f;--scrape-example-help-border-color:#aaa;--scrape-example-help-color:#eee;--scrape-example-help-hover-border-color:#fff;--scrape-example-help-hover-color:#fff;--scrape-example-code-wrapper-background-start:rgba(53,53,53,1);--scrape-example-code-wrapper-background-end:rgba(53,53,53,0);--sidebar-resizer-hover:hsl(207,30%,54%);--sidebar-resizer-active:hsl(207,90%,54%);}} \ No newline at end of file diff --git a/static.files/rust-logo-151179464ae7ed46.svg b/static.files/rust-logo-151179464ae7ed46.svg new file mode 100644 index 0000000..62424d8 --- /dev/null +++ b/static.files/rust-logo-151179464ae7ed46.svg @@ -0,0 +1,61 @@ + + + diff --git a/static.files/rustdoc-dd39b87e5fcfba68.css b/static.files/rustdoc-dd39b87e5fcfba68.css new file mode 100644 index 0000000..77f8983 --- /dev/null +++ b/static.files/rustdoc-dd39b87e5fcfba68.css @@ -0,0 +1,46 @@ + :root{--nav-sub-mobile-padding:8px;--search-typename-width:6.75rem;--desktop-sidebar-width:200px;--src-sidebar-width:300px;--desktop-sidebar-z-index:100;}@font-face {font-family:'Fira Sans';font-style:normal;font-weight:400;src:local('Fira Sans'),url("FiraSans-Regular-018c141bf0843ffd.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Fira Sans';font-style:normal;font-weight:500;src:local('Fira Sans Medium'),url("FiraSans-Medium-8f9a781e4970d388.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Source Serif 4';font-style:normal;font-weight:400;src:local('Source Serif 4'),url("SourceSerif4-Regular-46f98efaafac5295.ttf.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Source Serif 4';font-style:italic;font-weight:400;src:local('Source Serif 4 Italic'),url("SourceSerif4-It-acdfaf1a8af734b1.ttf.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Source Serif 4';font-style:normal;font-weight:700;src:local('Source Serif 4 Bold'),url("SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Source Code Pro';font-style:normal;font-weight:400;src:url("SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Source Code Pro';font-style:italic;font-weight:400;src:url("SourceCodePro-It-1cc31594bf4f1f79.ttf.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Source Code Pro';font-style:normal;font-weight:600;src:url("SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2") format("woff2");font-display:swap;}@font-face {font-family:'NanumBarunGothic';src:url("NanumBarunGothic-0f09457c7a19b7c6.ttf.woff2") format("woff2");font-display:swap;unicode-range:U+AC00-D7AF,U+1100-11FF,U+3130-318F,U+A960-A97F,U+D7B0-D7FF;}*{box-sizing:border-box;}body{font:1rem/1.5 "Source Serif 4",NanumBarunGothic,serif;margin:0;position:relative;overflow-wrap:break-word;overflow-wrap:anywhere;font-feature-settings:"kern","liga";background-color:var(--main-background-color);color:var(--main-color);}h1{font-size:1.5rem;}h2{font-size:1.375rem;}h3{font-size:1.25rem;}h1,h2,h3,h4,h5,h6{font-weight:500;}h1,h2,h3,h4{margin:25px 0 15px 0;padding-bottom:6px;}.docblock h3,.docblock h4,h5,h6{margin:15px 0 5px 0;}.docblock>h2:first-child,.docblock>h3:first-child,.docblock>h4:first-child,.docblock>h5:first-child,.docblock>h6:first-child{margin-top:0;}.main-heading h1{margin:0;padding:0;flex-grow:1;overflow-wrap:break-word;overflow-wrap:anywhere;}.main-heading{display:flex;flex-wrap:wrap;padding-bottom:6px;margin-bottom:15px;}.content h2,.top-doc .docblock>h3,.top-doc .docblock>h4{border-bottom:1px solid var(--headings-border-bottom-color);}h1,h2{line-height:1.25;padding-top:3px;padding-bottom:9px;}h3.code-header{font-size:1.125rem;}h4.code-header{font-size:1rem;}.code-header{font-weight:600;margin:0;padding:0;white-space:pre-wrap;}#crate-search,h1,h2,h3,h4,h5,h6,.sidebar,.mobile-topbar,.search-input,.search-results .result-name,.item-name>a,.out-of-band,span.since,a.src,#help-button>a,summary.hideme,.scraped-example-list,ul.all-items{font-family:"Fira Sans",Arial,NanumBarunGothic,sans-serif;}#toggle-all-docs,a.anchor,.section-header a,#src-sidebar a,.rust a,.sidebar h2 a,.sidebar h3 a,.mobile-topbar h2 a,h1 a,.search-results a,.stab,.result-name i{color:var(--main-color);}span.enum,a.enum,span.struct,a.struct,span.union,a.union,span.primitive,a.primitive,span.type,a.type,span.foreigntype,a.foreigntype{color:var(--type-link-color);}span.trait,a.trait,span.traitalias,a.traitalias{color:var(--trait-link-color);}span.associatedtype,a.associatedtype,span.constant,a.constant,span.static,a.static{color:var(--assoc-item-link-color);}span.fn,a.fn,span.method,a.method,span.tymethod,a.tymethod{color:var(--function-link-color);}span.attr,a.attr,span.derive,a.derive,span.macro,a.macro{color:var(--macro-link-color);}span.mod,a.mod{color:var(--mod-link-color);}span.keyword,a.keyword{color:var(--keyword-link-color);}a{color:var(--link-color);text-decoration:none;}ol,ul{padding-left:24px;}ul ul,ol ul,ul ol,ol ol{margin-bottom:.625em;}p,.docblock>.warning{margin:0 0 .75em 0;}p:last-child,.docblock>.warning:last-child{margin:0;}button{padding:1px 6px;cursor:pointer;}button#toggle-all-docs{padding:0;background:none;border:none;-webkit-appearance:none;opacity:1;}.rustdoc{display:flex;flex-direction:row;flex-wrap:nowrap;}main{position:relative;flex-grow:1;padding:10px 15px 40px 45px;min-width:0;}.src main{padding:15px;}.width-limiter{max-width:960px;margin-right:auto;}details:not(.toggle) summary{margin-bottom:.6em;}code,pre,a.test-arrow,.code-header{font-family:"Source Code Pro",monospace;}.docblock code,.docblock-short code{border-radius:3px;padding:0 0.125em;}.docblock pre code,.docblock-short pre code{padding:0;}pre{padding:14px;line-height:1.5;}pre.item-decl{overflow-x:auto;}.item-decl .type-contents-toggle{contain:initial;}.src .content pre{padding:20px;}.rustdoc.src .example-wrap pre.src-line-numbers{padding:20px 0 20px 4px;}img{max-width:100%;}.logo-container{line-height:0;display:block;}.rust-logo{filter:var(--rust-logo-filter);}.sidebar{font-size:0.875rem;flex:0 0 var(--desktop-sidebar-width);width:var(--desktop-sidebar-width);overflow-y:scroll;overscroll-behavior:contain;position:sticky;height:100vh;top:0;left:0;z-index:var(--desktop-sidebar-z-index);}.rustdoc.src .sidebar{flex-basis:50px;width:50px;border-right:1px solid;overflow-x:hidden;overflow-y:hidden;}.hide-sidebar .sidebar,.hide-sidebar .sidebar-resizer{display:none;}.sidebar-resizer{touch-action:none;width:9px;cursor:col-resize;z-index:calc(var(--desktop-sidebar-z-index) + 1);position:fixed;height:100%;left:calc(var(--desktop-sidebar-width) + 1px);}.rustdoc.src .sidebar-resizer{left:49px;}.src-sidebar-expanded .src .sidebar-resizer{left:var(--src-sidebar-width);}.sidebar-resizing{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;}.sidebar-resizing*{cursor:col-resize !important;}.sidebar-resizing .sidebar{position:fixed;}.sidebar-resizing>body{padding-left:var(--resizing-sidebar-width);}.sidebar-resizer:hover,.sidebar-resizer:active,.sidebar-resizer:focus,.sidebar-resizer.active{width:10px;margin:0;left:var(--desktop-sidebar-width);border-left:solid 1px var(--sidebar-resizer-hover);}.src-sidebar-expanded .rustdoc.src .sidebar-resizer:hover,.src-sidebar-expanded .rustdoc.src .sidebar-resizer:active,.src-sidebar-expanded .rustdoc.src .sidebar-resizer:focus,.src-sidebar-expanded .rustdoc.src .sidebar-resizer.active{left:calc(var(--src-sidebar-width) - 1px);}@media (pointer:coarse){.sidebar-resizer{display:none !important;}}.sidebar-resizer.active{padding:0 140px;width:2px;margin-left:-140px;border-left:none;}.sidebar-resizer.active:before{border-left:solid 2px var(--sidebar-resizer-active);display:block;height:100%;content:"";}.sidebar,.mobile-topbar,.sidebar-menu-toggle,#src-sidebar{background-color:var(--sidebar-background-color);}.src .sidebar>*{visibility:hidden;}.src-sidebar-expanded .src .sidebar{overflow-y:auto;flex-basis:var(--src-sidebar-width);width:var(--src-sidebar-width);}.src-sidebar-expanded .src .sidebar>*{visibility:visible;}#all-types{margin-top:1em;}*{scrollbar-width:initial;scrollbar-color:var(--scrollbar-color);}.sidebar{scrollbar-width:thin;scrollbar-color:var(--scrollbar-color);}::-webkit-scrollbar{width:12px;}.sidebar::-webkit-scrollbar{width:8px;}::-webkit-scrollbar-track{-webkit-box-shadow:inset 0;background-color:var(--scrollbar-track-background-color);}.sidebar::-webkit-scrollbar-track{background-color:var(--scrollbar-track-background-color);}::-webkit-scrollbar-thumb,.sidebar::-webkit-scrollbar-thumb{background-color:var(--scrollbar-thumb-background-color);}.hidden{display:none !important;}.logo-container>img{height:48px;width:48px;}ul.block,.block li{padding:0;margin:0;list-style:none;}.sidebar-elems a,.sidebar>h2 a{display:block;padding:0.25rem;margin-left:-0.25rem;margin-right:0.25rem;}.sidebar h2{overflow-wrap:anywhere;padding:0;margin:0.7rem 0;}.sidebar h3{font-size:1.125rem;padding:0;margin:0;}.sidebar-elems,.sidebar>.version,.sidebar>h2{padding-left:24px;}.sidebar a{color:var(--sidebar-link-color);}.sidebar .current,.sidebar .current a,.sidebar-crate a.logo-container:hover+h2 a,.sidebar a:hover:not(.logo-container){background-color:var(--sidebar-current-link-background-color);}.sidebar-elems .block{margin-bottom:2em;}.sidebar-elems .block li a{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;}.sidebar-crate{display:flex;align-items:center;justify-content:center;margin:14px 32px 1rem;row-gap:10px;column-gap:32px;flex-wrap:wrap;}.sidebar-crate h2{flex-grow:1;margin:0 -8px;align-self:start;}.sidebar-crate .logo-container{margin:0 -16px 0 -16px;text-align:center;}.sidebar-crate h2 a{display:block;margin:0 calc(-24px + 0.25rem) 0 -0.2rem;padding:calc((16px - 0.57rem ) / 2 ) 0.25rem;padding-left:0.2rem;}.sidebar-crate h2 .version{display:block;font-weight:normal;font-size:1rem;overflow-wrap:break-word;}.sidebar-crate+.version{margin-top:-1rem;margin-bottom:1rem;}.mobile-topbar{display:none;}.rustdoc .example-wrap{display:flex;position:relative;margin-bottom:10px;}.rustdoc .example-wrap:last-child{margin-bottom:0px;}.rustdoc .example-wrap pre{margin:0;flex-grow:1;}.rustdoc:not(.src) .example-wrap pre{overflow:auto hidden;}.rustdoc .example-wrap pre.example-line-numbers,.rustdoc .example-wrap pre.src-line-numbers{flex-grow:0;min-width:fit-content;overflow:initial;text-align:right;-webkit-user-select:none;user-select:none;padding:14px 8px;color:var(--src-line-numbers-span-color);}.rustdoc .example-wrap pre.src-line-numbers{padding:14px 0;}.src-line-numbers a,.src-line-numbers span{color:var(--src-line-numbers-span-color);padding:0 8px;}.src-line-numbers :target{background-color:transparent;border-right:none;padding:0 8px;}.src-line-numbers .line-highlighted{background-color:var(--src-line-number-highlighted-background-color);}.search-loading{text-align:center;}.docblock-short{overflow-wrap:break-word;overflow-wrap:anywhere;}.docblock :not(pre)>code,.docblock-short code{white-space:pre-wrap;}.top-doc .docblock h2{font-size:1.375rem;}.top-doc .docblock h3{font-size:1.25rem;}.top-doc .docblock h4,.top-doc .docblock h5{font-size:1.125rem;}.top-doc .docblock h6{font-size:1rem;}.docblock h5{font-size:1rem;}.docblock h6{font-size:0.875rem;}.docblock{margin-left:24px;position:relative;}.docblock>:not(.more-examples-toggle):not(.example-wrap){max-width:100%;overflow-x:auto;}.out-of-band{flex-grow:0;font-size:1.125rem;}.docblock code,.docblock-short code,pre,.rustdoc.src .example-wrap{background-color:var(--code-block-background-color);}#main-content{position:relative;}.docblock table{margin:.5em 0;border-collapse:collapse;}.docblock table td,.docblock table th{padding:.5em;border:1px solid var(--border-color);}.docblock table tbody tr:nth-child(2n){background:var(--table-alt-row-background-color);}div.where{white-space:pre-wrap;font-size:0.875rem;}.item-info{display:block;margin-left:24px;}.item-info code{font-size:0.875rem;}#main-content>.item-info{margin-left:0;}nav.sub{flex-grow:1;flex-flow:row nowrap;margin:4px 0 25px 0;display:flex;align-items:center;}.search-form{position:relative;display:flex;height:34px;flex-grow:1;}.src nav.sub{margin:0 0 15px 0;}.section-header{display:block;position:relative;}.section-header:hover>.anchor,.impl:hover>.anchor,.trait-impl:hover>.anchor,.variant:hover>.anchor{display:initial;}.anchor{display:none;position:absolute;left:-0.5em;background:none !important;}.anchor.field{left:-5px;}.section-header>.anchor{left:-15px;padding-right:8px;}h2.section-header>.anchor{padding-right:6px;}a.doc-anchor{color:var(--main-color);display:none;position:absolute;left:-17px;padding-right:5px;padding-left:3px;}*:hover>.doc-anchor{display:block;}.top-doc>.docblock>*:first-child>.doc-anchor{display:none !important;}.main-heading a:hover,.example-wrap .rust a:hover,.all-items a:hover,.docblock a:not(.test-arrow):not(.scrape-help):not(.tooltip):hover:not(.doc-anchor),.docblock-short a:not(.test-arrow):not(.scrape-help):not(.tooltip):hover,.item-info a{text-decoration:underline;}.crate.block li.current a{font-weight:500;}table,.item-table{overflow-wrap:break-word;}.item-table{display:table;padding:0;margin:0;}.item-table>li{display:table-row;}.item-table>li>div{display:table-cell;}.item-table>li>.item-name{padding-right:1.25rem;}.search-results-title{margin-top:0;white-space:nowrap;display:flex;align-items:baseline;}#crate-search-div{position:relative;min-width:5em;}#crate-search{min-width:115px;padding:0 23px 0 4px;max-width:100%;text-overflow:ellipsis;border:1px solid var(--border-color);border-radius:4px;outline:none;cursor:pointer;-moz-appearance:none;-webkit-appearance:none;text-indent:0.01px;background-color:var(--main-background-color);color:inherit;line-height:1.5;font-weight:500;}#crate-search:hover,#crate-search:focus{border-color:var(--crate-search-hover-border);}#crate-search-div::after{pointer-events:none;width:100%;height:100%;position:absolute;top:0;left:0;content:"";background-repeat:no-repeat;background-size:20px;background-position:calc(100% - 2px) 56%;background-image:url('data:image/svg+xml, \ + ');filter:var(--crate-search-div-filter);}#crate-search-div:hover::after,#crate-search-div:focus-within::after{filter:var(--crate-search-div-hover-filter);}#crate-search>option{font-size:1rem;}.search-input{-webkit-appearance:none;outline:none;border:1px solid var(--border-color);border-radius:2px;padding:8px;font-size:1rem;flex-grow:1;background-color:var(--button-background-color);color:var(--search-color);}.search-input:focus{border-color:var(--search-input-focused-border-color);}.search-results{display:none;}.search-results.active{display:block;}.search-results>a{display:flex;margin-left:2px;margin-right:2px;border-bottom:1px solid var(--search-result-border-color);gap:1em;}.search-results>a>div.desc{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;flex:2;}.search-results a:hover,.search-results a:focus{background-color:var(--search-result-link-focus-background-color);}.search-results .result-name{display:flex;align-items:center;justify-content:start;flex:3;}.search-results .result-name .alias{color:var(--search-results-alias-color);}.search-results .result-name .grey{color:var(--search-results-grey-color);}.search-results .result-name .typename{color:var(--search-results-grey-color);font-size:0.875rem;width:var(--search-typename-width);}.search-results .result-name .path{word-break:break-all;max-width:calc(100% - var(--search-typename-width));display:inline-block;}.search-results .result-name .path>*{display:inline;}.popover{position:absolute;top:100%;right:0;z-index:calc(var(--desktop-sidebar-z-index) + 1);margin-top:7px;border-radius:3px;border:1px solid var(--border-color);background-color:var(--main-background-color);color:var(--main-color);--popover-arrow-offset:11px;}.popover::before{content:'';position:absolute;right:var(--popover-arrow-offset);border:solid var(--border-color);border-width:1px 1px 0 0;background-color:var(--main-background-color);padding:4px;transform:rotate(-45deg);top:-5px;}.setting-line{margin:1.2em 0.6em;}.setting-radio input,.setting-check input{margin-right:0.3em;height:1.2rem;width:1.2rem;border:2px solid var(--settings-input-border-color);outline:none;-webkit-appearance:none;cursor:pointer;}.setting-radio input{border-radius:50%;}.setting-radio span,.setting-check span{padding-bottom:1px;}.setting-radio{margin-top:0.1em;margin-bottom:0.1em;min-width:3.8em;padding:0.3em;display:inline-flex;align-items:center;cursor:pointer;}.setting-radio+.setting-radio{margin-left:0.5em;}.setting-check{margin-right:20px;display:flex;align-items:center;cursor:pointer;}.setting-radio input:checked{box-shadow:inset 0 0 0 3px var(--main-background-color);background-color:var(--settings-input-color);}.setting-check input:checked{background-color:var(--settings-input-color);border-width:1px;content:url('data:image/svg+xml,\ + \ + ');}.setting-radio input:focus,.setting-check input:focus{box-shadow:0 0 1px 1px var(--settings-input-color);}.setting-radio input:checked:focus{box-shadow:inset 0 0 0 3px var(--main-background-color),0 0 2px 2px var(--settings-input-color);}.setting-radio input:hover,.setting-check input:hover{border-color:var(--settings-input-color) !important;}#help.popover{max-width:600px;--popover-arrow-offset:48px;}#help dt{float:left;clear:left;margin-right:0.5rem;}#help span.top,#help span.bottom{text-align:center;display:block;font-size:1.125rem;}#help span.top{margin:10px 0;border-bottom:1px solid var(--border-color);padding-bottom:4px;margin-bottom:6px;}#help span.bottom{clear:both;border-top:1px solid var(--border-color);}.side-by-side>div{width:50%;float:left;padding:0 20px 20px 17px;}.item-info .stab{display:block;padding:3px;margin-bottom:5px;}.item-name .stab{margin-left:0.3125em;}.stab{padding:0 2px;font-size:0.875rem;font-weight:normal;color:var(--main-color);background-color:var(--stab-background-color);width:fit-content;white-space:pre-wrap;border-radius:3px;display:inline;vertical-align:baseline;}.stab.portability>code{background:none;color:var(--stab-code-color);}.stab .emoji,.item-info .stab::before{font-size:1.25rem;}.stab .emoji{margin-right:0.3rem;}.item-info .stab::before{content:"\0";width:0;display:inline-block;color:transparent;}.emoji{text-shadow:1px 0 0 black,-1px 0 0 black,0 1px 0 black,0 -1px 0 black;}.since{font-weight:normal;font-size:initial;}.rightside{padding-left:12px;float:right;}.rightside:not(a),.out-of-band{color:var(--right-side-color);}pre.rust{tab-size:4;-moz-tab-size:4;}pre.rust .kw{color:var(--code-highlight-kw-color);}pre.rust .kw-2{color:var(--code-highlight-kw-2-color);}pre.rust .lifetime{color:var(--code-highlight-lifetime-color);}pre.rust .prelude-ty{color:var(--code-highlight-prelude-color);}pre.rust .prelude-val{color:var(--code-highlight-prelude-val-color);}pre.rust .string{color:var(--code-highlight-string-color);}pre.rust .number{color:var(--code-highlight-number-color);}pre.rust .bool-val{color:var(--code-highlight-literal-color);}pre.rust .self{color:var(--code-highlight-self-color);}pre.rust .attr{color:var(--code-highlight-attribute-color);}pre.rust .macro,pre.rust .macro-nonterminal{color:var(--code-highlight-macro-color);}pre.rust .question-mark{font-weight:bold;color:var(--code-highlight-question-mark-color);}pre.rust .comment{color:var(--code-highlight-comment-color);}pre.rust .doccomment{color:var(--code-highlight-doc-comment-color);}.rustdoc.src .example-wrap pre.rust a{background:var(--codeblock-link-background);}.example-wrap.compile_fail,.example-wrap.should_panic{border-left:2px solid var(--codeblock-error-color);}.ignore.example-wrap{border-left:2px solid var(--codeblock-ignore-color);}.example-wrap.compile_fail:hover,.example-wrap.should_panic:hover{border-left:2px solid var(--codeblock-error-hover-color);}.example-wrap.ignore:hover{border-left:2px solid var(--codeblock-ignore-hover-color);}.example-wrap.compile_fail .tooltip,.example-wrap.should_panic .tooltip{color:var(--codeblock-error-color);}.example-wrap.ignore .tooltip{color:var(--codeblock-ignore-color);}.example-wrap.compile_fail:hover .tooltip,.example-wrap.should_panic:hover .tooltip{color:var(--codeblock-error-hover-color);}.example-wrap.ignore:hover .tooltip{color:var(--codeblock-ignore-hover-color);}.example-wrap .tooltip{position:absolute;display:block;left:-25px;top:5px;margin:0;line-height:1;}.example-wrap.compile_fail .tooltip,.example-wrap.should_panic .tooltip,.example-wrap.ignore .tooltip{font-weight:bold;font-size:1.25rem;}.content .docblock .warning{border-left:2px solid var(--warning-border-color);padding:14px;position:relative;overflow-x:visible !important;}.content .docblock .warning::before{color:var(--warning-border-color);content:"ⓘ";position:absolute;left:-25px;top:5px;font-weight:bold;font-size:1.25rem;}.top-doc>.docblock>.warning:first-child::before{top:20px;}a.test-arrow{visibility:hidden;position:absolute;padding:5px 10px 5px 10px;border-radius:5px;font-size:1.375rem;top:5px;right:5px;z-index:1;color:var(--test-arrow-color);background-color:var(--test-arrow-background-color);}a.test-arrow:hover{color:var(--test-arrow-hover-color);background-color:var(--test-arrow-hover-background-color);}.example-wrap:hover .test-arrow{visibility:visible;}.code-attribute{font-weight:300;color:var(--code-attribute-color);}.item-spacer{width:100%;height:12px;display:block;}.out-of-band>span.since{font-size:1.25rem;}.sub-variant h4{font-size:1rem;font-weight:400;margin-top:0;margin-bottom:0;}.sub-variant{margin-left:24px;margin-bottom:40px;}.sub-variant>.sub-variant-field{margin-left:24px;}:target{padding-right:3px;background-color:var(--target-background-color);border-right:3px solid var(--target-border-color);}.code-header a.tooltip{color:inherit;margin-right:15px;position:relative;}.code-header a.tooltip:hover{color:var(--link-color);}a.tooltip:hover::after{position:absolute;top:calc(100% - 10px);left:-15px;right:-15px;height:20px;content:"\00a0";}.fade-out{opacity:0;transition:opacity 0.45s cubic-bezier(0,0,0.1,1.0);}.popover.tooltip .content{margin:0.25em 0.5em;}.popover.tooltip .content pre,.popover.tooltip .content code{background:transparent;margin:0;padding:0;font-size:1.25rem;white-space:pre-wrap;}.popover.tooltip .content>h3:first-child{margin:0 0 5px 0;}.search-failed{text-align:center;margin-top:20px;display:none;}.search-failed.active{display:block;}.search-failed>ul{text-align:left;max-width:570px;margin-left:auto;margin-right:auto;}#search-tabs{display:flex;flex-direction:row;gap:1px;margin-bottom:4px;}#search-tabs button{text-align:center;font-size:1.125rem;border:0;border-top:2px solid;flex:1;line-height:1.5;color:inherit;}#search-tabs button:not(.selected){background-color:var(--search-tab-button-not-selected-background);border-top-color:var(--search-tab-button-not-selected-border-top-color);}#search-tabs button:hover,#search-tabs button.selected{background-color:var(--search-tab-button-selected-background);border-top-color:var(--search-tab-button-selected-border-top-color);}#search-tabs .count{font-size:1rem;font-variant-numeric:tabular-nums;color:var(--search-tab-title-count-color);}#search .error code{border-radius:3px;background-color:var(--search-error-code-background-color);}.search-corrections{font-weight:normal;}#src-sidebar{width:100%;overflow:auto;}#src-sidebar div.files>a:hover,details.dir-entry summary:hover,#src-sidebar div.files>a:focus,details.dir-entry summary:focus{background-color:var(--src-sidebar-background-hover);}#src-sidebar div.files>a.selected{background-color:var(--src-sidebar-background-selected);}.src-sidebar-title{position:sticky;top:0;display:flex;padding:8px 8px 0 48px;margin-bottom:7px;background:var(--sidebar-background-color);border-bottom:1px solid var(--border-color);}#settings-menu,#help-button{margin-left:4px;display:flex;}#sidebar-button{display:none;line-height:0;}.hide-sidebar #sidebar-button,.src #sidebar-button{display:flex;margin-right:4px;position:fixed;left:6px;height:34px;width:34px;background-color:var(--main-background-color);z-index:1;}.src #sidebar-button{left:8px;z-index:calc(var(--desktop-sidebar-z-index) + 1);}.hide-sidebar .src #sidebar-button{position:static;}#settings-menu>a,#help-button>a,#sidebar-button>a{display:flex;align-items:center;justify-content:center;background-color:var(--button-background-color);border:1px solid var(--border-color);border-radius:2px;color:var(--settings-button-color);font-size:20px;width:33px;}#settings-menu>a:hover,#settings-menu>a:focus,#help-button>a:hover,#help-button>a:focus,#sidebar-button>a:hover,#sidebar-button>a:focus{border-color:var(--settings-button-border-focus);}#settings-menu>a{line-height:0;font-size:0;}#settings-menu>a:before{content:url('data:image/svg+xml,\ + ');width:22px;height:22px;filter:var(--settings-menu-filter);}#sidebar-button>a:before{content:url('data:image/svg+xml,\ + \ + \ + ');width:22px;height:22px;}#copy-path{color:var(--copy-path-button-color);background:var(--main-background-color);height:34px;width:33px;margin-left:10px;padding:0;padding-left:2px;border:0;font-size:0;}#copy-path::before{filter:var(--copy-path-img-filter);content:url('data:image/svg+xml,\ +\ +\ +');width:19px;height:18px;}#copy-path:hover::before{filter:var(--copy-path-img-hover-filter);}#copy-path.clicked::before{content:url('data:image/svg+xml,\ + \ + ');}@keyframes rotating{from{transform:rotate(0deg);}to{transform:rotate(360deg);}}#settings-menu.rotate>a img{animation:rotating 2s linear infinite;}kbd{display:inline-block;padding:3px 5px;font:15px monospace;line-height:10px;vertical-align:middle;border:solid 1px var(--border-color);border-radius:3px;color:var(--kbd-color);background-color:var(--kbd-background);box-shadow:inset 0 -1px 0 var(--kbd-box-shadow-color);}ul.all-items>li{list-style:none;}details.dir-entry{padding-left:4px;}details.dir-entry>summary{margin:0 0 0 -4px;padding:0 0 0 4px;cursor:pointer;}details.dir-entry div.folders,details.dir-entry div.files{padding-left:23px;}details.dir-entry a{display:block;}details.toggle{contain:layout;position:relative;}details.toggle>summary.hideme{cursor:pointer;font-size:1rem;}details.toggle>summary{list-style:none;outline:none;}details.toggle>summary::-webkit-details-marker,details.toggle>summary::marker{display:none;}details.toggle>summary.hideme>span{margin-left:9px;}details.toggle>summary::before{background:url('data:image/svg+xml,') no-repeat top left;content:"";cursor:pointer;width:16px;height:16px;display:inline-block;vertical-align:middle;opacity:.5;filter:var(--toggle-filter);}details.toggle>summary.hideme>span,.more-examples-toggle summary,.more-examples-toggle .hide-more{color:var(--toggles-color);}details.toggle>summary::after{content:"Expand";overflow:hidden;width:0;height:0;position:absolute;}details.toggle>summary.hideme::after{content:"";}details.toggle>summary:focus::before,details.toggle>summary:hover::before{opacity:1;}details.toggle>summary:focus-visible::before{outline:1px dotted #000;outline-offset:1px;}details.non-exhaustive{margin-bottom:8px;}details.toggle>summary.hideme::before{position:relative;}details.toggle>summary:not(.hideme)::before{position:absolute;left:-24px;top:4px;}.impl-items>details.toggle>summary:not(.hideme)::before{position:absolute;left:-24px;}details.toggle[open] >summary.hideme{position:absolute;}details.toggle[open] >summary.hideme>span{display:none;}details.toggle[open] >summary::before{background:url('data:image/svg+xml,') no-repeat top left;}details.toggle[open] >summary::after{content:"Collapse";}.docblock summary>*{display:inline-block;}.docblock>.example-wrap:first-child .tooltip{margin-top:16px;}.src #sidebar-button>a:before,.sidebar-menu-toggle:before{content:url('data:image/svg+xml,\ + ');opacity:0.75;}.sidebar-menu-toggle:hover:before,.sidebar-menu-toggle:active:before,.sidebar-menu-toggle:focus:before{opacity:1;}.src #sidebar-button>a:before{content:url('data:image/svg+xml,\ + \ + \ + ');opacity:0.75;}@media (max-width:850px){#search-tabs .count{display:block;}}@media (max-width:700px){*[id]{scroll-margin-top:45px;}.rustdoc{display:block;}main{padding-left:15px;padding-top:0px;}.main-heading{flex-direction:column;}.out-of-band{text-align:left;margin-left:initial;padding:initial;}.out-of-band .since::before{content:"Since ";}.sidebar .logo-container,.sidebar .location,.sidebar-resizer{display:none;}.sidebar{position:fixed;top:45px;left:-1000px;z-index:11;height:calc(100vh - 45px);width:200px;}.src main,.rustdoc.src .sidebar{top:0;padding:0;height:100vh;border:0;}.src .search-form{margin-left:40px;}.hide-sidebar .search-form{margin-left:32px;}.hide-sidebar .src .search-form{margin-left:0;}.sidebar.shown,.src-sidebar-expanded .src .sidebar,.rustdoc:not(.src) .sidebar:focus-within{left:0;}.mobile-topbar h2{padding-bottom:0;margin:auto 0.5em auto auto;overflow:hidden;font-size:24px;white-space:nowrap;text-overflow:ellipsis;}.mobile-topbar .logo-container>img{max-width:35px;max-height:35px;margin:5px 0 5px 20px;}.mobile-topbar{display:flex;flex-direction:row;position:sticky;z-index:10;font-size:2rem;height:45px;width:100%;left:0;top:0;}.hide-sidebar .mobile-topbar{display:none;}.sidebar-menu-toggle{width:45px;border:none;line-height:0;}.hide-sidebar .sidebar-menu-toggle{display:none;}.sidebar-elems{margin-top:1em;}.anchor{display:none !important;}#main-content>details.toggle>summary::before,#main-content>div>details.toggle>summary::before{left:-11px;}#copy-path,#help-button{display:none;}#sidebar-button>a:before{content:url('data:image/svg+xml,\ + \ + \ + ');width:22px;height:22px;}.sidebar-menu-toggle:before{filter:var(--mobile-sidebar-menu-filter);}.sidebar-menu-toggle:hover{background:var(--main-background-color);}.item-table,.item-row,.item-table>li,.item-table>li>div,.search-results>a,.search-results>a>div{display:block;}.search-results>a{padding:5px 0px;}.search-results>a>div.desc,.item-table>li>div.desc{padding-left:2em;}.search-results .result-name{display:block;}.search-results .result-name .typename{width:initial;margin-right:0;}.search-results .result-name .typename,.search-results .result-name .path{display:inline;}.src-sidebar-expanded .src .sidebar{position:fixed;max-width:100vw;width:100vw;}.src .src-sidebar-title{padding-top:0;}details.toggle:not(.top-doc)>summary{margin-left:10px;}.impl-items>details.toggle>summary:not(.hideme)::before,#main-content>details.toggle:not(.top-doc)>summary::before,#main-content>div>details.toggle>summary::before{left:-11px;}.impl-items>.item-info{margin-left:34px;}.src nav.sub{margin:0;padding:var(--nav-sub-mobile-padding);}}@media (min-width:701px){.scraped-example-title{position:absolute;z-index:10;background:var(--main-background-color);bottom:8px;right:5px;padding:2px 4px;box-shadow:0 0 4px var(--main-background-color);}}@media print{nav.sidebar,nav.sub,.out-of-band,a.src,#copy-path,details.toggle[open] >summary::before,details.toggle>summary::before,details.toggle.top-doc>summary{display:none;}.docblock{margin-left:0;}main{padding:10px;}}@media (max-width:464px){.docblock{margin-left:12px;}.docblock code{overflow-wrap:break-word;overflow-wrap:anywhere;}nav.sub{flex-direction:column;}.search-form{align-self:stretch;}}.variant,.implementors-toggle>summary,.impl,#implementors-list>.docblock,.impl-items>section,.impl-items>.toggle>summary,.methods>section,.methods>.toggle>summary{margin-bottom:0.75em;}.variants>.docblock,.implementors-toggle>.docblock,.impl-items>.toggle[open]:not(:last-child),.methods>.toggle[open]:not(:last-child),.implementors-toggle[open]:not(:last-child){margin-bottom:2em;}#trait-implementations-list .impl-items>.toggle:not(:last-child),#synthetic-implementations-list .impl-items>.toggle:not(:last-child),#blanket-implementations-list .impl-items>.toggle:not(:last-child){margin-bottom:1em;}.scraped-example-list .scrape-help{margin-left:10px;padding:0 4px;font-weight:normal;font-size:12px;position:relative;bottom:1px;border:1px solid var(--scrape-example-help-border-color);border-radius:50px;color:var(--scrape-example-help-color);}.scraped-example-list .scrape-help:hover{border-color:var(--scrape-example-help-hover-border-color);color:var(--scrape-example-help-hover-color);}.scraped-example{position:relative;}.scraped-example .code-wrapper{position:relative;display:flex;flex-direction:row;flex-wrap:wrap;width:100%;}.scraped-example:not(.expanded) .code-wrapper{max-height:calc(1.5em * 5 + 10px);}.scraped-example:not(.expanded) .code-wrapper pre{overflow-y:hidden;padding-bottom:0;max-height:calc(1.5em * 5 + 10px);}.more-scraped-examples .scraped-example:not(.expanded) .code-wrapper,.more-scraped-examples .scraped-example:not(.expanded) .code-wrapper pre{max-height:calc(1.5em * 10 + 10px);}.scraped-example .code-wrapper .next,.scraped-example .code-wrapper .prev,.scraped-example .code-wrapper .expand{color:var(--main-color);position:absolute;top:0.25em;z-index:1;padding:0;background:none;border:none;-webkit-appearance:none;opacity:1;}.scraped-example .code-wrapper .prev{right:2.25em;}.scraped-example .code-wrapper .next{right:1.25em;}.scraped-example .code-wrapper .expand{right:0.25em;}.scraped-example:not(.expanded) .code-wrapper::before,.scraped-example:not(.expanded) .code-wrapper::after{content:" ";width:100%;height:5px;position:absolute;z-index:1;}.scraped-example:not(.expanded) .code-wrapper::before{top:0;background:linear-gradient(to bottom,var(--scrape-example-code-wrapper-background-start),var(--scrape-example-code-wrapper-background-end));}.scraped-example:not(.expanded) .code-wrapper::after{bottom:0;background:linear-gradient(to top,var(--scrape-example-code-wrapper-background-start),var(--scrape-example-code-wrapper-background-end));}.scraped-example .code-wrapper .example-wrap{width:100%;overflow-y:hidden;margin-bottom:0;}.scraped-example:not(.expanded) .code-wrapper .example-wrap{overflow-x:hidden;}.scraped-example .example-wrap .rust span.highlight{background:var(--scrape-example-code-line-highlight);}.scraped-example .example-wrap .rust span.highlight.focus{background:var(--scrape-example-code-line-highlight-focus);}.more-examples-toggle{max-width:calc(100% + 25px);margin-top:10px;margin-left:-25px;}.more-examples-toggle .hide-more{margin-left:25px;cursor:pointer;}.more-scraped-examples{margin-left:25px;position:relative;}.toggle-line{position:absolute;top:5px;bottom:0;right:calc(100% + 10px);padding:0 4px;cursor:pointer;}.toggle-line-inner{min-width:2px;height:100%;background:var(--scrape-example-toggle-line-background);}.toggle-line:hover .toggle-line-inner{background:var(--scrape-example-toggle-line-hover-background);}.more-scraped-examples .scraped-example,.example-links{margin-top:20px;}.more-scraped-examples .scraped-example:first-child{margin-top:5px;}.example-links ul{margin-bottom:0;}:root[data-theme="light"],:root:not([data-theme]){--main-background-color:white;--main-color:black;--settings-input-color:#2196f3;--settings-input-border-color:#717171;--settings-button-color:#000;--settings-button-border-focus:#717171;--sidebar-background-color:#f5f5f5;--sidebar-background-color-hover:#e0e0e0;--code-block-background-color:#f5f5f5;--scrollbar-track-background-color:#dcdcdc;--scrollbar-thumb-background-color:rgba(36,37,39,0.6);--scrollbar-color:rgba(36,37,39,0.6) #d9d9d9;--headings-border-bottom-color:#ddd;--border-color:#e0e0e0;--button-background-color:#fff;--right-side-color:grey;--code-attribute-color:#999;--toggles-color:#999;--toggle-filter:none;--mobile-sidebar-menu-filter:none;--search-input-focused-border-color:#66afe9;--copy-path-button-color:#999;--copy-path-img-filter:invert(50%);--copy-path-img-hover-filter:invert(35%);--codeblock-error-hover-color:rgb(255,0,0);--codeblock-error-color:rgba(255,0,0,.5);--codeblock-ignore-hover-color:rgb(255,142,0);--codeblock-ignore-color:rgba(255,142,0,.6);--warning-border-color:#ff8e00;--type-link-color:#ad378a;--trait-link-color:#6e4fc9;--assoc-item-link-color:#3873ad;--function-link-color:#ad7c37;--macro-link-color:#068000;--keyword-link-color:#3873ad;--mod-link-color:#3873ad;--link-color:#3873ad;--sidebar-link-color:#356da4;--sidebar-current-link-background-color:#fff;--search-result-link-focus-background-color:#ccc;--search-result-border-color:#aaa3;--search-color:#000;--search-error-code-background-color:#d0cccc;--search-results-alias-color:#000;--search-results-grey-color:#999;--search-tab-title-count-color:#888;--search-tab-button-not-selected-border-top-color:#e6e6e6;--search-tab-button-not-selected-background:#e6e6e6;--search-tab-button-selected-border-top-color:#0089ff;--search-tab-button-selected-background:#fff;--settings-menu-filter:none;--stab-background-color:#fff5d6;--stab-code-color:#000;--code-highlight-kw-color:#8959a8;--code-highlight-kw-2-color:#4271ae;--code-highlight-lifetime-color:#b76514;--code-highlight-prelude-color:#4271ae;--code-highlight-prelude-val-color:#c82829;--code-highlight-number-color:#718c00;--code-highlight-string-color:#718c00;--code-highlight-literal-color:#c82829;--code-highlight-attribute-color:#c82829;--code-highlight-self-color:#c82829;--code-highlight-macro-color:#3e999f;--code-highlight-question-mark-color:#ff9011;--code-highlight-comment-color:#8e908c;--code-highlight-doc-comment-color:#4d4d4c;--src-line-numbers-span-color:#c67e2d;--src-line-number-highlighted-background-color:#fdffd3;--test-arrow-color:#f5f5f5;--test-arrow-background-color:rgba(78,139,202,0.2);--test-arrow-hover-color:#f5f5f5;--test-arrow-hover-background-color:rgb(78,139,202);--target-background-color:#fdffd3;--target-border-color:#ad7c37;--kbd-color:#000;--kbd-background:#fafbfc;--kbd-box-shadow-color:#c6cbd1;--rust-logo-filter:initial;--crate-search-div-filter:invert(100%) sepia(0%) saturate(4223%) hue-rotate(289deg) brightness(114%) contrast(76%);--crate-search-div-hover-filter:invert(44%) sepia(18%) saturate(23%) hue-rotate(317deg) brightness(96%) contrast(93%);--crate-search-hover-border:#717171;--src-sidebar-background-selected:#fff;--src-sidebar-background-hover:#e0e0e0;--table-alt-row-background-color:#f5f5f5;--codeblock-link-background:#eee;--scrape-example-toggle-line-background:#ccc;--scrape-example-toggle-line-hover-background:#999;--scrape-example-code-line-highlight:#fcffd6;--scrape-example-code-line-highlight-focus:#f6fdb0;--scrape-example-help-border-color:#555;--scrape-example-help-color:#333;--scrape-example-help-hover-border-color:#000;--scrape-example-help-hover-color:#000;--scrape-example-code-wrapper-background-start:rgba(255,255,255,1);--scrape-example-code-wrapper-background-end:rgba(255,255,255,0);--sidebar-resizer-hover:hsl(207,90%,66%);--sidebar-resizer-active:hsl(207,90%,54%);}:root[data-theme="dark"]{--main-background-color:#353535;--main-color:#ddd;--settings-input-color:#2196f3;--settings-input-border-color:#999;--settings-button-color:#000;--settings-button-border-focus:#ffb900;--sidebar-background-color:#505050;--sidebar-background-color-hover:#676767;--code-block-background-color:#2A2A2A;--scrollbar-track-background-color:#717171;--scrollbar-thumb-background-color:rgba(32,34,37,.6);--scrollbar-color:rgba(32,34,37,.6) #5a5a5a;--headings-border-bottom-color:#d2d2d2;--border-color:#e0e0e0;--button-background-color:#f0f0f0;--right-side-color:grey;--code-attribute-color:#999;--toggles-color:#999;--toggle-filter:invert(100%);--mobile-sidebar-menu-filter:invert(100%);--search-input-focused-border-color:#008dfd;--copy-path-button-color:#999;--copy-path-img-filter:invert(50%);--copy-path-img-hover-filter:invert(65%);--codeblock-error-hover-color:rgb(255,0,0);--codeblock-error-color:rgba(255,0,0,.5);--codeblock-ignore-hover-color:rgb(255,142,0);--codeblock-ignore-color:rgba(255,142,0,.6);--warning-border-color:#ff8e00;--type-link-color:#2dbfb8;--trait-link-color:#b78cf2;--assoc-item-link-color:#d2991d;--function-link-color:#2bab63;--macro-link-color:#09bd00;--keyword-link-color:#d2991d;--mod-link-color:#d2991d;--link-color:#d2991d;--sidebar-link-color:#fdbf35;--sidebar-current-link-background-color:#444;--search-result-link-focus-background-color:#616161;--search-result-border-color:#aaa3;--search-color:#111;--search-error-code-background-color:#484848;--search-results-alias-color:#fff;--search-results-grey-color:#ccc;--search-tab-title-count-color:#888;--search-tab-button-not-selected-border-top-color:#252525;--search-tab-button-not-selected-background:#252525;--search-tab-button-selected-border-top-color:#0089ff;--search-tab-button-selected-background:#353535;--settings-menu-filter:none;--stab-background-color:#314559;--stab-code-color:#e6e1cf;--code-highlight-kw-color:#ab8ac1;--code-highlight-kw-2-color:#769acb;--code-highlight-lifetime-color:#d97f26;--code-highlight-prelude-color:#769acb;--code-highlight-prelude-val-color:#ee6868;--code-highlight-number-color:#83a300;--code-highlight-string-color:#83a300;--code-highlight-literal-color:#ee6868;--code-highlight-attribute-color:#ee6868;--code-highlight-self-color:#ee6868;--code-highlight-macro-color:#3e999f;--code-highlight-question-mark-color:#ff9011;--code-highlight-comment-color:#8d8d8b;--code-highlight-doc-comment-color:#8ca375;--src-line-numbers-span-color:#3b91e2;--src-line-number-highlighted-background-color:#0a042f;--test-arrow-color:#dedede;--test-arrow-background-color:rgba(78,139,202,0.2);--test-arrow-hover-color:#dedede;--test-arrow-hover-background-color:#4e8bca;--target-background-color:#494a3d;--target-border-color:#bb7410;--kbd-color:#000;--kbd-background:#fafbfc;--kbd-box-shadow-color:#c6cbd1;--rust-logo-filter:drop-shadow(1px 0 0px #fff) drop-shadow(0 1px 0 #fff) drop-shadow(-1px 0 0 #fff) drop-shadow(0 -1px 0 #fff);--crate-search-div-filter:invert(94%) sepia(0%) saturate(721%) hue-rotate(255deg) brightness(90%) contrast(90%);--crate-search-div-hover-filter:invert(69%) sepia(60%) saturate(6613%) hue-rotate(184deg) brightness(100%) contrast(91%);--crate-search-hover-border:#2196f3;--src-sidebar-background-selected:#333;--src-sidebar-background-hover:#444;--table-alt-row-background-color:#2a2a2a;--codeblock-link-background:#333;--scrape-example-toggle-line-background:#999;--scrape-example-toggle-line-hover-background:#c5c5c5;--scrape-example-code-line-highlight:#5b3b01;--scrape-example-code-line-highlight-focus:#7c4b0f;--scrape-example-help-border-color:#aaa;--scrape-example-help-color:#eee;--scrape-example-help-hover-border-color:#fff;--scrape-example-help-hover-color:#fff;--scrape-example-code-wrapper-background-start:rgba(53,53,53,1);--scrape-example-code-wrapper-background-end:rgba(53,53,53,0);--sidebar-resizer-hover:hsl(207,30%,54%);--sidebar-resizer-active:hsl(207,90%,54%);}:root[data-theme="ayu"]{--main-background-color:#0f1419;--main-color:#c5c5c5;--settings-input-color:#ffb454;--settings-input-border-color:#999;--settings-button-color:#fff;--settings-button-border-focus:#e0e0e0;--sidebar-background-color:#14191f;--sidebar-background-color-hover:rgba(70,70,70,0.33);--code-block-background-color:#191f26;--scrollbar-track-background-color:transparent;--scrollbar-thumb-background-color:#5c6773;--scrollbar-color:#5c6773 #24292f;--headings-border-bottom-color:#5c6773;--border-color:#5c6773;--button-background-color:#141920;--right-side-color:grey;--code-attribute-color:#999;--toggles-color:#999;--toggle-filter:invert(100%);--mobile-sidebar-menu-filter:invert(100%);--search-input-focused-border-color:#5c6773;--copy-path-button-color:#fff;--copy-path-img-filter:invert(70%);--copy-path-img-hover-filter:invert(100%);--codeblock-error-hover-color:rgb(255,0,0);--codeblock-error-color:rgba(255,0,0,.5);--codeblock-ignore-hover-color:rgb(255,142,0);--codeblock-ignore-color:rgba(255,142,0,.6);--warning-border-color:#ff8e00;--type-link-color:#ffa0a5;--trait-link-color:#39afd7;--assoc-item-link-color:#39afd7;--function-link-color:#fdd687;--macro-link-color:#a37acc;--keyword-link-color:#39afd7;--mod-link-color:#39afd7;--link-color:#39afd7;--sidebar-link-color:#53b1db;--sidebar-current-link-background-color:transparent;--search-result-link-focus-background-color:#3c3c3c;--search-result-border-color:#aaa3;--search-color:#fff;--search-error-code-background-color:#4f4c4c;--search-results-alias-color:#c5c5c5;--search-results-grey-color:#999;--search-tab-title-count-color:#888;--search-tab-button-not-selected-border-top-color:none;--search-tab-button-not-selected-background:transparent !important;--search-tab-button-selected-border-top-color:none;--search-tab-button-selected-background:#141920 !important;--settings-menu-filter:invert(100%);--stab-background-color:#314559;--stab-code-color:#e6e1cf;--code-highlight-kw-color:#ff7733;--code-highlight-kw-2-color:#ff7733;--code-highlight-lifetime-color:#ff7733;--code-highlight-prelude-color:#69f2df;--code-highlight-prelude-val-color:#ff7733;--code-highlight-number-color:#b8cc52;--code-highlight-string-color:#b8cc52;--code-highlight-literal-color:#ff7733;--code-highlight-attribute-color:#e6e1cf;--code-highlight-self-color:#36a3d9;--code-highlight-macro-color:#a37acc;--code-highlight-question-mark-color:#ff9011;--code-highlight-comment-color:#788797;--code-highlight-doc-comment-color:#a1ac88;--src-line-numbers-span-color:#5c6773;--src-line-number-highlighted-background-color:rgba(255,236,164,0.06);--test-arrow-color:#788797;--test-arrow-background-color:rgba(57,175,215,0.09);--test-arrow-hover-color:#c5c5c5;--test-arrow-hover-background-color:rgba(57,175,215,0.368);--target-background-color:rgba(255,236,164,0.06);--target-border-color:rgba(255,180,76,0.85);--kbd-color:#c5c5c5;--kbd-background:#314559;--kbd-box-shadow-color:#5c6773;--rust-logo-filter:drop-shadow(1px 0 0px #fff) drop-shadow(0 1px 0 #fff) drop-shadow(-1px 0 0 #fff) drop-shadow(0 -1px 0 #fff);--crate-search-div-filter:invert(41%) sepia(12%) saturate(487%) hue-rotate(171deg) brightness(94%) contrast(94%);--crate-search-div-hover-filter:invert(98%) sepia(12%) saturate(81%) hue-rotate(343deg) brightness(113%) contrast(76%);--crate-search-hover-border:#e0e0e0;--src-sidebar-background-selected:#14191f;--src-sidebar-background-hover:#14191f;--table-alt-row-background-color:#191f26;--codeblock-link-background:#333;--scrape-example-toggle-line-background:#999;--scrape-example-toggle-line-hover-background:#c5c5c5;--scrape-example-code-line-highlight:#5b3b01;--scrape-example-code-line-highlight-focus:#7c4b0f;--scrape-example-help-border-color:#aaa;--scrape-example-help-color:#eee;--scrape-example-help-hover-border-color:#fff;--scrape-example-help-hover-color:#fff;--scrape-example-code-wrapper-background-start:rgba(15,20,25,1);--scrape-example-code-wrapper-background-end:rgba(15,20,25,0);--sidebar-resizer-hover:hsl(34,50%,33%);--sidebar-resizer-active:hsl(34,100%,66%);}:root[data-theme="ayu"] h1,:root[data-theme="ayu"] h2,:root[data-theme="ayu"] h3,:root[data-theme="ayu"] h4,:where(:root[data-theme="ayu"]) h1 a,:root[data-theme="ayu"] .sidebar h2 a,:root[data-theme="ayu"] .sidebar h3 a{color:#fff;}:root[data-theme="ayu"] .docblock code{color:#ffb454;}:root[data-theme="ayu"] .docblock a>code{color:#39AFD7 !important;}:root[data-theme="ayu"] .code-header,:root[data-theme="ayu"] .docblock pre>code,:root[data-theme="ayu"] pre,:root[data-theme="ayu"] pre>code,:root[data-theme="ayu"] .item-info code,:root[data-theme="ayu"] .rustdoc.source .example-wrap{color:#e6e1cf;}:root[data-theme="ayu"] .sidebar .current,:root[data-theme="ayu"] .sidebar .current a,:root[data-theme="ayu"] .sidebar a:hover,:root[data-theme="ayu"] #src-sidebar div.files>a:hover,:root[data-theme="ayu"] details.dir-entry summary:hover,:root[data-theme="ayu"] #src-sidebar div.files>a:focus,:root[data-theme="ayu"] details.dir-entry summary:focus,:root[data-theme="ayu"] #src-sidebar div.files>a.selected{color:#ffb44c;}:root[data-theme="ayu"] .sidebar-elems .location{color:#ff7733;}:root[data-theme="ayu"] .src-line-numbers .line-highlighted{color:#708090;padding-right:7px;border-right:1px solid #ffb44c;}:root[data-theme="ayu"] .search-results a:hover,:root[data-theme="ayu"] .search-results a:focus{color:#fff !important;background-color:#3c3c3c;}:root[data-theme="ayu"] .search-results a{color:#0096cf;}:root[data-theme="ayu"] .search-results a div.desc{color:#c5c5c5;}:root[data-theme="ayu"] .result-name .primitive>i,:root[data-theme="ayu"] .result-name .keyword>i{color:#788797;}:root[data-theme="ayu"] #search-tabs>button.selected{border-bottom:1px solid #ffb44c !important;border-top:none;}:root[data-theme="ayu"] #search-tabs>button:not(.selected){border:none;background-color:transparent !important;}:root[data-theme="ayu"] #search-tabs>button:hover{border-bottom:1px solid rgba(242,151,24,0.3);}:root[data-theme="ayu"] #settings-menu>a img,:root[data-theme="ayu"] #sidebar-button>a:before{filter:invert(100);} \ No newline at end of file diff --git a/static.files/scrape-examples-ef1e698c1d417c0c.js b/static.files/scrape-examples-ef1e698c1d417c0c.js new file mode 100644 index 0000000..ba830e3 --- /dev/null +++ b/static.files/scrape-examples-ef1e698c1d417c0c.js @@ -0,0 +1 @@ +"use strict";(function(){const DEFAULT_MAX_LINES=5;const HIDDEN_MAX_LINES=10;function scrollToLoc(elt,loc,isHidden){const lines=elt.querySelector(".src-line-numbers");let scrollOffset;const maxLines=isHidden?HIDDEN_MAX_LINES:DEFAULT_MAX_LINES;if(loc[1]-loc[0]>maxLines){const line=Math.max(0,loc[0]-1);scrollOffset=lines.children[line].offsetTop}else{const wrapper=elt.querySelector(".code-wrapper");const halfHeight=wrapper.offsetHeight/2;const offsetTop=lines.children[loc[0]].offsetTop;const lastLine=lines.children[loc[1]];const offsetBot=lastLine.offsetTop+lastLine.offsetHeight;const offsetMid=(offsetTop+offsetBot)/2;scrollOffset=offsetMid-halfHeight}lines.scrollTo(0,scrollOffset);elt.querySelector(".rust").scrollTo(0,scrollOffset)}function updateScrapedExample(example,isHidden){const locs=JSON.parse(example.attributes.getNamedItem("data-locs").textContent);let locIndex=0;const highlights=Array.prototype.slice.call(example.querySelectorAll(".highlight"));const link=example.querySelector(".scraped-example-title a");if(locs.length>1){const onChangeLoc=changeIndex=>{removeClass(highlights[locIndex],"focus");changeIndex();scrollToLoc(example,locs[locIndex][0],isHidden);addClass(highlights[locIndex],"focus");const url=locs[locIndex][1];const title=locs[locIndex][2];link.href=url;link.innerHTML=title};example.querySelector(".prev").addEventListener("click",()=>{onChangeLoc(()=>{locIndex=(locIndex-1+locs.length)%locs.length})});example.querySelector(".next").addEventListener("click",()=>{onChangeLoc(()=>{locIndex=(locIndex+1)%locs.length})})}const expandButton=example.querySelector(".expand");if(expandButton){expandButton.addEventListener("click",()=>{if(hasClass(example,"expanded")){removeClass(example,"expanded");scrollToLoc(example,locs[0][0],isHidden)}else{addClass(example,"expanded")}})}scrollToLoc(example,locs[0][0],isHidden)}const firstExamples=document.querySelectorAll(".scraped-example-list > .scraped-example");onEachLazy(firstExamples,el=>updateScrapedExample(el,false));onEachLazy(document.querySelectorAll(".more-examples-toggle"),toggle=>{onEachLazy(toggle.querySelectorAll(".toggle-line, .hide-more"),button=>{button.addEventListener("click",()=>{toggle.open=false})});const moreExamples=toggle.querySelectorAll(".scraped-example");toggle.querySelector("summary").addEventListener("click",()=>{setTimeout(()=>{onEachLazy(moreExamples,el=>updateScrapedExample(el,true))})},{once:true})})})() \ No newline at end of file diff --git a/static.files/search-d52510db62a78183.js b/static.files/search-d52510db62a78183.js new file mode 100644 index 0000000..a2824f2 --- /dev/null +++ b/static.files/search-d52510db62a78183.js @@ -0,0 +1,5 @@ +"use strict";if(!Array.prototype.toSpliced){Array.prototype.toSpliced=function(){const me=this.slice();Array.prototype.splice.apply(me,arguments);return me}}(function(){const itemTypes=["keyword","primitive","mod","externcrate","import","struct","enum","fn","type","static","trait","impl","tymethod","method","structfield","variant","macro","associatedtype","constant","associatedconstant","union","foreigntype","existential","attr","derive","traitalias","generic",];const longItemTypes=["keyword","primitive type","module","extern crate","re-export","struct","enum","function","type alias","static","trait","","trait method","method","struct field","enum variant","macro","assoc type","constant","assoc const","union","foreign type","existential type","attribute macro","derive macro","trait alias",];const TY_GENERIC=itemTypes.indexOf("generic");const TY_IMPORT=itemTypes.indexOf("import");const ROOT_PATH=typeof window!=="undefined"?window.rootPath:"../";const UNBOXING_LIMIT=5;function printTab(nb){let iter=0;let foundCurrentTab=false;let foundCurrentResultSet=false;onEachLazy(document.getElementById("search-tabs").childNodes,elem=>{if(nb===iter){addClass(elem,"selected");foundCurrentTab=true}else{removeClass(elem,"selected")}iter+=1});const isTypeSearch=(nb>0||iter===1);iter=0;onEachLazy(document.getElementById("results").childNodes,elem=>{if(nb===iter){addClass(elem,"active");foundCurrentResultSet=true}else{removeClass(elem,"active")}iter+=1});if(foundCurrentTab&&foundCurrentResultSet){searchState.currentTab=nb;const correctionsElem=document.getElementsByClassName("search-corrections");if(isTypeSearch){removeClass(correctionsElem[0],"hidden")}else{addClass(correctionsElem[0],"hidden")}}else if(nb!==0){printTab(0)}}const editDistanceState={current:[],prev:[],prevPrev:[],calculate:function calculate(a,b,limit){if(a.lengthlimit){return limit+1}while(b.length>0&&b[0]===a[0]){a=a.substring(1);b=b.substring(1)}while(b.length>0&&b[b.length-1]===a[a.length-1]){a=a.substring(0,a.length-1);b=b.substring(0,b.length-1)}if(b.length===0){return minDist}const aLength=a.length;const bLength=b.length;for(let i=0;i<=bLength;++i){this.current[i]=0;this.prev[i]=i;this.prevPrev[i]=Number.MAX_VALUE}for(let i=1;i<=aLength;++i){this.current[0]=i;const aIdx=i-1;for(let j=1;j<=bLength;++j){const bIdx=j-1;const substitutionCost=a[aIdx]===b[bIdx]?0:1;this.current[j]=Math.min(this.prev[j]+1,this.current[j-1]+1,this.prev[j-1]+substitutionCost,);if((i>1)&&(j>1)&&(a[aIdx]===b[bIdx-1])&&(a[aIdx-1]===b[bIdx])){this.current[j]=Math.min(this.current[j],this.prevPrev[j-2]+1,)}}const prevPrevTmp=this.prevPrev;this.prevPrev=this.prev;this.prev=this.current;this.current=prevPrevTmp}const distance=this.prev[bLength];return distance<=limit?distance:(limit+1)},};function editDistance(a,b,limit){return editDistanceState.calculate(a,b,limit)}function initSearch(rawSearchIndex){const MAX_RESULTS=200;const NO_TYPE_FILTER=-1;let searchIndex;let searchIndexDeprecated;let searchIndexEmptyDesc;let functionTypeFingerprint;let currentResults;const typeNameIdMap=new Map();const ALIASES=new Map();const typeNameIdOfArray=buildTypeMapIndex("array");const typeNameIdOfSlice=buildTypeMapIndex("slice");const typeNameIdOfArrayOrSlice=buildTypeMapIndex("[]");const typeNameIdOfTuple=buildTypeMapIndex("tuple");const typeNameIdOfUnit=buildTypeMapIndex("unit");const typeNameIdOfTupleOrUnit=buildTypeMapIndex("()");const typeNameIdOfFn=buildTypeMapIndex("fn");const typeNameIdOfFnMut=buildTypeMapIndex("fnmut");const typeNameIdOfFnOnce=buildTypeMapIndex("fnonce");const typeNameIdOfHof=buildTypeMapIndex("->");function buildTypeMapIndex(name,isAssocType){if(name===""||name===null){return null}if(typeNameIdMap.has(name)){const obj=typeNameIdMap.get(name);obj.assocOnly=isAssocType&&obj.assocOnly;return obj.id}else{const id=typeNameIdMap.size;typeNameIdMap.set(name,{id,assocOnly:isAssocType});return id}}function isSpecialStartCharacter(c){return"<\"".indexOf(c)!==-1}function isEndCharacter(c){return"=,>-])".indexOf(c)!==-1}function itemTypeFromName(typename){const index=itemTypes.findIndex(i=>i===typename);if(index<0){throw["Unknown type filter ",typename]}return index}function getStringElem(query,parserState,isInGenerics){if(isInGenerics){throw["Unexpected ","\""," in generics"]}else if(query.literalSearch){throw["Cannot have more than one literal search element"]}else if(parserState.totalElems-parserState.genericsElems>0){throw["Cannot use literal search when there is more than one element"]}parserState.pos+=1;const start=parserState.pos;const end=getIdentEndPosition(parserState);if(parserState.pos>=parserState.length){throw["Unclosed ","\""]}else if(parserState.userQuery[end]!=="\""){throw["Unexpected ",parserState.userQuery[end]," in a string element"]}else if(start===end){throw["Cannot have empty string element"]}parserState.pos+=1;query.literalSearch=true}function isPathStart(parserState){return parserState.userQuery.slice(parserState.pos,parserState.pos+2)==="::"}function isReturnArrow(parserState){return parserState.userQuery.slice(parserState.pos,parserState.pos+2)==="->"}function isIdentCharacter(c){return(c==="_"||(c>="0"&&c<="9")||(c>="a"&&c<="z")||(c>="A"&&c<="Z"))}function isSeparatorCharacter(c){return c===","||c==="="}function isPathSeparator(c){return c===":"||c===" "}function prevIs(parserState,lookingFor){let pos=parserState.pos;while(pos>0){const c=parserState.userQuery[pos-1];if(c===lookingFor){return true}else if(c!==" "){break}pos-=1}return false}function isLastElemGeneric(elems,parserState){return(elems.length>0&&elems[elems.length-1].generics.length>0)||prevIs(parserState,">")}function skipWhitespace(parserState){while(parserState.pos0){throw["Cannot have more than one element if you use quotes"]}const typeFilter=parserState.typeFilter;parserState.typeFilter=null;if(name==="!"){if(typeFilter!==null&&typeFilter!=="primitive"){throw["Invalid search type: primitive never type ","!"," and ",typeFilter," both specified",]}if(generics.length!==0){throw["Never type ","!"," does not accept generic parameters",]}const bindingName=parserState.isInBinding;parserState.isInBinding=null;return makePrimitiveElement("never",{bindingName})}const quadcolon=/::\s*::/.exec(path);if(path.startsWith("::")){throw["Paths cannot start with ","::"]}else if(path.endsWith("::")){throw["Paths cannot end with ","::"]}else if(quadcolon!==null){throw["Unexpected ",quadcolon[0]]}const pathSegments=path.split(/(?:::\s*)|(?:\s+(?:::\s*)?)/);if(pathSegments.length===0||(pathSegments.length===1&&pathSegments[0]==="")){if(generics.length>0||prevIs(parserState,">")){throw["Found generics without a path"]}else{throw["Unexpected ",parserState.userQuery[parserState.pos]]}}for(const[i,pathSegment]of pathSegments.entries()){if(pathSegment==="!"){if(i!==0){throw["Never type ","!"," is not associated item"]}pathSegments[i]="never"}}parserState.totalElems+=1;if(isInGenerics){parserState.genericsElems+=1}const bindingName=parserState.isInBinding;parserState.isInBinding=null;const bindings=new Map();const pathLast=pathSegments[pathSegments.length-1];return{name:name.trim(),id:null,fullPath:pathSegments,pathWithoutLast:pathSegments.slice(0,pathSegments.length-1),pathLast,normalizedPathLast:pathLast.replace(/_/g,""),generics:generics.filter(gen=>{if(gen.bindingName!==null){if(gen.name!==null){gen.bindingName.generics.unshift(gen)}bindings.set(gen.bindingName.name,gen.bindingName.generics);return false}return true}),bindings,typeFilter,bindingName,}}function getIdentEndPosition(parserState){const start=parserState.pos;let end=parserState.pos;let foundExclamation=-1;while(parserState.pos0){throw["Unexpected ",c," after ",parserState.userQuery[parserState.pos-1]]}else{throw["Unexpected ",c]}}parserState.pos+=1;end=parserState.pos}if(foundExclamation!==-1&&foundExclamation!==start&&isIdentCharacter(parserState.userQuery[foundExclamation-1])){if(parserState.typeFilter===null){parserState.typeFilter="macro"}else if(parserState.typeFilter!=="macro"){throw["Invalid search type: macro ","!"," and ",parserState.typeFilter," both specified",]}end=foundExclamation}return end}function getFilteredNextElem(query,parserState,elems,isInGenerics){const start=parserState.pos;if(parserState.userQuery[parserState.pos]===":"&&!isPathStart(parserState)){throw["Expected type filter before ",":"]}getNextElem(query,parserState,elems,isInGenerics);if(parserState.userQuery[parserState.pos]===":"&&!isPathStart(parserState)){if(parserState.typeFilter!==null){throw["Unexpected ",":"," (expected path after type filter ",parserState.typeFilter+":",")",]}if(elems.length===0){throw["Expected type filter before ",":"]}else if(query.literalSearch){throw["Cannot use quotes on type filter"]}const typeFilterElem=elems.pop();checkExtraTypeFilterCharacters(start,parserState);parserState.typeFilter=typeFilterElem.name;parserState.pos+=1;parserState.totalElems-=1;query.literalSearch=false;getNextElem(query,parserState,elems,isInGenerics)}}function getNextElem(query,parserState,elems,isInGenerics){const generics=[];skipWhitespace(parserState);let start=parserState.pos;let end;if("[(".indexOf(parserState.userQuery[parserState.pos])!==-1){let endChar=")";let name="()";let friendlyName="tuple";if(parserState.userQuery[parserState.pos]==="["){endChar="]";name="[]";friendlyName="slice"}parserState.pos+=1;const{foundSeparator}=getItemsBefore(query,parserState,generics,endChar);const typeFilter=parserState.typeFilter;const bindingName=parserState.isInBinding;parserState.typeFilter=null;parserState.isInBinding=null;for(const gen of generics){if(gen.bindingName!==null){throw["Type parameter ","=",` cannot be within ${friendlyName} `,name]}}if(name==="()"&&!foundSeparator&&generics.length===1&&typeFilter===null){elems.push(generics[0])}else if(name==="()"&&generics.length===1&&generics[0].name==="->"){generics[0].typeFilter=typeFilter;elems.push(generics[0])}else{if(typeFilter!==null&&typeFilter!=="primitive"){throw["Invalid search type: primitive ",name," and ",typeFilter," both specified",]}parserState.totalElems+=1;if(isInGenerics){parserState.genericsElems+=1}elems.push(makePrimitiveElement(name,{bindingName,generics}))}}else if(parserState.userQuery[parserState.pos]==="&"){if(parserState.typeFilter!==null&&parserState.typeFilter!=="primitive"){throw["Invalid search type: primitive ","&"," and ",parserState.typeFilter," both specified",]}parserState.typeFilter=null;parserState.pos+=1;let c=parserState.userQuery[parserState.pos];while(c===" "&&parserState.pos=end){throw["Found generics without a path"]}parserState.pos+=1;getItemsBefore(query,parserState,generics,">")}else if(parserState.pos=end){throw["Found generics without a path"]}if(parserState.isInBinding){throw["Unexpected ","("," after ","="]}parserState.pos+=1;const typeFilter=parserState.typeFilter;parserState.typeFilter=null;getItemsBefore(query,parserState,generics,")");skipWhitespace(parserState);if(isReturnArrow(parserState)){parserState.pos+=2;skipWhitespace(parserState);getFilteredNextElem(query,parserState,generics,isInGenerics);generics[generics.length-1].bindingName=makePrimitiveElement("output")}else{generics.push(makePrimitiveElement(null,{bindingName:makePrimitiveElement("output"),typeFilter:null,}))}parserState.typeFilter=typeFilter}if(isStringElem){skipWhitespace(parserState)}if(start>=end&&generics.length===0){return}if(parserState.userQuery[parserState.pos]==="="){if(parserState.isInBinding){throw["Cannot write ","="," twice in a binding"]}if(!isInGenerics){throw["Type parameter ","="," must be within generics list"]}const name=parserState.userQuery.slice(start,end).trim();if(name==="!"){throw["Type parameter ","="," key cannot be ","!"," never type"]}if(name.includes("!")){throw["Type parameter ","="," key cannot be ","!"," macro"]}if(name.includes("::")){throw["Type parameter ","="," key cannot contain ","::"," path"]}if(name.includes(":")){throw["Type parameter ","="," key cannot contain ",":"," type"]}parserState.isInBinding={name,generics}}else{elems.push(createQueryElement(query,parserState,parserState.userQuery.slice(start,end),generics,isInGenerics,),)}}}function getItemsBefore(query,parserState,elems,endChar){let foundStopChar=true;let foundSeparator=false;const oldTypeFilter=parserState.typeFilter;parserState.typeFilter=null;const oldIsInBinding=parserState.isInBinding;parserState.isInBinding=null;let hofParameters=null;let extra="";if(endChar===">"){extra="<"}else if(endChar==="]"){extra="["}else if(endChar===")"){extra="("}else if(endChar===""){extra="->"}else{extra=endChar}while(parserState.pos"," after ","="]}hofParameters=[...elems];elems.length=0;parserState.pos+=2;foundStopChar=true;foundSeparator=false;continue}else if(c===" "){parserState.pos+=1;continue}else if(isSeparatorCharacter(c)){parserState.pos+=1;foundStopChar=true;foundSeparator=true;continue}else if(c===":"&&isPathStart(parserState)){throw["Unexpected ","::",": paths cannot start with ","::"]}else if(isEndCharacter(c)){throw["Unexpected ",c," after ",extra]}if(!foundStopChar){let extra=[];if(isLastElemGeneric(query.elems,parserState)){extra=[" after ",">"]}else if(prevIs(parserState,"\"")){throw["Cannot have more than one element if you use quotes"]}if(endChar!==""){throw["Expected ",",",", ","=",", or ",endChar,...extra,", found ",c,]}throw["Expected ",","," or ","=",...extra,", found ",c,]}const posBefore=parserState.pos;getFilteredNextElem(query,parserState,elems,endChar!=="");if(endChar!==""&&parserState.pos>=parserState.length){throw["Unclosed ",extra]}if(posBefore===parserState.pos){parserState.pos+=1}foundStopChar=false}if(parserState.pos>=parserState.length&&endChar!==""){throw["Unclosed ",extra]}parserState.pos+=1;if(hofParameters){foundSeparator=false;if([...elems,...hofParameters].some(x=>x.bindingName)||parserState.isInBinding){throw["Unexpected ","="," within ","->"]}const hofElem=makePrimitiveElement("->",{generics:hofParameters,bindings:new Map([["output",[...elems]]]),typeFilter:null,});elems.length=0;elems[0]=hofElem}parserState.typeFilter=oldTypeFilter;parserState.isInBinding=oldIsInBinding;return{foundSeparator}}function checkExtraTypeFilterCharacters(start,parserState){const query=parserState.userQuery.slice(start,parserState.pos).trim();for(const c in query){if(!isIdentCharacter(query[c])){throw["Unexpected ",query[c]," in type filter (before ",":",")",]}}}function parseInput(query,parserState){let foundStopChar=true;while(parserState.pos"){if(isReturnArrow(parserState)){break}throw["Unexpected ",c," (did you mean ","->","?)"]}else if(parserState.pos>0){throw["Unexpected ",c," after ",parserState.userQuery[parserState.pos-1]]}throw["Unexpected ",c]}else if(c===" "){skipWhitespace(parserState);continue}if(!foundStopChar){let extra="";if(isLastElemGeneric(query.elems,parserState)){extra=[" after ",">"]}else if(prevIs(parserState,"\"")){throw["Cannot have more than one element if you use quotes"]}if(parserState.typeFilter!==null){throw["Expected ",","," or ","->",...extra,", found ",c,]}throw["Expected ",",",", ",":"," or ","->",...extra,", found ",c,]}const before=query.elems.length;getFilteredNextElem(query,parserState,query.elems,false);if(query.elems.length===before){parserState.pos+=1}foundStopChar=false}if(parserState.typeFilter!==null){throw["Unexpected ",":"," (expected path after type filter ",parserState.typeFilter+":",")",]}while(parserState.pos"]}break}else{parserState.pos+=1}}}function newParsedQuery(userQuery){return{original:userQuery,userQuery:userQuery.toLowerCase(),elems:[],returned:[],foundElems:0,totalElems:0,literalSearch:false,error:null,correction:null,proposeCorrectionFrom:null,proposeCorrectionTo:null,typeFingerprint:new Uint32Array(4),}}function buildUrl(search,filterCrates){let extra="?search="+encodeURIComponent(search);if(filterCrates!==null){extra+="&filter-crate="+encodeURIComponent(filterCrates)}return getNakedUrl()+extra+window.location.hash}function getFilterCrates(){const elem=document.getElementById("crate-search");if(elem&&elem.value!=="all crates"&&rawSearchIndex.has(elem.value)){return elem.value}return null}function parseQuery(userQuery){function convertTypeFilterOnElem(elem){if(elem.typeFilter!==null){let typeFilter=elem.typeFilter;if(typeFilter==="const"){typeFilter="constant"}elem.typeFilter=itemTypeFromName(typeFilter)}else{elem.typeFilter=NO_TYPE_FILTER}for(const elem2 of elem.generics){convertTypeFilterOnElem(elem2)}for(const constraints of elem.bindings.values()){for(const constraint of constraints){convertTypeFilterOnElem(constraint)}}}userQuery=userQuery.trim().replace(/\r|\n|\t/g," ");const parserState={length:userQuery.length,pos:0,totalElems:0,genericsElems:0,typeFilter:null,isInBinding:null,userQuery:userQuery.toLowerCase(),};let query=newParsedQuery(userQuery);try{parseInput(query,parserState);for(const elem of query.elems){convertTypeFilterOnElem(elem)}for(const elem of query.returned){convertTypeFilterOnElem(elem)}}catch(err){query=newParsedQuery(userQuery);query.error=err;return query}if(!query.literalSearch){query.literalSearch=parserState.totalElems>1}query.foundElems=query.elems.length+query.returned.length;query.totalElems=parserState.totalElems;return query}function createQueryResults(results_in_args,results_returned,results_others,parsedQuery){return{"in_args":results_in_args,"returned":results_returned,"others":results_others,"query":parsedQuery,}}async function execQuery(parsedQuery,filterCrates,currentCrate){const results_others=new Map(),results_in_args=new Map(),results_returned=new Map();function transformResults(results){const duplicates=new Set();const out=[];for(const result of results){if(result.id!==-1){const obj=searchIndex[result.id];obj.dist=result.dist;const res=buildHrefAndPath(obj);obj.displayPath=pathSplitter(res[0]);obj.fullPath=res[2]+"|"+obj.ty;if(duplicates.has(obj.fullPath)){continue}if(obj.ty===TY_IMPORT&&duplicates.has(res[2])){continue}if(duplicates.has(res[2]+"|"+TY_IMPORT)){continue}duplicates.add(obj.fullPath);duplicates.add(res[2]);obj.href=res[1];out.push(obj);if(out.length>=MAX_RESULTS){break}}}return out}async function sortResults(results,isType,preferredCrate){const userQuery=parsedQuery.userQuery;const result_list=[];for(const result of results.values()){result.item=searchIndex[result.id];result.word=searchIndex[result.id].word;result_list.push(result)}result_list.sort((aaa,bbb)=>{let a,b;a=(aaa.word!==userQuery);b=(bbb.word!==userQuery);if(a!==b){return a-b}a=(aaa.index<0);b=(bbb.index<0);if(a!==b){return a-b}a=aaa.path_dist;b=bbb.path_dist;if(a!==b){return a-b}a=aaa.index;b=bbb.index;if(a!==b){return a-b}a=(aaa.dist);b=(bbb.dist);if(a!==b){return a-b}a=searchIndexDeprecated.get(aaa.item.crate).contains(aaa.item.bitIndex);b=searchIndexDeprecated.get(bbb.item.crate).contains(bbb.item.bitIndex);if(a!==b){return a-b}a=(aaa.item.crate!==preferredCrate);b=(bbb.item.crate!==preferredCrate);if(a!==b){return a-b}a=aaa.word.length;b=bbb.word.length;if(a!==b){return a-b}a=aaa.word;b=bbb.word;if(a!==b){return(a>b?+1:-1)}a=searchIndexEmptyDesc.get(aaa.item.crate).contains(aaa.item.bitIndex);b=searchIndexEmptyDesc.get(bbb.item.crate).contains(bbb.item.bitIndex);if(a!==b){return a-b}a=aaa.item.ty;b=bbb.item.ty;if(a!==b){return a-b}a=aaa.item.path;b=bbb.item.path;if(a!==b){return(a>b?+1:-1)}return 0});return transformResults(result_list)}function unifyFunctionTypes(fnTypesIn,queryElems,whereClause,mgensIn,solutionCb,unboxingDepth,){if(unboxingDepth>=UNBOXING_LIMIT){return false}const mgens=mgensIn===null?null:new Map(mgensIn);if(queryElems.length===0){return!solutionCb||solutionCb(mgens)}if(!fnTypesIn||fnTypesIn.length===0){return false}const ql=queryElems.length;const fl=fnTypesIn.length;if(ql===1&&queryElems[0].generics.length===0&&queryElems[0].bindings.size===0){const queryElem=queryElems[0];for(const fnType of fnTypesIn){if(!unifyFunctionTypeIsMatchCandidate(fnType,queryElem,mgens)){continue}if(fnType.id<0&&queryElem.id<0){if(mgens&&mgens.has(fnType.id)&&mgens.get(fnType.id)!==queryElem.id){continue}const mgensScratch=new Map(mgens);mgensScratch.set(fnType.id,queryElem.id);if(!solutionCb||solutionCb(mgensScratch)){return true}}else if(!solutionCb||solutionCb(mgens?new Map(mgens):null)){return true}}for(const fnType of fnTypesIn){if(!unifyFunctionTypeIsUnboxCandidate(fnType,queryElem,whereClause,mgens,unboxingDepth+1,)){continue}if(fnType.id<0){if(mgens&&mgens.has(fnType.id)&&mgens.get(fnType.id)!==0){continue}const mgensScratch=new Map(mgens);mgensScratch.set(fnType.id,0);if(unifyFunctionTypes(whereClause[(-fnType.id)-1],queryElems,whereClause,mgensScratch,solutionCb,unboxingDepth+1,)){return true}}else if(unifyFunctionTypes([...fnType.generics,...Array.from(fnType.bindings.values()).flat()],queryElems,whereClause,mgens?new Map(mgens):null,solutionCb,unboxingDepth+1,)){return true}}return false}const fnTypes=fnTypesIn.slice();const flast=fl-1;const qlast=ql-1;const queryElem=queryElems[qlast];let queryElemsTmp=null;for(let i=flast;i>=0;i-=1){const fnType=fnTypes[i];if(!unifyFunctionTypeIsMatchCandidate(fnType,queryElem,mgens)){continue}let mgensScratch;if(fnType.id<0){mgensScratch=new Map(mgens);if(mgensScratch.has(fnType.id)&&mgensScratch.get(fnType.id)!==queryElem.id){continue}mgensScratch.set(fnType.id,queryElem.id)}else{mgensScratch=mgens}fnTypes[i]=fnTypes[flast];fnTypes.length=flast;if(!queryElemsTmp){queryElemsTmp=queryElems.slice(0,qlast)}const passesUnification=unifyFunctionTypes(fnTypes,queryElemsTmp,whereClause,mgensScratch,mgensScratch=>{if(fnType.generics.length===0&&queryElem.generics.length===0&&fnType.bindings.size===0&&queryElem.bindings.size===0){return!solutionCb||solutionCb(mgensScratch)}const solution=unifyFunctionTypeCheckBindings(fnType,queryElem,whereClause,mgensScratch,unboxingDepth,);if(!solution){return false}const simplifiedGenerics=solution.simplifiedGenerics;for(const simplifiedMgens of solution.mgens){const passesUnification=unifyFunctionTypes(simplifiedGenerics,queryElem.generics,whereClause,simplifiedMgens,solutionCb,unboxingDepth,);if(passesUnification){return true}}return false},unboxingDepth,);if(passesUnification){return true}fnTypes[flast]=fnTypes[i];fnTypes[i]=fnType;fnTypes.length=fl}for(let i=flast;i>=0;i-=1){const fnType=fnTypes[i];if(!unifyFunctionTypeIsUnboxCandidate(fnType,queryElem,whereClause,mgens,unboxingDepth+1,)){continue}let mgensScratch;if(fnType.id<0){mgensScratch=new Map(mgens);if(mgensScratch.has(fnType.id)&&mgensScratch.get(fnType.id)!==0){continue}mgensScratch.set(fnType.id,0)}else{mgensScratch=mgens}const generics=fnType.id<0?whereClause[(-fnType.id)-1]:fnType.generics;const bindings=fnType.bindings?Array.from(fnType.bindings.values()).flat():[];const passesUnification=unifyFunctionTypes(fnTypes.toSpliced(i,1,...generics,...bindings),queryElems,whereClause,mgensScratch,solutionCb,unboxingDepth+1,);if(passesUnification){return true}}return false}function unifyFunctionTypeIsMatchCandidate(fnType,queryElem,mgensIn){if(!typePassesFilter(queryElem.typeFilter,fnType.ty)){return false}if(fnType.id<0&&queryElem.id<0){if(mgensIn){if(mgensIn.has(fnType.id)&&mgensIn.get(fnType.id)!==queryElem.id){return false}for(const[fid,qid]of mgensIn.entries()){if(fnType.id!==fid&&queryElem.id===qid){return false}if(fnType.id===fid&&queryElem.id!==qid){return false}}}return true}else{if(queryElem.id===typeNameIdOfArrayOrSlice&&(fnType.id===typeNameIdOfSlice||fnType.id===typeNameIdOfArray)){}else if(queryElem.id===typeNameIdOfTupleOrUnit&&(fnType.id===typeNameIdOfTuple||fnType.id===typeNameIdOfUnit)){}else if(queryElem.id===typeNameIdOfHof&&(fnType.id===typeNameIdOfFn||fnType.id===typeNameIdOfFnMut||fnType.id===typeNameIdOfFnOnce)){}else if(fnType.id!==queryElem.id||queryElem.id===null){return false}if((fnType.generics.length+fnType.bindings.size)===0&&queryElem.generics.length!==0){return false}if(fnType.bindings.size0){const fnTypePath=fnType.path!==undefined&&fnType.path!==null?fnType.path.split("::"):[];if(queryElemPathLength>fnTypePath.length){return false}let i=0;for(const path of fnTypePath){if(path===queryElem.pathWithoutLast[i]){i+=1;if(i>=queryElemPathLength){break}}}if(i0){let mgensSolutionSet=[mgensIn];for(const[name,constraints]of queryElem.bindings.entries()){if(mgensSolutionSet.length===0){return false}if(!fnType.bindings.has(name)){return false}const fnTypeBindings=fnType.bindings.get(name);mgensSolutionSet=mgensSolutionSet.flatMap(mgens=>{const newSolutions=[];unifyFunctionTypes(fnTypeBindings,constraints,whereClause,mgens,newMgens=>{newSolutions.push(newMgens);return false},unboxingDepth,);return newSolutions})}if(mgensSolutionSet.length===0){return false}const binds=Array.from(fnType.bindings.entries()).flatMap(entry=>{const[name,constraints]=entry;if(queryElem.bindings.has(name)){return[]}else{return constraints}});if(simplifiedGenerics.length>0){simplifiedGenerics=[...simplifiedGenerics,...binds]}else{simplifiedGenerics=binds}return{simplifiedGenerics,mgens:mgensSolutionSet}}return{simplifiedGenerics,mgens:[mgensIn]}}function unifyFunctionTypeIsUnboxCandidate(fnType,queryElem,whereClause,mgens,unboxingDepth,){if(unboxingDepth>=UNBOXING_LIMIT){return false}if(fnType.id<0&&queryElem.id>=0){if(!whereClause){return false}if(mgens&&mgens.has(fnType.id)&&mgens.get(fnType.id)!==0){return false}const mgensTmp=new Map(mgens);mgensTmp.set(fnType.id,null);return checkIfInList(whereClause[(-fnType.id)-1],queryElem,whereClause,mgensTmp,unboxingDepth,)}else if(fnType.generics.length>0||fnType.bindings.size>0){const simplifiedGenerics=[...fnType.generics,...Array.from(fnType.bindings.values()).flat(),];return checkIfInList(simplifiedGenerics,queryElem,whereClause,mgens,unboxingDepth,)}return false}function checkIfInList(list,elem,whereClause,mgens,unboxingDepth){for(const entry of list){if(checkType(entry,elem,whereClause,mgens,unboxingDepth)){return true}}return false}function checkType(row,elem,whereClause,mgens,unboxingDepth){if(unboxingDepth>=UNBOXING_LIMIT){return false}if(row.bindings.size===0&&elem.bindings.size===0){if(elem.id<0&&mgens===null){return row.id<0||checkIfInList(row.generics,elem,whereClause,mgens,unboxingDepth+1,)}if(row.id>0&&elem.id>0&&elem.pathWithoutLast.length===0&&typePassesFilter(elem.typeFilter,row.ty)&&elem.generics.length===0&&elem.id!==typeNameIdOfArrayOrSlice&&elem.id!==typeNameIdOfTupleOrUnit&&elem.id!==typeNameIdOfHof){return row.id===elem.id||checkIfInList(row.generics,elem,whereClause,mgens,unboxingDepth,)}}return unifyFunctionTypes([row],[elem],whereClause,mgens,null,unboxingDepth)}function checkPath(contains,ty){if(contains.length===0){return 0}const maxPathEditDistance=Math.floor(contains.reduce((acc,next)=>acc+next.length,0)/3,);let ret_dist=maxPathEditDistance+1;const path=ty.path.split("::");if(ty.parent&&ty.parent.name){path.push(ty.parent.name.toLowerCase())}const length=path.length;const clength=contains.length;pathiter:for(let i=length-clength;i>=0;i-=1){let dist_total=0;for(let x=0;xmaxPathEditDistance){continue pathiter}dist_total+=dist}}ret_dist=Math.min(ret_dist,Math.round(dist_total/clength))}return ret_dist>maxPathEditDistance?null:ret_dist}function typePassesFilter(filter,type){if(filter<=NO_TYPE_FILTER||filter===type)return true;const name=itemTypes[type];switch(itemTypes[filter]){case"constant":return name==="associatedconstant";case"fn":return name==="method"||name==="tymethod";case"type":return name==="primitive"||name==="associatedtype";case"trait":return name==="traitalias"}return false}function createAliasFromItem(item){return{crate:item.crate,name:item.name,path:item.path,descShard:item.descShard,descIndex:item.descIndex,exactPath:item.exactPath,ty:item.ty,parent:item.parent,type:item.type,is_alias:true,bitIndex:item.bitIndex,implDisambiguator:item.implDisambiguator,}}function handleAliases(ret,query,filterCrates,currentCrate){const lowerQuery=query.toLowerCase();const aliases=[];const crateAliases=[];if(filterCrates!==null){if(ALIASES.has(filterCrates)&&ALIASES.get(filterCrates).has(lowerQuery)){const query_aliases=ALIASES.get(filterCrates).get(lowerQuery);for(const alias of query_aliases){aliases.push(createAliasFromItem(searchIndex[alias]))}}}else{for(const[crate,crateAliasesIndex]of ALIASES){if(crateAliasesIndex.has(lowerQuery)){const pushTo=crate===currentCrate?crateAliases:aliases;const query_aliases=crateAliasesIndex.get(lowerQuery);for(const alias of query_aliases){pushTo.push(createAliasFromItem(searchIndex[alias]))}}}}const sortFunc=(aaa,bbb)=>{if(aaa.path{alias.alias=query;const res=buildHrefAndPath(alias);alias.displayPath=pathSplitter(res[0]);alias.fullPath=alias.displayPath+alias.name;alias.href=res[1];ret.others.unshift(alias);if(ret.others.length>MAX_RESULTS){ret.others.pop()}};aliases.forEach(pushFunc);crateAliases.forEach(pushFunc)}function addIntoResults(results,fullId,id,index,dist,path_dist,maxEditDistance){if(dist<=maxEditDistance||index!==-1){if(results.has(fullId)){const result=results.get(fullId);if(result.dontValidate||result.dist<=dist){return}}results.set(fullId,{id:id,index:index,dontValidate:parsedQuery.literalSearch,dist:dist,path_dist:path_dist,})}}function handleSingleArg(row,pos,elem,results_others,results_in_args,results_returned,maxEditDistance,){if(!row||(filterCrates!==null&&row.crate!==filterCrates)){return}let path_dist=0;const fullId=row.id;const tfpDist=compareTypeFingerprints(fullId,parsedQuery.typeFingerprint,);if(tfpDist!==null){const in_args=row.type&&row.type.inputs&&checkIfInList(row.type.inputs,elem,row.type.where_clause,null,0);const returned=row.type&&row.type.output&&checkIfInList(row.type.output,elem,row.type.where_clause,null,0);if(in_args){results_in_args.max_dist=Math.max(results_in_args.max_dist||0,tfpDist);const maxDist=results_in_args.sizenormalizedIndex&&normalizedIndex!==-1)){index=normalizedIndex}if(elem.fullPath.length>1){path_dist=checkPath(elem.pathWithoutLast,row);if(path_dist===null){return}}if(parsedQuery.literalSearch){if(row.word===elem.pathLast){addIntoResults(results_others,fullId,pos,index,0,path_dist)}return}const dist=editDistance(row.normalizedName,elem.normalizedPathLast,maxEditDistance);if(index===-1&&dist>maxEditDistance){return}addIntoResults(results_others,fullId,pos,index,dist,path_dist,maxEditDistance)}function handleArgs(row,pos,results){if(!row||(filterCrates!==null&&row.crate!==filterCrates)||!row.type){return}const tfpDist=compareTypeFingerprints(row.id,parsedQuery.typeFingerprint,);if(tfpDist===null){return}if(results.size>=MAX_RESULTS&&tfpDist>results.max_dist){return}if(!unifyFunctionTypes(row.type.inputs,parsedQuery.elems,row.type.where_clause,null,mgens=>{return unifyFunctionTypes(row.type.output,parsedQuery.returned,row.type.where_clause,mgens,null,0,)},0,)){return}results.max_dist=Math.max(results.max_dist||0,tfpDist);addIntoResults(results,row.id,pos,0,tfpDist,0,Number.MAX_VALUE)}function innerRunQuery(){const queryLen=parsedQuery.elems.reduce((acc,next)=>acc+next.pathLast.length,0)+parsedQuery.returned.reduce((acc,next)=>acc+next.pathLast.length,0);const maxEditDistance=Math.floor(queryLen/3);const genericSymbols=new Map();function convertNameToId(elem,isAssocType){if(typeNameIdMap.has(elem.normalizedPathLast)&&(isAssocType||!typeNameIdMap.get(elem.normalizedPathLast).assocOnly)){elem.id=typeNameIdMap.get(elem.normalizedPathLast).id}else if(!parsedQuery.literalSearch){let match=null;let matchDist=maxEditDistance+1;let matchName="";for(const[name,{id,assocOnly}]of typeNameIdMap){const dist=editDistance(name,elem.normalizedPathLast,maxEditDistance);if(dist<=matchDist&&dist<=maxEditDistance&&(isAssocType||!assocOnly)){if(dist===matchDist&&matchName>name){continue}match=id;matchDist=dist;matchName=name}}if(match!==null){parsedQuery.correction=matchName}elem.id=match}if((elem.id===null&&parsedQuery.totalElems>1&&elem.typeFilter===-1&&elem.generics.length===0&&elem.bindings.size===0)||elem.typeFilter===TY_GENERIC){if(genericSymbols.has(elem.name)){elem.id=genericSymbols.get(elem.name)}else{elem.id=-(genericSymbols.size+1);genericSymbols.set(elem.name,elem.id)}if(elem.typeFilter===-1&&elem.name.length>=3){const maxPartDistance=Math.floor(elem.name.length/3);let matchDist=maxPartDistance+1;let matchName="";for(const name of typeNameIdMap.keys()){const dist=editDistance(name,elem.name,maxPartDistance);if(dist<=matchDist&&dist<=maxPartDistance){if(dist===matchDist&&matchName>name){continue}matchDist=dist;matchName=name}}if(matchName!==""){parsedQuery.proposeCorrectionFrom=elem.name;parsedQuery.proposeCorrectionTo=matchName}}elem.typeFilter=TY_GENERIC}if(elem.generics.length>0&&elem.typeFilter===TY_GENERIC){parsedQuery.error=["Generic type parameter ",elem.name," does not accept generic parameters",]}for(const elem2 of elem.generics){convertNameToId(elem2)}elem.bindings=new Map(Array.from(elem.bindings.entries()).map(entry=>{const[name,constraints]=entry;if(!typeNameIdMap.has(name)){parsedQuery.error=["Type parameter ",name," does not exist",];return[null,[]]}for(const elem2 of constraints){convertNameToId(elem2)}return[typeNameIdMap.get(name).id,constraints]}),)}const fps=new Set();for(const elem of parsedQuery.elems){convertNameToId(elem);buildFunctionTypeFingerprint(elem,parsedQuery.typeFingerprint,fps)}for(const elem of parsedQuery.returned){convertNameToId(elem);buildFunctionTypeFingerprint(elem,parsedQuery.typeFingerprint,fps)}if(parsedQuery.foundElems===1&&parsedQuery.returned.length===0){if(parsedQuery.elems.length===1){const elem=parsedQuery.elems[0];for(let i=0,nSearchIndex=searchIndex.length;i0){const sortQ=(a,b)=>{const ag=a.generics.length===0&&a.bindings.size===0;const bg=b.generics.length===0&&b.bindings.size===0;if(ag!==bg){return ag-bg}const ai=a.id>0;const bi=b.id>0;return ai-bi};parsedQuery.elems.sort(sortQ);parsedQuery.returned.sort(sortQ);for(let i=0,nSearchIndex=searchIndex.length;i{const descs=await Promise.all(list.map(result=>{return searchIndexEmptyDesc.get(result.crate).contains(result.bitIndex)?"":searchState.loadDesc(result)}));for(const[i,result]of list.entries()){result.desc=descs[i]}}));if(parsedQuery.error!==null&&ret.others.length!==0){ret.query.error=null}return ret}function nextTab(direction){const next=(searchState.currentTab+direction+3)%searchState.focusedByTab.length;searchState.focusedByTab[searchState.currentTab]=document.activeElement;printTab(next);focusSearchResult()}function focusSearchResult(){const target=searchState.focusedByTab[searchState.currentTab]||document.querySelectorAll(".search-results.active a").item(0)||document.querySelectorAll("#search-tabs button").item(searchState.currentTab);searchState.focusedByTab[searchState.currentTab]=null;if(target){target.focus()}}function buildHrefAndPath(item){let displayPath;let href;const type=itemTypes[item.ty];const name=item.name;let path=item.path;let exactPath=item.exactPath;if(type==="mod"){displayPath=path+"::";href=ROOT_PATH+path.replace(/::/g,"/")+"/"+name+"/index.html"}else if(type==="import"){displayPath=item.path+"::";href=ROOT_PATH+item.path.replace(/::/g,"/")+"/index.html#reexport."+name}else if(type==="primitive"||type==="keyword"){displayPath="";href=ROOT_PATH+path.replace(/::/g,"/")+"/"+type+"."+name+".html"}else if(type==="externcrate"){displayPath="";href=ROOT_PATH+name+"/index.html"}else if(item.parent!==undefined){const myparent=item.parent;let anchor=type+"."+name;const parentType=itemTypes[myparent.ty];let pageType=parentType;let pageName=myparent.name;exactPath=`${myparent.exactPath}::${myparent.name}`;if(parentType==="primitive"){displayPath=myparent.name+"::"}else if(type==="structfield"&&parentType==="variant"){const enumNameIdx=item.path.lastIndexOf("::");const enumName=item.path.substr(enumNameIdx+2);path=item.path.substr(0,enumNameIdx);displayPath=path+"::"+enumName+"::"+myparent.name+"::";anchor="variant."+myparent.name+".field."+name;pageType="enum";pageName=enumName}else{displayPath=path+"::"+myparent.name+"::"}if(item.implDisambiguator!==null){anchor=item.implDisambiguator+"/"+anchor}href=ROOT_PATH+path.replace(/::/g,"/")+"/"+pageType+"."+pageName+".html#"+anchor}else{displayPath=item.path+"::";href=ROOT_PATH+item.path.replace(/::/g,"/")+"/"+type+"."+name+".html"}return[displayPath,href,`${exactPath}::${name}`]}function pathSplitter(path){const tmp=""+path.replace(/::/g,"::");if(tmp.endsWith("")){return tmp.slice(0,tmp.length-6)}return tmp}async function addTab(array,query,display){const extraClass=display?" active":"";const output=document.createElement("div");if(array.length>0){output.className="search-results "+extraClass;for(const item of array){const name=item.name;const type=itemTypes[item.ty];const longType=longItemTypes[item.ty];const typeName=longType.length!==0?`${longType}`:"?";const link=document.createElement("a");link.className="result-"+type;link.href=item.href;const resultName=document.createElement("div");resultName.className="result-name";resultName.insertAdjacentHTML("beforeend",`${typeName}`);link.appendChild(resultName);let alias=" ";if(item.is_alias){alias=`
\ +${item.alias} - see \ +
`}resultName.insertAdjacentHTML("beforeend",`
${alias}\ +${item.displayPath}${name}\ +
`);const description=document.createElement("div");description.className="desc";description.insertAdjacentHTML("beforeend",item.desc);link.appendChild(description);output.appendChild(link)}}else if(query.error===null){output.className="search-failed"+extraClass;output.innerHTML="No results :(
"+"Try on DuckDuckGo?

"+"Or try looking in one of these:"}return[output,array.length]}function makeTabHeader(tabNb,text,nbElems){const fmtNbElems=nbElems<10?`\u{2007}(${nbElems})\u{2007}\u{2007}`:nbElems<100?`\u{2007}(${nbElems})\u{2007}`:`\u{2007}(${nbElems})`;if(searchState.currentTab===tabNb){return""}return""}async function showResults(results,go_to_first,filterCrates){const search=searchState.outputElement();if(go_to_first||(results.others.length===1&&getSettingValue("go-to-only-result")==="true")){window.onunload=()=>{};searchState.removeQueryParameters();const elem=document.createElement("a");elem.href=results.others[0].href;removeClass(elem,"active");document.body.appendChild(elem);elem.click();return}if(results.query===undefined){results.query=parseQuery(searchState.input.value)}currentResults=results.query.userQuery;const[ret_others,ret_in_args,ret_returned]=await Promise.all([addTab(results.others,results.query,true),addTab(results.in_args,results.query,false),addTab(results.returned,results.query,false),]);let currentTab=searchState.currentTab;if((currentTab===0&&ret_others[1]===0)||(currentTab===1&&ret_in_args[1]===0)||(currentTab===2&&ret_returned[1]===0)){if(ret_others[1]!==0){currentTab=0}else if(ret_in_args[1]!==0){currentTab=1}else if(ret_returned[1]!==0){currentTab=2}}let crates="";if(rawSearchIndex.size>1){crates=" in 
"}let output=`

Results${crates}

`;if(results.query.error!==null){const error=results.query.error;error.forEach((value,index)=>{value=value.split("<").join("<").split(">").join(">");if(index%2!==0){error[index]=`${value.replaceAll(" ", " ")}`}else{error[index]=value}});output+=`

Query parser error: "${error.join("")}".

`;output+="
"+makeTabHeader(0,"In Names",ret_others[1])+"
";currentTab=0}else if(results.query.foundElems<=1&&results.query.returned.length===0){output+="
"+makeTabHeader(0,"In Names",ret_others[1])+makeTabHeader(1,"In Parameters",ret_in_args[1])+makeTabHeader(2,"In Return Types",ret_returned[1])+"
"}else{const signatureTabTitle=results.query.elems.length===0?"In Function Return Types":results.query.returned.length===0?"In Function Parameters":"In Function Signatures";output+="
"+makeTabHeader(0,signatureTabTitle,ret_others[1])+"
";currentTab=0}if(results.query.correction!==null){const orig=results.query.returned.length>0?results.query.returned[0].name:results.query.elems[0].name;output+="

"+`Type "${orig}" not found. `+"Showing results for closest type name "+`"${results.query.correction}" instead.

`}if(results.query.proposeCorrectionFrom!==null){const orig=results.query.proposeCorrectionFrom;const targ=results.query.proposeCorrectionTo;output+="

"+`Type "${orig}" not found and used as generic parameter. `+`Consider searching for "${targ}" instead.

`}const resultsElem=document.createElement("div");resultsElem.id="results";resultsElem.appendChild(ret_others[0]);resultsElem.appendChild(ret_in_args[0]);resultsElem.appendChild(ret_returned[0]);search.innerHTML=output;const crateSearch=document.getElementById("crate-search");if(crateSearch){crateSearch.addEventListener("input",updateCrate)}search.appendChild(resultsElem);searchState.showResults(search);const elems=document.getElementById("search-tabs").childNodes;searchState.focusedByTab=[];let i=0;for(const elem of elems){const j=i;elem.onclick=()=>printTab(j);searchState.focusedByTab.push(null);i+=1}printTab(currentTab)}function updateSearchHistory(url){if(!browserSupportsHistoryApi()){return}const params=searchState.getQueryStringParams();if(!history.state&&!params.search){history.pushState(null,"",url)}else{history.replaceState(null,"",url)}}async function search(forced){const query=parseQuery(searchState.input.value.trim());let filterCrates=getFilterCrates();if(!forced&&query.userQuery===currentResults){if(query.userQuery.length>0){putBackSearch()}return}searchState.setLoadingSearch();const params=searchState.getQueryStringParams();if(filterCrates===null&¶ms["filter-crate"]!==undefined){filterCrates=params["filter-crate"]}searchState.title="Results for "+query.original+" - Rust";updateSearchHistory(buildUrl(query.original,filterCrates));await showResults(await execQuery(query,filterCrates,window.currentCrate),params.go_to_first,filterCrates)}function buildItemSearchTypeAll(types,lowercasePaths){return types.length>0?types.map(type=>buildItemSearchType(type,lowercasePaths)):EMPTY_GENERICS_ARRAY}const EMPTY_BINDINGS_MAP=new Map();const EMPTY_GENERICS_ARRAY=[];let TYPES_POOL=new Map();function buildItemSearchType(type,lowercasePaths,isAssocType){const PATH_INDEX_DATA=0;const GENERICS_DATA=1;const BINDINGS_DATA=2;let pathIndex,generics,bindings;if(typeof type==="number"){pathIndex=type;generics=EMPTY_GENERICS_ARRAY;bindings=EMPTY_BINDINGS_MAP}else{pathIndex=type[PATH_INDEX_DATA];generics=buildItemSearchTypeAll(type[GENERICS_DATA],lowercasePaths,);if(type.length>BINDINGS_DATA&&type[BINDINGS_DATA].length>0){bindings=new Map(type[BINDINGS_DATA].map(binding=>{const[assocType,constraints]=binding;return[buildItemSearchType(assocType,lowercasePaths,true).id,buildItemSearchTypeAll(constraints,lowercasePaths),]}))}else{bindings=EMPTY_BINDINGS_MAP}}let result;if(pathIndex<0){result={id:pathIndex,ty:TY_GENERIC,path:null,exactPath:null,generics,bindings,}}else if(pathIndex===0){result={id:null,ty:null,path:null,exactPath:null,generics,bindings,}}else{const item=lowercasePaths[pathIndex-1];result={id:buildTypeMapIndex(item.name,isAssocType),ty:item.ty,path:item.path,exactPath:item.exactPath,generics,bindings,}}const cr=TYPES_POOL.get(result.id);if(cr){if(cr.generics.length===result.generics.length&&cr.generics!==result.generics&&cr.generics.every((x,i)=>result.generics[i]===x)){result.generics=cr.generics}if(cr.bindings.size===result.bindings.size&&cr.bindings!==result.bindings){let ok=true;for(const[k,v]of cr.bindings.entries()){const v2=result.bindings.get(v);if(!v2){ok=false;break}if(v!==v2&&v.length===v2.length&&v.every((x,i)=>v2[i]===x)){result.bindings.set(k,v)}else if(v!==v2){ok=false;break}}if(ok){result.bindings=cr.bindings}}if(cr.ty===result.ty&&cr.path===result.path&&cr.bindings===result.bindings&&cr.generics===result.generics&&cr.ty===result.ty){return cr}}TYPES_POOL.set(result.id,result);return result}function buildFunctionSearchTypeCallback(lowercasePaths){return functionSearchType=>{if(functionSearchType===0){return null}const INPUTS_DATA=0;const OUTPUT_DATA=1;let inputs,output;if(typeof functionSearchType[INPUTS_DATA]==="number"){inputs=[buildItemSearchType(functionSearchType[INPUTS_DATA],lowercasePaths)]}else{inputs=buildItemSearchTypeAll(functionSearchType[INPUTS_DATA],lowercasePaths,)}if(functionSearchType.length>1){if(typeof functionSearchType[OUTPUT_DATA]==="number"){output=[buildItemSearchType(functionSearchType[OUTPUT_DATA],lowercasePaths)]}else{output=buildItemSearchTypeAll(functionSearchType[OUTPUT_DATA],lowercasePaths,)}}else{output=[]}const where_clause=[];const l=functionSearchType.length;for(let i=2;i{k=(~~k+0x7ed55d16)+(k<<12);k=(k ^ 0xc761c23c)^(k>>>19);k=(~~k+0x165667b1)+(k<<5);k=(~~k+0xd3a2646c)^(k<<9);k=(~~k+0xfd7046c5)+(k<<3);return(k ^ 0xb55a4f09)^(k>>>16)};const hashint2=k=>{k=~k+(k<<15);k ^=k>>>12;k+=k<<2;k ^=k>>>4;k=Math.imul(k,2057);return k ^(k>>16)};if(input!==null){const h0a=hashint1(input);const h0b=hashint2(input);const h1a=~~(h0a+Math.imul(h0b,2));const h1b=~~(h0a+Math.imul(h0b,3));const h2a=~~(h0a+Math.imul(h0b,4));const h2b=~~(h0a+Math.imul(h0b,5));output[0]|=(1<<(h0a%32))|(1<<(h1b%32));output[1]|=(1<<(h1a%32))|(1<<(h2b%32));output[2]|=(1<<(h2a%32))|(1<<(h0b%32));fps.add(input)}for(const g of type.generics){buildFunctionTypeFingerprint(g,output,fps)}const fb={id:null,ty:0,generics:EMPTY_GENERICS_ARRAY,bindings:EMPTY_BINDINGS_MAP,};for(const[k,v]of type.bindings.entries()){fb.id=k;fb.generics=v;buildFunctionTypeFingerprint(fb,output,fps)}output[3]=fps.size}function compareTypeFingerprints(fullId,queryFingerprint){const fh0=functionTypeFingerprint[fullId*4];const fh1=functionTypeFingerprint[(fullId*4)+1];const fh2=functionTypeFingerprint[(fullId*4)+2];const[qh0,qh1,qh2]=queryFingerprint;const[in0,in1,in2]=[fh0&qh0,fh1&qh1,fh2&qh2];if((in0 ^ qh0)||(in1 ^ qh1)||(in2 ^ qh2)){return null}return functionTypeFingerprint[(fullId*4)+3]}class VlqHexDecoder{constructor(string,cons){this.string=string;this.cons=cons;this.offset=0;this.backrefQueue=[]}decodeList(){const cb="}".charCodeAt(0);let c=this.string.charCodeAt(this.offset);const ret=[];while(c!==cb){ret.push(this.decode());c=this.string.charCodeAt(this.offset)}this.offset+=1;return ret}decode(){const[ob,la]=["{","`"].map(c=>c.charCodeAt(0));let n=0;let c=this.string.charCodeAt(this.offset);if(c===ob){this.offset+=1;return this.decodeList()}while(c>1];this.offset+=1;return sign?-value:value}next(){const c=this.string.charCodeAt(this.offset);const[zero,ua,la]=["0","@","`"].map(c=>c.charCodeAt(0));if(c>=zero&&c16){this.backrefQueue.pop()}return result}}class RoaringBitmap{constructor(str){const strdecoded=atob(str);const u8array=new Uint8Array(strdecoded.length);for(let j=0;j=4){offsets=[];for(let j=0;j>3]&(1<<(j&0x7))){const runcount=(u8array[i]|(u8array[i+1]<<8));i+=2;this.containers.push(new RoaringBitmapRun(runcount,u8array.slice(i,i+(runcount*4)),));i+=runcount*4}else if(this.cardinalities[j]>=4096){this.containers.push(new RoaringBitmapBits(u8array.slice(i,i+8192)));i+=8192}else{const end=this.cardinalities[j]*2;this.containers.push(new RoaringBitmapArray(this.cardinalities[j],u8array.slice(i,i+end),));i+=end}}}contains(keyvalue){const key=keyvalue>>16;const value=keyvalue&0xFFFF;for(let i=0;i=start&&value<=(start+lenm1)){return true}}return false}}class RoaringBitmapArray{constructor(cardinality,array){this.cardinality=cardinality;this.array=array}contains(value){const l=this.cardinality*2;for(let i=0;i>3]&(1<<(value&7)))}}function buildIndex(rawSearchIndex){searchIndex=[];searchIndexDeprecated=new Map();searchIndexEmptyDesc=new Map();const charA="A".charCodeAt(0);let currentIndex=0;let id=0;for(const crate of rawSearchIndex.values()){id+=crate.t.length+1}functionTypeFingerprint=new Uint32Array((id+1)*4);id=0;for(const[crate,crateCorpus]of rawSearchIndex){const itemDescShardDecoder=new VlqHexDecoder(crateCorpus.D,noop=>noop);let descShard={crate,shard:0,start:0,len:itemDescShardDecoder.next(),promise:null,resolve:null,};const descShardList=[descShard];searchIndexDeprecated.set(crate,new RoaringBitmap(crateCorpus.c));searchIndexEmptyDesc.set(crate,new RoaringBitmap(crateCorpus.e));let descIndex=0;const crateRow={crate,ty:3,name:crate,path:"",descShard,descIndex,exactPath:"",desc:crateCorpus.doc,parent:undefined,type:null,id,word:crate,normalizedName:crate.indexOf("_")===-1?crate:crate.replace(/_/g,""),bitIndex:0,implDisambiguator:null,};id+=1;searchIndex.push(crateRow);currentIndex+=1;if(!searchIndexEmptyDesc.get(crate).contains(0)){descIndex+=1}const itemTypes=crateCorpus.t;const itemNames=crateCorpus.n;const itemPaths=new Map(crateCorpus.q);const itemReexports=new Map(crateCorpus.r);const itemParentIdxs=crateCorpus.i;const implDisambiguator=new Map(crateCorpus.b);const paths=crateCorpus.p;const aliases=crateCorpus.a;const lowercasePaths=[];const itemFunctionDecoder=new VlqHexDecoder(crateCorpus.f,buildFunctionSearchTypeCallback(lowercasePaths),);let len=paths.length;let lastPath=itemPaths.get(0);for(let i=0;i2){path=itemPaths.has(elem[2])?itemPaths.get(elem[2]):lastPath;lastPath=path}const exactPath=elem.length>3?itemPaths.get(elem[3]):path;lowercasePaths.push({ty,name:name.toLowerCase(),path,exactPath});paths[i]={ty,name,path,exactPath}}lastPath="";len=itemTypes.length;for(let i=0;i=descShard.len&&!searchIndexEmptyDesc.get(crate).contains(bitIndex)){descShard={crate,shard:descShard.shard+1,start:descShard.start+descShard.len,len:itemDescShardDecoder.next(),promise:null,resolve:null,};descIndex=0;descShardList.push(descShard)}let word="";if(typeof itemNames[i]==="string"){word=itemNames[i].toLowerCase()}const path=itemPaths.has(i)?itemPaths.get(i):lastPath;const type=itemFunctionDecoder.next();if(type!==null){if(type){const fp=functionTypeFingerprint.subarray(id*4,(id+1)*4);const fps=new Set();for(const t of type.inputs){buildFunctionTypeFingerprint(t,fp,fps)}for(const t of type.output){buildFunctionTypeFingerprint(t,fp,fps)}for(const w of type.where_clause){for(const t of w){buildFunctionTypeFingerprint(t,fp,fps)}}}}const row={crate,ty:itemTypes.charCodeAt(i)-charA,name:itemNames[i],path,descShard,descIndex,exactPath:itemReexports.has(i)?itemPaths.get(itemReexports.get(i)):path,parent:itemParentIdxs[i]>0?paths[itemParentIdxs[i]-1]:undefined,type,id,word,normalizedName:word.indexOf("_")===-1?word:word.replace(/_/g,""),bitIndex,implDisambiguator:implDisambiguator.has(i)?implDisambiguator.get(i):null,};id+=1;searchIndex.push(row);lastPath=row.path;if(!searchIndexEmptyDesc.get(crate).contains(bitIndex)){descIndex+=1}}if(aliases){const currentCrateAliases=new Map();ALIASES.set(crate,currentCrateAliases);for(const alias_name in aliases){if(!Object.prototype.hasOwnProperty.call(aliases,alias_name)){continue}let currentNameAliases;if(currentCrateAliases.has(alias_name)){currentNameAliases=currentCrateAliases.get(alias_name)}else{currentNameAliases=[];currentCrateAliases.set(alias_name,currentNameAliases)}for(const local_alias of aliases[alias_name]){currentNameAliases.push(local_alias+currentIndex)}}}currentIndex+=itemTypes.length;searchState.descShards.set(crate,descShardList)}TYPES_POOL=new Map()}function onSearchSubmit(e){e.preventDefault();searchState.clearInputTimeout();search()}function putBackSearch(){const search_input=searchState.input;if(!searchState.input){return}if(search_input.value!==""&&!searchState.isDisplayed()){searchState.showResults();if(browserSupportsHistoryApi()){history.replaceState(null,"",buildUrl(search_input.value,getFilterCrates()))}document.title=searchState.title}}function registerSearchEvents(){const params=searchState.getQueryStringParams();if(searchState.input.value===""){searchState.input.value=params.search||""}const searchAfter500ms=()=>{searchState.clearInputTimeout();if(searchState.input.value.length===0){searchState.hideResults()}else{searchState.timeout=setTimeout(search,500)}};searchState.input.onkeyup=searchAfter500ms;searchState.input.oninput=searchAfter500ms;document.getElementsByClassName("search-form")[0].onsubmit=onSearchSubmit;searchState.input.onchange=e=>{if(e.target!==document.activeElement){return}searchState.clearInputTimeout();setTimeout(search,0)};searchState.input.onpaste=searchState.input.onchange;searchState.outputElement().addEventListener("keydown",e=>{if(e.altKey||e.ctrlKey||e.shiftKey||e.metaKey){return}if(e.which===38){const previous=document.activeElement.previousElementSibling;if(previous){previous.focus()}else{searchState.focus()}e.preventDefault()}else if(e.which===40){const next=document.activeElement.nextElementSibling;if(next){next.focus()}const rect=document.activeElement.getBoundingClientRect();if(window.innerHeight-rect.bottom{if(e.which===40){focusSearchResult();e.preventDefault()}});searchState.input.addEventListener("focus",()=>{putBackSearch()});searchState.input.addEventListener("blur",()=>{searchState.input.placeholder=searchState.input.origPlaceholder});if(browserSupportsHistoryApi()){const previousTitle=document.title;window.addEventListener("popstate",e=>{const params=searchState.getQueryStringParams();document.title=previousTitle;currentResults=null;if(params.search&¶ms.search.length>0){searchState.input.value=params.search;e.preventDefault();search()}else{searchState.input.value="";searchState.hideResults()}})}window.onpageshow=()=>{const qSearch=searchState.getQueryStringParams().search;if(searchState.input.value===""&&qSearch){searchState.input.value=qSearch}search()}}function updateCrate(ev){if(ev.target.value==="all crates"){const query=searchState.input.value.trim();updateSearchHistory(buildUrl(query,null))}currentResults=null;search(true)}buildIndex(rawSearchIndex);if(typeof window!=="undefined"){registerSearchEvents();if(window.searchState.getQueryStringParams().search){search()}}if(typeof exports!=="undefined"){exports.initSearch=initSearch;exports.execQuery=execQuery;exports.parseQuery=parseQuery}}if(typeof window!=="undefined"){window.initSearch=initSearch;if(window.searchIndex!==undefined){initSearch(window.searchIndex)}}else{initSearch(new Map())}})() \ No newline at end of file diff --git a/static.files/settings-4313503d2e1961c2.js b/static.files/settings-4313503d2e1961c2.js new file mode 100644 index 0000000..ab425fe --- /dev/null +++ b/static.files/settings-4313503d2e1961c2.js @@ -0,0 +1,17 @@ +"use strict";(function(){const isSettingsPage=window.location.pathname.endsWith("/settings.html");function changeSetting(settingName,value){if(settingName==="theme"){const useSystem=value==="system preference"?"true":"false";updateLocalStorage("use-system-theme",useSystem)}updateLocalStorage(settingName,value);switch(settingName){case"theme":case"preferred-dark-theme":case"preferred-light-theme":updateTheme();updateLightAndDark();break;case"line-numbers":if(value===true){window.rustdoc_add_line_numbers_to_examples()}else{window.rustdoc_remove_line_numbers_from_examples()}break;case"hide-sidebar":if(value===true){addClass(document.documentElement,"hide-sidebar")}else{removeClass(document.documentElement,"hide-sidebar")}break}}function showLightAndDark(){removeClass(document.getElementById("preferred-light-theme"),"hidden");removeClass(document.getElementById("preferred-dark-theme"),"hidden")}function hideLightAndDark(){addClass(document.getElementById("preferred-light-theme"),"hidden");addClass(document.getElementById("preferred-dark-theme"),"hidden")}function updateLightAndDark(){const useSystem=getSettingValue("use-system-theme");if(useSystem==="true"||(useSystem===null&&getSettingValue("theme")===null)){showLightAndDark()}else{hideLightAndDark()}}function setEvents(settingsElement){updateLightAndDark();onEachLazy(settingsElement.querySelectorAll("input[type=\"checkbox\"]"),toggle=>{const settingId=toggle.id;const settingValue=getSettingValue(settingId);if(settingValue!==null){toggle.checked=settingValue==="true"}toggle.onchange=()=>{changeSetting(toggle.id,toggle.checked)}});onEachLazy(settingsElement.querySelectorAll("input[type=\"radio\"]"),elem=>{const settingId=elem.name;let settingValue=getSettingValue(settingId);if(settingId==="theme"){const useSystem=getSettingValue("use-system-theme");if(useSystem==="true"||settingValue===null){settingValue=useSystem==="false"?"light":"system preference"}}if(settingValue!==null&&settingValue!=="null"){elem.checked=settingValue===elem.value}elem.addEventListener("change",ev=>{changeSetting(ev.target.name,ev.target.value)})})}function buildSettingsPageSections(settings){let output="";for(const setting of settings){const js_data_name=setting["js_name"];const setting_name=setting["name"];if(setting["options"]!==undefined){output+=`\ +
+
${setting_name}
+
`;onEach(setting["options"],option=>{const checked=option===setting["default"]?" checked":"";const full=`${js_data_name}-${option.replace(/ /g,"-")}`;output+=`\ + `});output+=`\ +
+
`}else{const checked=setting["default"]===true?" checked":"";output+=`\ +
\ + \ +
`}}return output}function buildSettingsPage(){const theme_names=getVar("themes").split(",").filter(t=>t);theme_names.push("light","dark","ayu");const settings=[{"name":"Theme","js_name":"theme","default":"system preference","options":theme_names.concat("system preference"),},{"name":"Preferred light theme","js_name":"preferred-light-theme","default":"light","options":theme_names,},{"name":"Preferred dark theme","js_name":"preferred-dark-theme","default":"dark","options":theme_names,},{"name":"Auto-hide item contents for large items","js_name":"auto-hide-large-items","default":true,},{"name":"Auto-hide item methods' documentation","js_name":"auto-hide-method-docs","default":false,},{"name":"Auto-hide trait implementation documentation","js_name":"auto-hide-trait-implementations","default":false,},{"name":"Directly go to item in search if there is only one result","js_name":"go-to-only-result","default":false,},{"name":"Show line numbers on code examples","js_name":"line-numbers","default":false,},{"name":"Hide persistent navigation bar","js_name":"hide-sidebar","default":false,},{"name":"Disable keyboard shortcuts","js_name":"disable-shortcuts","default":false,},];const elementKind=isSettingsPage?"section":"div";const innerHTML=`
${buildSettingsPageSections(settings)}
`;const el=document.createElement(elementKind);el.id="settings";if(!isSettingsPage){el.className="popover"}el.innerHTML=innerHTML;if(isSettingsPage){document.getElementById(MAIN_ID).appendChild(el)}else{el.setAttribute("tabindex","-1");getSettingsButton().appendChild(el)}return el}const settingsMenu=buildSettingsPage();function displaySettings(){settingsMenu.style.display="";onEachLazy(settingsMenu.querySelectorAll("input[type='checkbox']"),el=>{const val=getSettingValue(el.id);const checked=val==="true";if(checked!==el.checked&&val!==null){el.checked=checked}})}function settingsBlurHandler(event){blurHandler(event,getSettingsButton(),window.hidePopoverMenus)}if(isSettingsPage){getSettingsButton().onclick=event=>{event.preventDefault()}}else{const settingsButton=getSettingsButton();const settingsMenu=document.getElementById("settings");settingsButton.onclick=event=>{if(settingsMenu.contains(event.target)){return}event.preventDefault();const shouldDisplaySettings=settingsMenu.style.display==="none";window.hideAllModals();if(shouldDisplaySettings){displaySettings()}};settingsButton.onblur=settingsBlurHandler;settingsButton.querySelector("a").onblur=settingsBlurHandler;onEachLazy(settingsMenu.querySelectorAll("input"),el=>{el.onblur=settingsBlurHandler});settingsMenu.onblur=settingsBlurHandler}setTimeout(()=>{setEvents(settingsMenu);if(!isSettingsPage){displaySettings()}removeClass(getSettingsButton(),"rotate")},0)})() \ No newline at end of file diff --git a/static.files/src-script-e66d777a5a92e9b2.js b/static.files/src-script-e66d777a5a92e9b2.js new file mode 100644 index 0000000..d0aebb8 --- /dev/null +++ b/static.files/src-script-e66d777a5a92e9b2.js @@ -0,0 +1 @@ +"use strict";(function(){const rootPath=getVar("root-path");const NAME_OFFSET=0;const DIRS_OFFSET=1;const FILES_OFFSET=2;const RUSTDOC_MOBILE_BREAKPOINT=700;function closeSidebarIfMobile(){if(window.innerWidth{removeClass(document.documentElement,"src-sidebar-expanded");updateLocalStorage("source-sidebar-show","false")};window.rustdocShowSourceSidebar=()=>{addClass(document.documentElement,"src-sidebar-expanded");updateLocalStorage("source-sidebar-show","true")};window.rustdocToggleSrcSidebar=()=>{if(document.documentElement.classList.contains("src-sidebar-expanded")){window.rustdocCloseSourceSidebar()}else{window.rustdocShowSourceSidebar()}};function createSrcSidebar(){const container=document.querySelector("nav.sidebar");const sidebar=document.createElement("div");sidebar.id="src-sidebar";let hasFoundFile=false;for(const[key,source]of srcIndex){source[NAME_OFFSET]=key;hasFoundFile=createDirEntry(source,sidebar,"",hasFoundFile)}container.appendChild(sidebar);const selected_elem=sidebar.getElementsByClassName("selected")[0];if(typeof selected_elem!=="undefined"){selected_elem.focus()}}function highlightSrcLines(){const match=window.location.hash.match(/^#?(\d+)(?:-(\d+))?$/);if(!match){return}let from=parseInt(match[1],10);let to=from;if(typeof match[2]!=="undefined"){to=parseInt(match[2],10)}if(to{onEachLazy(e.getElementsByTagName("a"),i_e=>{removeClass(i_e,"line-highlighted")})});for(let i=from;i<=to;++i){elem=document.getElementById(i);if(!elem){break}addClass(elem,"line-highlighted")}}const handleSrcHighlight=(function(){let prev_line_id=0;const set_fragment=name=>{const x=window.scrollX,y=window.scrollY;if(browserSupportsHistoryApi()){history.replaceState(null,null,"#"+name);highlightSrcLines()}else{location.replace("#"+name)}window.scrollTo(x,y)};return ev=>{let cur_line_id=parseInt(ev.target.id,10);if(isNaN(cur_line_id)||ev.ctrlKey||ev.altKey||ev.metaKey){return}ev.preventDefault();if(ev.shiftKey&&prev_line_id){if(prev_line_id>cur_line_id){const tmp=prev_line_id;prev_line_id=cur_line_id;cur_line_id=tmp}set_fragment(prev_line_id+"-"+cur_line_id)}else{prev_line_id=cur_line_id;set_fragment(cur_line_id)}}}());window.addEventListener("hashchange",highlightSrcLines);onEachLazy(document.getElementsByClassName("src-line-numbers"),el=>{el.addEventListener("click",handleSrcHighlight)});highlightSrcLines();window.createSrcSidebar=createSrcSidebar})() \ No newline at end of file diff --git a/static.files/storage-118b08c4c78b968e.js b/static.files/storage-118b08c4c78b968e.js new file mode 100644 index 0000000..9818946 --- /dev/null +++ b/static.files/storage-118b08c4c78b968e.js @@ -0,0 +1,24 @@ +"use strict";const builtinThemes=["light","dark","ayu"];const darkThemes=["dark","ayu"];window.currentTheme=document.getElementById("themeStyle");const settingsDataset=(function(){const settingsElement=document.getElementById("default-settings");return settingsElement&&settingsElement.dataset?settingsElement.dataset:null})();function getSettingValue(settingName){const current=getCurrentValue(settingName);if(current===null&&settingsDataset!==null){const def=settingsDataset[settingName.replace(/-/g,"_")];if(def!==undefined){return def}}return current}const localStoredTheme=getSettingValue("theme");function hasClass(elem,className){return elem&&elem.classList&&elem.classList.contains(className)}function addClass(elem,className){if(elem&&elem.classList){elem.classList.add(className)}}function removeClass(elem,className){if(elem&&elem.classList){elem.classList.remove(className)}}function onEach(arr,func){for(const elem of arr){if(func(elem)){return true}}return false}function onEachLazy(lazyArray,func){return onEach(Array.prototype.slice.call(lazyArray),func)}function updateLocalStorage(name,value){try{window.localStorage.setItem("rustdoc-"+name,value)}catch(e){}}function getCurrentValue(name){try{return window.localStorage.getItem("rustdoc-"+name)}catch(e){return null}}const getVar=(function getVar(name){const el=document.querySelector("head > meta[name='rustdoc-vars']");return el?el.attributes["data-"+name].value:null});function switchTheme(newThemeName,saveTheme){const themeNames=getVar("themes").split(",").filter(t=>t);themeNames.push(...builtinThemes);if(themeNames.indexOf(newThemeName)===-1){return}if(saveTheme){updateLocalStorage("theme",newThemeName)}document.documentElement.setAttribute("data-theme",newThemeName);if(builtinThemes.indexOf(newThemeName)!==-1){if(window.currentTheme){window.currentTheme.parentNode.removeChild(window.currentTheme);window.currentTheme=null}}else{const newHref=getVar("root-path")+encodeURIComponent(newThemeName)+getVar("resource-suffix")+".css";if(!window.currentTheme){if(document.readyState==="loading"){document.write(``);window.currentTheme=document.getElementById("themeStyle")}else{window.currentTheme=document.createElement("link");window.currentTheme.rel="stylesheet";window.currentTheme.id="themeStyle";window.currentTheme.href=newHref;document.documentElement.appendChild(window.currentTheme)}}else if(newHref!==window.currentTheme.href){window.currentTheme.href=newHref}}}const updateTheme=(function(){const mql=window.matchMedia("(prefers-color-scheme: dark)");function updateTheme(){if(getSettingValue("use-system-theme")!=="false"){const lightTheme=getSettingValue("preferred-light-theme")||"light";const darkTheme=getSettingValue("preferred-dark-theme")||"dark";updateLocalStorage("use-system-theme","true");switchTheme(mql.matches?darkTheme:lightTheme,true)}else{switchTheme(getSettingValue("theme"),false)}}mql.addEventListener("change",updateTheme);return updateTheme})();if(getSettingValue("use-system-theme")!=="false"&&window.matchMedia){if(getSettingValue("use-system-theme")===null&&getSettingValue("preferred-dark-theme")===null&&darkThemes.indexOf(localStoredTheme)>=0){updateLocalStorage("preferred-dark-theme",localStoredTheme)}}updateTheme();if(getSettingValue("source-sidebar-show")==="true"){addClass(document.documentElement,"src-sidebar-expanded")}if(getSettingValue("hide-sidebar")==="true"){addClass(document.documentElement,"hide-sidebar")}function updateSidebarWidth(){const desktopSidebarWidth=getSettingValue("desktop-sidebar-width");if(desktopSidebarWidth&&desktopSidebarWidth!=="null"){document.documentElement.style.setProperty("--desktop-sidebar-width",desktopSidebarWidth+"px",)}const srcSidebarWidth=getSettingValue("src-sidebar-width");if(srcSidebarWidth&&srcSidebarWidth!=="null"){document.documentElement.style.setProperty("--src-sidebar-width",srcSidebarWidth+"px",)}}updateSidebarWidth();window.addEventListener("pageshow",ev=>{if(ev.persisted){setTimeout(updateTheme,0);setTimeout(updateSidebarWidth,0)}});class RustdocSearchElement extends HTMLElement{constructor(){super()}connectedCallback(){const rootPath=getVar("root-path");const currentCrate=getVar("current-crate");this.innerHTML=``}}window.customElements.define("rustdoc-search",RustdocSearchElement) \ No newline at end of file diff --git a/syn/all.html b/syn/all.html new file mode 100644 index 0000000..117ad6c --- /dev/null +++ b/syn/all.html @@ -0,0 +1 @@ +List of all items in this crate

List of all items

Structs

Enums

Traits

Macros

Functions

Type Aliases

\ No newline at end of file diff --git a/syn/attr/enum.AttrStyle.html b/syn/attr/enum.AttrStyle.html new file mode 100644 index 0000000..b476895 --- /dev/null +++ b/syn/attr/enum.AttrStyle.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/enum.AttrStyle.html...

+ + + \ No newline at end of file diff --git a/syn/attr/enum.Meta.html b/syn/attr/enum.Meta.html new file mode 100644 index 0000000..b7a97a3 --- /dev/null +++ b/syn/attr/enum.Meta.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/enum.Meta.html...

+ + + \ No newline at end of file diff --git a/syn/attr/struct.Attribute.html b/syn/attr/struct.Attribute.html new file mode 100644 index 0000000..2bf7df5 --- /dev/null +++ b/syn/attr/struct.Attribute.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.Attribute.html...

+ + + \ No newline at end of file diff --git a/syn/attr/struct.MetaList.html b/syn/attr/struct.MetaList.html new file mode 100644 index 0000000..5cb50de --- /dev/null +++ b/syn/attr/struct.MetaList.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.MetaList.html...

+ + + \ No newline at end of file diff --git a/syn/attr/struct.MetaNameValue.html b/syn/attr/struct.MetaNameValue.html new file mode 100644 index 0000000..8635acc --- /dev/null +++ b/syn/attr/struct.MetaNameValue.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.MetaNameValue.html...

+ + + \ No newline at end of file diff --git a/syn/buffer/index.html b/syn/buffer/index.html new file mode 100644 index 0000000..00f0ad3 --- /dev/null +++ b/syn/buffer/index.html @@ -0,0 +1,5 @@ +syn::buffer - Rust

Module syn::buffer

source ·
Expand description

A stably addressed token buffer supporting efficient traversal based on a +cheaply copyable cursor.

+

Structs§

  • A cheaply copyable cursor into a TokenBuffer.
  • A buffer that can be efficiently traversed multiple times, unlike +TokenStream which requires a deep copy in order to traverse more than +once.
\ No newline at end of file diff --git a/syn/buffer/sidebar-items.js b/syn/buffer/sidebar-items.js new file mode 100644 index 0000000..37915de --- /dev/null +++ b/syn/buffer/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":["Cursor","TokenBuffer"]}; \ No newline at end of file diff --git a/syn/buffer/struct.Cursor.html b/syn/buffer/struct.Cursor.html new file mode 100644 index 0000000..62916e5 --- /dev/null +++ b/syn/buffer/struct.Cursor.html @@ -0,0 +1,47 @@ +Cursor in syn::buffer - Rust

Struct syn::buffer::Cursor

source ·
pub struct Cursor<'a> { /* private fields */ }
Expand description

A cheaply copyable cursor into a TokenBuffer.

+

This cursor holds a shared reference into the immutable data which is used +internally to represent a TokenStream, and can be efficiently manipulated +and copied around.

+

An empty Cursor can be created directly, or one may create a TokenBuffer +object and get a cursor to its first token with begin().

+

Implementations§

source§

impl<'a> Cursor<'a>

source

pub fn empty() -> Self

Creates a cursor referencing a static empty TokenStream.

+
source

pub fn eof(self) -> bool

Checks whether the cursor is currently pointing at the end of its valid +scope.

+
source

pub fn group( + self, + delim: Delimiter +) -> Option<(Cursor<'a>, DelimSpan, Cursor<'a>)>

If the cursor is pointing at a Group with the given delimiter, returns +a cursor into that group and one pointing to the next TokenTree.

+
source

pub fn ident(self) -> Option<(Ident, Cursor<'a>)>

If the cursor is pointing at a Ident, returns it along with a cursor +pointing at the next TokenTree.

+
source

pub fn punct(self) -> Option<(Punct, Cursor<'a>)>

If the cursor is pointing at a Punct, returns it along with a cursor +pointing at the next TokenTree.

+
source

pub fn literal(self) -> Option<(Literal, Cursor<'a>)>

If the cursor is pointing at a Literal, return it along with a cursor +pointing at the next TokenTree.

+
source

pub fn lifetime(self) -> Option<(Lifetime, Cursor<'a>)>

If the cursor is pointing at a Lifetime, returns it along with a +cursor pointing at the next TokenTree.

+
source

pub fn token_stream(self) -> TokenStream

Copies all remaining tokens visible from this cursor into a +TokenStream.

+
source

pub fn token_tree(self) -> Option<(TokenTree, Cursor<'a>)>

If the cursor is pointing at a TokenTree, returns it along with a +cursor pointing at the next TokenTree.

+

Returns None if the cursor has reached the end of its stream.

+

This method does not treat None-delimited groups as transparent, and +will return a Group(None, ..) if the cursor is looking at one.

+
source

pub fn span(self) -> Span

Returns the Span of the current token, or Span::call_site() if this +cursor points to eof.

+

Trait Implementations§

source§

impl<'a> Clone for Cursor<'a>

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'a> PartialEq for Cursor<'a>

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl<'a> PartialOrd for Cursor<'a>

source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= +operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= +operator. Read more
source§

impl<'a> Copy for Cursor<'a>

source§

impl<'a> Eq for Cursor<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for Cursor<'a>

§

impl<'a> RefUnwindSafe for Cursor<'a>

§

impl<'a> !Send for Cursor<'a>

§

impl<'a> !Sync for Cursor<'a>

§

impl<'a> Unpin for Cursor<'a>

§

impl<'a> UnwindSafe for Cursor<'a>

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/buffer/struct.TokenBuffer.html b/syn/buffer/struct.TokenBuffer.html new file mode 100644 index 0000000..7267d50 --- /dev/null +++ b/syn/buffer/struct.TokenBuffer.html @@ -0,0 +1,20 @@ +TokenBuffer in syn::buffer - Rust

Struct syn::buffer::TokenBuffer

source ·
pub struct TokenBuffer { /* private fields */ }
Expand description

A buffer that can be efficiently traversed multiple times, unlike +TokenStream which requires a deep copy in order to traverse more than +once.

+

Implementations§

source§

impl TokenBuffer

source

pub fn new(stream: TokenStream) -> Self

Creates a TokenBuffer containing all the tokens from the input +proc_macro::TokenStream.

+
source

pub fn new2(stream: TokenStream) -> Self

Creates a TokenBuffer containing all the tokens from the input +proc_macro2::TokenStream.

+
source

pub fn begin(&self) -> Cursor<'_>

Creates a cursor referencing the first token in the buffer and able to +traverse until the end of the buffer.

+

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/data/enum.Fields.html b/syn/data/enum.Fields.html new file mode 100644 index 0000000..8bf0d85 --- /dev/null +++ b/syn/data/enum.Fields.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/enum.Fields.html...

+ + + \ No newline at end of file diff --git a/syn/data/struct.Field.html b/syn/data/struct.Field.html new file mode 100644 index 0000000..6965b83 --- /dev/null +++ b/syn/data/struct.Field.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.Field.html...

+ + + \ No newline at end of file diff --git a/syn/data/struct.FieldsNamed.html b/syn/data/struct.FieldsNamed.html new file mode 100644 index 0000000..d903eb2 --- /dev/null +++ b/syn/data/struct.FieldsNamed.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.FieldsNamed.html...

+ + + \ No newline at end of file diff --git a/syn/data/struct.FieldsUnnamed.html b/syn/data/struct.FieldsUnnamed.html new file mode 100644 index 0000000..c5eaeb2 --- /dev/null +++ b/syn/data/struct.FieldsUnnamed.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.FieldsUnnamed.html...

+ + + \ No newline at end of file diff --git a/syn/data/struct.Variant.html b/syn/data/struct.Variant.html new file mode 100644 index 0000000..ec277f7 --- /dev/null +++ b/syn/data/struct.Variant.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.Variant.html...

+ + + \ No newline at end of file diff --git a/syn/derive/enum.Data.html b/syn/derive/enum.Data.html new file mode 100644 index 0000000..c5c3ced --- /dev/null +++ b/syn/derive/enum.Data.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/enum.Data.html...

+ + + \ No newline at end of file diff --git a/syn/derive/struct.DataEnum.html b/syn/derive/struct.DataEnum.html new file mode 100644 index 0000000..c2f78ca --- /dev/null +++ b/syn/derive/struct.DataEnum.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.DataEnum.html...

+ + + \ No newline at end of file diff --git a/syn/derive/struct.DataStruct.html b/syn/derive/struct.DataStruct.html new file mode 100644 index 0000000..0f6a041 --- /dev/null +++ b/syn/derive/struct.DataStruct.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.DataStruct.html...

+ + + \ No newline at end of file diff --git a/syn/derive/struct.DataUnion.html b/syn/derive/struct.DataUnion.html new file mode 100644 index 0000000..e2c1c44 --- /dev/null +++ b/syn/derive/struct.DataUnion.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.DataUnion.html...

+ + + \ No newline at end of file diff --git a/syn/derive/struct.DeriveInput.html b/syn/derive/struct.DeriveInput.html new file mode 100644 index 0000000..02488b6 --- /dev/null +++ b/syn/derive/struct.DeriveInput.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.DeriveInput.html...

+ + + \ No newline at end of file diff --git a/syn/enum.AttrStyle.html b/syn/enum.AttrStyle.html new file mode 100644 index 0000000..d235ea9 --- /dev/null +++ b/syn/enum.AttrStyle.html @@ -0,0 +1,29 @@ +AttrStyle in syn - Rust

Enum syn::AttrStyle

source ·
pub enum AttrStyle {
+    Outer,
+    Inner(Not),
+}
Expand description

Distinguishes between attributes that decorate an item and attributes +that are contained within an item.

+

§Outer attributes

+
    +
  • #[repr(transparent)]
  • +
  • /// # Example
  • +
  • /** Please file an issue */
  • +
+

§Inner attributes

+
    +
  • #![feature(proc_macro)]
  • +
  • //! # Example
  • +
  • /*! Please file an issue */
  • +
+

Variants§

§

Outer

§

Inner(Not)

Trait Implementations§

source§

impl Clone for AttrStyle

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Copy for AttrStyle

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/enum.BinOp.html b/syn/enum.BinOp.html new file mode 100644 index 0000000..35c591d --- /dev/null +++ b/syn/enum.BinOp.html @@ -0,0 +1,73 @@ +BinOp in syn - Rust

Enum syn::BinOp

source ·
#[non_exhaustive]
pub enum BinOp { +
Show 28 variants Add(Plus), + Sub(Minus), + Mul(Star), + Div(Slash), + Rem(Percent), + And(AndAnd), + Or(OrOr), + BitXor(Caret), + BitAnd(And), + BitOr(Or), + Shl(Shl), + Shr(Shr), + Eq(EqEq), + Lt(Lt), + Le(Le), + Ne(Ne), + Ge(Ge), + Gt(Gt), + AddAssign(PlusEq), + SubAssign(MinusEq), + MulAssign(StarEq), + DivAssign(SlashEq), + RemAssign(PercentEq), + BitXorAssign(CaretEq), + BitAndAssign(AndEq), + BitOrAssign(OrEq), + ShlAssign(ShlEq), + ShrAssign(ShrEq), +
}
Expand description

A binary operator: +, +=, &.

+

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Add(Plus)

The + operator (addition)

+
§

Sub(Minus)

The - operator (subtraction)

+
§

Mul(Star)

The * operator (multiplication)

+
§

Div(Slash)

The / operator (division)

+
§

Rem(Percent)

The % operator (modulus)

+
§

And(AndAnd)

The && operator (logical and)

+
§

Or(OrOr)

The || operator (logical or)

+
§

BitXor(Caret)

The ^ operator (bitwise xor)

+
§

BitAnd(And)

The & operator (bitwise and)

+
§

BitOr(Or)

The | operator (bitwise or)

+
§

Shl(Shl)

The << operator (shift left)

+
§

Shr(Shr)

The >> operator (shift right)

+
§

Eq(EqEq)

The == operator (equality)

+
§

Lt(Lt)

The < operator (less than)

+
§

Le(Le)

The <= operator (less than or equal to)

+
§

Ne(Ne)

The != operator (not equal to)

+
§

Ge(Ge)

The >= operator (greater than or equal to)

+
§

Gt(Gt)

The > operator (greater than)

+
§

AddAssign(PlusEq)

The += operator

+
§

SubAssign(MinusEq)

The -= operator

+
§

MulAssign(StarEq)

The *= operator

+
§

DivAssign(SlashEq)

The /= operator

+
§

RemAssign(PercentEq)

The %= operator

+
§

BitXorAssign(CaretEq)

The ^= operator

+
§

BitAndAssign(AndEq)

The &= operator

+
§

BitOrAssign(OrEq)

The |= operator

+
§

ShlAssign(ShlEq)

The <<= operator

+
§

ShrAssign(ShrEq)

The >>= operator

+

Trait Implementations§

source§

impl Clone for BinOp

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Parse for BinOp

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for BinOp

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for BinOp

Auto Trait Implementations§

§

impl Freeze for BinOp

§

impl RefUnwindSafe for BinOp

§

impl !Send for BinOp

§

impl !Sync for BinOp

§

impl Unpin for BinOp

§

impl UnwindSafe for BinOp

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/enum.Data.html b/syn/enum.Data.html new file mode 100644 index 0000000..c31185b --- /dev/null +++ b/syn/enum.Data.html @@ -0,0 +1,19 @@ +Data in syn - Rust

Enum syn::Data

source ·
pub enum Data {
+    Struct(DataStruct),
+    Enum(DataEnum),
+    Union(DataUnion),
+}
Expand description

The storage of a struct, enum or union data structure.

+

§Syntax tree enum

+

This type is a syntax tree enum.

+

Variants§

Trait Implementations§

source§

impl Clone for Data

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

§

impl Freeze for Data

§

impl RefUnwindSafe for Data

§

impl !Send for Data

§

impl !Sync for Data

§

impl Unpin for Data

§

impl UnwindSafe for Data

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/enum.Expr.html b/syn/enum.Expr.html new file mode 100644 index 0000000..4607c2d --- /dev/null +++ b/syn/enum.Expr.html @@ -0,0 +1,248 @@ +Expr in syn - Rust

Enum syn::Expr

source ·
#[non_exhaustive]
pub enum Expr { +
Show 39 variants Array(ExprArray), + Assign(ExprAssign), + Async(ExprAsync), + Await(ExprAwait), + Binary(ExprBinary), + Block(ExprBlock), + Break(ExprBreak), + Call(ExprCall), + Cast(ExprCast), + Closure(ExprClosure), + Const(ExprConst), + Continue(ExprContinue), + Field(ExprField), + ForLoop(ExprForLoop), + Group(ExprGroup), + If(ExprIf), + Index(ExprIndex), + Infer(ExprInfer), + Let(ExprLet), + Lit(ExprLit), + Loop(ExprLoop), + Macro(ExprMacro), + Match(ExprMatch), + MethodCall(ExprMethodCall), + Paren(ExprParen), + Path(ExprPath), + Range(ExprRange), + Reference(ExprReference), + Repeat(ExprRepeat), + Return(ExprReturn), + Struct(ExprStruct), + Try(ExprTry), + TryBlock(ExprTryBlock), + Tuple(ExprTuple), + Unary(ExprUnary), + Unsafe(ExprUnsafe), + Verbatim(TokenStream), + While(ExprWhile), + Yield(ExprYield), +
}
Expand description

A Rust expression.

+

This type is available only if Syn is built with the "derive" or "full" +feature, but most of the variants are not available unless “full” is enabled.

+

§Syntax tree enums

+

This type is a syntax tree enum. In Syn this and other syntax tree enums +are designed to be traversed using the following rebinding idiom.

+ +
let expr: Expr = /* ... */;
+match expr {
+    Expr::MethodCall(expr) => {
+        /* ... */
+    }
+    Expr::Cast(expr) => {
+        /* ... */
+    }
+    Expr::If(expr) => {
+        /* ... */
+    }
+
+    /* ... */
+

We begin with a variable expr of type Expr that has no fields +(because it is an enum), and by matching on it and rebinding a variable +with the same name expr we effectively imbue our variable with all of +the data fields provided by the variant that it turned out to be. So for +example above if we ended up in the MethodCall case then we get to use +expr.receiver, expr.args etc; if we ended up in the If case we get +to use expr.cond, expr.then_branch, expr.else_branch.

+

This approach avoids repeating the variant names twice on every line.

+ +
// Repetitive; recommend not doing this.
+match expr {
+    Expr::MethodCall(ExprMethodCall { method, args, .. }) => {
+

In general, the name to which a syntax tree enum variant is bound should +be a suitable name for the complete syntax tree enum type.

+ +
// Binding is called `base` which is the name I would use if I were
+// assigning `*discriminant.base` without an `if let`.
+if let Expr::Tuple(base) = *discriminant.base {
+

A sign that you may not be choosing the right variable names is if you +see names getting repeated in your code, like accessing +receiver.receiver or pat.pat or cond.cond.

+

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Array(ExprArray)

A slice literal expression: [a, b, c, d].

+
§

Assign(ExprAssign)

An assignment expression: a = compute().

+
§

Async(ExprAsync)

An async block: async { ... }.

+
§

Await(ExprAwait)

An await expression: fut.await.

+
§

Binary(ExprBinary)

A binary operation: a + b, a += b.

+
§

Block(ExprBlock)

A blocked scope: { ... }.

+
§

Break(ExprBreak)

A break, with an optional label to break and an optional +expression.

+
§

Call(ExprCall)

A function call expression: invoke(a, b).

+
§

Cast(ExprCast)

A cast expression: foo as f64.

+
§

Closure(ExprClosure)

A closure expression: |a, b| a + b.

+
§

Const(ExprConst)

A const block: const { ... }.

+
§

Continue(ExprContinue)

A continue, with an optional label.

+
§

Field(ExprField)

Access of a named struct field (obj.k) or unnamed tuple struct +field (obj.0).

+
§

ForLoop(ExprForLoop)

A for loop: for pat in expr { ... }.

+
§

Group(ExprGroup)

An expression contained within invisible delimiters.

+

This variant is important for faithfully representing the precedence +of expressions and is related to None-delimited spans in a +TokenStream.

+
§

If(ExprIf)

An if expression with an optional else block: if expr { ... } else { ... }.

+

The else branch expression may only be an If or Block +expression, not any of the other types of expression.

+
§

Index(ExprIndex)

A square bracketed indexing expression: vector[2].

+
§

Infer(ExprInfer)

The inferred value of a const generic argument, denoted _.

+
§

Let(ExprLet)

A let guard: let Some(x) = opt.

+
§

Lit(ExprLit)

A literal in place of an expression: 1, "foo".

+
§

Loop(ExprLoop)

Conditionless loop: loop { ... }.

+
§

Macro(ExprMacro)

A macro invocation expression: format!("{}", q).

+
§

Match(ExprMatch)

A match expression: match n { Some(n) => {}, None => {} }.

+
§

MethodCall(ExprMethodCall)

A method call expression: x.foo::<T>(a, b).

+
§

Paren(ExprParen)

A parenthesized expression: (a + b).

+
§

Path(ExprPath)

A path like std::mem::replace possibly containing generic +parameters and a qualified self-type.

+

A plain identifier like x is a path of length 1.

+
§

Range(ExprRange)

A range expression: 1..2, 1.., ..2, 1..=2, ..=2.

+
§

Reference(ExprReference)

A referencing operation: &a or &mut a.

+
§

Repeat(ExprRepeat)

An array literal constructed from one repeated element: [0u8; N].

+
§

Return(ExprReturn)

A return, with an optional value to be returned.

+
§

Struct(ExprStruct)

A struct literal expression: Point { x: 1, y: 1 }.

+

The rest provides the value of the remaining fields as in S { a: 1, b: 1, ..rest }.

+
§

Try(ExprTry)

A try-expression: expr?.

+
§

TryBlock(ExprTryBlock)

A try block: try { ... }.

+
§

Tuple(ExprTuple)

A tuple expression: (a, b, c, d).

+
§

Unary(ExprUnary)

A unary operation: !x, *x.

+
§

Unsafe(ExprUnsafe)

An unsafe block: unsafe { ... }.

+
§

Verbatim(TokenStream)

Tokens in expression position not interpreted by Syn.

+
§

While(ExprWhile)

A while loop: while expr { ... }.

+
§

Yield(ExprYield)

A yield expression: yield expr.

+

Implementations§

source§

impl Expr

source

pub const PLACEHOLDER: Self = _

An unspecified invalid expression.

+ +
use quote::ToTokens;
+use std::mem;
+use syn::{parse_quote, Expr};
+
+fn unparenthesize(e: &mut Expr) {
+    while let Expr::Paren(paren) = e {
+        *e = mem::replace(&mut *paren.expr, Expr::PLACEHOLDER);
+    }
+}
+
+fn main() {
+    let mut e: Expr = parse_quote! { ((1 + 1)) };
+    unparenthesize(&mut e);
+    assert_eq!("1 + 1", e.to_token_stream().to_string());
+}
+
source

pub fn parse_without_eager_brace(input: ParseStream<'_>) -> Result<Expr>

An alternative to the primary Expr::parse parser (from the Parse +trait) for ambiguous syntactic positions in which a trailing brace +should not be taken as part of the expression.

+

Rust grammar has an ambiguity where braces sometimes turn a path +expression into a struct initialization and sometimes do not. In the +following code, the expression S {} is one expression. Presumably +there is an empty struct struct S {} defined somewhere which it is +instantiating.

+ +
let _ = *S {};
+
+// parsed by rustc as: `*(S {})`
+

We would want to parse the above using Expr::parse after the = +token.

+

But in the following, S {} is not a struct init expression.

+ +
if *S {} {}
+
+// parsed by rustc as:
+//
+//    if (*S) {
+//        /* empty block */
+//    }
+//    {
+//        /* another empty block */
+//    }
+

For that reason we would want to parse if-conditions using +Expr::parse_without_eager_brace after the if token. Same for similar +syntactic positions such as the condition expr after a while token or +the expr at the top of a match.

+

The Rust grammar’s choices around which way this ambiguity is resolved +at various syntactic positions is fairly arbitrary. Really either parse +behavior could work in most positions, and language designers just +decide each case based on which is more likely to be what the programmer +had in mind most of the time.

+ +
if return S {} {}
+
+// parsed by rustc as:
+//
+//    if (return (S {})) {
+//    }
+//
+// but could equally well have been this other arbitrary choice:
+//
+//    if (return S) {
+//    }
+//    {}
+

Note the grammar ambiguity on trailing braces is distinct from +precedence and is not captured by assigning a precedence level to the +braced struct init expr in relation to other operators. This can be +illustrated by return 0..S {} vs match 0..S {}. The former parses as +return (0..(S {})) implying tighter precedence for struct init than +.., while the latter parses as match (0..S) {} implying tighter +precedence for .. than struct init, a contradiction.

+
source

pub fn parse_with_earlier_boundary_rule(input: ParseStream<'_>) -> Result<Expr>

An alternative to the primary Expr::parse parser (from the Parse +trait) for syntactic positions in which expression boundaries are placed +more eagerly than done by the typical expression grammar. This includes +expressions at the head of a statement or in the right-hand side of a +match arm.

+

Compare the following cases:

+
    +
  1. +
    let _ = match result {
    +    () if guard => if cond { f } else { g }
    +    () => false,
    +};
    +
  2. +
  3. +
    let _ = || {
    +    if cond { f } else { g }
    +    ()
    +};
    +
  4. +
  5. +
    let _ = [if cond { f } else { g } ()];
    +
  6. +
+

The same sequence of tokens if cond { f } else { g } () appears in +expression position 3 times. The first two syntactic positions use eager +placement of expression boundaries, and parse as Expr::If, with the +adjacent () becoming Pat::Tuple or Expr::Tuple. In contrast, the +third case uses standard expression boundaries and parses as +Expr::Call.

+

As with parse_without_eager_brace, this ambiguity in the Rust +grammar is independent of precedence.

+

Trait Implementations§

source§

impl Clone for Expr

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<ExprArray> for Expr

source§

fn from(e: ExprArray) -> Expr

Converts to this type from the input type.
source§

impl From<ExprAssign> for Expr

source§

fn from(e: ExprAssign) -> Expr

Converts to this type from the input type.
source§

impl From<ExprAsync> for Expr

source§

fn from(e: ExprAsync) -> Expr

Converts to this type from the input type.
source§

impl From<ExprAwait> for Expr

source§

fn from(e: ExprAwait) -> Expr

Converts to this type from the input type.
source§

impl From<ExprBinary> for Expr

source§

fn from(e: ExprBinary) -> Expr

Converts to this type from the input type.
source§

impl From<ExprBlock> for Expr

source§

fn from(e: ExprBlock) -> Expr

Converts to this type from the input type.
source§

impl From<ExprBreak> for Expr

source§

fn from(e: ExprBreak) -> Expr

Converts to this type from the input type.
source§

impl From<ExprCall> for Expr

source§

fn from(e: ExprCall) -> Expr

Converts to this type from the input type.
source§

impl From<ExprCast> for Expr

source§

fn from(e: ExprCast) -> Expr

Converts to this type from the input type.
source§

impl From<ExprClosure> for Expr

source§

fn from(e: ExprClosure) -> Expr

Converts to this type from the input type.
source§

impl From<ExprConst> for Expr

source§

fn from(e: ExprConst) -> Expr

Converts to this type from the input type.
source§

impl From<ExprContinue> for Expr

source§

fn from(e: ExprContinue) -> Expr

Converts to this type from the input type.
source§

impl From<ExprField> for Expr

source§

fn from(e: ExprField) -> Expr

Converts to this type from the input type.
source§

impl From<ExprForLoop> for Expr

source§

fn from(e: ExprForLoop) -> Expr

Converts to this type from the input type.
source§

impl From<ExprGroup> for Expr

source§

fn from(e: ExprGroup) -> Expr

Converts to this type from the input type.
source§

impl From<ExprIf> for Expr

source§

fn from(e: ExprIf) -> Expr

Converts to this type from the input type.
source§

impl From<ExprIndex> for Expr

source§

fn from(e: ExprIndex) -> Expr

Converts to this type from the input type.
source§

impl From<ExprInfer> for Expr

source§

fn from(e: ExprInfer) -> Expr

Converts to this type from the input type.
source§

impl From<ExprLet> for Expr

source§

fn from(e: ExprLet) -> Expr

Converts to this type from the input type.
source§

impl From<ExprLit> for Expr

source§

fn from(e: ExprLit) -> Expr

Converts to this type from the input type.
source§

impl From<ExprLoop> for Expr

source§

fn from(e: ExprLoop) -> Expr

Converts to this type from the input type.
source§

impl From<ExprMacro> for Expr

source§

fn from(e: ExprMacro) -> Expr

Converts to this type from the input type.
source§

impl From<ExprMatch> for Expr

source§

fn from(e: ExprMatch) -> Expr

Converts to this type from the input type.
source§

impl From<ExprMethodCall> for Expr

source§

fn from(e: ExprMethodCall) -> Expr

Converts to this type from the input type.
source§

impl From<ExprParen> for Expr

source§

fn from(e: ExprParen) -> Expr

Converts to this type from the input type.
source§

impl From<ExprPath> for Expr

source§

fn from(e: ExprPath) -> Expr

Converts to this type from the input type.
source§

impl From<ExprRange> for Expr

source§

fn from(e: ExprRange) -> Expr

Converts to this type from the input type.
source§

impl From<ExprReference> for Expr

source§

fn from(e: ExprReference) -> Expr

Converts to this type from the input type.
source§

impl From<ExprRepeat> for Expr

source§

fn from(e: ExprRepeat) -> Expr

Converts to this type from the input type.
source§

impl From<ExprReturn> for Expr

source§

fn from(e: ExprReturn) -> Expr

Converts to this type from the input type.
source§

impl From<ExprStruct> for Expr

source§

fn from(e: ExprStruct) -> Expr

Converts to this type from the input type.
source§

impl From<ExprTry> for Expr

source§

fn from(e: ExprTry) -> Expr

Converts to this type from the input type.
source§

impl From<ExprTryBlock> for Expr

source§

fn from(e: ExprTryBlock) -> Expr

Converts to this type from the input type.
source§

impl From<ExprTuple> for Expr

source§

fn from(e: ExprTuple) -> Expr

Converts to this type from the input type.
source§

impl From<ExprUnary> for Expr

source§

fn from(e: ExprUnary) -> Expr

Converts to this type from the input type.
source§

impl From<ExprUnsafe> for Expr

source§

fn from(e: ExprUnsafe) -> Expr

Converts to this type from the input type.
source§

impl From<ExprWhile> for Expr

source§

fn from(e: ExprWhile) -> Expr

Converts to this type from the input type.
source§

impl From<ExprYield> for Expr

source§

fn from(e: ExprYield) -> Expr

Converts to this type from the input type.
source§

impl Parse for Expr

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for Expr

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

§

impl Freeze for Expr

§

impl RefUnwindSafe for Expr

§

impl !Send for Expr

§

impl !Sync for Expr

§

impl Unpin for Expr

§

impl UnwindSafe for Expr

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/enum.FieldMutability.html b/syn/enum.FieldMutability.html new file mode 100644 index 0000000..b4f2807 --- /dev/null +++ b/syn/enum.FieldMutability.html @@ -0,0 +1,15 @@ +FieldMutability in syn - Rust

Enum syn::FieldMutability

source ·
#[non_exhaustive]
pub enum FieldMutability { + None, +}
Expand description

Unused, but reserved for RFC 3323 restrictions.

+

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

None

Trait Implementations§

source§

impl Clone for FieldMutability

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/enum.Fields.html b/syn/enum.Fields.html new file mode 100644 index 0000000..40106d3 --- /dev/null +++ b/syn/enum.Fields.html @@ -0,0 +1,33 @@ +Fields in syn - Rust

Enum syn::Fields

source ·
pub enum Fields {
+    Named(FieldsNamed),
+    Unnamed(FieldsUnnamed),
+    Unit,
+}
Expand description

Data stored within an enum variant or struct.

+

§Syntax tree enum

+

This type is a syntax tree enum.

+

Variants§

§

Named(FieldsNamed)

Named fields of a struct or struct variant such as Point { x: f64, y: f64 }.

+
§

Unnamed(FieldsUnnamed)

Unnamed fields of a tuple struct or tuple variant such as Some(T).

+
§

Unit

Unit struct or unit variant such as None.

+

Implementations§

source§

impl Fields

source

pub fn iter(&self) -> Iter<'_, Field>

Get an iterator over the borrowed Field items in this object. This +iterator can be used to iterate over a named or unnamed struct or +variant’s fields uniformly.

+
source

pub fn iter_mut(&mut self) -> IterMut<'_, Field>

Get an iterator over the mutably borrowed Field items in this +object. This iterator can be used to iterate over a named or unnamed +struct or variant’s fields uniformly.

+
source

pub fn len(&self) -> usize

Returns the number of fields.

+
source

pub fn is_empty(&self) -> bool

Returns true if there are zero fields.

+

Trait Implementations§

source§

impl Clone for Fields

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<FieldsNamed> for Fields

source§

fn from(e: FieldsNamed) -> Fields

Converts to this type from the input type.
source§

impl From<FieldsUnnamed> for Fields

source§

fn from(e: FieldsUnnamed) -> Fields

Converts to this type from the input type.
source§

impl<'a> IntoIterator for &'a Fields

§

type Item = &'a Field

The type of the elements being iterated over.
§

type IntoIter = Iter<'a, Field>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl<'a> IntoIterator for &'a mut Fields

§

type Item = &'a mut Field

The type of the elements being iterated over.
§

type IntoIter = IterMut<'a, Field>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl IntoIterator for Fields

§

type Item = Field

The type of the elements being iterated over.
§

type IntoIter = IntoIter<Field>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl ToTokens for Fields

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

§

impl Freeze for Fields

§

impl RefUnwindSafe for Fields

§

impl !Send for Fields

§

impl !Sync for Fields

§

impl Unpin for Fields

§

impl UnwindSafe for Fields

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/enum.FnArg.html b/syn/enum.FnArg.html new file mode 100644 index 0000000..1e622cc --- /dev/null +++ b/syn/enum.FnArg.html @@ -0,0 +1,21 @@ +FnArg in syn - Rust

Enum syn::FnArg

source ·
pub enum FnArg {
+    Receiver(Receiver),
+    Typed(PatType),
+}
Expand description

An argument in a function signature: the n: usize in fn f(n: usize).

+

Variants§

§

Receiver(Receiver)

The self argument of an associated method.

+
§

Typed(PatType)

A function argument accepted by pattern and type.

+

Trait Implementations§

source§

impl Clone for FnArg

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<PatType> for FnArg

source§

fn from(e: PatType) -> FnArg

Converts to this type from the input type.
source§

impl From<Receiver> for FnArg

source§

fn from(e: Receiver) -> FnArg

Converts to this type from the input type.
source§

impl Parse for FnArg

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for FnArg

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

§

impl Freeze for FnArg

§

impl RefUnwindSafe for FnArg

§

impl !Send for FnArg

§

impl !Sync for FnArg

§

impl Unpin for FnArg

§

impl UnwindSafe for FnArg

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/enum.ForeignItem.html b/syn/enum.ForeignItem.html new file mode 100644 index 0000000..eb27375 --- /dev/null +++ b/syn/enum.ForeignItem.html @@ -0,0 +1,29 @@ +ForeignItem in syn - Rust

Enum syn::ForeignItem

source ·
#[non_exhaustive]
pub enum ForeignItem { + Fn(ForeignItemFn), + Static(ForeignItemStatic), + Type(ForeignItemType), + Macro(ForeignItemMacro), + Verbatim(TokenStream), +}
Expand description

An item within an extern block.

+

§Syntax tree enum

+

This type is a syntax tree enum.

+

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Fn(ForeignItemFn)

A foreign function in an extern block.

+
§

Static(ForeignItemStatic)

A foreign static item in an extern block: static ext: u8.

+
§

Type(ForeignItemType)

A foreign type in an extern block: type void.

+
§

Macro(ForeignItemMacro)

A macro invocation within an extern block.

+
§

Verbatim(TokenStream)

Tokens in an extern block not interpreted by Syn.

+

Trait Implementations§

source§

impl Clone for ForeignItem

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<ForeignItemFn> for ForeignItem

source§

fn from(e: ForeignItemFn) -> ForeignItem

Converts to this type from the input type.
source§

impl From<ForeignItemMacro> for ForeignItem

source§

fn from(e: ForeignItemMacro) -> ForeignItem

Converts to this type from the input type.
source§

impl From<ForeignItemStatic> for ForeignItem

source§

fn from(e: ForeignItemStatic) -> ForeignItem

Converts to this type from the input type.
source§

impl From<ForeignItemType> for ForeignItem

source§

fn from(e: ForeignItemType) -> ForeignItem

Converts to this type from the input type.
source§

impl Parse for ForeignItem

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for ForeignItem

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/enum.GenericArgument.html b/syn/enum.GenericArgument.html new file mode 100644 index 0000000..9703862 --- /dev/null +++ b/syn/enum.GenericArgument.html @@ -0,0 +1,31 @@ +GenericArgument in syn - Rust

Enum syn::GenericArgument

source ·
#[non_exhaustive]
pub enum GenericArgument { + Lifetime(Lifetime), + Type(Type), + Const(Expr), + AssocType(AssocType), + AssocConst(AssocConst), + Constraint(Constraint), +}
Expand description

An individual generic argument, like 'a, T, or Item = T.

+

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Lifetime(Lifetime)

A lifetime argument.

+
§

Type(Type)

A type argument.

+
§

Const(Expr)

A const expression. Must be inside of a block.

+

NOTE: Identity expressions are represented as Type arguments, as +they are indistinguishable syntactically.

+
§

AssocType(AssocType)

A binding (equality constraint) on an associated type: the Item = u8 in Iterator<Item = u8>.

+
§

AssocConst(AssocConst)

An equality constraint on an associated constant: the PANIC = false in Trait<PANIC = false>.

+
§

Constraint(Constraint)

An associated type bound: Iterator<Item: Display>.

+

Trait Implementations§

source§

impl Clone for GenericArgument

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Parse for GenericArgument

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for GenericArgument

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/enum.GenericParam.html b/syn/enum.GenericParam.html new file mode 100644 index 0000000..e63ff41 --- /dev/null +++ b/syn/enum.GenericParam.html @@ -0,0 +1,26 @@ +GenericParam in syn - Rust

Enum syn::GenericParam

source ·
pub enum GenericParam {
+    Lifetime(LifetimeParam),
+    Type(TypeParam),
+    Const(ConstParam),
+}
Expand description

A generic type parameter, lifetime, or const generic: T: Into<String>, +'a: 'b, const LEN: usize.

+

§Syntax tree enum

+

This type is a syntax tree enum.

+

Variants§

§

Lifetime(LifetimeParam)

A lifetime parameter: 'a: 'b + 'c + 'd.

+
§

Type(TypeParam)

A generic type parameter: T: Into<String>.

+
§

Const(ConstParam)

A const generic parameter: const LENGTH: usize.

+

Trait Implementations§

source§

impl Clone for GenericParam

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<ConstParam> for GenericParam

source§

fn from(e: ConstParam) -> GenericParam

Converts to this type from the input type.
source§

impl From<LifetimeParam> for GenericParam

source§

fn from(e: LifetimeParam) -> GenericParam

Converts to this type from the input type.
source§

impl From<TypeParam> for GenericParam

source§

fn from(e: TypeParam) -> GenericParam

Converts to this type from the input type.
source§

impl Parse for GenericParam

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for GenericParam

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/enum.ImplItem.html b/syn/enum.ImplItem.html new file mode 100644 index 0000000..59163c3 --- /dev/null +++ b/syn/enum.ImplItem.html @@ -0,0 +1,29 @@ +ImplItem in syn - Rust

Enum syn::ImplItem

source ·
#[non_exhaustive]
pub enum ImplItem { + Const(ImplItemConst), + Fn(ImplItemFn), + Type(ImplItemType), + Macro(ImplItemMacro), + Verbatim(TokenStream), +}
Expand description

An item within an impl block.

+

§Syntax tree enum

+

This type is a syntax tree enum.

+

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Const(ImplItemConst)

An associated constant within an impl block.

+
§

Fn(ImplItemFn)

An associated function within an impl block.

+
§

Type(ImplItemType)

An associated type within an impl block.

+
§

Macro(ImplItemMacro)

A macro invocation within an impl block.

+
§

Verbatim(TokenStream)

Tokens within an impl block not interpreted by Syn.

+

Trait Implementations§

source§

impl Clone for ImplItem

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<ImplItemConst> for ImplItem

source§

fn from(e: ImplItemConst) -> ImplItem

Converts to this type from the input type.
source§

impl From<ImplItemFn> for ImplItem

source§

fn from(e: ImplItemFn) -> ImplItem

Converts to this type from the input type.
source§

impl From<ImplItemMacro> for ImplItem

source§

fn from(e: ImplItemMacro) -> ImplItem

Converts to this type from the input type.
source§

impl From<ImplItemType> for ImplItem

source§

fn from(e: ImplItemType) -> ImplItem

Converts to this type from the input type.
source§

impl Parse for ImplItem

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for ImplItem

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/enum.ImplRestriction.html b/syn/enum.ImplRestriction.html new file mode 100644 index 0000000..d990e1f --- /dev/null +++ b/syn/enum.ImplRestriction.html @@ -0,0 +1,13 @@ +ImplRestriction in syn - Rust

Enum syn::ImplRestriction

source ·
#[non_exhaustive]
pub enum ImplRestriction {}
Expand description

Unused, but reserved for RFC 3323 restrictions.

+

Trait Implementations§

source§

impl Clone for ImplRestriction

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/enum.Item.html b/syn/enum.Item.html new file mode 100644 index 0000000..dc0e648 --- /dev/null +++ b/syn/enum.Item.html @@ -0,0 +1,51 @@ +Item in syn - Rust

Enum syn::Item

source ·
#[non_exhaustive]
pub enum Item { +
Show 16 variants Const(ItemConst), + Enum(ItemEnum), + ExternCrate(ItemExternCrate), + Fn(ItemFn), + ForeignMod(ItemForeignMod), + Impl(ItemImpl), + Macro(ItemMacro), + Mod(ItemMod), + Static(ItemStatic), + Struct(ItemStruct), + Trait(ItemTrait), + TraitAlias(ItemTraitAlias), + Type(ItemType), + Union(ItemUnion), + Use(ItemUse), + Verbatim(TokenStream), +
}
Expand description

Things that can appear directly inside of a module or scope.

+

§Syntax tree enum

+

This type is a syntax tree enum.

+

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Const(ItemConst)

A constant item: const MAX: u16 = 65535.

+
§

Enum(ItemEnum)

An enum definition: enum Foo<A, B> { A(A), B(B) }.

+
§

ExternCrate(ItemExternCrate)

An extern crate item: extern crate serde.

+
§

Fn(ItemFn)

A free-standing function: fn process(n: usize) -> Result<()> { ... }.

+
§

ForeignMod(ItemForeignMod)

A block of foreign items: extern "C" { ... }.

+
§

Impl(ItemImpl)

An impl block providing trait or associated items: impl<A> Trait for Data<A> { ... }.

+
§

Macro(ItemMacro)

A macro invocation, which includes macro_rules! definitions.

+
§

Mod(ItemMod)

A module or module declaration: mod m or mod m { ... }.

+
§

Static(ItemStatic)

A static item: static BIKE: Shed = Shed(42).

+
§

Struct(ItemStruct)

A struct definition: struct Foo<A> { x: A }.

+
§

Trait(ItemTrait)

A trait definition: pub trait Iterator { ... }.

+
§

TraitAlias(ItemTraitAlias)

A trait alias: pub trait SharableIterator = Iterator + Sync.

+
§

Type(ItemType)

A type alias: type Result<T> = std::result::Result<T, MyError>.

+
§

Union(ItemUnion)

A union definition: union Foo<A, B> { x: A, y: B }.

+
§

Use(ItemUse)

A use declaration: use std::collections::HashMap.

+
§

Verbatim(TokenStream)

Tokens forming an item not interpreted by Syn.

+

Trait Implementations§

source§

impl Clone for Item

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<DeriveInput> for Item

source§

fn from(input: DeriveInput) -> Item

Converts to this type from the input type.
source§

impl From<ItemConst> for Item

source§

fn from(e: ItemConst) -> Item

Converts to this type from the input type.
source§

impl From<ItemEnum> for Item

source§

fn from(e: ItemEnum) -> Item

Converts to this type from the input type.
source§

impl From<ItemExternCrate> for Item

source§

fn from(e: ItemExternCrate) -> Item

Converts to this type from the input type.
source§

impl From<ItemFn> for Item

source§

fn from(e: ItemFn) -> Item

Converts to this type from the input type.
source§

impl From<ItemForeignMod> for Item

source§

fn from(e: ItemForeignMod) -> Item

Converts to this type from the input type.
source§

impl From<ItemImpl> for Item

source§

fn from(e: ItemImpl) -> Item

Converts to this type from the input type.
source§

impl From<ItemMacro> for Item

source§

fn from(e: ItemMacro) -> Item

Converts to this type from the input type.
source§

impl From<ItemMod> for Item

source§

fn from(e: ItemMod) -> Item

Converts to this type from the input type.
source§

impl From<ItemStatic> for Item

source§

fn from(e: ItemStatic) -> Item

Converts to this type from the input type.
source§

impl From<ItemStruct> for Item

source§

fn from(e: ItemStruct) -> Item

Converts to this type from the input type.
source§

impl From<ItemTrait> for Item

source§

fn from(e: ItemTrait) -> Item

Converts to this type from the input type.
source§

impl From<ItemTraitAlias> for Item

source§

fn from(e: ItemTraitAlias) -> Item

Converts to this type from the input type.
source§

impl From<ItemType> for Item

source§

fn from(e: ItemType) -> Item

Converts to this type from the input type.
source§

impl From<ItemUnion> for Item

source§

fn from(e: ItemUnion) -> Item

Converts to this type from the input type.
source§

impl From<ItemUse> for Item

source§

fn from(e: ItemUse) -> Item

Converts to this type from the input type.
source§

impl Parse for Item

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for Item

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

§

impl Freeze for Item

§

impl RefUnwindSafe for Item

§

impl !Send for Item

§

impl !Sync for Item

§

impl Unpin for Item

§

impl UnwindSafe for Item

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/enum.Lit.html b/syn/enum.Lit.html new file mode 100644 index 0000000..98880ce --- /dev/null +++ b/syn/enum.Lit.html @@ -0,0 +1,39 @@ +Lit in syn - Rust

Enum syn::Lit

source ·
#[non_exhaustive]
pub enum Lit { + Str(LitStr), + ByteStr(LitByteStr), + CStr(LitCStr), + Byte(LitByte), + Char(LitChar), + Int(LitInt), + Float(LitFloat), + Bool(LitBool), + Verbatim(Literal), +}
Expand description

A Rust literal such as a string or integer or boolean.

+

§Syntax tree enum

+

This type is a syntax tree enum.

+

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Str(LitStr)

A UTF-8 string literal: "foo".

+
§

ByteStr(LitByteStr)

A byte string literal: b"foo".

+
§

CStr(LitCStr)

A nul-terminated C-string literal: c"foo".

+
§

Byte(LitByte)

A byte literal: b'f'.

+
§

Char(LitChar)

A character literal: 'a'.

+
§

Int(LitInt)

An integer literal: 1 or 1u16.

+
§

Float(LitFloat)

A floating point literal: 1f64 or 1.0e10f64.

+

Must be finite. May not be infinite or NaN.

+
§

Bool(LitBool)

A boolean literal: true or false.

+
§

Verbatim(Literal)

A raw token literal not interpreted by Syn.

+

Implementations§

source§

impl Lit

source

pub fn new(token: Literal) -> Self

Interpret a Syn literal from a proc-macro2 literal.

+
source

pub fn suffix(&self) -> &str

source

pub fn span(&self) -> Span

source

pub fn set_span(&mut self, span: Span)

Trait Implementations§

source§

impl Clone for Lit

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<LitBool> for Lit

source§

fn from(e: LitBool) -> Lit

Converts to this type from the input type.
source§

impl From<LitByte> for Lit

source§

fn from(e: LitByte) -> Lit

Converts to this type from the input type.
source§

impl From<LitByteStr> for Lit

source§

fn from(e: LitByteStr) -> Lit

Converts to this type from the input type.
source§

impl From<LitCStr> for Lit

source§

fn from(e: LitCStr) -> Lit

Converts to this type from the input type.
source§

impl From<LitChar> for Lit

source§

fn from(e: LitChar) -> Lit

Converts to this type from the input type.
source§

impl From<LitFloat> for Lit

source§

fn from(e: LitFloat) -> Lit

Converts to this type from the input type.
source§

impl From<LitInt> for Lit

source§

fn from(e: LitInt) -> Lit

Converts to this type from the input type.
source§

impl From<LitStr> for Lit

source§

fn from(e: LitStr) -> Lit

Converts to this type from the input type.
source§

impl Parse for Lit

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for Lit

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Token for Lit

Auto Trait Implementations§

§

impl Freeze for Lit

§

impl RefUnwindSafe for Lit

§

impl !Send for Lit

§

impl !Sync for Lit

§

impl Unpin for Lit

§

impl UnwindSafe for Lit

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/enum.MacroDelimiter.html b/syn/enum.MacroDelimiter.html new file mode 100644 index 0000000..e7d5f85 --- /dev/null +++ b/syn/enum.MacroDelimiter.html @@ -0,0 +1,17 @@ +MacroDelimiter in syn - Rust

Enum syn::MacroDelimiter

source ·
pub enum MacroDelimiter {
+    Paren(Paren),
+    Brace(Brace),
+    Bracket(Bracket),
+}
Expand description

A grouping token that surrounds a macro body: m!(...) or m!{...} or m![...].

+

Variants§

§

Paren(Paren)

§

Brace(Brace)

§

Bracket(Bracket)

Implementations§

Trait Implementations§

source§

impl Clone for MacroDelimiter

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/enum.Member.html b/syn/enum.Member.html new file mode 100644 index 0000000..e533d58 --- /dev/null +++ b/syn/enum.Member.html @@ -0,0 +1,26 @@ +Member in syn - Rust

Enum syn::Member

source ·
pub enum Member {
+    Named(Ident),
+    Unnamed(Index),
+}
Expand description

A struct or tuple struct field accessed in a struct literal or field +expression.

+

Variants§

§

Named(Ident)

A named field like self.x.

+
§

Unnamed(Index)

An unnamed field like self.0.

+

Trait Implementations§

source§

impl Clone for Member

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<Ident> for Member

source§

fn from(ident: Ident) -> Member

Converts to this type from the input type.
source§

impl From<Index> for Member

source§

fn from(index: Index) -> Member

Converts to this type from the input type.
source§

impl From<usize> for Member

source§

fn from(index: usize) -> Member

Converts to this type from the input type.
source§

impl Hash for Member

source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl IdentFragment for Member

source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result

Format this value as an identifier fragment.
source§

fn span(&self) -> Option<Span>

Span associated with this IdentFragment. Read more
source§

impl Parse for Member

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl PartialEq for Member

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl ToTokens for Member

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Eq for Member

Auto Trait Implementations§

§

impl Freeze for Member

§

impl RefUnwindSafe for Member

§

impl !Send for Member

§

impl !Sync for Member

§

impl Unpin for Member

§

impl UnwindSafe for Member

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/enum.Meta.html b/syn/enum.Meta.html new file mode 100644 index 0000000..3c707ce --- /dev/null +++ b/syn/enum.Meta.html @@ -0,0 +1,36 @@ +Meta in syn - Rust

Enum syn::Meta

source ·
pub enum Meta {
+    Path(Path),
+    List(MetaList),
+    NameValue(MetaNameValue),
+}
Expand description

Content of a compile-time structured attribute.

+

§Path

+

A meta path is like the test in #[test].

+

§List

+

A meta list is like the derive(Copy) in #[derive(Copy)].

+

§NameValue

+

A name-value meta is like the path = "..." in #[path = "sys/windows.rs"].

+

§Syntax tree enum

+

This type is a syntax tree enum.

+

Variants§

§

Path(Path)

§

List(MetaList)

A structured list within an attribute, like derive(Copy, Clone).

+
§

NameValue(MetaNameValue)

A name-value pair within an attribute, like feature = "nightly".

+

Implementations§

source§

impl Meta

source

pub fn path(&self) -> &Path

Returns the path that begins this structured meta item.

+

For example this would return the test in #[test], the derive in +#[derive(Copy)], and the path in #[path = "sys/windows.rs"].

+
source

pub fn require_path_only(&self) -> Result<&Path>

Error if this is a Meta::List or Meta::NameValue.

+
source

pub fn require_list(&self) -> Result<&MetaList>

Error if this is a Meta::Path or Meta::NameValue.

+
source

pub fn require_name_value(&self) -> Result<&MetaNameValue>

Error if this is a Meta::Path or Meta::List.

+

Trait Implementations§

source§

impl Clone for Meta

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<MetaList> for Meta

source§

fn from(e: MetaList) -> Meta

Converts to this type from the input type.
source§

impl From<MetaNameValue> for Meta

source§

fn from(e: MetaNameValue) -> Meta

Converts to this type from the input type.
source§

impl From<Path> for Meta

source§

fn from(e: Path) -> Meta

Converts to this type from the input type.
source§

impl Parse for Meta

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for Meta

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

§

impl Freeze for Meta

§

impl RefUnwindSafe for Meta

§

impl !Send for Meta

§

impl !Sync for Meta

§

impl Unpin for Meta

§

impl UnwindSafe for Meta

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/enum.Pat.html b/syn/enum.Pat.html new file mode 100644 index 0000000..bd66944 --- /dev/null +++ b/syn/enum.Pat.html @@ -0,0 +1,101 @@ +Pat in syn - Rust

Enum syn::Pat

source ·
#[non_exhaustive]
pub enum Pat { +
Show 17 variants Const(PatConst), + Ident(PatIdent), + Lit(PatLit), + Macro(PatMacro), + Or(PatOr), + Paren(PatParen), + Path(PatPath), + Range(PatRange), + Reference(PatReference), + Rest(PatRest), + Slice(PatSlice), + Struct(PatStruct), + Tuple(PatTuple), + TupleStruct(PatTupleStruct), + Type(PatType), + Verbatim(TokenStream), + Wild(PatWild), +
}
Expand description

A pattern in a local binding, function signature, match expression, or +various other places.

+

§Syntax tree enum

+

This type is a syntax tree enum.

+

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Const(PatConst)

A const block: const { ... }.

+
§

Ident(PatIdent)

A pattern that binds a new variable: ref mut binding @ SUBPATTERN.

+
§

Lit(PatLit)

A literal pattern: 0.

+
§

Macro(PatMacro)

A macro in pattern position.

+
§

Or(PatOr)

A pattern that matches any one of a set of cases.

+
§

Paren(PatParen)

A parenthesized pattern: (A | B).

+
§

Path(PatPath)

A path pattern like Color::Red, optionally qualified with a +self-type.

+

Unqualified path patterns can legally refer to variants, structs, +constants or associated constants. Qualified path patterns like +<A>::B::C and <A as Trait>::B::C can only legally refer to +associated constants.

+
§

Range(PatRange)

A range pattern: 1..=2.

+
§

Reference(PatReference)

A reference pattern: &mut var.

+
§

Rest(PatRest)

The dots in a tuple or slice pattern: [0, 1, ..].

+
§

Slice(PatSlice)

A dynamically sized slice pattern: [a, b, ref i @ .., y, z].

+
§

Struct(PatStruct)

A struct or struct variant pattern: Variant { x, y, .. }.

+
§

Tuple(PatTuple)

A tuple pattern: (a, b).

+
§

TupleStruct(PatTupleStruct)

A tuple struct or tuple variant pattern: Variant(x, y, .., z).

+
§

Type(PatType)

A type ascription pattern: foo: f64.

+
§

Verbatim(TokenStream)

Tokens in pattern position not interpreted by Syn.

+
§

Wild(PatWild)

A pattern that matches any value: _.

+

Implementations§

source§

impl Pat

source

pub fn parse_single(input: ParseStream<'_>) -> Result<Self>

Parse a pattern that does not involve | at the top level.

+

This parser matches the behavior of the $:pat_param macro_rules +matcher, and on editions prior to Rust 2021, the behavior of +$:pat.

+

In Rust syntax, some examples of where this syntax would occur are +in the argument pattern of functions and closures. Patterns using +| are not allowed to occur in these positions.

+ +
fn f(Some(_) | None: Option<T>) {
+    let _ = |Some(_) | None: Option<T>| {};
+    //       ^^^^^^^^^^^^^^^^^^^^^^^^^??? :(
+}
+
error: top-level or-patterns are not allowed in function parameters
+ --> src/main.rs:1:6
+  |
+1 | fn f(Some(_) | None: Option<T>) {
+  |      ^^^^^^^^^^^^^^ help: wrap the pattern in parentheses: `(Some(_) | None)`
+
source

pub fn parse_multi(input: ParseStream<'_>) -> Result<Self>

Parse a pattern, possibly involving |, but not a leading |.

+
source

pub fn parse_multi_with_leading_vert(input: ParseStream<'_>) -> Result<Self>

Parse a pattern, possibly involving |, possibly including a +leading |.

+

This parser matches the behavior of the Rust 2021 edition’s $:pat +macro_rules matcher.

+

In Rust syntax, an example of where this syntax would occur is in +the pattern of a match arm, where the language permits an optional +leading |, although it is not idiomatic to write one there in +handwritten code.

+ +
match wat {
+    | None | Some(false) => {}
+    | Some(true) => {}
+}
+

The compiler accepts it only to facilitate some situations in +macro-generated code where a macro author might need to write:

+ +
match $value {
+    $(| $conditions1)* $(| $conditions2)* => $then
+}
+

Expressing the same thing correctly in the case that either one (but +not both) of $conditions1 and $conditions2 might be empty, +without leading |, is complex.

+

Use Pat::parse_multi instead if you are not intending to support +macro-generated macro input.

+

Trait Implementations§

source§

impl Clone for Pat

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<ExprConst> for Pat

source§

fn from(e: PatConst) -> Pat

Converts to this type from the input type.
source§

impl From<ExprLit> for Pat

source§

fn from(e: PatLit) -> Pat

Converts to this type from the input type.
source§

impl From<ExprMacro> for Pat

source§

fn from(e: PatMacro) -> Pat

Converts to this type from the input type.
source§

impl From<ExprPath> for Pat

source§

fn from(e: PatPath) -> Pat

Converts to this type from the input type.
source§

impl From<ExprRange> for Pat

source§

fn from(e: PatRange) -> Pat

Converts to this type from the input type.
source§

impl From<PatIdent> for Pat

source§

fn from(e: PatIdent) -> Pat

Converts to this type from the input type.
source§

impl From<PatOr> for Pat

source§

fn from(e: PatOr) -> Pat

Converts to this type from the input type.
source§

impl From<PatParen> for Pat

source§

fn from(e: PatParen) -> Pat

Converts to this type from the input type.
source§

impl From<PatReference> for Pat

source§

fn from(e: PatReference) -> Pat

Converts to this type from the input type.
source§

impl From<PatRest> for Pat

source§

fn from(e: PatRest) -> Pat

Converts to this type from the input type.
source§

impl From<PatSlice> for Pat

source§

fn from(e: PatSlice) -> Pat

Converts to this type from the input type.
source§

impl From<PatStruct> for Pat

source§

fn from(e: PatStruct) -> Pat

Converts to this type from the input type.
source§

impl From<PatTuple> for Pat

source§

fn from(e: PatTuple) -> Pat

Converts to this type from the input type.
source§

impl From<PatTupleStruct> for Pat

source§

fn from(e: PatTupleStruct) -> Pat

Converts to this type from the input type.
source§

impl From<PatType> for Pat

source§

fn from(e: PatType) -> Pat

Converts to this type from the input type.
source§

impl From<PatWild> for Pat

source§

fn from(e: PatWild) -> Pat

Converts to this type from the input type.
source§

impl ToTokens for Pat

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

§

impl Freeze for Pat

§

impl RefUnwindSafe for Pat

§

impl !Send for Pat

§

impl !Sync for Pat

§

impl Unpin for Pat

§

impl UnwindSafe for Pat

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/enum.PathArguments.html b/syn/enum.PathArguments.html new file mode 100644 index 0000000..d0768a6 --- /dev/null +++ b/syn/enum.PathArguments.html @@ -0,0 +1,26 @@ +PathArguments in syn - Rust

Enum syn::PathArguments

source ·
pub enum PathArguments {
+    None,
+    AngleBracketed(AngleBracketedGenericArguments),
+    Parenthesized(ParenthesizedGenericArguments),
+}
Expand description

Angle bracketed or parenthesized arguments of a path segment.

+

§Angle bracketed

+

The <'a, T> in std::slice::iter<'a, T>.

+

§Parenthesized

+

The (A, B) -> C in Fn(A, B) -> C.

+

Variants§

§

None

§

AngleBracketed(AngleBracketedGenericArguments)

The <'a, T> in std::slice::iter<'a, T>.

+
§

Parenthesized(ParenthesizedGenericArguments)

The (A, B) -> C in Fn(A, B) -> C.

+

Implementations§

source§

impl PathArguments

source

pub fn is_empty(&self) -> bool

source

pub fn is_none(&self) -> bool

Trait Implementations§

source§

impl Clone for PathArguments

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for PathArguments

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl ToTokens for PathArguments

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/enum.RangeLimits.html b/syn/enum.RangeLimits.html new file mode 100644 index 0000000..779ab2e --- /dev/null +++ b/syn/enum.RangeLimits.html @@ -0,0 +1,21 @@ +RangeLimits in syn - Rust

Enum syn::RangeLimits

source ·
pub enum RangeLimits {
+    HalfOpen(DotDot),
+    Closed(DotDotEq),
+}
Expand description

Limit types of a range, inclusive or exclusive.

+

Variants§

§

HalfOpen(DotDot)

Inclusive at the beginning, exclusive at the end.

+
§

Closed(DotDotEq)

Inclusive at the beginning and end.

+

Trait Implementations§

source§

impl Clone for RangeLimits

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Parse for RangeLimits

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for RangeLimits

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for RangeLimits

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/enum.ReturnType.html b/syn/enum.ReturnType.html new file mode 100644 index 0000000..012d681 --- /dev/null +++ b/syn/enum.ReturnType.html @@ -0,0 +1,22 @@ +ReturnType in syn - Rust

Enum syn::ReturnType

source ·
pub enum ReturnType {
+    Default,
+    Type(RArrow, Box<Type>),
+}
Expand description

Return type of a function signature.

+

Variants§

§

Default

Return type is not specified.

+

Functions default to () and closures default to type inference.

+
§

Type(RArrow, Box<Type>)

A particular type is returned.

+

Implementations§

Trait Implementations§

source§

impl Clone for ReturnType

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Parse for ReturnType

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for ReturnType

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/enum.StaticMutability.html b/syn/enum.StaticMutability.html new file mode 100644 index 0000000..b2402ea --- /dev/null +++ b/syn/enum.StaticMutability.html @@ -0,0 +1,19 @@ +StaticMutability in syn - Rust

Enum syn::StaticMutability

source ·
#[non_exhaustive]
pub enum StaticMutability { + Mut(Mut), + None, +}
Expand description

The mutability of an Item::Static or ForeignItem::Static.

+

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Mut(Mut)

§

None

Trait Implementations§

source§

impl Clone for StaticMutability

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Parse for StaticMutability

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for StaticMutability

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/enum.Stmt.html b/syn/enum.Stmt.html new file mode 100644 index 0000000..f970f9a --- /dev/null +++ b/syn/enum.Stmt.html @@ -0,0 +1,28 @@ +Stmt in syn - Rust

Enum syn::Stmt

source ·
pub enum Stmt {
+    Local(Local),
+    Item(Item),
+    Expr(Expr, Option<Semi>),
+    Macro(StmtMacro),
+}
Expand description

A statement, usually ending in a semicolon.

+

Variants§

§

Local(Local)

A local (let) binding.

+
§

Item(Item)

An item definition.

+
§

Expr(Expr, Option<Semi>)

Expression, with or without trailing semicolon.

+
§

Macro(StmtMacro)

A macro invocation in statement position.

+

Syntactically it’s ambiguous which other kind of statement this +macro would expand to. It can be any of local variable (let), +item, or expression.

+

Trait Implementations§

source§

impl Clone for Stmt

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Parse for Stmt

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for Stmt

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

§

impl Freeze for Stmt

§

impl RefUnwindSafe for Stmt

§

impl !Send for Stmt

§

impl !Sync for Stmt

§

impl Unpin for Stmt

§

impl UnwindSafe for Stmt

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/enum.TraitBoundModifier.html b/syn/enum.TraitBoundModifier.html new file mode 100644 index 0000000..b837f23 --- /dev/null +++ b/syn/enum.TraitBoundModifier.html @@ -0,0 +1,20 @@ +TraitBoundModifier in syn - Rust

Enum syn::TraitBoundModifier

source ·
pub enum TraitBoundModifier {
+    None,
+    Maybe(Question),
+}
Expand description

A modifier on a trait bound, currently only used for the ? in +?Sized.

+

Variants§

§

None

§

Maybe(Question)

Trait Implementations§

source§

impl Clone for TraitBoundModifier

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Parse for TraitBoundModifier

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for TraitBoundModifier

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for TraitBoundModifier

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/enum.TraitItem.html b/syn/enum.TraitItem.html new file mode 100644 index 0000000..18ad95f --- /dev/null +++ b/syn/enum.TraitItem.html @@ -0,0 +1,29 @@ +TraitItem in syn - Rust

Enum syn::TraitItem

source ·
#[non_exhaustive]
pub enum TraitItem { + Const(TraitItemConst), + Fn(TraitItemFn), + Type(TraitItemType), + Macro(TraitItemMacro), + Verbatim(TokenStream), +}
Expand description

An item declaration within the definition of a trait.

+

§Syntax tree enum

+

This type is a syntax tree enum.

+

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Const(TraitItemConst)

An associated constant within the definition of a trait.

+
§

Fn(TraitItemFn)

An associated function within the definition of a trait.

+
§

Type(TraitItemType)

An associated type within the definition of a trait.

+
§

Macro(TraitItemMacro)

A macro invocation within the definition of a trait.

+
§

Verbatim(TokenStream)

Tokens within the definition of a trait not interpreted by Syn.

+

Trait Implementations§

source§

impl Clone for TraitItem

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<TraitItemConst> for TraitItem

source§

fn from(e: TraitItemConst) -> TraitItem

Converts to this type from the input type.
source§

impl From<TraitItemFn> for TraitItem

source§

fn from(e: TraitItemFn) -> TraitItem

Converts to this type from the input type.
source§

impl From<TraitItemMacro> for TraitItem

source§

fn from(e: TraitItemMacro) -> TraitItem

Converts to this type from the input type.
source§

impl From<TraitItemType> for TraitItem

source§

fn from(e: TraitItemType) -> TraitItem

Converts to this type from the input type.
source§

impl Parse for TraitItem

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for TraitItem

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/enum.Type.html b/syn/enum.Type.html new file mode 100644 index 0000000..bfdd516 --- /dev/null +++ b/syn/enum.Type.html @@ -0,0 +1,56 @@ +Type in syn - Rust

Enum syn::Type

source ·
#[non_exhaustive]
pub enum Type { +
Show 15 variants Array(TypeArray), + BareFn(TypeBareFn), + Group(TypeGroup), + ImplTrait(TypeImplTrait), + Infer(TypeInfer), + Macro(TypeMacro), + Never(TypeNever), + Paren(TypeParen), + Path(TypePath), + Ptr(TypePtr), + Reference(TypeReference), + Slice(TypeSlice), + TraitObject(TypeTraitObject), + Tuple(TypeTuple), + Verbatim(TokenStream), +
}
Expand description

The possible types that a Rust value could have.

+

§Syntax tree enum

+

This type is a syntax tree enum.

+

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Array(TypeArray)

A fixed size array type: [T; n].

+
§

BareFn(TypeBareFn)

A bare function type: fn(usize) -> bool.

+
§

Group(TypeGroup)

A type contained within invisible delimiters.

+
§

ImplTrait(TypeImplTrait)

An impl Bound1 + Bound2 + Bound3 type where Bound is a trait or +a lifetime.

+
§

Infer(TypeInfer)

Indication that a type should be inferred by the compiler: _.

+
§

Macro(TypeMacro)

A macro in the type position.

+
§

Never(TypeNever)

The never type: !.

+
§

Paren(TypeParen)

A parenthesized type equivalent to the inner type.

+
§

Path(TypePath)

A path like std::slice::Iter, optionally qualified with a +self-type as in <Vec<T> as SomeTrait>::Associated.

+
§

Ptr(TypePtr)

A raw pointer type: *const T or *mut T.

+
§

Reference(TypeReference)

A reference type: &'a T or &'a mut T.

+
§

Slice(TypeSlice)

A dynamically sized slice type: [T].

+
§

TraitObject(TypeTraitObject)

A trait object type dyn Bound1 + Bound2 + Bound3 where Bound is a +trait or a lifetime.

+
§

Tuple(TypeTuple)

A tuple type: (A, B, C, String).

+
§

Verbatim(TokenStream)

Tokens in type position not interpreted by Syn.

+

Implementations§

source§

impl Type

source

pub fn without_plus(input: ParseStream<'_>) -> Result<Self>

In some positions, types may not contain the + character, to +disambiguate them. For example in the expression 1 as T, T may not +contain a + character.

+

This parser does not allow a +, while the default parser does.

+

Trait Implementations§

source§

impl Clone for Type

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<TypeArray> for Type

source§

fn from(e: TypeArray) -> Type

Converts to this type from the input type.
source§

impl From<TypeBareFn> for Type

source§

fn from(e: TypeBareFn) -> Type

Converts to this type from the input type.
source§

impl From<TypeGroup> for Type

source§

fn from(e: TypeGroup) -> Type

Converts to this type from the input type.
source§

impl From<TypeImplTrait> for Type

source§

fn from(e: TypeImplTrait) -> Type

Converts to this type from the input type.
source§

impl From<TypeInfer> for Type

source§

fn from(e: TypeInfer) -> Type

Converts to this type from the input type.
source§

impl From<TypeMacro> for Type

source§

fn from(e: TypeMacro) -> Type

Converts to this type from the input type.
source§

impl From<TypeNever> for Type

source§

fn from(e: TypeNever) -> Type

Converts to this type from the input type.
source§

impl From<TypeParen> for Type

source§

fn from(e: TypeParen) -> Type

Converts to this type from the input type.
source§

impl From<TypePath> for Type

source§

fn from(e: TypePath) -> Type

Converts to this type from the input type.
source§

impl From<TypePtr> for Type

source§

fn from(e: TypePtr) -> Type

Converts to this type from the input type.
source§

impl From<TypeReference> for Type

source§

fn from(e: TypeReference) -> Type

Converts to this type from the input type.
source§

impl From<TypeSlice> for Type

source§

fn from(e: TypeSlice) -> Type

Converts to this type from the input type.
source§

impl From<TypeTraitObject> for Type

source§

fn from(e: TypeTraitObject) -> Type

Converts to this type from the input type.
source§

impl From<TypeTuple> for Type

source§

fn from(e: TypeTuple) -> Type

Converts to this type from the input type.
source§

impl Parse for Type

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for Type

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

§

impl Freeze for Type

§

impl RefUnwindSafe for Type

§

impl !Send for Type

§

impl !Sync for Type

§

impl Unpin for Type

§

impl UnwindSafe for Type

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/enum.TypeParamBound.html b/syn/enum.TypeParamBound.html new file mode 100644 index 0000000..977c3a9 --- /dev/null +++ b/syn/enum.TypeParamBound.html @@ -0,0 +1,20 @@ +TypeParamBound in syn - Rust

Enum syn::TypeParamBound

source ·
#[non_exhaustive]
pub enum TypeParamBound { + Trait(TraitBound), + Lifetime(Lifetime), + Verbatim(TokenStream), +}
Expand description

A trait or lifetime used as a bound on a type parameter.

+

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Trait(TraitBound)

§

Lifetime(Lifetime)

§

Verbatim(TokenStream)

Trait Implementations§

source§

impl Clone for TypeParamBound

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<Lifetime> for TypeParamBound

source§

fn from(e: Lifetime) -> TypeParamBound

Converts to this type from the input type.
source§

impl From<TraitBound> for TypeParamBound

source§

fn from(e: TraitBound) -> TypeParamBound

Converts to this type from the input type.
source§

impl Parse for TypeParamBound

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for TypeParamBound

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/enum.UnOp.html b/syn/enum.UnOp.html new file mode 100644 index 0000000..ddd49fe --- /dev/null +++ b/syn/enum.UnOp.html @@ -0,0 +1,23 @@ +UnOp in syn - Rust

Enum syn::UnOp

source ·
#[non_exhaustive]
pub enum UnOp { + Deref(Star), + Not(Not), + Neg(Minus), +}
Expand description

A unary operator: *, !, -.

+

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Deref(Star)

The * operator for dereferencing

+
§

Not(Not)

The ! operator for logical inversion

+
§

Neg(Minus)

The - operator for negation

+

Trait Implementations§

source§

impl Clone for UnOp

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Parse for UnOp

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for UnOp

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for UnOp

Auto Trait Implementations§

§

impl Freeze for UnOp

§

impl RefUnwindSafe for UnOp

§

impl !Send for UnOp

§

impl !Sync for UnOp

§

impl Unpin for UnOp

§

impl UnwindSafe for UnOp

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/enum.UseTree.html b/syn/enum.UseTree.html new file mode 100644 index 0000000..dcf2e1d --- /dev/null +++ b/syn/enum.UseTree.html @@ -0,0 +1,29 @@ +UseTree in syn - Rust

Enum syn::UseTree

source ·
pub enum UseTree {
+    Path(UsePath),
+    Name(UseName),
+    Rename(UseRename),
+    Glob(UseGlob),
+    Group(UseGroup),
+}
Expand description

A suffix of an import tree in a use item: Type as Renamed or *.

+

§Syntax tree enum

+

This type is a syntax tree enum.

+

Variants§

§

Path(UsePath)

A path prefix of imports in a use item: std::....

+
§

Name(UseName)

An identifier imported by a use item: HashMap.

+
§

Rename(UseRename)

An renamed identifier imported by a use item: HashMap as Map.

+
§

Glob(UseGlob)

A glob import in a use item: *.

+
§

Group(UseGroup)

A braced group of imports in a use item: {A, B, C}.

+

Trait Implementations§

source§

impl Clone for UseTree

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<UseGlob> for UseTree

source§

fn from(e: UseGlob) -> UseTree

Converts to this type from the input type.
source§

impl From<UseGroup> for UseTree

source§

fn from(e: UseGroup) -> UseTree

Converts to this type from the input type.
source§

impl From<UseName> for UseTree

source§

fn from(e: UseName) -> UseTree

Converts to this type from the input type.
source§

impl From<UsePath> for UseTree

source§

fn from(e: UsePath) -> UseTree

Converts to this type from the input type.
source§

impl From<UseRename> for UseTree

source§

fn from(e: UseRename) -> UseTree

Converts to this type from the input type.
source§

impl Parse for UseTree

source§

impl ToTokens for UseTree

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/enum.Visibility.html b/syn/enum.Visibility.html new file mode 100644 index 0000000..973d4d8 --- /dev/null +++ b/syn/enum.Visibility.html @@ -0,0 +1,27 @@ +Visibility in syn - Rust

Enum syn::Visibility

source ·
pub enum Visibility {
+    Public(Pub),
+    Restricted(VisRestricted),
+    Inherited,
+}
Expand description

The visibility level of an item: inherited or pub or +pub(restricted).

+

§Syntax tree enum

+

This type is a syntax tree enum.

+

Variants§

§

Public(Pub)

A public visibility level: pub.

+
§

Restricted(VisRestricted)

A visibility level restricted to some path: pub(self) or +pub(super) or pub(crate) or pub(in some::module).

+
§

Inherited

An inherited visibility, which usually means private.

+

Trait Implementations§

source§

impl Clone for Visibility

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Parse for Visibility

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for Visibility

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/enum.WherePredicate.html b/syn/enum.WherePredicate.html new file mode 100644 index 0000000..513a219 --- /dev/null +++ b/syn/enum.WherePredicate.html @@ -0,0 +1,23 @@ +WherePredicate in syn - Rust

Enum syn::WherePredicate

source ·
#[non_exhaustive]
pub enum WherePredicate { + Lifetime(PredicateLifetime), + Type(PredicateType), +}
Expand description

A single predicate in a where clause: T: Deserialize<'de>.

+

§Syntax tree enum

+

This type is a syntax tree enum.

+

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Lifetime(PredicateLifetime)

A lifetime predicate in a where clause: 'a: 'b + 'c.

+
§

Type(PredicateType)

A type predicate in a where clause: for<'c> Foo<'c>: Trait<'c>.

+

Trait Implementations§

source§

impl Clone for WherePredicate

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<PredicateLifetime> for WherePredicate

source§

fn from(e: PredicateLifetime) -> WherePredicate

Converts to this type from the input type.
source§

impl From<PredicateType> for WherePredicate

source§

fn from(e: PredicateType) -> WherePredicate

Converts to this type from the input type.
source§

impl Parse for WherePredicate

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for WherePredicate

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/error/struct.Error.html b/syn/error/struct.Error.html new file mode 100644 index 0000000..ef00d11 --- /dev/null +++ b/syn/error/struct.Error.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/parse/struct.Error.html...

+ + + \ No newline at end of file diff --git a/syn/error/type.Result.html b/syn/error/type.Result.html new file mode 100644 index 0000000..abb0eb6 --- /dev/null +++ b/syn/error/type.Result.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/parse/type.Result.html...

+ + + \ No newline at end of file diff --git a/syn/expr/enum.Expr.html b/syn/expr/enum.Expr.html new file mode 100644 index 0000000..872346d --- /dev/null +++ b/syn/expr/enum.Expr.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/enum.Expr.html...

+ + + \ No newline at end of file diff --git a/syn/expr/enum.Member.html b/syn/expr/enum.Member.html new file mode 100644 index 0000000..94d187f --- /dev/null +++ b/syn/expr/enum.Member.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/enum.Member.html...

+ + + \ No newline at end of file diff --git a/syn/expr/enum.RangeLimits.html b/syn/expr/enum.RangeLimits.html new file mode 100644 index 0000000..9d933eb --- /dev/null +++ b/syn/expr/enum.RangeLimits.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/enum.RangeLimits.html...

+ + + \ No newline at end of file diff --git a/syn/expr/struct.Arm.html b/syn/expr/struct.Arm.html new file mode 100644 index 0000000..6687339 --- /dev/null +++ b/syn/expr/struct.Arm.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.Arm.html...

+ + + \ No newline at end of file diff --git a/syn/expr/struct.ExprArray.html b/syn/expr/struct.ExprArray.html new file mode 100644 index 0000000..cacd013 --- /dev/null +++ b/syn/expr/struct.ExprArray.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.ExprArray.html...

+ + + \ No newline at end of file diff --git a/syn/expr/struct.ExprAssign.html b/syn/expr/struct.ExprAssign.html new file mode 100644 index 0000000..84f7b8d --- /dev/null +++ b/syn/expr/struct.ExprAssign.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.ExprAssign.html...

+ + + \ No newline at end of file diff --git a/syn/expr/struct.ExprAsync.html b/syn/expr/struct.ExprAsync.html new file mode 100644 index 0000000..563fdd7 --- /dev/null +++ b/syn/expr/struct.ExprAsync.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.ExprAsync.html...

+ + + \ No newline at end of file diff --git a/syn/expr/struct.ExprAwait.html b/syn/expr/struct.ExprAwait.html new file mode 100644 index 0000000..00d4413 --- /dev/null +++ b/syn/expr/struct.ExprAwait.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.ExprAwait.html...

+ + + \ No newline at end of file diff --git a/syn/expr/struct.ExprBinary.html b/syn/expr/struct.ExprBinary.html new file mode 100644 index 0000000..4b471c7 --- /dev/null +++ b/syn/expr/struct.ExprBinary.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.ExprBinary.html...

+ + + \ No newline at end of file diff --git a/syn/expr/struct.ExprBlock.html b/syn/expr/struct.ExprBlock.html new file mode 100644 index 0000000..29e6c24 --- /dev/null +++ b/syn/expr/struct.ExprBlock.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.ExprBlock.html...

+ + + \ No newline at end of file diff --git a/syn/expr/struct.ExprBreak.html b/syn/expr/struct.ExprBreak.html new file mode 100644 index 0000000..488c180 --- /dev/null +++ b/syn/expr/struct.ExprBreak.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.ExprBreak.html...

+ + + \ No newline at end of file diff --git a/syn/expr/struct.ExprCall.html b/syn/expr/struct.ExprCall.html new file mode 100644 index 0000000..05079b1 --- /dev/null +++ b/syn/expr/struct.ExprCall.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.ExprCall.html...

+ + + \ No newline at end of file diff --git a/syn/expr/struct.ExprCast.html b/syn/expr/struct.ExprCast.html new file mode 100644 index 0000000..ba76ee5 --- /dev/null +++ b/syn/expr/struct.ExprCast.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.ExprCast.html...

+ + + \ No newline at end of file diff --git a/syn/expr/struct.ExprClosure.html b/syn/expr/struct.ExprClosure.html new file mode 100644 index 0000000..94d26db --- /dev/null +++ b/syn/expr/struct.ExprClosure.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.ExprClosure.html...

+ + + \ No newline at end of file diff --git a/syn/expr/struct.ExprConst.html b/syn/expr/struct.ExprConst.html new file mode 100644 index 0000000..00b6a94 --- /dev/null +++ b/syn/expr/struct.ExprConst.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.ExprConst.html...

+ + + \ No newline at end of file diff --git a/syn/expr/struct.ExprContinue.html b/syn/expr/struct.ExprContinue.html new file mode 100644 index 0000000..5eae2b0 --- /dev/null +++ b/syn/expr/struct.ExprContinue.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.ExprContinue.html...

+ + + \ No newline at end of file diff --git a/syn/expr/struct.ExprField.html b/syn/expr/struct.ExprField.html new file mode 100644 index 0000000..d5f9bb6 --- /dev/null +++ b/syn/expr/struct.ExprField.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.ExprField.html...

+ + + \ No newline at end of file diff --git a/syn/expr/struct.ExprForLoop.html b/syn/expr/struct.ExprForLoop.html new file mode 100644 index 0000000..92477ce --- /dev/null +++ b/syn/expr/struct.ExprForLoop.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.ExprForLoop.html...

+ + + \ No newline at end of file diff --git a/syn/expr/struct.ExprGroup.html b/syn/expr/struct.ExprGroup.html new file mode 100644 index 0000000..77a84a3 --- /dev/null +++ b/syn/expr/struct.ExprGroup.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.ExprGroup.html...

+ + + \ No newline at end of file diff --git a/syn/expr/struct.ExprIf.html b/syn/expr/struct.ExprIf.html new file mode 100644 index 0000000..5d78ace --- /dev/null +++ b/syn/expr/struct.ExprIf.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.ExprIf.html...

+ + + \ No newline at end of file diff --git a/syn/expr/struct.ExprIndex.html b/syn/expr/struct.ExprIndex.html new file mode 100644 index 0000000..4b6219b --- /dev/null +++ b/syn/expr/struct.ExprIndex.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.ExprIndex.html...

+ + + \ No newline at end of file diff --git a/syn/expr/struct.ExprInfer.html b/syn/expr/struct.ExprInfer.html new file mode 100644 index 0000000..541ec0e --- /dev/null +++ b/syn/expr/struct.ExprInfer.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.ExprInfer.html...

+ + + \ No newline at end of file diff --git a/syn/expr/struct.ExprLet.html b/syn/expr/struct.ExprLet.html new file mode 100644 index 0000000..3b425d4 --- /dev/null +++ b/syn/expr/struct.ExprLet.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.ExprLet.html...

+ + + \ No newline at end of file diff --git a/syn/expr/struct.ExprLit.html b/syn/expr/struct.ExprLit.html new file mode 100644 index 0000000..2412255 --- /dev/null +++ b/syn/expr/struct.ExprLit.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.ExprLit.html...

+ + + \ No newline at end of file diff --git a/syn/expr/struct.ExprLoop.html b/syn/expr/struct.ExprLoop.html new file mode 100644 index 0000000..f947289 --- /dev/null +++ b/syn/expr/struct.ExprLoop.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.ExprLoop.html...

+ + + \ No newline at end of file diff --git a/syn/expr/struct.ExprMacro.html b/syn/expr/struct.ExprMacro.html new file mode 100644 index 0000000..3fd7f1c --- /dev/null +++ b/syn/expr/struct.ExprMacro.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.ExprMacro.html...

+ + + \ No newline at end of file diff --git a/syn/expr/struct.ExprMatch.html b/syn/expr/struct.ExprMatch.html new file mode 100644 index 0000000..54e7c95 --- /dev/null +++ b/syn/expr/struct.ExprMatch.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.ExprMatch.html...

+ + + \ No newline at end of file diff --git a/syn/expr/struct.ExprMethodCall.html b/syn/expr/struct.ExprMethodCall.html new file mode 100644 index 0000000..fa296ae --- /dev/null +++ b/syn/expr/struct.ExprMethodCall.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.ExprMethodCall.html...

+ + + \ No newline at end of file diff --git a/syn/expr/struct.ExprParen.html b/syn/expr/struct.ExprParen.html new file mode 100644 index 0000000..924de76 --- /dev/null +++ b/syn/expr/struct.ExprParen.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.ExprParen.html...

+ + + \ No newline at end of file diff --git a/syn/expr/struct.ExprPath.html b/syn/expr/struct.ExprPath.html new file mode 100644 index 0000000..5c21325 --- /dev/null +++ b/syn/expr/struct.ExprPath.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.ExprPath.html...

+ + + \ No newline at end of file diff --git a/syn/expr/struct.ExprRange.html b/syn/expr/struct.ExprRange.html new file mode 100644 index 0000000..d4bb2d8 --- /dev/null +++ b/syn/expr/struct.ExprRange.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.ExprRange.html...

+ + + \ No newline at end of file diff --git a/syn/expr/struct.ExprReference.html b/syn/expr/struct.ExprReference.html new file mode 100644 index 0000000..5455ad3 --- /dev/null +++ b/syn/expr/struct.ExprReference.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.ExprReference.html...

+ + + \ No newline at end of file diff --git a/syn/expr/struct.ExprRepeat.html b/syn/expr/struct.ExprRepeat.html new file mode 100644 index 0000000..5fe4009 --- /dev/null +++ b/syn/expr/struct.ExprRepeat.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.ExprRepeat.html...

+ + + \ No newline at end of file diff --git a/syn/expr/struct.ExprReturn.html b/syn/expr/struct.ExprReturn.html new file mode 100644 index 0000000..2bc1800 --- /dev/null +++ b/syn/expr/struct.ExprReturn.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.ExprReturn.html...

+ + + \ No newline at end of file diff --git a/syn/expr/struct.ExprStruct.html b/syn/expr/struct.ExprStruct.html new file mode 100644 index 0000000..a9fb640 --- /dev/null +++ b/syn/expr/struct.ExprStruct.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.ExprStruct.html...

+ + + \ No newline at end of file diff --git a/syn/expr/struct.ExprTry.html b/syn/expr/struct.ExprTry.html new file mode 100644 index 0000000..5990235 --- /dev/null +++ b/syn/expr/struct.ExprTry.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.ExprTry.html...

+ + + \ No newline at end of file diff --git a/syn/expr/struct.ExprTryBlock.html b/syn/expr/struct.ExprTryBlock.html new file mode 100644 index 0000000..63e2b24 --- /dev/null +++ b/syn/expr/struct.ExprTryBlock.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.ExprTryBlock.html...

+ + + \ No newline at end of file diff --git a/syn/expr/struct.ExprTuple.html b/syn/expr/struct.ExprTuple.html new file mode 100644 index 0000000..ab1a03e --- /dev/null +++ b/syn/expr/struct.ExprTuple.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.ExprTuple.html...

+ + + \ No newline at end of file diff --git a/syn/expr/struct.ExprUnary.html b/syn/expr/struct.ExprUnary.html new file mode 100644 index 0000000..2e7d039 --- /dev/null +++ b/syn/expr/struct.ExprUnary.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.ExprUnary.html...

+ + + \ No newline at end of file diff --git a/syn/expr/struct.ExprUnsafe.html b/syn/expr/struct.ExprUnsafe.html new file mode 100644 index 0000000..3587ef5 --- /dev/null +++ b/syn/expr/struct.ExprUnsafe.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.ExprUnsafe.html...

+ + + \ No newline at end of file diff --git a/syn/expr/struct.ExprWhile.html b/syn/expr/struct.ExprWhile.html new file mode 100644 index 0000000..dc0806c --- /dev/null +++ b/syn/expr/struct.ExprWhile.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.ExprWhile.html...

+ + + \ No newline at end of file diff --git a/syn/expr/struct.ExprYield.html b/syn/expr/struct.ExprYield.html new file mode 100644 index 0000000..7b48496 --- /dev/null +++ b/syn/expr/struct.ExprYield.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.ExprYield.html...

+ + + \ No newline at end of file diff --git a/syn/expr/struct.FieldValue.html b/syn/expr/struct.FieldValue.html new file mode 100644 index 0000000..3e13849 --- /dev/null +++ b/syn/expr/struct.FieldValue.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.FieldValue.html...

+ + + \ No newline at end of file diff --git a/syn/expr/struct.Index.html b/syn/expr/struct.Index.html new file mode 100644 index 0000000..3d9d997 --- /dev/null +++ b/syn/expr/struct.Index.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.Index.html...

+ + + \ No newline at end of file diff --git a/syn/expr/struct.Label.html b/syn/expr/struct.Label.html new file mode 100644 index 0000000..4254779 --- /dev/null +++ b/syn/expr/struct.Label.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.Label.html...

+ + + \ No newline at end of file diff --git a/syn/ext/index.html b/syn/ext/index.html new file mode 100644 index 0000000..aa38fef --- /dev/null +++ b/syn/ext/index.html @@ -0,0 +1,2 @@ +syn::ext - Rust

Module syn::ext

source ·
Expand description

Extension traits to provide parsing methods on foreign types.

+

Traits§

  • Additional methods for Ident not provided by proc-macro2 or libproc_macro.
\ No newline at end of file diff --git a/syn/ext/sidebar-items.js b/syn/ext/sidebar-items.js new file mode 100644 index 0000000..6e9f1c5 --- /dev/null +++ b/syn/ext/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"trait":["IdentExt"]}; \ No newline at end of file diff --git a/syn/ext/trait.IdentExt.html b/syn/ext/trait.IdentExt.html new file mode 100644 index 0000000..edb2b08 --- /dev/null +++ b/syn/ext/trait.IdentExt.html @@ -0,0 +1,62 @@ +IdentExt in syn::ext - Rust

Trait syn::ext::IdentExt

source ·
pub trait IdentExt: Sized + Sealed {
+    const peek_any: PeekFn = private::PeekFn;
+
+    // Required methods
+    fn parse_any(input: ParseStream<'_>) -> Result<Self>;
+    fn unraw(&self) -> Ident;
+}
Expand description

Additional methods for Ident not provided by proc-macro2 or libproc_macro.

+

This trait is sealed and cannot be implemented for types outside of Syn. It +is implemented only for proc_macro2::Ident.

+

Provided Associated Constants§

source

const peek_any: PeekFn = private::PeekFn

Peeks any identifier including keywords. Usage: +input.peek(Ident::peek_any)

+

This is different from input.peek(Ident) which only returns true in +the case of an ident which is not a Rust keyword.

+

Required Methods§

source

fn parse_any(input: ParseStream<'_>) -> Result<Self>

Parses any identifier including keywords.

+

This is useful when parsing macro input which allows Rust keywords as +identifiers.

+
§Example
+
use syn::{Error, Ident, Result, Token};
+use syn::ext::IdentExt;
+use syn::parse::ParseStream;
+
+mod kw {
+    syn::custom_keyword!(name);
+}
+
+// Parses input that looks like `name = NAME` where `NAME` can be
+// any identifier.
+//
+// Examples:
+//
+//     name = anything
+//     name = impl
+fn parse_dsl(input: ParseStream) -> Result<Ident> {
+    input.parse::<kw::name>()?;
+    input.parse::<Token![=]>()?;
+    let name = input.call(Ident::parse_any)?;
+    Ok(name)
+}
+
source

fn unraw(&self) -> Ident

Strips the raw marker r#, if any, from the beginning of an ident.

+
    +
  • unraw(x) = x
  • +
  • unraw(move) = move
  • +
  • unraw(r#move) = move
  • +
+
§Example
+

In the case of interop with other languages like Python that have a +different set of keywords than Rust, we might come across macro input +that involves raw identifiers to refer to ordinary variables in the +other language with a name that happens to be a Rust keyword.

+

The function below appends an identifier from the caller’s input onto a +fixed prefix. Without using unraw(), this would tend to produce +invalid identifiers like __pyo3_get_r#move.

+ +
use proc_macro2::Span;
+use syn::Ident;
+use syn::ext::IdentExt;
+
+fn ident_for_getter(variable: &Ident) -> Ident {
+    let getter = format!("__pyo3_get_{}", variable.unraw());
+    Ident::new(&getter, Span::call_site())
+}
+

Object Safety§

This trait is not object safe.

Implementors§

\ No newline at end of file diff --git a/syn/file/struct.File.html b/syn/file/struct.File.html new file mode 100644 index 0000000..8aa4e1d --- /dev/null +++ b/syn/file/struct.File.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.File.html...

+ + + \ No newline at end of file diff --git a/syn/fn.parse.html b/syn/fn.parse.html new file mode 100644 index 0000000..8e762d3 --- /dev/null +++ b/syn/fn.parse.html @@ -0,0 +1,27 @@ +parse in syn - Rust

Function syn::parse

source ·
pub fn parse<T: Parse>(tokens: TokenStream) -> Result<T>
Expand description

Parse tokens of source code into the chosen syntax tree node.

+

This is preferred over parsing a string because tokens are able to preserve +information about where in the user’s code they were originally written (the +“span” of the token), possibly allowing the compiler to produce better error +messages.

+

This function parses a proc_macro::TokenStream which is the type used for +interop with the compiler in a procedural macro. To parse a +proc_macro2::TokenStream, use syn::parse2 instead.

+

§Examples

+
use proc_macro::TokenStream;
+use quote::quote;
+use syn::DeriveInput;
+
+#[proc_macro_derive(MyMacro)]
+pub fn my_macro(input: TokenStream) -> TokenStream {
+    // Parse the tokens into a syntax tree
+    let ast: DeriveInput = syn::parse(input).unwrap();
+
+    // Build the output, possibly using quasi-quotation
+    let expanded = quote! {
+        /* ... */
+    };
+
+    // Convert into a token stream and return it
+    expanded.into()
+}
+
\ No newline at end of file diff --git a/syn/fn.parse2.html b/syn/fn.parse2.html new file mode 100644 index 0000000..c99101a --- /dev/null +++ b/syn/fn.parse2.html @@ -0,0 +1,9 @@ +parse2 in syn - Rust

Function syn::parse2

source ·
pub fn parse2<T: Parse>(tokens: TokenStream) -> Result<T>
Expand description

Parse a proc-macro2 token stream into the chosen syntax tree node.

+

This function will check that the input is fully parsed. If there are +any unparsed tokens at the end of the stream, an error is returned.

+

This function parses a proc_macro2::TokenStream which is commonly useful +when the input comes from a node of the Syn syntax tree, for example the +body tokens of a Macro node. When in a procedural macro parsing the +proc_macro::TokenStream provided by the compiler, use syn::parse +instead.

+
\ No newline at end of file diff --git a/syn/fn.parse_file.html b/syn/fn.parse_file.html new file mode 100644 index 0000000..591c437 --- /dev/null +++ b/syn/fn.parse_file.html @@ -0,0 +1,26 @@ +parse_file in syn - Rust

Function syn::parse_file

source ·
pub fn parse_file(content: &str) -> Result<File>
Expand description

Parse the content of a file of Rust code.

+

This is different from syn::parse_str::<File>(content) in two ways:

+
    +
  • It discards a leading byte order mark \u{FEFF} if the file has one.
  • +
  • It preserves the shebang line of the file, such as #!/usr/bin/env rustx.
  • +
+

If present, either of these would be an error using from_str.

+

§Examples

+
use std::error::Error;
+use std::fs::File;
+use std::io::Read;
+
+fn run() -> Result<(), Box<dyn Error>> {
+    let mut file = File::open("path/to/code.rs")?;
+    let mut content = String::new();
+    file.read_to_string(&mut content)?;
+
+    let ast = syn::parse_file(&content)?;
+    if let Some(shebang) = ast.shebang {
+        println!("{}", shebang);
+    }
+    println!("{} items", ast.items.len());
+
+    Ok(())
+}
+
\ No newline at end of file diff --git a/syn/fn.parse_str.html b/syn/fn.parse_str.html new file mode 100644 index 0000000..41b3e59 --- /dev/null +++ b/syn/fn.parse_str.html @@ -0,0 +1,14 @@ +parse_str in syn - Rust

Function syn::parse_str

source ·
pub fn parse_str<T: Parse>(s: &str) -> Result<T>
Expand description

Parse a string of Rust code into the chosen syntax tree node.

+

§Hygiene

+

Every span in the resulting syntax tree will be set to resolve at the macro +call site.

+

§Examples

+
use syn::{Expr, Result};
+
+fn run() -> Result<()> {
+    let code = "assert_eq!(u8::max_value(), 255)";
+    let expr = syn::parse_str::<Expr>(code)?;
+    println!("{:#?}", expr);
+    Ok(())
+}
+
\ No newline at end of file diff --git a/syn/generics/enum.GenericParam.html b/syn/generics/enum.GenericParam.html new file mode 100644 index 0000000..b72491d --- /dev/null +++ b/syn/generics/enum.GenericParam.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/enum.GenericParam.html...

+ + + \ No newline at end of file diff --git a/syn/generics/enum.TraitBoundModifier.html b/syn/generics/enum.TraitBoundModifier.html new file mode 100644 index 0000000..f87143a --- /dev/null +++ b/syn/generics/enum.TraitBoundModifier.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/enum.TraitBoundModifier.html...

+ + + \ No newline at end of file diff --git a/syn/generics/enum.TypeParamBound.html b/syn/generics/enum.TypeParamBound.html new file mode 100644 index 0000000..31d8615 --- /dev/null +++ b/syn/generics/enum.TypeParamBound.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/enum.TypeParamBound.html...

+ + + \ No newline at end of file diff --git a/syn/generics/enum.WherePredicate.html b/syn/generics/enum.WherePredicate.html new file mode 100644 index 0000000..e843261 --- /dev/null +++ b/syn/generics/enum.WherePredicate.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/enum.WherePredicate.html...

+ + + \ No newline at end of file diff --git a/syn/generics/struct.BoundLifetimes.html b/syn/generics/struct.BoundLifetimes.html new file mode 100644 index 0000000..c1f06c2 --- /dev/null +++ b/syn/generics/struct.BoundLifetimes.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.BoundLifetimes.html...

+ + + \ No newline at end of file diff --git a/syn/generics/struct.ConstParam.html b/syn/generics/struct.ConstParam.html new file mode 100644 index 0000000..60f24c7 --- /dev/null +++ b/syn/generics/struct.ConstParam.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.ConstParam.html...

+ + + \ No newline at end of file diff --git a/syn/generics/struct.Generics.html b/syn/generics/struct.Generics.html new file mode 100644 index 0000000..898a563 --- /dev/null +++ b/syn/generics/struct.Generics.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.Generics.html...

+ + + \ No newline at end of file diff --git a/syn/generics/struct.ImplGenerics.html b/syn/generics/struct.ImplGenerics.html new file mode 100644 index 0000000..618c429 --- /dev/null +++ b/syn/generics/struct.ImplGenerics.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.ImplGenerics.html...

+ + + \ No newline at end of file diff --git a/syn/generics/struct.LifetimeParam.html b/syn/generics/struct.LifetimeParam.html new file mode 100644 index 0000000..d605561 --- /dev/null +++ b/syn/generics/struct.LifetimeParam.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.LifetimeParam.html...

+ + + \ No newline at end of file diff --git a/syn/generics/struct.PredicateLifetime.html b/syn/generics/struct.PredicateLifetime.html new file mode 100644 index 0000000..54f06d1 --- /dev/null +++ b/syn/generics/struct.PredicateLifetime.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.PredicateLifetime.html...

+ + + \ No newline at end of file diff --git a/syn/generics/struct.PredicateType.html b/syn/generics/struct.PredicateType.html new file mode 100644 index 0000000..c41b897 --- /dev/null +++ b/syn/generics/struct.PredicateType.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.PredicateType.html...

+ + + \ No newline at end of file diff --git a/syn/generics/struct.TraitBound.html b/syn/generics/struct.TraitBound.html new file mode 100644 index 0000000..d7b7d54 --- /dev/null +++ b/syn/generics/struct.TraitBound.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.TraitBound.html...

+ + + \ No newline at end of file diff --git a/syn/generics/struct.Turbofish.html b/syn/generics/struct.Turbofish.html new file mode 100644 index 0000000..b4b226d --- /dev/null +++ b/syn/generics/struct.Turbofish.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.Turbofish.html...

+ + + \ No newline at end of file diff --git a/syn/generics/struct.TypeGenerics.html b/syn/generics/struct.TypeGenerics.html new file mode 100644 index 0000000..6dde282 --- /dev/null +++ b/syn/generics/struct.TypeGenerics.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.TypeGenerics.html...

+ + + \ No newline at end of file diff --git a/syn/generics/struct.TypeParam.html b/syn/generics/struct.TypeParam.html new file mode 100644 index 0000000..d67ff0a --- /dev/null +++ b/syn/generics/struct.TypeParam.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.TypeParam.html...

+ + + \ No newline at end of file diff --git a/syn/generics/struct.WhereClause.html b/syn/generics/struct.WhereClause.html new file mode 100644 index 0000000..6d14d1c --- /dev/null +++ b/syn/generics/struct.WhereClause.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.WhereClause.html...

+ + + \ No newline at end of file diff --git a/syn/ident/struct.Ident.html b/syn/ident/struct.Ident.html new file mode 100644 index 0000000..86b15d3 --- /dev/null +++ b/syn/ident/struct.Ident.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.Ident.html...

+ + + \ No newline at end of file diff --git a/syn/index.html b/syn/index.html new file mode 100644 index 0000000..ce80df1 --- /dev/null +++ b/syn/index.html @@ -0,0 +1,201 @@ +syn - Rust

Crate syn

source ·
Expand description

githubcrates-iodocs-rs

+
+

Syn is a parsing library for parsing a stream of Rust tokens into a syntax +tree of Rust source code.

+

Currently this library is geared toward use in Rust procedural macros, but +contains some APIs that may be useful more generally.

+
    +
  • +

    Data structures — Syn provides a complete syntax tree that can +represent any valid Rust source code. The syntax tree is rooted at +syn::File which represents a full source file, but there are other +entry points that may be useful to procedural macros including +syn::Item, syn::Expr and syn::Type.

    +
  • +
  • +

    Derives — Of particular interest to derive macros is +syn::DeriveInput which is any of the three legal input items to a +derive macro. An example below shows using this type in a library that can +derive implementations of a user-defined trait.

    +
  • +
  • +

    Parsing — Parsing in Syn is built around parser functions with the +signature fn(ParseStream) -> Result<T>. Every syntax tree node defined +by Syn is individually parsable and may be used as a building block for +custom syntaxes, or you may dream up your own brand new syntax without +involving any of our syntax tree types.

    +
  • +
  • +

    Location information — Every token parsed by Syn is associated with a +Span that tracks line and column information back to the source of that +token. These spans allow a procedural macro to display detailed error +messages pointing to all the right places in the user’s code. There is an +example of this below.

    +
  • +
  • +

    Feature flags — Functionality is aggressively feature gated so your +procedural macros enable only what they need, and do not pay in compile +time for all the rest.

    +
  • +
+
+

§Example of a derive macro

+

The canonical derive macro using Syn looks like this. We write an ordinary +Rust function tagged with a proc_macro_derive attribute and the name of +the trait we are deriving. Any time that derive appears in the user’s code, +the Rust compiler passes their data structure as tokens into our macro. We +get to execute arbitrary Rust code to figure out what to do with those +tokens, then hand some tokens back to the compiler to compile into the +user’s crate.

+
[dependencies]
+syn = "2.0"
+quote = "1.0"
+
+[lib]
+proc-macro = true
+
+
use proc_macro::TokenStream;
+use quote::quote;
+use syn::{parse_macro_input, DeriveInput};
+
+#[proc_macro_derive(MyMacro)]
+pub fn my_macro(input: TokenStream) -> TokenStream {
+    // Parse the input tokens into a syntax tree
+    let input = parse_macro_input!(input as DeriveInput);
+
+    // Build the output, possibly using quasi-quotation
+    let expanded = quote! {
+        // ...
+    };
+
+    // Hand the output tokens back to the compiler
+    TokenStream::from(expanded)
+}
+

The heapsize example directory shows a complete working implementation +of a derive macro. The example derives a HeapSize trait which computes an +estimate of the amount of heap memory owned by a value.

+ +
pub trait HeapSize {
+    /// Total number of bytes of heap memory owned by `self`.
+    fn heap_size_of_children(&self) -> usize;
+}
+

The derive macro allows users to write #[derive(HeapSize)] on data +structures in their program.

+ +
#[derive(HeapSize)]
+struct Demo<'a, T: ?Sized> {
+    a: Box<T>,
+    b: u8,
+    c: &'a str,
+    d: String,
+}
+


+

§Spans and error reporting

+

The token-based procedural macro API provides great control over where the +compiler’s error messages are displayed in user code. Consider the error the +user sees if one of their field types does not implement HeapSize.

+ +
#[derive(HeapSize)]
+struct Broken {
+    ok: String,
+    bad: std::thread::Thread,
+}
+

By tracking span information all the way through the expansion of a +procedural macro as shown in the heapsize example, token-based macros in +Syn are able to trigger errors that directly pinpoint the source of the +problem.

+
error[E0277]: the trait bound `std::thread::Thread: HeapSize` is not satisfied
+ --> src/main.rs:7:5
+  |
+7 |     bad: std::thread::Thread,
+  |     ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `HeapSize` is not implemented for `Thread`
+

+

§Parsing a custom syntax

+

The lazy-static example directory shows the implementation of a +functionlike!(...) procedural macro in which the input tokens are parsed +using Syn’s parsing API.

+

The example reimplements the popular lazy_static crate from crates.io as a +procedural macro.

+ +
lazy_static! {
+    static ref USERNAME: Regex = Regex::new("^[a-z0-9_-]{3,16}$").unwrap();
+}
+

The implementation shows how to trigger custom warnings and error messages +on the macro input.

+
warning: come on, pick a more creative name
+  --> src/main.rs:10:16
+   |
+10 |     static ref FOO: String = "lazy_static".to_owned();
+   |                ^^^
+

+

§Testing

+

When testing macros, we often care not just that the macro can be used +successfully but also that when the macro is provided with invalid input it +produces maximally helpful error messages. Consider using the trybuild +crate to write tests for errors that are emitted by your macro or errors +detected by the Rust compiler in the expanded code following misuse of the +macro. Such tests help avoid regressions from later refactors that +mistakenly make an error no longer trigger or be less helpful than it used +to be.

+
+

§Debugging

+

When developing a procedural macro it can be helpful to look at what the +generated code looks like. Use cargo rustc -- -Zunstable-options --pretty=expanded or the cargo expand subcommand.

+

To show the expanded code for some crate that uses your procedural macro, +run cargo expand from that crate. To show the expanded code for one of +your own test cases, run cargo expand --test the_test_case where the last +argument is the name of the test file without the .rs extension.

+

This write-up by Brandon W Maister discusses debugging in more detail: +Debugging Rust’s new Custom Derive system.

+
+

§Optional features

+

Syn puts a lot of functionality behind optional features in order to +optimize compile time for the most common use cases. The following features +are available.

+
    +
  • derive (enabled by default) — Data structures for representing the +possible input to a derive macro, including structs and enums and types.
  • +
  • full — Data structures for representing the syntax tree of all valid +Rust source code, including items and expressions.
  • +
  • parsing (enabled by default) — Ability to parse input tokens into +a syntax tree node of a chosen type.
  • +
  • printing (enabled by default) — Ability to print a syntax tree +node as tokens of Rust source code.
  • +
  • visit — Trait for traversing a syntax tree.
  • +
  • visit-mut — Trait for traversing and mutating in place a syntax +tree.
  • +
  • fold — Trait for transforming an owned syntax tree.
  • +
  • clone-impls (enabled by default) — Clone impls for all syntax tree +types.
  • +
  • extra-traits — Debug, Eq, PartialEq, Hash impls for all syntax tree +types.
  • +
  • proc-macro (enabled by default) — Runtime dependency on the +dynamic library libproc_macro from rustc toolchain.
  • +
+

Modules§

  • A stably addressed token buffer supporting efficient traversal based on a +cheaply copyable cursor.
  • Extension traits to provide parsing methods on foreign types.
  • Facility for interpreting structured content inside of an Attribute.
  • Parsing interface for parsing a token stream into a syntax tree node.
  • A punctuated sequence of syntax tree nodes separated by punctuation.
  • A trait that can provide the Span of the complete contents of a syntax +tree node.
  • Tokens representing Rust punctuation, keywords, and delimiters.

Macros§

  • A type-macro that expands to the name of the Rust type representation of a +given token.
  • Parse a set of curly braces and expose their content to subsequent parsers.
  • Parse a set of square brackets and expose their content to subsequent +parsers.
  • Define a type that supports parsing and printing a given identifier as if it +were a keyword.
  • Define a type that supports parsing and printing a multi-character symbol +as if it were a punctuation token.
  • Parse a set of parentheses and expose their content to subsequent parsers.
  • Parse the input TokenStream of a macro, triggering a compile error if the +tokens fail to parse.
  • Quasi-quotation macro that accepts input like the quote! macro but uses +type inference to figure out a return type for those tokens.
  • This macro is parse_quote! + quote_spanned!.

Structs§

  • The binary interface of a function: extern "C".
  • Angle bracketed arguments of a path segment: the <K, V> in HashMap<K, V>.
  • One arm of a match expression: 0..=10 => { return true; }.
  • An equality constraint on an associated constant: the PANIC = false in +Trait<PANIC = false>.
  • A binding (equality constraint) on an associated type: the Item = u8 +in Iterator<Item = u8>.
  • An attribute, like #[repr(transparent)].
  • An argument in a function type: the usize in fn(usize) -> bool.
  • The variadic argument of a function pointer like fn(usize, ...).
  • A braced block containing Rust statements.
  • A set of bound lifetimes: for<'a, 'b, 'c>.
  • A const generic parameter: const LENGTH: usize.
  • An associated type bound: Iterator<Item: Display>.
  • An enum input to a proc_macro_derive macro.
  • A struct input to a proc_macro_derive macro.
  • An untagged union input to a proc_macro_derive macro.
  • Data structure sent to a proc_macro_derive macro.
  • Error returned when a Syn parser cannot parse the input tokens.
  • A slice literal expression: [a, b, c, d].
  • An assignment expression: a = compute().
  • An async block: async { ... }.
  • An await expression: fut.await.
  • A binary operation: a + b, a += b.
  • A blocked scope: { ... }.
  • A break, with an optional label to break and an optional +expression.
  • A function call expression: invoke(a, b).
  • A cast expression: foo as f64.
  • A closure expression: |a, b| a + b.
  • A const block: const { ... }.
  • A continue, with an optional label.
  • Access of a named struct field (obj.k) or unnamed tuple struct +field (obj.0).
  • A for loop: for pat in expr { ... }.
  • An expression contained within invisible delimiters.
  • An if expression with an optional else block: if expr { ... } else { ... }.
  • A square bracketed indexing expression: vector[2].
  • The inferred value of a const generic argument, denoted _.
  • A let guard: let Some(x) = opt.
  • A literal in place of an expression: 1, "foo".
  • Conditionless loop: loop { ... }.
  • A macro invocation expression: format!("{}", q).
  • A match expression: match n { Some(n) => {}, None => {} }.
  • A method call expression: x.foo::<T>(a, b).
  • A parenthesized expression: (a + b).
  • A path like std::mem::replace possibly containing generic +parameters and a qualified self-type.
  • A range expression: 1..2, 1.., ..2, 1..=2, ..=2.
  • A referencing operation: &a or &mut a.
  • An array literal constructed from one repeated element: [0u8; N].
  • A return, with an optional value to be returned.
  • A struct literal expression: Point { x: 1, y: 1 }.
  • A try-expression: expr?.
  • A try block: try { ... }.
  • A tuple expression: (a, b, c, d).
  • A unary operation: !x, *x.
  • An unsafe block: unsafe { ... }.
  • A while loop: while expr { ... }.
  • A yield expression: yield expr.
  • A field of a struct or enum variant.
  • A single field in a struct pattern.
  • A field-value pair in a struct literal.
  • Named fields of a struct or struct variant such as Point { x: f64, y: f64 }.
  • Unnamed fields of a tuple struct or tuple variant such as Some(T).
  • A complete file of Rust source code.
  • A foreign function in an extern block.
  • A macro invocation within an extern block.
  • A foreign static item in an extern block: static ext: u8.
  • A foreign type in an extern block: type void.
  • Lifetimes and type parameters attached to a declaration of a function, +enum, trait, etc.
  • A word of Rust code, which may be a keyword or legal variable name.
  • Returned by Generics::split_for_impl.
  • An associated constant within an impl block.
  • An associated function within an impl block.
  • A macro invocation within an impl block.
  • An associated type within an impl block.
  • The index of an unnamed tuple struct field.
  • A constant item: const MAX: u16 = 65535.
  • An enum definition: enum Foo<A, B> { A(A), B(B) }.
  • An extern crate item: extern crate serde.
  • A free-standing function: fn process(n: usize) -> Result<()> { ... }.
  • A block of foreign items: extern "C" { ... }.
  • An impl block providing trait or associated items: impl<A> Trait for Data<A> { ... }.
  • A macro invocation, which includes macro_rules! definitions.
  • A module or module declaration: mod m or mod m { ... }.
  • A static item: static BIKE: Shed = Shed(42).
  • A struct definition: struct Foo<A> { x: A }.
  • A trait definition: pub trait Iterator { ... }.
  • A trait alias: pub trait SharableIterator = Iterator + Sync.
  • A type alias: type Result<T> = std::result::Result<T, MyError>.
  • A union definition: union Foo<A, B> { x: A, y: B }.
  • A use declaration: use std::collections::HashMap.
  • A lifetime labeling a for, while, or loop.
  • A Rust lifetime: 'a.
  • A lifetime definition: 'a: 'b + 'c + 'd.
  • A boolean literal: true or false.
  • A byte literal: b'f'.
  • A byte string literal: b"foo".
  • A nul-terminated C-string literal: c"foo".
  • A character literal: 'a'.
  • A floating point literal: 1f64 or 1.0e10f64.
  • An integer literal: 1 or 1u16.
  • A UTF-8 string literal: "foo".
  • A local let binding: let x: u64 = s.parse()?.
  • The expression assigned in a local let binding, including optional +diverging else block.
  • A macro invocation: println!("{}", mac).
  • A structured list within an attribute, like derive(Copy, Clone).
  • A name-value pair within an attribute, like feature = "nightly".
  • Arguments of a function path segment: the (A, B) -> C in Fn(A,B) -> C.
  • A const block: const { ... }.
  • A pattern that binds a new variable: ref mut binding @ SUBPATTERN.
  • A literal in place of an expression: 1, "foo".
  • A macro invocation expression: format!("{}", q).
  • A pattern that matches any one of a set of cases.
  • A parenthesized pattern: (A | B).
  • A path like std::mem::replace possibly containing generic +parameters and a qualified self-type.
  • A range expression: 1..2, 1.., ..2, 1..=2, ..=2.
  • A reference pattern: &mut var.
  • The dots in a tuple or slice pattern: [0, 1, ..].
  • A dynamically sized slice pattern: [a, b, ref i @ .., y, z].
  • A struct or struct variant pattern: Variant { x, y, .. }.
  • A tuple pattern: (a, b).
  • A tuple struct or tuple variant pattern: Variant(x, y, .., z).
  • A type ascription pattern: foo: f64.
  • A pattern that matches any value: _.
  • A path at which a named item is exported (e.g. std::collections::HashMap).
  • A segment of a path together with any path arguments on that segment.
  • A lifetime predicate in a where clause: 'a: 'b + 'c.
  • A type predicate in a where clause: for<'c> Foo<'c>: Trait<'c>.
  • The explicit Self type in a qualified path: the T in <T as Display>::fmt.
  • The self argument of an associated method.
  • A function signature in a trait or implementation: unsafe fn initialize(&self).
  • A macro invocation in statement position.
  • A trait used as a bound on a type parameter.
  • An associated constant within the definition of a trait.
  • An associated function within the definition of a trait.
  • A macro invocation within the definition of a trait.
  • An associated type within the definition of a trait.
  • Returned by TypeGenerics::as_turbofish.
  • A fixed size array type: [T; n].
  • A bare function type: fn(usize) -> bool.
  • Returned by Generics::split_for_impl.
  • A type contained within invisible delimiters.
  • An impl Bound1 + Bound2 + Bound3 type where Bound is a trait or +a lifetime.
  • Indication that a type should be inferred by the compiler: _.
  • A macro in the type position.
  • The never type: !.
  • A generic type parameter: T: Into<String>.
  • A parenthesized type equivalent to the inner type.
  • A path like std::slice::Iter, optionally qualified with a +self-type as in <Vec<T> as SomeTrait>::Associated.
  • A raw pointer type: *const T or *mut T.
  • A reference type: &'a T or &'a mut T.
  • A dynamically sized slice type: [T].
  • A trait object type dyn Bound1 + Bound2 + Bound3 where Bound is a +trait or a lifetime.
  • A tuple type: (A, B, C, String).
  • A glob import in a use item: *.
  • A braced group of imports in a use item: {A, B, C}.
  • An identifier imported by a use item: HashMap.
  • A path prefix of imports in a use item: std::....
  • An renamed identifier imported by a use item: HashMap as Map.
  • The variadic argument of a foreign function.
  • An enum variant.
  • A visibility level restricted to some path: pub(self) or +pub(super) or pub(crate) or pub(in some::module).
  • A where clause in a definition: where T: Deserialize<'de>, D: 'static.

Enums§

  • Distinguishes between attributes that decorate an item and attributes +that are contained within an item.
  • A binary operator: +, +=, &.
  • The storage of a struct, enum or union data structure.
  • A Rust expression.
  • Unused, but reserved for RFC 3323 restrictions.
  • Data stored within an enum variant or struct.
  • An argument in a function signature: the n: usize in fn f(n: usize).
  • An item within an extern block.
  • An individual generic argument, like 'a, T, or Item = T.
  • A generic type parameter, lifetime, or const generic: T: Into<String>, +'a: 'b, const LEN: usize.
  • An item within an impl block.
  • Unused, but reserved for RFC 3323 restrictions.
  • Things that can appear directly inside of a module or scope.
  • A Rust literal such as a string or integer or boolean.
  • A grouping token that surrounds a macro body: m!(...) or m!{...} or m![...].
  • A struct or tuple struct field accessed in a struct literal or field +expression.
  • Content of a compile-time structured attribute.
  • A pattern in a local binding, function signature, match expression, or +various other places.
  • Angle bracketed or parenthesized arguments of a path segment.
  • Limit types of a range, inclusive or exclusive.
  • Return type of a function signature.
  • The mutability of an Item::Static or ForeignItem::Static.
  • A statement, usually ending in a semicolon.
  • A modifier on a trait bound, currently only used for the ? in +?Sized.
  • An item declaration within the definition of a trait.
  • The possible types that a Rust value could have.
  • A trait or lifetime used as a bound on a type parameter.
  • A unary operator: *, !, -.
  • A suffix of an import tree in a use item: Type as Renamed or *.
  • The visibility level of an item: inherited or pub or +pub(restricted).
  • A single predicate in a where clause: T: Deserialize<'de>.

Functions§

  • Parse tokens of source code into the chosen syntax tree node.
  • Parse a proc-macro2 token stream into the chosen syntax tree node.
  • Parse the content of a file of Rust code.
  • Parse a string of Rust code into the chosen syntax tree node.

Type Aliases§

  • The result of a Syn parser.
\ No newline at end of file diff --git a/syn/item/enum.FnArg.html b/syn/item/enum.FnArg.html new file mode 100644 index 0000000..a8ec9f7 --- /dev/null +++ b/syn/item/enum.FnArg.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/enum.FnArg.html...

+ + + \ No newline at end of file diff --git a/syn/item/enum.ForeignItem.html b/syn/item/enum.ForeignItem.html new file mode 100644 index 0000000..bb36bc3 --- /dev/null +++ b/syn/item/enum.ForeignItem.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/enum.ForeignItem.html...

+ + + \ No newline at end of file diff --git a/syn/item/enum.ImplItem.html b/syn/item/enum.ImplItem.html new file mode 100644 index 0000000..61f6436 --- /dev/null +++ b/syn/item/enum.ImplItem.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/enum.ImplItem.html...

+ + + \ No newline at end of file diff --git a/syn/item/enum.ImplRestriction.html b/syn/item/enum.ImplRestriction.html new file mode 100644 index 0000000..8a69bac --- /dev/null +++ b/syn/item/enum.ImplRestriction.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/enum.ImplRestriction.html...

+ + + \ No newline at end of file diff --git a/syn/item/enum.Item.html b/syn/item/enum.Item.html new file mode 100644 index 0000000..c7a202a --- /dev/null +++ b/syn/item/enum.Item.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/enum.Item.html...

+ + + \ No newline at end of file diff --git a/syn/item/enum.StaticMutability.html b/syn/item/enum.StaticMutability.html new file mode 100644 index 0000000..c496236 --- /dev/null +++ b/syn/item/enum.StaticMutability.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/enum.StaticMutability.html...

+ + + \ No newline at end of file diff --git a/syn/item/enum.TraitItem.html b/syn/item/enum.TraitItem.html new file mode 100644 index 0000000..51d000a --- /dev/null +++ b/syn/item/enum.TraitItem.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/enum.TraitItem.html...

+ + + \ No newline at end of file diff --git a/syn/item/enum.UseTree.html b/syn/item/enum.UseTree.html new file mode 100644 index 0000000..0339012 --- /dev/null +++ b/syn/item/enum.UseTree.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/enum.UseTree.html...

+ + + \ No newline at end of file diff --git a/syn/item/struct.ForeignItemFn.html b/syn/item/struct.ForeignItemFn.html new file mode 100644 index 0000000..978c2a3 --- /dev/null +++ b/syn/item/struct.ForeignItemFn.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.ForeignItemFn.html...

+ + + \ No newline at end of file diff --git a/syn/item/struct.ForeignItemMacro.html b/syn/item/struct.ForeignItemMacro.html new file mode 100644 index 0000000..236b721 --- /dev/null +++ b/syn/item/struct.ForeignItemMacro.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.ForeignItemMacro.html...

+ + + \ No newline at end of file diff --git a/syn/item/struct.ForeignItemStatic.html b/syn/item/struct.ForeignItemStatic.html new file mode 100644 index 0000000..c4614ae --- /dev/null +++ b/syn/item/struct.ForeignItemStatic.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.ForeignItemStatic.html...

+ + + \ No newline at end of file diff --git a/syn/item/struct.ForeignItemType.html b/syn/item/struct.ForeignItemType.html new file mode 100644 index 0000000..5801ef0 --- /dev/null +++ b/syn/item/struct.ForeignItemType.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.ForeignItemType.html...

+ + + \ No newline at end of file diff --git a/syn/item/struct.ImplItemConst.html b/syn/item/struct.ImplItemConst.html new file mode 100644 index 0000000..311faea --- /dev/null +++ b/syn/item/struct.ImplItemConst.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.ImplItemConst.html...

+ + + \ No newline at end of file diff --git a/syn/item/struct.ImplItemFn.html b/syn/item/struct.ImplItemFn.html new file mode 100644 index 0000000..6391734 --- /dev/null +++ b/syn/item/struct.ImplItemFn.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.ImplItemFn.html...

+ + + \ No newline at end of file diff --git a/syn/item/struct.ImplItemMacro.html b/syn/item/struct.ImplItemMacro.html new file mode 100644 index 0000000..34715d8 --- /dev/null +++ b/syn/item/struct.ImplItemMacro.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.ImplItemMacro.html...

+ + + \ No newline at end of file diff --git a/syn/item/struct.ImplItemType.html b/syn/item/struct.ImplItemType.html new file mode 100644 index 0000000..a626a27 --- /dev/null +++ b/syn/item/struct.ImplItemType.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.ImplItemType.html...

+ + + \ No newline at end of file diff --git a/syn/item/struct.ItemConst.html b/syn/item/struct.ItemConst.html new file mode 100644 index 0000000..51e5e1a --- /dev/null +++ b/syn/item/struct.ItemConst.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.ItemConst.html...

+ + + \ No newline at end of file diff --git a/syn/item/struct.ItemEnum.html b/syn/item/struct.ItemEnum.html new file mode 100644 index 0000000..c680cd1 --- /dev/null +++ b/syn/item/struct.ItemEnum.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.ItemEnum.html...

+ + + \ No newline at end of file diff --git a/syn/item/struct.ItemExternCrate.html b/syn/item/struct.ItemExternCrate.html new file mode 100644 index 0000000..bab058f --- /dev/null +++ b/syn/item/struct.ItemExternCrate.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.ItemExternCrate.html...

+ + + \ No newline at end of file diff --git a/syn/item/struct.ItemFn.html b/syn/item/struct.ItemFn.html new file mode 100644 index 0000000..053be0b --- /dev/null +++ b/syn/item/struct.ItemFn.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.ItemFn.html...

+ + + \ No newline at end of file diff --git a/syn/item/struct.ItemForeignMod.html b/syn/item/struct.ItemForeignMod.html new file mode 100644 index 0000000..07f4a4c --- /dev/null +++ b/syn/item/struct.ItemForeignMod.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.ItemForeignMod.html...

+ + + \ No newline at end of file diff --git a/syn/item/struct.ItemImpl.html b/syn/item/struct.ItemImpl.html new file mode 100644 index 0000000..e845cbd --- /dev/null +++ b/syn/item/struct.ItemImpl.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.ItemImpl.html...

+ + + \ No newline at end of file diff --git a/syn/item/struct.ItemMacro.html b/syn/item/struct.ItemMacro.html new file mode 100644 index 0000000..a9d6409 --- /dev/null +++ b/syn/item/struct.ItemMacro.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.ItemMacro.html...

+ + + \ No newline at end of file diff --git a/syn/item/struct.ItemMod.html b/syn/item/struct.ItemMod.html new file mode 100644 index 0000000..498bf4e --- /dev/null +++ b/syn/item/struct.ItemMod.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.ItemMod.html...

+ + + \ No newline at end of file diff --git a/syn/item/struct.ItemStatic.html b/syn/item/struct.ItemStatic.html new file mode 100644 index 0000000..9528ff0 --- /dev/null +++ b/syn/item/struct.ItemStatic.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.ItemStatic.html...

+ + + \ No newline at end of file diff --git a/syn/item/struct.ItemStruct.html b/syn/item/struct.ItemStruct.html new file mode 100644 index 0000000..582f27a --- /dev/null +++ b/syn/item/struct.ItemStruct.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.ItemStruct.html...

+ + + \ No newline at end of file diff --git a/syn/item/struct.ItemTrait.html b/syn/item/struct.ItemTrait.html new file mode 100644 index 0000000..6603ddf --- /dev/null +++ b/syn/item/struct.ItemTrait.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.ItemTrait.html...

+ + + \ No newline at end of file diff --git a/syn/item/struct.ItemTraitAlias.html b/syn/item/struct.ItemTraitAlias.html new file mode 100644 index 0000000..43a0616 --- /dev/null +++ b/syn/item/struct.ItemTraitAlias.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.ItemTraitAlias.html...

+ + + \ No newline at end of file diff --git a/syn/item/struct.ItemType.html b/syn/item/struct.ItemType.html new file mode 100644 index 0000000..3639cbc --- /dev/null +++ b/syn/item/struct.ItemType.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.ItemType.html...

+ + + \ No newline at end of file diff --git a/syn/item/struct.ItemUnion.html b/syn/item/struct.ItemUnion.html new file mode 100644 index 0000000..171ed7c --- /dev/null +++ b/syn/item/struct.ItemUnion.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.ItemUnion.html...

+ + + \ No newline at end of file diff --git a/syn/item/struct.ItemUse.html b/syn/item/struct.ItemUse.html new file mode 100644 index 0000000..97fdc1f --- /dev/null +++ b/syn/item/struct.ItemUse.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.ItemUse.html...

+ + + \ No newline at end of file diff --git a/syn/item/struct.Receiver.html b/syn/item/struct.Receiver.html new file mode 100644 index 0000000..395c120 --- /dev/null +++ b/syn/item/struct.Receiver.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.Receiver.html...

+ + + \ No newline at end of file diff --git a/syn/item/struct.Signature.html b/syn/item/struct.Signature.html new file mode 100644 index 0000000..37263bd --- /dev/null +++ b/syn/item/struct.Signature.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.Signature.html...

+ + + \ No newline at end of file diff --git a/syn/item/struct.TraitItemConst.html b/syn/item/struct.TraitItemConst.html new file mode 100644 index 0000000..c2dc2f4 --- /dev/null +++ b/syn/item/struct.TraitItemConst.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.TraitItemConst.html...

+ + + \ No newline at end of file diff --git a/syn/item/struct.TraitItemFn.html b/syn/item/struct.TraitItemFn.html new file mode 100644 index 0000000..cf27ed0 --- /dev/null +++ b/syn/item/struct.TraitItemFn.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.TraitItemFn.html...

+ + + \ No newline at end of file diff --git a/syn/item/struct.TraitItemMacro.html b/syn/item/struct.TraitItemMacro.html new file mode 100644 index 0000000..c471b09 --- /dev/null +++ b/syn/item/struct.TraitItemMacro.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.TraitItemMacro.html...

+ + + \ No newline at end of file diff --git a/syn/item/struct.TraitItemType.html b/syn/item/struct.TraitItemType.html new file mode 100644 index 0000000..5f809d9 --- /dev/null +++ b/syn/item/struct.TraitItemType.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.TraitItemType.html...

+ + + \ No newline at end of file diff --git a/syn/item/struct.UseGlob.html b/syn/item/struct.UseGlob.html new file mode 100644 index 0000000..3898358 --- /dev/null +++ b/syn/item/struct.UseGlob.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.UseGlob.html...

+ + + \ No newline at end of file diff --git a/syn/item/struct.UseGroup.html b/syn/item/struct.UseGroup.html new file mode 100644 index 0000000..d6f3b91 --- /dev/null +++ b/syn/item/struct.UseGroup.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.UseGroup.html...

+ + + \ No newline at end of file diff --git a/syn/item/struct.UseName.html b/syn/item/struct.UseName.html new file mode 100644 index 0000000..d5e3d0b --- /dev/null +++ b/syn/item/struct.UseName.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.UseName.html...

+ + + \ No newline at end of file diff --git a/syn/item/struct.UsePath.html b/syn/item/struct.UsePath.html new file mode 100644 index 0000000..5ca9bd9 --- /dev/null +++ b/syn/item/struct.UsePath.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.UsePath.html...

+ + + \ No newline at end of file diff --git a/syn/item/struct.UseRename.html b/syn/item/struct.UseRename.html new file mode 100644 index 0000000..88fc106 --- /dev/null +++ b/syn/item/struct.UseRename.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.UseRename.html...

+ + + \ No newline at end of file diff --git a/syn/item/struct.Variadic.html b/syn/item/struct.Variadic.html new file mode 100644 index 0000000..b3f6c7e --- /dev/null +++ b/syn/item/struct.Variadic.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.Variadic.html...

+ + + \ No newline at end of file diff --git a/syn/lifetime/struct.Lifetime.html b/syn/lifetime/struct.Lifetime.html new file mode 100644 index 0000000..c8ece63 --- /dev/null +++ b/syn/lifetime/struct.Lifetime.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.Lifetime.html...

+ + + \ No newline at end of file diff --git a/syn/lit/enum.Lit.html b/syn/lit/enum.Lit.html new file mode 100644 index 0000000..f074c5f --- /dev/null +++ b/syn/lit/enum.Lit.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/enum.Lit.html...

+ + + \ No newline at end of file diff --git a/syn/lit/struct.LitBool.html b/syn/lit/struct.LitBool.html new file mode 100644 index 0000000..5cf3db6 --- /dev/null +++ b/syn/lit/struct.LitBool.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.LitBool.html...

+ + + \ No newline at end of file diff --git a/syn/lit/struct.LitByte.html b/syn/lit/struct.LitByte.html new file mode 100644 index 0000000..2f1ab51 --- /dev/null +++ b/syn/lit/struct.LitByte.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.LitByte.html...

+ + + \ No newline at end of file diff --git a/syn/lit/struct.LitByteStr.html b/syn/lit/struct.LitByteStr.html new file mode 100644 index 0000000..a8248bc --- /dev/null +++ b/syn/lit/struct.LitByteStr.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.LitByteStr.html...

+ + + \ No newline at end of file diff --git a/syn/lit/struct.LitCStr.html b/syn/lit/struct.LitCStr.html new file mode 100644 index 0000000..102f7dd --- /dev/null +++ b/syn/lit/struct.LitCStr.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.LitCStr.html...

+ + + \ No newline at end of file diff --git a/syn/lit/struct.LitChar.html b/syn/lit/struct.LitChar.html new file mode 100644 index 0000000..9fe383e --- /dev/null +++ b/syn/lit/struct.LitChar.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.LitChar.html...

+ + + \ No newline at end of file diff --git a/syn/lit/struct.LitFloat.html b/syn/lit/struct.LitFloat.html new file mode 100644 index 0000000..d85e824 --- /dev/null +++ b/syn/lit/struct.LitFloat.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.LitFloat.html...

+ + + \ No newline at end of file diff --git a/syn/lit/struct.LitInt.html b/syn/lit/struct.LitInt.html new file mode 100644 index 0000000..cae71ca --- /dev/null +++ b/syn/lit/struct.LitInt.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.LitInt.html...

+ + + \ No newline at end of file diff --git a/syn/lit/struct.LitStr.html b/syn/lit/struct.LitStr.html new file mode 100644 index 0000000..38d9a0b --- /dev/null +++ b/syn/lit/struct.LitStr.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.LitStr.html...

+ + + \ No newline at end of file diff --git a/syn/lookahead/struct.Lookahead1.html b/syn/lookahead/struct.Lookahead1.html new file mode 100644 index 0000000..84c934b --- /dev/null +++ b/syn/lookahead/struct.Lookahead1.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/parse/struct.Lookahead1.html...

+ + + \ No newline at end of file diff --git a/syn/lookahead/trait.Peek.html b/syn/lookahead/trait.Peek.html new file mode 100644 index 0000000..4551e70 --- /dev/null +++ b/syn/lookahead/trait.Peek.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/parse/trait.Peek.html...

+ + + \ No newline at end of file diff --git a/syn/mac/enum.MacroDelimiter.html b/syn/mac/enum.MacroDelimiter.html new file mode 100644 index 0000000..3a74fc3 --- /dev/null +++ b/syn/mac/enum.MacroDelimiter.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/enum.MacroDelimiter.html...

+ + + \ No newline at end of file diff --git a/syn/mac/struct.Macro.html b/syn/mac/struct.Macro.html new file mode 100644 index 0000000..c1d072e --- /dev/null +++ b/syn/mac/struct.Macro.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.Macro.html...

+ + + \ No newline at end of file diff --git a/syn/macro.Token!.html b/syn/macro.Token!.html new file mode 100644 index 0000000..5f80fc2 --- /dev/null +++ b/syn/macro.Token!.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to macro.Token.html...

+ + + \ No newline at end of file diff --git a/syn/macro.Token.html b/syn/macro.Token.html new file mode 100644 index 0000000..2c7dae1 --- /dev/null +++ b/syn/macro.Token.html @@ -0,0 +1,141 @@ +Token in syn - Rust

Macro syn::Token

source ·
macro_rules! Token {
+    [abstract] => { ... };
+    [as] => { ... };
+    [async] => { ... };
+    [auto] => { ... };
+    [await] => { ... };
+    [become] => { ... };
+    [box] => { ... };
+    [break] => { ... };
+    [const] => { ... };
+    [continue] => { ... };
+    [crate] => { ... };
+    [default] => { ... };
+    [do] => { ... };
+    [dyn] => { ... };
+    [else] => { ... };
+    [enum] => { ... };
+    [extern] => { ... };
+    [final] => { ... };
+    [fn] => { ... };
+    [for] => { ... };
+    [if] => { ... };
+    [impl] => { ... };
+    [in] => { ... };
+    [let] => { ... };
+    [loop] => { ... };
+    [macro] => { ... };
+    [match] => { ... };
+    [mod] => { ... };
+    [move] => { ... };
+    [mut] => { ... };
+    [override] => { ... };
+    [priv] => { ... };
+    [pub] => { ... };
+    [ref] => { ... };
+    [return] => { ... };
+    [Self] => { ... };
+    [self] => { ... };
+    [static] => { ... };
+    [struct] => { ... };
+    [super] => { ... };
+    [trait] => { ... };
+    [try] => { ... };
+    [type] => { ... };
+    [typeof] => { ... };
+    [union] => { ... };
+    [unsafe] => { ... };
+    [unsized] => { ... };
+    [use] => { ... };
+    [virtual] => { ... };
+    [where] => { ... };
+    [while] => { ... };
+    [yield] => { ... };
+    [&] => { ... };
+    [&&] => { ... };
+    [&=] => { ... };
+    [@] => { ... };
+    [^] => { ... };
+    [^=] => { ... };
+    [:] => { ... };
+    [,] => { ... };
+    [$] => { ... };
+    [.] => { ... };
+    [..] => { ... };
+    [...] => { ... };
+    [..=] => { ... };
+    [=] => { ... };
+    [==] => { ... };
+    [=>] => { ... };
+    [>=] => { ... };
+    [>] => { ... };
+    [<-] => { ... };
+    [<=] => { ... };
+    [<] => { ... };
+    [-] => { ... };
+    [-=] => { ... };
+    [!=] => { ... };
+    [!] => { ... };
+    [|] => { ... };
+    [|=] => { ... };
+    [||] => { ... };
+    [::] => { ... };
+    [%] => { ... };
+    [%=] => { ... };
+    [+] => { ... };
+    [+=] => { ... };
+    [#] => { ... };
+    [?] => { ... };
+    [->] => { ... };
+    [;] => { ... };
+    [<<] => { ... };
+    [<<=] => { ... };
+    [>>] => { ... };
+    [>>=] => { ... };
+    [/] => { ... };
+    [/=] => { ... };
+    [*] => { ... };
+    [*=] => { ... };
+    [~] => { ... };
+    [_] => { ... };
+}
Expand description

A type-macro that expands to the name of the Rust type representation of a +given token.

+

As a type, Token! is commonly used in the type of struct fields, the type +of a let statement, or in turbofish for a parse function.

+ +
use syn::{Ident, Token};
+use syn::parse::{Parse, ParseStream, Result};
+
+// `struct Foo;`
+pub struct UnitStruct {
+    struct_token: Token![struct],
+    ident: Ident,
+    semi_token: Token![;],
+}
+
+impl Parse for UnitStruct {
+    fn parse(input: ParseStream) -> Result<Self> {
+        let struct_token: Token![struct] = input.parse()?;
+        let ident: Ident = input.parse()?;
+        let semi_token = input.parse::<Token![;]>()?;
+        Ok(UnitStruct { struct_token, ident, semi_token })
+    }
+}
+

As an expression, Token! is used for peeking tokens or instantiating +tokens from a span.

+ +
fn make_unit_struct(name: Ident) -> UnitStruct {
+    let span = name.span();
+    UnitStruct {
+        struct_token: Token![struct](span),
+        ident: name,
+        semi_token: Token![;](span),
+    }
+}
+
+if input.peek(Token![struct]) {
+    let unit_struct: UnitStruct = input.parse()?;
+    /* ... */
+}
+

See the token module documentation for details and examples.

+
\ No newline at end of file diff --git a/syn/macro.braced!.html b/syn/macro.braced!.html new file mode 100644 index 0000000..e7c2e96 --- /dev/null +++ b/syn/macro.braced!.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to macro.braced.html...

+ + + \ No newline at end of file diff --git a/syn/macro.braced.html b/syn/macro.braced.html new file mode 100644 index 0000000..f177fbd --- /dev/null +++ b/syn/macro.braced.html @@ -0,0 +1,49 @@ +braced in syn - Rust

Macro syn::braced

source ·
macro_rules! braced {
+    ($content:ident in $cursor:expr) => { ... };
+}
Expand description

Parse a set of curly braces and expose their content to subsequent parsers.

+

§Example

+
use syn::{braced, token, Ident, Result, Token, Type};
+use syn::parse::{Parse, ParseStream};
+use syn::punctuated::Punctuated;
+
+// Parse a simplified struct syntax like:
+//
+//     struct S {
+//         a: A,
+//         b: B,
+//     }
+struct Struct {
+    struct_token: Token![struct],
+    ident: Ident,
+    brace_token: token::Brace,
+    fields: Punctuated<Field, Token![,]>,
+}
+
+struct Field {
+    name: Ident,
+    colon_token: Token![:],
+    ty: Type,
+}
+
+impl Parse for Struct {
+    fn parse(input: ParseStream) -> Result<Self> {
+        let content;
+        Ok(Struct {
+            struct_token: input.parse()?,
+            ident: input.parse()?,
+            brace_token: braced!(content in input),
+            fields: content.parse_terminated(Field::parse, Token![,])?,
+        })
+    }
+}
+
+impl Parse for Field {
+    fn parse(input: ParseStream) -> Result<Self> {
+        Ok(Field {
+            name: input.parse()?,
+            colon_token: input.parse()?,
+            ty: input.parse()?,
+        })
+    }
+}
+
\ No newline at end of file diff --git a/syn/macro.bracketed!.html b/syn/macro.bracketed!.html new file mode 100644 index 0000000..fc3b6a5 --- /dev/null +++ b/syn/macro.bracketed!.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to macro.bracketed.html...

+ + + \ No newline at end of file diff --git a/syn/macro.bracketed.html b/syn/macro.bracketed.html new file mode 100644 index 0000000..d462bcd --- /dev/null +++ b/syn/macro.bracketed.html @@ -0,0 +1,29 @@ +bracketed in syn - Rust

Macro syn::bracketed

source ·
macro_rules! bracketed {
+    ($content:ident in $cursor:expr) => { ... };
+}
Expand description

Parse a set of square brackets and expose their content to subsequent +parsers.

+

§Example

+
use proc_macro2::TokenStream;
+use syn::{bracketed, token, Result, Token};
+use syn::parse::{Parse, ParseStream};
+
+// Parse an outer attribute like:
+//
+//     #[repr(C, packed)]
+struct OuterAttribute {
+    pound_token: Token![#],
+    bracket_token: token::Bracket,
+    content: TokenStream,
+}
+
+impl Parse for OuterAttribute {
+    fn parse(input: ParseStream) -> Result<Self> {
+        let content;
+        Ok(OuterAttribute {
+            pound_token: input.parse()?,
+            bracket_token: bracketed!(content in input),
+            content: content.parse()?,
+        })
+    }
+}
+
\ No newline at end of file diff --git a/syn/macro.custom_keyword!.html b/syn/macro.custom_keyword!.html new file mode 100644 index 0000000..a473b4f --- /dev/null +++ b/syn/macro.custom_keyword!.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to macro.custom_keyword.html...

+ + + \ No newline at end of file diff --git a/syn/macro.custom_keyword.html b/syn/macro.custom_keyword.html new file mode 100644 index 0000000..67a1467 --- /dev/null +++ b/syn/macro.custom_keyword.html @@ -0,0 +1,83 @@ +custom_keyword in syn - Rust

Macro syn::custom_keyword

source ·
macro_rules! custom_keyword {
+    ($ident:ident) => { ... };
+}
Expand description

Define a type that supports parsing and printing a given identifier as if it +were a keyword.

+

§Usage

+

As a convention, it is recommended that this macro be invoked within a +module called kw or keyword and that the resulting parser be invoked +with a kw:: or keyword:: prefix.

+ +
mod kw {
+    syn::custom_keyword!(whatever);
+}
+

The generated syntax tree node supports the following operations just like +any built-in keyword token.

+
    +
  • +

    Peekinginput.peek(kw::whatever)

    +
  • +
  • +

    Parsinginput.parse::<kw::whatever>()?

    +
  • +
  • +

    Printingquote!( ... #whatever_token ... )

    +
  • +
  • +

    Construction from a Spanlet whatever_token = kw::whatever(sp)

    +
  • +
  • +

    Field access to its span — let sp = whatever_token.span

    +
  • +
+

§Example

+

This example parses input that looks like bool = true or str = "value". +The key must be either the identifier bool or the identifier str. If +bool, the value may be either true or false. If str, the value may +be any string literal.

+

The symbols bool and str are not reserved keywords in Rust so these are +not considered keywords in the syn::token module. Like any other +identifier that is not a keyword, these can be declared as custom keywords +by crates that need to use them as such.

+ +
use syn::{LitBool, LitStr, Result, Token};
+use syn::parse::{Parse, ParseStream};
+
+mod kw {
+    syn::custom_keyword!(bool);
+    syn::custom_keyword!(str);
+}
+
+enum Argument {
+    Bool {
+        bool_token: kw::bool,
+        eq_token: Token![=],
+        value: LitBool,
+    },
+    Str {
+        str_token: kw::str,
+        eq_token: Token![=],
+        value: LitStr,
+    },
+}
+
+impl Parse for Argument {
+    fn parse(input: ParseStream) -> Result<Self> {
+        let lookahead = input.lookahead1();
+        if lookahead.peek(kw::bool) {
+            Ok(Argument::Bool {
+                bool_token: input.parse::<kw::bool>()?,
+                eq_token: input.parse()?,
+                value: input.parse()?,
+            })
+        } else if lookahead.peek(kw::str) {
+            Ok(Argument::Str {
+                str_token: input.parse::<kw::str>()?,
+                eq_token: input.parse()?,
+                value: input.parse()?,
+            })
+        } else {
+            Err(lookahead.error())
+        }
+    }
+}
+
\ No newline at end of file diff --git a/syn/macro.custom_punctuation!.html b/syn/macro.custom_punctuation!.html new file mode 100644 index 0000000..8bcdb09 --- /dev/null +++ b/syn/macro.custom_punctuation!.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to macro.custom_punctuation.html...

+ + + \ No newline at end of file diff --git a/syn/macro.custom_punctuation.html b/syn/macro.custom_punctuation.html new file mode 100644 index 0000000..3f6d69b --- /dev/null +++ b/syn/macro.custom_punctuation.html @@ -0,0 +1,73 @@ +custom_punctuation in syn - Rust

Macro syn::custom_punctuation

source ·
macro_rules! custom_punctuation {
+    ($ident:ident, $($tt:tt)+) => { ... };
+}
Expand description

Define a type that supports parsing and printing a multi-character symbol +as if it were a punctuation token.

+

§Usage

+
syn::custom_punctuation!(LeftRightArrow, <=>);
+

The generated syntax tree node supports the following operations just like +any built-in punctuation token.

+
    +
  • +

    Peekinginput.peek(LeftRightArrow)

    +
  • +
  • +

    Parsinginput.parse::<LeftRightArrow>()?

    +
  • +
  • +

    Printingquote!( ... #lrarrow ... )

    +
  • +
  • +

    Construction from a Spanlet lrarrow = LeftRightArrow(sp)

    +
  • +
  • +

    Construction from multiple Spanlet lrarrow = LeftRightArrow([sp, sp, sp])

    +
  • +
  • +

    Field access to its spans — let spans = lrarrow.spans

    +
  • +
+

§Example

+
use proc_macro2::{TokenStream, TokenTree};
+use syn::parse::{Parse, ParseStream, Peek, Result};
+use syn::punctuated::Punctuated;
+use syn::Expr;
+
+syn::custom_punctuation!(PathSeparator, </>);
+
+// expr </> expr </> expr ...
+struct PathSegments {
+    segments: Punctuated<Expr, PathSeparator>,
+}
+
+impl Parse for PathSegments {
+    fn parse(input: ParseStream) -> Result<Self> {
+        let mut segments = Punctuated::new();
+
+        let first = parse_until(input, PathSeparator)?;
+        segments.push_value(syn::parse2(first)?);
+
+        while input.peek(PathSeparator) {
+            segments.push_punct(input.parse()?);
+
+            let next = parse_until(input, PathSeparator)?;
+            segments.push_value(syn::parse2(next)?);
+        }
+
+        Ok(PathSegments { segments })
+    }
+}
+
+fn parse_until<E: Peek>(input: ParseStream, end: E) -> Result<TokenStream> {
+    let mut tokens = TokenStream::new();
+    while !input.is_empty() && !input.peek(end) {
+        let next: TokenTree = input.parse()?;
+        tokens.extend(Some(next));
+    }
+    Ok(tokens)
+}
+
+fn main() {
+    let input = r#" a::b </> c::d::e "#;
+    let _: PathSegments = syn::parse_str(input).unwrap();
+}
+
\ No newline at end of file diff --git a/syn/macro.parenthesized!.html b/syn/macro.parenthesized!.html new file mode 100644 index 0000000..ffb60ba --- /dev/null +++ b/syn/macro.parenthesized!.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to macro.parenthesized.html...

+ + + \ No newline at end of file diff --git a/syn/macro.parenthesized.html b/syn/macro.parenthesized.html new file mode 100644 index 0000000..23f2341 --- /dev/null +++ b/syn/macro.parenthesized.html @@ -0,0 +1,32 @@ +parenthesized in syn - Rust

Macro syn::parenthesized

source ·
macro_rules! parenthesized {
+    ($content:ident in $cursor:expr) => { ... };
+}
Expand description

Parse a set of parentheses and expose their content to subsequent parsers.

+

§Example

+
use syn::{parenthesized, token, Ident, Result, Token, Type};
+use syn::parse::{Parse, ParseStream};
+use syn::punctuated::Punctuated;
+
+// Parse a simplified tuple struct syntax like:
+//
+//     struct S(A, B);
+struct TupleStruct {
+    struct_token: Token![struct],
+    ident: Ident,
+    paren_token: token::Paren,
+    fields: Punctuated<Type, Token![,]>,
+    semi_token: Token![;],
+}
+
+impl Parse for TupleStruct {
+    fn parse(input: ParseStream) -> Result<Self> {
+        let content;
+        Ok(TupleStruct {
+            struct_token: input.parse()?,
+            ident: input.parse()?,
+            paren_token: parenthesized!(content in input),
+            fields: content.parse_terminated(Type::parse, Token![,])?,
+            semi_token: input.parse()?,
+        })
+    }
+}
+
\ No newline at end of file diff --git a/syn/macro.parse_macro_input!.html b/syn/macro.parse_macro_input!.html new file mode 100644 index 0000000..6723854 --- /dev/null +++ b/syn/macro.parse_macro_input!.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to macro.parse_macro_input.html...

+ + + \ No newline at end of file diff --git a/syn/macro.parse_macro_input.html b/syn/macro.parse_macro_input.html new file mode 100644 index 0000000..e085f7d --- /dev/null +++ b/syn/macro.parse_macro_input.html @@ -0,0 +1,61 @@ +parse_macro_input in syn - Rust

Macro syn::parse_macro_input

source ·
macro_rules! parse_macro_input {
+    ($tokenstream:ident as $ty:ty) => { ... };
+    ($tokenstream:ident with $parser:path) => { ... };
+    ($tokenstream:ident) => { ... };
+}
Expand description

Parse the input TokenStream of a macro, triggering a compile error if the +tokens fail to parse.

+

Refer to the parse module documentation for more details about parsing +in Syn.

+
+

§Intended usage

+

This macro must be called from a function that returns +proc_macro::TokenStream. Usually this will be your proc macro entry point, +the function that has the #[proc_macro] / #[proc_macro_derive] / +#[proc_macro_attribute] attribute.

+ +
use proc_macro::TokenStream;
+use syn::{parse_macro_input, Result};
+use syn::parse::{Parse, ParseStream};
+
+struct MyMacroInput {
+    /* ... */
+}
+
+impl Parse for MyMacroInput {
+    fn parse(input: ParseStream) -> Result<Self> {
+        /* ... */
+    }
+}
+
+#[proc_macro]
+pub fn my_macro(tokens: TokenStream) -> TokenStream {
+    let input = parse_macro_input!(tokens as MyMacroInput);
+
+    /* ... */
+}
+
+

§Usage with Parser

+

This macro can also be used with the Parser trait for types that have +multiple ways that they can be parsed.

+ +
impl MyMacroInput {
+    fn parse_alternate(input: ParseStream) -> Result<Self> {
+        /* ... */
+    }
+}
+
+#[proc_macro]
+pub fn my_macro(tokens: TokenStream) -> TokenStream {
+    let input = parse_macro_input!(tokens with MyMacroInput::parse_alternate);
+
+    /* ... */
+}
+
+

§Expansion

+

parse_macro_input!($variable as $Type) expands to something like:

+ +
match syn::parse::<$Type>($variable) {
+    Ok(syntax_tree) => syntax_tree,
+    Err(err) => return proc_macro::TokenStream::from(err.to_compile_error()),
+}
+
\ No newline at end of file diff --git a/syn/macro.parse_quote!.html b/syn/macro.parse_quote!.html new file mode 100644 index 0000000..fb31570 --- /dev/null +++ b/syn/macro.parse_quote!.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to macro.parse_quote.html...

+ + + \ No newline at end of file diff --git a/syn/macro.parse_quote.html b/syn/macro.parse_quote.html new file mode 100644 index 0000000..90fe18c --- /dev/null +++ b/syn/macro.parse_quote.html @@ -0,0 +1,52 @@ +parse_quote in syn - Rust

Macro syn::parse_quote

source ·
macro_rules! parse_quote {
+    ($($tt:tt)*) => { ... };
+}
Expand description

Quasi-quotation macro that accepts input like the quote! macro but uses +type inference to figure out a return type for those tokens.

+

The return type can be any syntax tree node that implements the Parse +trait.

+ +
use quote::quote;
+use syn::{parse_quote, Stmt};
+
+fn main() {
+    let name = quote!(v);
+    let ty = quote!(u8);
+
+    let stmt: Stmt = parse_quote! {
+        let #name: #ty = Default::default();
+    };
+
+    println!("{:#?}", stmt);
+}
+

This macro is available only if Syn is built with both the "parsing" and +"printing" features.

+

§Example

+

The following helper function adds a bound T: HeapSize to every type +parameter T in the input generics.

+ +
use syn::{parse_quote, Generics, GenericParam};
+
+// Add a bound `T: HeapSize` to every type parameter T.
+fn add_trait_bounds(mut generics: Generics) -> Generics {
+    for param in &mut generics.params {
+        if let GenericParam::Type(type_param) = param {
+            type_param.bounds.push(parse_quote!(HeapSize));
+        }
+    }
+    generics
+}
+

§Special cases

+

This macro can parse the following additional types as a special case even +though they do not implement the Parse trait.

+
    +
  • Attribute — parses one attribute, allowing either outer like #[...] +or inner like #![...]
  • +
  • Punctuated<T, P> — parses zero or more T separated by punctuation +P with optional trailing punctuation
  • +
  • Vec<Stmt> — parses the same as Block::parse_within
  • +
+

§Panics

+

Panics if the tokens fail to parse as the expected syntax tree type. The +caller is responsible for ensuring that the input tokens are syntactically +valid.

+
\ No newline at end of file diff --git a/syn/macro.parse_quote_spanned!.html b/syn/macro.parse_quote_spanned!.html new file mode 100644 index 0000000..32cbefd --- /dev/null +++ b/syn/macro.parse_quote_spanned!.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to macro.parse_quote_spanned.html...

+ + + \ No newline at end of file diff --git a/syn/macro.parse_quote_spanned.html b/syn/macro.parse_quote_spanned.html new file mode 100644 index 0000000..aadcccd --- /dev/null +++ b/syn/macro.parse_quote_spanned.html @@ -0,0 +1,22 @@ +parse_quote_spanned in syn - Rust

Macro syn::parse_quote_spanned

source ·
macro_rules! parse_quote_spanned {
+    ($span:expr=> $($tt:tt)*) => { ... };
+}
Expand description

This macro is parse_quote! + quote_spanned!.

+

Please refer to each of their documentation.

+

§Example

+
use quote::{quote, quote_spanned};
+use syn::spanned::Spanned;
+use syn::{parse_quote_spanned, ReturnType, Signature};
+
+// Changes `fn()` to `fn() -> Pin<Box<dyn Future<Output = ()>>>`,
+// and `fn() -> T` to `fn() -> Pin<Box<dyn Future<Output = T>>>`,
+// without introducing any call_site() spans.
+fn make_ret_pinned_future(sig: &mut Signature) {
+    let ret = match &sig.output {
+        ReturnType::Default => quote_spanned!(sig.paren_token.span=> ()),
+        ReturnType::Type(_, ret) => quote!(#ret),
+    };
+    sig.output = parse_quote_spanned! {ret.span()=>
+        -> ::std::pin::Pin<::std::boxed::Box<dyn ::std::future::Future<Output = #ret>>>
+    };
+}
+
\ No newline at end of file diff --git a/syn/meta/fn.parser.html b/syn/meta/fn.parser.html new file mode 100644 index 0000000..aa5cd0b --- /dev/null +++ b/syn/meta/fn.parser.html @@ -0,0 +1,93 @@ +parser in syn::meta - Rust

Function syn::meta::parser

source ·
pub fn parser(
+    logic: impl FnMut(ParseNestedMeta<'_>) -> Result<()>
+) -> impl Parser<Output = ()>
Expand description

Make a parser that is usable with parse_macro_input! in a +#[proc_macro_attribute] macro.

+

Warning: When parsing attribute args other than the +proc_macro::TokenStream input of a proc_macro_attribute, you do not +need this function. In several cases your callers will get worse error +messages if you use this function, because the surrounding delimiter’s span +is concealed from attribute macros by rustc. Use +Attribute::parse_nested_meta instead.

+

§Example

+

This example implements an attribute macro whose invocations look like this:

+ +
#[tea(kind = "EarlGrey", hot)]
+struct Picard {...}
+

The “parameters” supported by the attribute are:

+
    +
  • kind = "..."
  • +
  • hot
  • +
  • with(sugar, milk, ...), a comma-separated list of ingredients
  • +
+ +
use proc_macro::TokenStream;
+use syn::{parse_macro_input, LitStr, Path};
+
+#[proc_macro_attribute]
+pub fn tea(args: TokenStream, input: TokenStream) -> TokenStream {
+    let mut kind: Option<LitStr> = None;
+    let mut hot: bool = false;
+    let mut with: Vec<Path> = Vec::new();
+    let tea_parser = syn::meta::parser(|meta| {
+        if meta.path.is_ident("kind") {
+            kind = Some(meta.value()?.parse()?);
+            Ok(())
+        } else if meta.path.is_ident("hot") {
+            hot = true;
+            Ok(())
+        } else if meta.path.is_ident("with") {
+            meta.parse_nested_meta(|meta| {
+                with.push(meta.path);
+                Ok(())
+            })
+        } else {
+            Err(meta.error("unsupported tea property"))
+        }
+    });
+
+    parse_macro_input!(args with tea_parser);
+    eprintln!("kind={kind:?} hot={hot} with={with:?}");
+
+    /* ... */
+}
+

The syn::meta library will take care of dealing with the commas including +trailing commas, and producing sensible error messages on unexpected input.

+
error: expected `,`
+ --> src/main.rs:3:37
+  |
+3 | #[tea(kind = "EarlGrey", with(sugar = "lol", milk))]
+  |                                     ^
+

§Example

+

Same as above but we factor out most of the logic into a separate function.

+ +
use proc_macro::TokenStream;
+use syn::meta::ParseNestedMeta;
+use syn::parse::{Parser, Result};
+use syn::{parse_macro_input, LitStr, Path};
+
+#[proc_macro_attribute]
+pub fn tea(args: TokenStream, input: TokenStream) -> TokenStream {
+    let mut attrs = TeaAttributes::default();
+    let tea_parser = syn::meta::parser(|meta| attrs.parse(meta));
+    parse_macro_input!(args with tea_parser);
+
+    /* ... */
+}
+
+#[derive(Default)]
+struct TeaAttributes {
+    kind: Option<LitStr>,
+    hot: bool,
+    with: Vec<Path>,
+}
+
+impl TeaAttributes {
+    fn parse(&mut self, meta: ParseNestedMeta) -> Result<()> {
+        if meta.path.is_ident("kind") {
+            self.kind = Some(meta.value()?.parse()?);
+            Ok(())
+        } else /* just like in last example */
+
+    }
+}
+
\ No newline at end of file diff --git a/syn/meta/index.html b/syn/meta/index.html new file mode 100644 index 0000000..e105be4 --- /dev/null +++ b/syn/meta/index.html @@ -0,0 +1,4 @@ +syn::meta - Rust

Module syn::meta

source ·
Expand description

Facility for interpreting structured content inside of an Attribute.

+

Structs§

  • Context for parsing a single property in the conventional syntax for +structured attributes.

Functions§

  • Make a parser that is usable with parse_macro_input! in a +#[proc_macro_attribute] macro.
\ No newline at end of file diff --git a/syn/meta/sidebar-items.js b/syn/meta/sidebar-items.js new file mode 100644 index 0000000..79f286b --- /dev/null +++ b/syn/meta/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"fn":["parser"],"struct":["ParseNestedMeta"]}; \ No newline at end of file diff --git a/syn/meta/struct.ParseNestedMeta.html b/syn/meta/struct.ParseNestedMeta.html new file mode 100644 index 0000000..352d334 --- /dev/null +++ b/syn/meta/struct.ParseNestedMeta.html @@ -0,0 +1,176 @@ +ParseNestedMeta in syn::meta - Rust

Struct syn::meta::ParseNestedMeta

source ·
#[non_exhaustive]
pub struct ParseNestedMeta<'a> { + pub path: Path, + pub input: ParseStream<'a>, +}
Expand description

Context for parsing a single property in the conventional syntax for +structured attributes.

+

§Examples

+

Refer to usage examples on the following two entry-points:

+
    +
  • +

    Attribute::parse_nested_meta if you have an entire Attribute to +parse. Always use this if possible. Generally this is able to produce +better error messages because Attribute holds span information for all +of the delimiters therein.

    +
  • +
  • +

    syn::meta::parser if you are implementing a proc_macro_attribute +macro and parsing the arguments to the attribute macro, i.e. the ones +written in the same attribute that dispatched the macro invocation. Rustc +does not pass span information for the surrounding delimiters into the +attribute macro invocation in this situation, so error messages might be +less precise.

    +
  • +
+

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§path: Path§input: ParseStream<'a>

Implementations§

source§

impl<'a> ParseNestedMeta<'a>

source

pub fn value(&self) -> Result<ParseStream<'a>>

Used when parsing key = "value" syntax.

+

All it does is advance meta.input past the = sign in the input. You +could accomplish the same effect by writing +meta.parse::<Token![=]>()?, so at most it is a minor convenience to +use meta.value()?.

+
§Example
+
use syn::{parse_quote, Attribute, LitStr};
+
+let attr: Attribute = parse_quote! {
+    #[tea(kind = "EarlGrey")]
+};
+                                         // conceptually:
+if attr.path().is_ident("tea") {         // this parses the `tea`
+    attr.parse_nested_meta(|meta| {      // this parses the `(`
+        if meta.path.is_ident("kind") {  // this parses the `kind`
+            let value = meta.value()?;   // this parses the `=`
+            let s: LitStr = value.parse()?;  // this parses `"EarlGrey"`
+            if s.value() == "EarlGrey" {
+                // ...
+            }
+            Ok(())
+        } else {
+            Err(meta.error("unsupported attribute"))
+        }
+    })?;
+}
+
source

pub fn parse_nested_meta( + &self, + logic: impl FnMut(ParseNestedMeta<'_>) -> Result<()> +) -> Result<()>

Used when parsing list(...) syntax if the content inside the +nested parentheses is also expected to conform to Rust’s structured +attribute convention.

+
§Example
+
use syn::{parse_quote, Attribute};
+
+let attr: Attribute = parse_quote! {
+    #[tea(with(sugar, milk))]
+};
+
+if attr.path().is_ident("tea") {
+    attr.parse_nested_meta(|meta| {
+        if meta.path.is_ident("with") {
+            meta.parse_nested_meta(|meta| {  // <---
+                if meta.path.is_ident("sugar") {
+                    // Here we can go even deeper if needed.
+                    Ok(())
+                } else if meta.path.is_ident("milk") {
+                    Ok(())
+                } else {
+                    Err(meta.error("unsupported ingredient"))
+                }
+            })
+        } else {
+            Err(meta.error("unsupported tea property"))
+        }
+    })?;
+}
+
§Counterexample
+

If you don’t need parse_nested_meta’s help in parsing the content +written within the nested parentheses, keep in mind that you can always +just parse it yourself from the exposed ParseStream. Rust syntax permits +arbitrary tokens within those parentheses so for the crazier stuff, +parse_nested_meta is not what you want.

+ +
use syn::{parenthesized, parse_quote, Attribute, LitInt};
+
+let attr: Attribute = parse_quote! {
+    #[repr(align(32))]
+};
+
+let mut align: Option<LitInt> = None;
+if attr.path().is_ident("repr") {
+    attr.parse_nested_meta(|meta| {
+        if meta.path.is_ident("align") {
+            let content;
+            parenthesized!(content in meta.input);
+            align = Some(content.parse()?);
+            Ok(())
+        } else {
+            Err(meta.error("unsupported repr"))
+        }
+    })?;
+}
+
source

pub fn error(&self, msg: impl Display) -> Error

Report that the attribute’s content did not conform to expectations.

+

The span of the resulting error will cover meta.path and everything +that has been parsed so far since it.

+

There are 2 ways you might call this. First, if meta.path is not +something you recognize:

+ +
attr.parse_nested_meta(|meta| {
+    if meta.path.is_ident("kind") {
+        // ...
+        Ok(())
+    } else {
+        Err(meta.error("unsupported tea property"))
+    }
+})?;
+

In this case, it behaves exactly like +syn::Error::new_spanned(&meta.path, "message...").

+
error: unsupported tea property
+ --> src/main.rs:3:26
+  |
+3 | #[tea(kind = "EarlGrey", wat = "foo")]
+  |                          ^^^
+
+

More usefully, the second place is if you’ve already parsed a value but +have decided not to accept the value:

+ +
use syn::Expr;
+
+attr.parse_nested_meta(|meta| {
+    if meta.path.is_ident("kind") {
+        let expr: Expr = meta.value()?.parse()?;
+        match expr {
+            Expr::Lit(expr) => /* ... */
+            Expr::Path(expr) => /* ... */
+            Expr::Macro(expr) => /* ... */
+            _ => Err(meta.error("tea kind must be a string literal, path, or macro")),
+        }
+    } else /* as above */
+
+})?;
+
error: tea kind must be a string literal, path, or macro
+ --> src/main.rs:3:7
+  |
+3 | #[tea(kind = async { replicator.await })]
+  |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+

Often you may want to use syn::Error::new_spanned even in this +situation. In the above code, that would be:

+ +
    match expr {
+        Expr::Lit(expr) => /* ... */
+        Expr::Path(expr) => /* ... */
+        Expr::Macro(expr) => /* ... */
+        _ => Err(Error::new_spanned(expr, "unsupported expression type for `kind`")),
+    }
+
error: unsupported expression type for `kind`
+ --> src/main.rs:3:14
+  |
+3 | #[tea(kind = async { replicator.await })]
+  |              ^^^^^^^^^^^^^^^^^^^^^^^^^^
+

Auto Trait Implementations§

§

impl<'a> Freeze for ParseNestedMeta<'a>

§

impl<'a> !RefUnwindSafe for ParseNestedMeta<'a>

§

impl<'a> !Send for ParseNestedMeta<'a>

§

impl<'a> !Sync for ParseNestedMeta<'a>

§

impl<'a> Unpin for ParseNestedMeta<'a>

§

impl<'a> !UnwindSafe for ParseNestedMeta<'a>

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/op/enum.BinOp.html b/syn/op/enum.BinOp.html new file mode 100644 index 0000000..e7cea98 --- /dev/null +++ b/syn/op/enum.BinOp.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/enum.BinOp.html...

+ + + \ No newline at end of file diff --git a/syn/op/enum.UnOp.html b/syn/op/enum.UnOp.html new file mode 100644 index 0000000..5940cfe --- /dev/null +++ b/syn/op/enum.UnOp.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/enum.UnOp.html...

+ + + \ No newline at end of file diff --git a/syn/parse/discouraged/index.html b/syn/parse/discouraged/index.html new file mode 100644 index 0000000..cf0b8c9 --- /dev/null +++ b/syn/parse/discouraged/index.html @@ -0,0 +1,3 @@ +syn::parse::discouraged - Rust

Module syn::parse::discouraged

source ·
Expand description

Extensions to the parsing API with niche applicability.

+

Traits§

  • Extensions to the ParseStream API to support manipulating invisible +delimiters the same as if they were visible.
  • Extensions to the ParseStream API to support speculative parsing.
\ No newline at end of file diff --git a/syn/parse/discouraged/sidebar-items.js b/syn/parse/discouraged/sidebar-items.js new file mode 100644 index 0000000..77607c2 --- /dev/null +++ b/syn/parse/discouraged/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"trait":["AnyDelimiter","Speculative"]}; \ No newline at end of file diff --git a/syn/parse/discouraged/trait.AnyDelimiter.html b/syn/parse/discouraged/trait.AnyDelimiter.html new file mode 100644 index 0000000..c79961f --- /dev/null +++ b/syn/parse/discouraged/trait.AnyDelimiter.html @@ -0,0 +1,10 @@ +AnyDelimiter in syn::parse::discouraged - Rust

Trait syn::parse::discouraged::AnyDelimiter

source ·
pub trait AnyDelimiter {
+    // Required method
+    fn parse_any_delimiter(
+        &self
+    ) -> Result<(Delimiter, DelimSpan, ParseBuffer<'_>)>;
+}
Expand description

Extensions to the ParseStream API to support manipulating invisible +delimiters the same as if they were visible.

+

Required Methods§

source

fn parse_any_delimiter(&self) -> Result<(Delimiter, DelimSpan, ParseBuffer<'_>)>

Returns the delimiter, the span of the delimiter token, and the nested +contents for further parsing.

+

Implementors§

\ No newline at end of file diff --git a/syn/parse/discouraged/trait.Speculative.html b/syn/parse/discouraged/trait.Speculative.html new file mode 100644 index 0000000..4b44722 --- /dev/null +++ b/syn/parse/discouraged/trait.Speculative.html @@ -0,0 +1,110 @@ +Speculative in syn::parse::discouraged - Rust

Trait syn::parse::discouraged::Speculative

source ·
pub trait Speculative {
+    // Required method
+    fn advance_to(&self, fork: &Self);
+}
Expand description

Extensions to the ParseStream API to support speculative parsing.

+

Required Methods§

source

fn advance_to(&self, fork: &Self)

Advance this parse stream to the position of a forked parse stream.

+

This is the opposite operation to ParseStream::fork. You can fork a +parse stream, perform some speculative parsing, then join the original +stream to the fork to “commit” the parsing from the fork to the main +stream.

+

If you can avoid doing this, you should, as it limits the ability to +generate useful errors. That said, it is often the only way to parse +syntax of the form A* B* for arbitrary syntax A and B. The problem +is that when the fork fails to parse an A, it’s impossible to tell +whether that was because of a syntax error and the user meant to provide +an A, or that the As are finished and it’s time to start parsing +Bs. Use with care.

+

Also note that if A is a subset of B, A* B* can be parsed by +parsing B* and removing the leading members of A from the +repetition, bypassing the need to involve the downsides associated with +speculative parsing.

+
§Example
+

There has been chatter about the possibility of making the colons in the +turbofish syntax like path::to::<T> no longer required by accepting +path::to<T> in expression position. Specifically, according to RFC +2544, PathSegment parsing should always try to consume a following +< token as the start of generic arguments, and reset to the < if +that fails (e.g. the token is acting as a less-than operator).

+

This is the exact kind of parsing behavior which requires the “fork, +try, commit” behavior that ParseStream::fork discourages. With +advance_to, we can avoid having to parse the speculatively parsed +content a second time.

+

This change in behavior can be implemented in syn by replacing just the +Parse implementation for PathSegment:

+ +
use syn::parse::discouraged::Speculative;
+
+pub struct PathSegment {
+    pub ident: Ident,
+    pub arguments: PathArguments,
+}
+
+impl Parse for PathSegment {
+    fn parse(input: ParseStream) -> Result<Self> {
+        if input.peek(Token![super])
+            || input.peek(Token![self])
+            || input.peek(Token![Self])
+            || input.peek(Token![crate])
+        {
+            let ident = input.call(Ident::parse_any)?;
+            return Ok(PathSegment::from(ident));
+        }
+
+        let ident = input.parse()?;
+        if input.peek(Token![::]) && input.peek3(Token![<]) {
+            return Ok(PathSegment {
+                ident,
+                arguments: PathArguments::AngleBracketed(input.parse()?),
+            });
+        }
+        if input.peek(Token![<]) && !input.peek(Token![<=]) {
+            let fork = input.fork();
+            if let Ok(arguments) = fork.parse() {
+                input.advance_to(&fork);
+                return Ok(PathSegment {
+                    ident,
+                    arguments: PathArguments::AngleBracketed(arguments),
+                });
+            }
+        }
+        Ok(PathSegment::from(ident))
+    }
+}
+
+
§Drawbacks
+

The main drawback of this style of speculative parsing is in error +presentation. Even if the lookahead is the “correct” parse, the error +that is shown is that of the “fallback” parse. To use the same example +as the turbofish above, take the following unfinished “turbofish”:

+
let _ = f<&'a fn(), for<'a> serde::>();
+
+

If this is parsed as generic arguments, we can provide the error message

+
error: expected identifier
+ --> src.rs:L:C
+  |
+L | let _ = f<&'a fn(), for<'a> serde::>();
+  |                                    ^
+
+

but if parsed using the above speculative parsing, it falls back to +assuming that the < is a less-than when it fails to parse the generic +arguments, and tries to interpret the &'a as the start of a labelled +loop, resulting in the much less helpful error

+
error: expected `:`
+ --> src.rs:L:C
+  |
+L | let _ = f<&'a fn(), for<'a> serde::>();
+  |               ^^
+
+

This can be mitigated with various heuristics (two examples: show both +forks’ parse errors, or show the one that consumed more tokens), but +when you can control the grammar, sticking to something that can be +parsed LL(3) and without the LL(*) speculative parsing this makes +possible, displaying reasonable errors becomes much more simple.

+
§Performance
+

This method performs a cheap fixed amount of work that does not depend +on how far apart the two streams are positioned.

+
§Panics
+

The forked stream in the argument of advance_to must have been +obtained by forking self. Attempting to advance to any other stream +will cause a panic.

+

Object Safety§

This trait is not object safe.

Implementors§

\ No newline at end of file diff --git a/syn/parse/index.html b/syn/parse/index.html new file mode 100644 index 0000000..ef4a918 --- /dev/null +++ b/syn/parse/index.html @@ -0,0 +1,118 @@ +syn::parse - Rust

Module syn::parse

source ·
Expand description

Parsing interface for parsing a token stream into a syntax tree node.

+

Parsing in Syn is built on parser functions that take in a ParseStream +and produce a Result<T> where T is some syntax tree node. Underlying +these parser functions is a lower level mechanism built around the +Cursor type. Cursor is a cheaply copyable cursor over a range of +tokens in a token stream.

+

§Example

+

Here is a snippet of parsing code to get a feel for the style of the +library. We define data structures for a subset of Rust syntax including +enums (not shown) and structs, then provide implementations of the Parse +trait to parse these syntax tree data structures from a token stream.

+

Once Parse impls have been defined, they can be called conveniently from a +procedural macro through parse_macro_input! as shown at the bottom of +the snippet. If the caller provides syntactically invalid input to the +procedural macro, they will receive a helpful compiler error message +pointing out the exact token that triggered the failure to parse.

+ +
use proc_macro::TokenStream;
+use syn::{braced, parse_macro_input, token, Field, Ident, Result, Token};
+use syn::parse::{Parse, ParseStream};
+use syn::punctuated::Punctuated;
+
+enum Item {
+    Struct(ItemStruct),
+    Enum(ItemEnum),
+}
+
+struct ItemStruct {
+    struct_token: Token![struct],
+    ident: Ident,
+    brace_token: token::Brace,
+    fields: Punctuated<Field, Token![,]>,
+}
+
+impl Parse for Item {
+    fn parse(input: ParseStream) -> Result<Self> {
+        let lookahead = input.lookahead1();
+        if lookahead.peek(Token![struct]) {
+            input.parse().map(Item::Struct)
+        } else if lookahead.peek(Token![enum]) {
+            input.parse().map(Item::Enum)
+        } else {
+            Err(lookahead.error())
+        }
+    }
+}
+
+impl Parse for ItemStruct {
+    fn parse(input: ParseStream) -> Result<Self> {
+        let content;
+        Ok(ItemStruct {
+            struct_token: input.parse()?,
+            ident: input.parse()?,
+            brace_token: braced!(content in input),
+            fields: content.parse_terminated(Field::parse_named, Token![,])?,
+        })
+    }
+}
+
+#[proc_macro]
+pub fn my_macro(tokens: TokenStream) -> TokenStream {
+    let input = parse_macro_input!(tokens as Item);
+
+    /* ... */
+}
+

§The syn::parse* functions

+

The syn::parse, syn::parse2, and syn::parse_str functions serve +as an entry point for parsing syntax tree nodes that can be parsed in an +obvious default way. These functions can return any syntax tree node that +implements the Parse trait, which includes most types in Syn.

+ +
use syn::Type;
+
+let t: Type = syn::parse_str("std::collections::HashMap<String, Value>")?;
+

The parse_quote! macro also uses this approach.

+

§The Parser trait

+

Some types can be parsed in several ways depending on context. For example +an Attribute can be either “outer” like #[...] or “inner” like +#![...] and parsing the wrong one would be a bug. Similarly Punctuated +may or may not allow trailing punctuation, and parsing it the wrong way +would either reject valid input or accept invalid input.

+

The Parse trait is not implemented in these cases because there is no good +behavior to consider the default.

+ +
// Can't parse `Punctuated` without knowing whether trailing punctuation
+// should be allowed in this context.
+let path: Punctuated<PathSegment, Token![::]> = syn::parse(tokens)?;
+

In these cases the types provide a choice of parser functions rather than a +single Parse implementation, and those parser functions can be invoked +through the Parser trait.

+ +
use proc_macro::TokenStream;
+use syn::parse::Parser;
+use syn::punctuated::Punctuated;
+use syn::{Attribute, Expr, PathSegment, Result, Token};
+
+fn call_some_parser_methods(input: TokenStream) -> Result<()> {
+    // Parse a nonempty sequence of path segments separated by `::` punctuation
+    // with no trailing punctuation.
+    let tokens = input.clone();
+    let parser = Punctuated::<PathSegment, Token![::]>::parse_separated_nonempty;
+    let _path = parser.parse(tokens)?;
+
+    // Parse a possibly empty sequence of expressions terminated by commas with
+    // an optional trailing punctuation.
+    let tokens = input.clone();
+    let parser = Punctuated::<Expr, Token![,]>::parse_terminated;
+    let _args = parser.parse(tokens)?;
+
+    // Parse zero or more outer attributes but not inner attributes.
+    let tokens = input.clone();
+    let parser = Attribute::parse_outer;
+    let _attrs = parser.parse(tokens)?;
+
+    Ok(())
+}
+

Modules§

  • Extensions to the parsing API with niche applicability.

Structs§

  • Error returned when a Syn parser cannot parse the input tokens.
  • Support for checking the next token in a stream to decide how to parse.
  • An empty syntax tree node that consumes no tokens when parsed.
  • Cursor position within a buffered token stream.
  • Cursor state associated with speculative parsing.

Traits§

  • Parsing interface implemented by all types that can be parsed in a default +way from a token stream.
  • Parser that can parse Rust tokens into a particular syntax tree node.
  • Types that can be parsed by looking at just one token.

Type Aliases§

\ No newline at end of file diff --git a/syn/parse/sidebar-items.js b/syn/parse/sidebar-items.js new file mode 100644 index 0000000..49263f8 --- /dev/null +++ b/syn/parse/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"mod":["discouraged"],"struct":["Error","Lookahead1","Nothing","ParseBuffer","StepCursor"],"trait":["Parse","Parser","Peek"],"type":["ParseStream","Result"]}; \ No newline at end of file diff --git a/syn/parse/struct.Error.html b/syn/parse/struct.Error.html new file mode 100644 index 0000000..507ee8f --- /dev/null +++ b/syn/parse/struct.Error.html @@ -0,0 +1,120 @@ +Error in syn::parse - Rust

Struct syn::parse::Error

source ·
pub struct Error { /* private fields */ }
Expand description

Error returned when a Syn parser cannot parse the input tokens.

+

§Error reporting in proc macros

+

The correct way to report errors back to the compiler from a procedural +macro is by emitting an appropriately spanned invocation of +compile_error! in the generated code. This produces a better diagnostic +message than simply panicking the macro.

+

When parsing macro input, the parse_macro_input! macro handles the +conversion to compile_error! automatically.

+ +
use proc_macro::TokenStream;
+use syn::parse::{Parse, ParseStream, Result};
+use syn::{parse_macro_input, ItemFn};
+
+#[proc_macro_attribute]
+pub fn my_attr(args: TokenStream, input: TokenStream) -> TokenStream {
+    let args = parse_macro_input!(args as MyAttrArgs);
+    let input = parse_macro_input!(input as ItemFn);
+
+    /* ... */
+}
+
+struct MyAttrArgs {
+    ...
+}
+
+impl Parse for MyAttrArgs {
+    fn parse(input: ParseStream) -> Result<Self> {
+        ...
+    }
+}
+

For errors that arise later than the initial parsing stage, the +.to_compile_error() or .into_compile_error() methods can be used to +perform an explicit conversion to compile_error!.

+ +
#[proc_macro_derive(MyDerive)]
+pub fn my_derive(input: TokenStream) -> TokenStream {
+    let input = parse_macro_input!(input as DeriveInput);
+
+    // fn(DeriveInput) -> syn::Result<proc_macro2::TokenStream>
+    expand::my_derive(input)
+        .unwrap_or_else(syn::Error::into_compile_error)
+        .into()
+}
+

Implementations§

source§

impl Error

source

pub fn new<T: Display>(span: Span, message: T) -> Self

Usually the ParseStream::error method will be used instead, which +automatically uses the correct span from the current position of the +parse stream.

+

Use Error::new when the error needs to be triggered on some span other +than where the parse stream is currently positioned.

+
§Example
+
use syn::{Error, Ident, LitStr, Result, Token};
+use syn::parse::ParseStream;
+
+// Parses input that looks like `name = "string"` where the key must be
+// the identifier `name` and the value may be any string literal.
+// Returns the string literal.
+fn parse_name(input: ParseStream) -> Result<LitStr> {
+    let name_token: Ident = input.parse()?;
+    if name_token != "name" {
+        // Trigger an error not on the current position of the stream,
+        // but on the position of the unexpected identifier.
+        return Err(Error::new(name_token.span(), "expected `name`"));
+    }
+    input.parse::<Token![=]>()?;
+    let s: LitStr = input.parse()?;
+    Ok(s)
+}
+
source

pub fn new_spanned<T: ToTokens, U: Display>(tokens: T, message: U) -> Self

Creates an error with the specified message spanning the given syntax +tree node.

+

Unlike the Error::new constructor, this constructor takes an argument +tokens which is a syntax tree node. This allows the resulting Error +to attempt to span all tokens inside of tokens. While you would +typically be able to use the Spanned trait with the above Error::new +constructor, implementation limitations today mean that +Error::new_spanned may provide a higher-quality error message on +stable Rust.

+

When in doubt it’s recommended to stick to Error::new (or +ParseStream::error)!

+
source

pub fn span(&self) -> Span

The source location of the error.

+

Spans are not thread-safe so this function returns Span::call_site() +if called from a different thread than the one on which the Error was +originally created.

+
source

pub fn to_compile_error(&self) -> TokenStream

Render the error as an invocation of compile_error!.

+

The parse_macro_input! macro provides a convenient way to invoke +this method correctly in a procedural macro.

+
source

pub fn into_compile_error(self) -> TokenStream

Render the error as an invocation of compile_error!.

+
§Example
+
use proc_macro::TokenStream;
+use syn::{parse_macro_input, DeriveInput, Error};
+
+#[proc_macro_derive(MyTrait)]
+pub fn derive_my_trait(input: TokenStream) -> TokenStream {
+    let input = parse_macro_input!(input as DeriveInput);
+    my_trait::expand(input)
+        .unwrap_or_else(Error::into_compile_error)
+        .into()
+}
+
+mod my_trait {
+    use proc_macro2::TokenStream;
+    use syn::{DeriveInput, Result};
+
+    pub(crate) fn expand(input: DeriveInput) -> Result<TokenStream> {
+        /* ... */
+    }
+}
+
source

pub fn combine(&mut self, another: Error)

Add another error message to self such that when to_compile_error() is +called, both errors will be emitted together.

+

Trait Implementations§

source§

impl Clone for Error

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Error

source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for Error

source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for Error

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl Extend<Error> for Error

source§

fn extend<T: IntoIterator<Item = Error>>(&mut self, iter: T)

Extends a collection with the contents of an iterator. Read more
source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
source§

impl From<LexError> for Error

source§

fn from(err: LexError) -> Self

Converts to this type from the input type.
source§

impl<'a> IntoIterator for &'a Error

§

type Item = Error

The type of the elements being iterated over.
§

type IntoIter = Iter<'a>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl IntoIterator for Error

§

type Item = Error

The type of the elements being iterated over.
§

type IntoIter = IntoIter

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more

Auto Trait Implementations§

§

impl Freeze for Error

§

impl RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl UnwindSafe for Error

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/parse/struct.Lookahead1.html b/syn/parse/struct.Lookahead1.html new file mode 100644 index 0000000..d49061a --- /dev/null +++ b/syn/parse/struct.Lookahead1.html @@ -0,0 +1,70 @@ +Lookahead1 in syn::parse - Rust

Struct syn::parse::Lookahead1

source ·
pub struct Lookahead1<'a> { /* private fields */ }
Expand description

Support for checking the next token in a stream to decide how to parse.

+

An important advantage over ParseStream::peek is that here we +automatically construct an appropriate error message based on the token +alternatives that get peeked. If you are producing your own error message, +go ahead and use ParseStream::peek instead.

+

Use ParseStream::lookahead1 to construct this object.

+

Consuming tokens from the source stream after constructing a lookahead +object does not also advance the lookahead object.

+

§Example

+
use syn::{ConstParam, Ident, Lifetime, LifetimeParam, Result, Token, TypeParam};
+use syn::parse::{Parse, ParseStream};
+
+// A generic parameter, a single one of the comma-separated elements inside
+// angle brackets in:
+//
+//     fn f<T: Clone, 'a, 'b: 'a, const N: usize>() { ... }
+//
+// On invalid input, lookahead gives us a reasonable error message.
+//
+//     error: expected one of: identifier, lifetime, `const`
+//       |
+//     5 |     fn f<!Sized>() {}
+//       |          ^
+enum GenericParam {
+    Type(TypeParam),
+    Lifetime(LifetimeParam),
+    Const(ConstParam),
+}
+
+impl Parse for GenericParam {
+    fn parse(input: ParseStream) -> Result<Self> {
+        let lookahead = input.lookahead1();
+        if lookahead.peek(Ident) {
+            input.parse().map(GenericParam::Type)
+        } else if lookahead.peek(Lifetime) {
+            input.parse().map(GenericParam::Lifetime)
+        } else if lookahead.peek(Token![const]) {
+            input.parse().map(GenericParam::Const)
+        } else {
+            Err(lookahead.error())
+        }
+    }
+}
+

Implementations§

source§

impl<'a> Lookahead1<'a>

source

pub fn peek<T: Peek>(&self, token: T) -> bool

Looks at the next token in the parse stream to determine whether it +matches the requested type of token.

+
§Syntax
+

Note that this method does not use turbofish syntax. Pass the peek type +inside of parentheses.

+
    +
  • input.peek(Token![struct])
  • +
  • input.peek(Token![==])
  • +
  • input.peek(Ident)(does not accept keywords)
  • +
  • input.peek(Ident::peek_any)
  • +
  • input.peek(Lifetime)
  • +
  • input.peek(token::Brace)
  • +
+
source

pub fn error(self) -> Error

Triggers an error at the current position of the parse stream.

+

The error message will identify all of the expected token types that +have been peeked against this lookahead instance.

+

Auto Trait Implementations§

§

impl<'a> !Freeze for Lookahead1<'a>

§

impl<'a> !RefUnwindSafe for Lookahead1<'a>

§

impl<'a> !Send for Lookahead1<'a>

§

impl<'a> !Sync for Lookahead1<'a>

§

impl<'a> Unpin for Lookahead1<'a>

§

impl<'a> UnwindSafe for Lookahead1<'a>

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/parse/struct.Nothing.html b/syn/parse/struct.Nothing.html new file mode 100644 index 0000000..c6a0c48 --- /dev/null +++ b/syn/parse/struct.Nothing.html @@ -0,0 +1,34 @@ +Nothing in syn::parse - Rust

Struct syn::parse::Nothing

source ·
pub struct Nothing;
Expand description

An empty syntax tree node that consumes no tokens when parsed.

+

This is useful for attribute macros that want to ensure they are not +provided any attribute args.

+ +
use proc_macro::TokenStream;
+use syn::parse_macro_input;
+use syn::parse::Nothing;
+
+#[proc_macro_attribute]
+pub fn my_attr(args: TokenStream, input: TokenStream) -> TokenStream {
+    parse_macro_input!(args as Nothing);
+
+    /* ... */
+}
+
error: unexpected token
+ --> src/main.rs:3:19
+  |
+3 | #[my_attr(asdf)]
+  |           ^^^^
+

Trait Implementations§

source§

impl Clone for Nothing

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Parse for Nothing

source§

fn parse(_input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for Nothing

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for Nothing

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/parse/struct.ParseBuffer.html b/syn/parse/struct.ParseBuffer.html new file mode 100644 index 0000000..dfea484 --- /dev/null +++ b/syn/parse/struct.ParseBuffer.html @@ -0,0 +1,503 @@ +ParseBuffer in syn::parse - Rust

Struct syn::parse::ParseBuffer

source ·
pub struct ParseBuffer<'a> { /* private fields */ }
Expand description

Cursor position within a buffered token stream.

+

This type is more commonly used through the type alias ParseStream which +is an alias for &ParseBuffer.

+

ParseStream is the input type for all parser functions in Syn. They have +the signature fn(ParseStream) -> Result<T>.

+

§Calling a parser function

+

There is no public way to construct a ParseBuffer. Instead, if you are +looking to invoke a parser function that requires ParseStream as input, +you will need to go through one of the public parsing entry points.

+ +

Implementations§

source§

impl<'a> ParseBuffer<'a>

source

pub fn parse<T: Parse>(&self) -> Result<T>

Parses a syntax tree node of type T, advancing the position of our +parse stream past it.

+
source

pub fn call<T>( + &self, + function: fn(_: ParseStream<'_>) -> Result<T> +) -> Result<T>

Calls the given parser function to parse a syntax tree node of type T +from this stream.

+
§Example
+

The parser below invokes Attribute::parse_outer to parse a vector of +zero or more outer attributes.

+ +
use syn::{Attribute, Ident, Result, Token};
+use syn::parse::{Parse, ParseStream};
+
+// Parses a unit struct with attributes.
+//
+//     #[path = "s.tmpl"]
+//     struct S;
+struct UnitStruct {
+    attrs: Vec<Attribute>,
+    struct_token: Token![struct],
+    name: Ident,
+    semi_token: Token![;],
+}
+
+impl Parse for UnitStruct {
+    fn parse(input: ParseStream) -> Result<Self> {
+        Ok(UnitStruct {
+            attrs: input.call(Attribute::parse_outer)?,
+            struct_token: input.parse()?,
+            name: input.parse()?,
+            semi_token: input.parse()?,
+        })
+    }
+}
+
source

pub fn peek<T: Peek>(&self, token: T) -> bool

Looks at the next token in the parse stream to determine whether it +matches the requested type of token.

+

Does not advance the position of the parse stream.

+
§Syntax
+

Note that this method does not use turbofish syntax. Pass the peek type +inside of parentheses.

+
    +
  • input.peek(Token![struct])
  • +
  • input.peek(Token![==])
  • +
  • input.peek(syn::Ident)(does not accept keywords)
  • +
  • input.peek(syn::Ident::peek_any)
  • +
  • input.peek(Lifetime)
  • +
  • input.peek(token::Brace)
  • +
+
§Example
+

In this example we finish parsing the list of supertraits when the next +token in the input is either where or an opening curly brace.

+ +
use syn::{braced, token, Generics, Ident, Result, Token, TypeParamBound};
+use syn::parse::{Parse, ParseStream};
+use syn::punctuated::Punctuated;
+
+// Parses a trait definition containing no associated items.
+//
+//     trait Marker<'de, T>: A + B<'de> where Box<T>: Clone {}
+struct MarkerTrait {
+    trait_token: Token![trait],
+    ident: Ident,
+    generics: Generics,
+    colon_token: Option<Token![:]>,
+    supertraits: Punctuated<TypeParamBound, Token![+]>,
+    brace_token: token::Brace,
+}
+
+impl Parse for MarkerTrait {
+    fn parse(input: ParseStream) -> Result<Self> {
+        let trait_token: Token![trait] = input.parse()?;
+        let ident: Ident = input.parse()?;
+        let mut generics: Generics = input.parse()?;
+        let colon_token: Option<Token![:]> = input.parse()?;
+
+        let mut supertraits = Punctuated::new();
+        if colon_token.is_some() {
+            loop {
+                supertraits.push_value(input.parse()?);
+                if input.peek(Token![where]) || input.peek(token::Brace) {
+                    break;
+                }
+                supertraits.push_punct(input.parse()?);
+            }
+        }
+
+        generics.where_clause = input.parse()?;
+        let content;
+        let empty_brace_token = braced!(content in input);
+
+        Ok(MarkerTrait {
+            trait_token,
+            ident,
+            generics,
+            colon_token,
+            supertraits,
+            brace_token: empty_brace_token,
+        })
+    }
+}
+
source

pub fn peek2<T: Peek>(&self, token: T) -> bool

Looks at the second-next token in the parse stream.

+

This is commonly useful as a way to implement contextual keywords.

+
§Example
+

This example needs to use peek2 because the symbol union is not a +keyword in Rust. We can’t use just peek and decide to parse a union if +the very next token is union, because someone is free to write a mod union and a macro invocation that looks like union::some_macro! { ... }. In other words union is a contextual keyword.

+ +
use syn::{Ident, ItemUnion, Macro, Result, Token};
+use syn::parse::{Parse, ParseStream};
+
+// Parses either a union or a macro invocation.
+enum UnionOrMacro {
+    // union MaybeUninit<T> { uninit: (), value: T }
+    Union(ItemUnion),
+    // lazy_static! { ... }
+    Macro(Macro),
+}
+
+impl Parse for UnionOrMacro {
+    fn parse(input: ParseStream) -> Result<Self> {
+        if input.peek(Token![union]) && input.peek2(Ident) {
+            input.parse().map(UnionOrMacro::Union)
+        } else {
+            input.parse().map(UnionOrMacro::Macro)
+        }
+    }
+}
+
source

pub fn peek3<T: Peek>(&self, token: T) -> bool

Looks at the third-next token in the parse stream.

+
source

pub fn parse_terminated<T, P>( + &self, + parser: fn(_: ParseStream<'_>) -> Result<T>, + separator: P +) -> Result<Punctuated<T, P::Token>>
where + P: Peek, + P::Token: Parse,

Parses zero or more occurrences of T separated by punctuation of type +P, with optional trailing punctuation.

+

Parsing continues until the end of this parse stream. The entire content +of this parse stream must consist of T and P.

+
§Example
+
use syn::{parenthesized, token, Ident, Result, Token, Type};
+use syn::parse::{Parse, ParseStream};
+use syn::punctuated::Punctuated;
+
+// Parse a simplified tuple struct syntax like:
+//
+//     struct S(A, B);
+struct TupleStruct {
+    struct_token: Token![struct],
+    ident: Ident,
+    paren_token: token::Paren,
+    fields: Punctuated<Type, Token![,]>,
+    semi_token: Token![;],
+}
+
+impl Parse for TupleStruct {
+    fn parse(input: ParseStream) -> Result<Self> {
+        let content;
+        Ok(TupleStruct {
+            struct_token: input.parse()?,
+            ident: input.parse()?,
+            paren_token: parenthesized!(content in input),
+            fields: content.parse_terminated(Type::parse, Token![,])?,
+            semi_token: input.parse()?,
+        })
+    }
+}
+
§See also
+

If your separator is anything more complicated than an invocation of the +Token! macro, this method won’t be applicable and you can instead +directly use Punctuated’s parser functions: parse_terminated, +parse_separated_nonempty etc.

+ +
use syn::{custom_keyword, Expr, Result, Token};
+use syn::parse::{Parse, ParseStream};
+use syn::punctuated::Punctuated;
+
+mod kw {
+    syn::custom_keyword!(fin);
+}
+
+struct Fin(kw::fin, Token![;]);
+
+impl Parse for Fin {
+    fn parse(input: ParseStream) -> Result<Self> {
+        Ok(Self(input.parse()?, input.parse()?))
+    }
+}
+
+struct Thing {
+    steps: Punctuated<Expr, Fin>,
+}
+
+impl Parse for Thing {
+    fn parse(input: ParseStream) -> Result<Self> {
+        Ok(Thing {
+            steps: Punctuated::parse_terminated(input)?,
+        })
+        // or equivalently, this means the same thing:
+            steps: input.call(Punctuated::parse_terminated)?,
+    }
+}
+
source

pub fn is_empty(&self) -> bool

Returns whether there are tokens remaining in this stream.

+

This method returns true at the end of the content of a set of +delimiters, as well as at the very end of the complete macro input.

+
§Example
+
use syn::{braced, token, Ident, Item, Result, Token};
+use syn::parse::{Parse, ParseStream};
+
+// Parses a Rust `mod m { ... }` containing zero or more items.
+struct Mod {
+    mod_token: Token![mod],
+    name: Ident,
+    brace_token: token::Brace,
+    items: Vec<Item>,
+}
+
+impl Parse for Mod {
+    fn parse(input: ParseStream) -> Result<Self> {
+        let content;
+        Ok(Mod {
+            mod_token: input.parse()?,
+            name: input.parse()?,
+            brace_token: braced!(content in input),
+            items: {
+                let mut items = Vec::new();
+                while !content.is_empty() {
+                    items.push(content.parse()?);
+                }
+                items
+            },
+        })
+    }
+}
+
source

pub fn lookahead1(&self) -> Lookahead1<'a>

Constructs a helper for peeking at the next token in this stream and +building an error message if it is not one of a set of expected tokens.

+
§Example
+
use syn::{ConstParam, Ident, Lifetime, LifetimeParam, Result, Token, TypeParam};
+use syn::parse::{Parse, ParseStream};
+
+// A generic parameter, a single one of the comma-separated elements inside
+// angle brackets in:
+//
+//     fn f<T: Clone, 'a, 'b: 'a, const N: usize>() { ... }
+//
+// On invalid input, lookahead gives us a reasonable error message.
+//
+//     error: expected one of: identifier, lifetime, `const`
+//       |
+//     5 |     fn f<!Sized>() {}
+//       |          ^
+enum GenericParam {
+    Type(TypeParam),
+    Lifetime(LifetimeParam),
+    Const(ConstParam),
+}
+
+impl Parse for GenericParam {
+    fn parse(input: ParseStream) -> Result<Self> {
+        let lookahead = input.lookahead1();
+        if lookahead.peek(Ident) {
+            input.parse().map(GenericParam::Type)
+        } else if lookahead.peek(Lifetime) {
+            input.parse().map(GenericParam::Lifetime)
+        } else if lookahead.peek(Token![const]) {
+            input.parse().map(GenericParam::Const)
+        } else {
+            Err(lookahead.error())
+        }
+    }
+}
+
source

pub fn fork(&self) -> Self

Forks a parse stream so that parsing tokens out of either the original +or the fork does not advance the position of the other.

+
§Performance
+

Forking a parse stream is a cheap fixed amount of work and does not +involve copying token buffers. Where you might hit performance problems +is if your macro ends up parsing a large amount of content more than +once.

+ +
// Do not do this.
+if input.fork().parse::<Expr>().is_ok() {
+    return input.parse::<Expr>();
+}
+

As a rule, avoid parsing an unbounded amount of tokens out of a forked +parse stream. Only use a fork when the amount of work performed against +the fork is small and bounded.

+

When complex speculative parsing against the forked stream is +unavoidable, use parse::discouraged::Speculative to advance the +original stream once the fork’s parse is determined to have been +successful.

+

For a lower level way to perform speculative parsing at the token level, +consider using ParseStream::step instead.

+
§Example
+

The parse implementation shown here parses possibly restricted pub +visibilities.

+
    +
  • pub
  • +
  • pub(crate)
  • +
  • pub(self)
  • +
  • pub(super)
  • +
  • pub(in some::path)
  • +
+

To handle the case of visibilities inside of tuple structs, the parser +needs to distinguish parentheses that specify visibility restrictions +from parentheses that form part of a tuple type.

+ +
struct S(pub(crate) A, pub (B, C));
+

In this example input the first tuple struct element of S has +pub(crate) visibility while the second tuple struct element has pub +visibility; the parentheses around (B, C) are part of the type rather +than part of a visibility restriction.

+

The parser uses a forked parse stream to check the first token inside of +parentheses after the pub keyword. This is a small bounded amount of +work performed against the forked parse stream.

+ +
use syn::{parenthesized, token, Ident, Path, Result, Token};
+use syn::ext::IdentExt;
+use syn::parse::{Parse, ParseStream};
+
+struct PubVisibility {
+    pub_token: Token![pub],
+    restricted: Option<Restricted>,
+}
+
+struct Restricted {
+    paren_token: token::Paren,
+    in_token: Option<Token![in]>,
+    path: Path,
+}
+
+impl Parse for PubVisibility {
+    fn parse(input: ParseStream) -> Result<Self> {
+        let pub_token: Token![pub] = input.parse()?;
+
+        if input.peek(token::Paren) {
+            let ahead = input.fork();
+            let mut content;
+            parenthesized!(content in ahead);
+
+            if content.peek(Token![crate])
+                || content.peek(Token![self])
+                || content.peek(Token![super])
+            {
+                return Ok(PubVisibility {
+                    pub_token,
+                    restricted: Some(Restricted {
+                        paren_token: parenthesized!(content in input),
+                        in_token: None,
+                        path: Path::from(content.call(Ident::parse_any)?),
+                    }),
+                });
+            } else if content.peek(Token![in]) {
+                return Ok(PubVisibility {
+                    pub_token,
+                    restricted: Some(Restricted {
+                        paren_token: parenthesized!(content in input),
+                        in_token: Some(content.parse()?),
+                        path: content.call(Path::parse_mod_style)?,
+                    }),
+                });
+            }
+        }
+
+        Ok(PubVisibility {
+            pub_token,
+            restricted: None,
+        })
+    }
+}
+
source

pub fn error<T: Display>(&self, message: T) -> Error

Triggers an error at the current position of the parse stream.

+
§Example
+
use syn::{Expr, Result, Token};
+use syn::parse::{Parse, ParseStream};
+
+// Some kind of loop: `while` or `for` or `loop`.
+struct Loop {
+    expr: Expr,
+}
+
+impl Parse for Loop {
+    fn parse(input: ParseStream) -> Result<Self> {
+        if input.peek(Token![while])
+            || input.peek(Token![for])
+            || input.peek(Token![loop])
+        {
+            Ok(Loop {
+                expr: input.parse()?,
+            })
+        } else {
+            Err(input.error("expected some kind of loop"))
+        }
+    }
+}
+
source

pub fn step<F, R>(&self, function: F) -> Result<R>
where + F: for<'c> FnOnce(StepCursor<'c, 'a>) -> Result<(R, Cursor<'c>)>,

Speculatively parses tokens from this parse stream, advancing the +position of this stream only if parsing succeeds.

+

This is a powerful low-level API used for defining the Parse impls of +the basic built-in token types. It is not something that will be used +widely outside of the Syn codebase.

+
§Example
+
use proc_macro2::TokenTree;
+use syn::Result;
+use syn::parse::ParseStream;
+
+// This function advances the stream past the next occurrence of `@`. If
+// no `@` is present in the stream, the stream position is unchanged and
+// an error is returned.
+fn skip_past_next_at(input: ParseStream) -> Result<()> {
+    input.step(|cursor| {
+        let mut rest = *cursor;
+        while let Some((tt, next)) = rest.token_tree() {
+            match &tt {
+                TokenTree::Punct(punct) if punct.as_char() == '@' => {
+                    return Ok(((), next));
+                }
+                _ => rest = next,
+            }
+        }
+        Err(cursor.error("no `@` was found after this point"))
+    })
+}
+
source

pub fn span(&self) -> Span

Returns the Span of the next token in the parse stream, or +Span::call_site() if this parse stream has completely exhausted its +input TokenStream.

+
source

pub fn cursor(&self) -> Cursor<'a>

Provides low-level access to the token representation underlying this +parse stream.

+

Cursors are immutable so no operations you perform against the cursor +will affect the state of this parse stream.

+
§Example
+
use proc_macro2::TokenStream;
+use syn::buffer::Cursor;
+use syn::parse::{ParseStream, Result};
+
+// Run a parser that returns T, but get its output as TokenStream instead of T.
+// This works without T needing to implement ToTokens.
+fn recognize_token_stream<T>(
+    recognizer: fn(ParseStream) -> Result<T>,
+) -> impl Fn(ParseStream) -> Result<TokenStream> {
+    move |input| {
+        let begin = input.cursor();
+        recognizer(input)?;
+        let end = input.cursor();
+        Ok(tokens_between(begin, end))
+    }
+}
+
+// Collect tokens between two cursors as a TokenStream.
+fn tokens_between(begin: Cursor, end: Cursor) -> TokenStream {
+    assert!(begin <= end);
+
+    let mut cursor = begin;
+    let mut tokens = TokenStream::new();
+    while cursor < end {
+        let (token, next) = cursor.token_tree().unwrap();
+        tokens.extend(std::iter::once(token));
+        cursor = next;
+    }
+    tokens
+}
+
+fn main() {
+    use quote::quote;
+    use syn::parse::{Parse, Parser};
+    use syn::Token;
+
+    // Parse syn::Type as a TokenStream, surrounded by angle brackets.
+    fn example(input: ParseStream) -> Result<TokenStream> {
+        let _langle: Token![<] = input.parse()?;
+        let ty = recognize_token_stream(syn::Type::parse)(input)?;
+        let _rangle: Token![>] = input.parse()?;
+        Ok(ty)
+    }
+
+    let tokens = quote! { <fn() -> u8> };
+    println!("{}", example.parse2(tokens).unwrap());
+}
+

Trait Implementations§

source§

impl<'a> AnyDelimiter for ParseBuffer<'a>

source§

fn parse_any_delimiter(&self) -> Result<(Delimiter, DelimSpan, ParseBuffer<'_>)>

Returns the delimiter, the span of the delimiter token, and the nested +contents for further parsing.
source§

impl<'a> Debug for ParseBuffer<'a>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'a> Display for ParseBuffer<'a>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'a> Drop for ParseBuffer<'a>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl<'a> Speculative for ParseBuffer<'a>

source§

fn advance_to(&self, fork: &Self)

Advance this parse stream to the position of a forked parse stream. Read more

Auto Trait Implementations§

§

impl<'a> !Freeze for ParseBuffer<'a>

§

impl<'a> !RefUnwindSafe for ParseBuffer<'a>

§

impl<'a> !Send for ParseBuffer<'a>

§

impl<'a> !Sync for ParseBuffer<'a>

§

impl<'a> Unpin for ParseBuffer<'a>

§

impl<'a> !UnwindSafe for ParseBuffer<'a>

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/parse/struct.StepCursor.html b/syn/parse/struct.StepCursor.html new file mode 100644 index 0000000..1063e2d --- /dev/null +++ b/syn/parse/struct.StepCursor.html @@ -0,0 +1,39 @@ +StepCursor in syn::parse - Rust

Struct syn::parse::StepCursor

source ·
pub struct StepCursor<'c, 'a> { /* private fields */ }
Expand description

Cursor state associated with speculative parsing.

+

This type is the input of the closure provided to ParseStream::step.

+

§Example

+
use proc_macro2::TokenTree;
+use syn::Result;
+use syn::parse::ParseStream;
+
+// This function advances the stream past the next occurrence of `@`. If
+// no `@` is present in the stream, the stream position is unchanged and
+// an error is returned.
+fn skip_past_next_at(input: ParseStream) -> Result<()> {
+    input.step(|cursor| {
+        let mut rest = *cursor;
+        while let Some((tt, next)) = rest.token_tree() {
+            match &tt {
+                TokenTree::Punct(punct) if punct.as_char() == '@' => {
+                    return Ok(((), next));
+                }
+                _ => rest = next,
+            }
+        }
+        Err(cursor.error("no `@` was found after this point"))
+    })
+}
+

Implementations§

source§

impl<'c, 'a> StepCursor<'c, 'a>

source

pub fn error<T: Display>(self, message: T) -> Error

Triggers an error at the current position of the parse stream.

+

The ParseStream::step invocation will return this same error without +advancing the stream state.

+

Trait Implementations§

source§

impl<'c, 'a> Clone for StepCursor<'c, 'a>

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'c, 'a> Deref for StepCursor<'c, 'a>

§

type Target = Cursor<'c>

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl<'c, 'a> Copy for StepCursor<'c, 'a>

Auto Trait Implementations§

§

impl<'c, 'a> Freeze for StepCursor<'c, 'a>

§

impl<'c, 'a> RefUnwindSafe for StepCursor<'c, 'a>

§

impl<'c, 'a> !Send for StepCursor<'c, 'a>

§

impl<'c, 'a> !Sync for StepCursor<'c, 'a>

§

impl<'c, 'a> Unpin for StepCursor<'c, 'a>

§

impl<'c, 'a> UnwindSafe for StepCursor<'c, 'a>

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/parse/trait.Parse.html b/syn/parse/trait.Parse.html new file mode 100644 index 0000000..e11216c --- /dev/null +++ b/syn/parse/trait.Parse.html @@ -0,0 +1,8 @@ +Parse in syn::parse - Rust

Trait syn::parse::Parse

source ·
pub trait Parse: Sized {
+    // Required method
+    fn parse(input: ParseStream<'_>) -> Result<Self>;
+}
Expand description

Parsing interface implemented by all types that can be parsed in a default +way from a token stream.

+

Refer to the module documentation for details about implementing and using +the Parse trait.

+

Required Methods§

source

fn parse(input: ParseStream<'_>) -> Result<Self>

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl Parse for TokenTree

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl Parse for Option<Abi>

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl Parse for Option<BoundLifetimes>

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl Parse for Option<Label>

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl Parse for Option<WhereClause>

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl Parse for Group

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl Parse for Literal

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl Parse for Punct

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl Parse for TokenStream

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl<T: Parse + Token> Parse for Option<T>

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl<T: Parse> Parse for Box<T>

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

Implementors§

source§

impl Parse for BinOp

source§

impl Parse for Expr

source§

impl Parse for FnArg

source§

impl Parse for ForeignItem

source§

impl Parse for GenericArgument

source§

impl Parse for GenericParam

source§

impl Parse for ImplItem

source§

impl Parse for Item

source§

impl Parse for Lit

source§

impl Parse for Member

source§

impl Parse for Meta

source§

impl Parse for RangeLimits

source§

impl Parse for ReturnType

source§

impl Parse for StaticMutability

source§

impl Parse for Stmt

source§

impl Parse for TraitBoundModifier

source§

impl Parse for TraitItem

source§

impl Parse for syn::Type

source§

impl Parse for TypeParamBound

source§

impl Parse for UnOp

source§

impl Parse for UseTree

source§

impl Parse for Visibility

source§

impl Parse for WherePredicate

source§

impl Parse for Abi

source§

impl Parse for AngleBracketedGenericArguments

source§

impl Parse for Arm

source§

impl Parse for BareFnArg

source§

impl Parse for Block

source§

impl Parse for BoundLifetimes

source§

impl Parse for ConstParam

source§

impl Parse for DeriveInput

source§

impl Parse for ExprArray

source§

impl Parse for ExprAssign

source§

impl Parse for ExprAsync

source§

impl Parse for ExprAwait

source§

impl Parse for ExprBinary

source§

impl Parse for ExprBlock

source§

impl Parse for ExprBreak

source§

impl Parse for ExprCall

source§

impl Parse for ExprCast

source§

impl Parse for ExprClosure

source§

impl Parse for ExprConst

source§

impl Parse for ExprContinue

source§

impl Parse for ExprField

source§

impl Parse for ExprForLoop

source§

impl Parse for ExprIf

source§

impl Parse for ExprIndex

source§

impl Parse for ExprInfer

source§

impl Parse for ExprLet

source§

impl Parse for ExprLit

source§

impl Parse for ExprLoop

source§

impl Parse for ExprMacro

source§

impl Parse for ExprMatch

source§

impl Parse for ExprMethodCall

source§

impl Parse for ExprParen

source§

impl Parse for ExprPath

source§

impl Parse for ExprRange

source§

impl Parse for ExprReference

source§

impl Parse for ExprRepeat

source§

impl Parse for ExprReturn

source§

impl Parse for ExprStruct

source§

impl Parse for ExprTry

source§

impl Parse for ExprTryBlock

source§

impl Parse for ExprTuple

source§

impl Parse for ExprUnary

source§

impl Parse for ExprUnsafe

source§

impl Parse for ExprWhile

source§

impl Parse for ExprYield

source§

impl Parse for FieldValue

source§

impl Parse for FieldsNamed

source§

impl Parse for FieldsUnnamed

source§

impl Parse for File

source§

impl Parse for ForeignItemFn

source§

impl Parse for ForeignItemMacro

source§

impl Parse for ForeignItemStatic

source§

impl Parse for ForeignItemType

source§

impl Parse for Generics

source§

impl Parse for Ident

source§

impl Parse for ImplItemConst

source§

impl Parse for ImplItemFn

source§

impl Parse for ImplItemMacro

source§

impl Parse for ImplItemType

source§

impl Parse for Index

source§

impl Parse for ItemConst

source§

impl Parse for ItemEnum

source§

impl Parse for ItemExternCrate

source§

impl Parse for ItemFn

source§

impl Parse for ItemForeignMod

source§

impl Parse for ItemImpl

source§

impl Parse for ItemMacro

source§

impl Parse for ItemMod

source§

impl Parse for ItemStatic

source§

impl Parse for ItemStruct

source§

impl Parse for ItemTrait

source§

impl Parse for ItemTraitAlias

source§

impl Parse for ItemType

source§

impl Parse for ItemUnion

source§

impl Parse for ItemUse

source§

impl Parse for Label

source§

impl Parse for Lifetime

source§

impl Parse for LifetimeParam

source§

impl Parse for LitBool

source§

impl Parse for LitByte

source§

impl Parse for LitByteStr

source§

impl Parse for LitCStr

source§

impl Parse for LitChar

source§

impl Parse for LitFloat

source§

impl Parse for LitInt

source§

impl Parse for LitStr

source§

impl Parse for syn::Macro

source§

impl Parse for MetaList

source§

impl Parse for MetaNameValue

source§

impl Parse for ParenthesizedGenericArguments

source§

impl Parse for PatType

source§

impl Parse for Path

source§

impl Parse for PathSegment

source§

impl Parse for Receiver

source§

impl Parse for Signature

source§

impl Parse for TraitBound

source§

impl Parse for TraitItemConst

source§

impl Parse for TraitItemFn

source§

impl Parse for TraitItemMacro

source§

impl Parse for TraitItemType

source§

impl Parse for TypeArray

source§

impl Parse for TypeBareFn

source§

impl Parse for TypeGroup

source§

impl Parse for TypeImplTrait

source§

impl Parse for TypeInfer

source§

impl Parse for TypeMacro

source§

impl Parse for TypeNever

source§

impl Parse for TypeParam

source§

impl Parse for TypeParen

source§

impl Parse for TypePath

source§

impl Parse for TypePtr

source§

impl Parse for TypeReference

source§

impl Parse for TypeSlice

source§

impl Parse for TypeTraitObject

source§

impl Parse for TypeTuple

source§

impl Parse for Variant

source§

impl Parse for WhereClause

source§

impl Parse for Abstract

source§

impl Parse for And

source§

impl Parse for AndAnd

source§

impl Parse for AndEq

source§

impl Parse for As

source§

impl Parse for Async

source§

impl Parse for At

source§

impl Parse for Auto

source§

impl Parse for Await

source§

impl Parse for Become

source§

impl Parse for syn::token::Box

source§

impl Parse for Break

source§

impl Parse for Caret

source§

impl Parse for CaretEq

source§

impl Parse for Colon

source§

impl Parse for Comma

source§

impl Parse for Const

source§

impl Parse for Continue

source§

impl Parse for Crate

source§

impl Parse for Default

source§

impl Parse for Do

source§

impl Parse for Dollar

source§

impl Parse for Dot

source§

impl Parse for DotDot

source§

impl Parse for DotDotDot

source§

impl Parse for DotDotEq

source§

impl Parse for Dyn

source§

impl Parse for Else

source§

impl Parse for Enum

source§

impl Parse for Eq

source§

impl Parse for EqEq

source§

impl Parse for Extern

source§

impl Parse for FatArrow

source§

impl Parse for Final

source§

impl Parse for Fn

source§

impl Parse for For

source§

impl Parse for Ge

source§

impl Parse for Gt

source§

impl Parse for If

source§

impl Parse for Impl

source§

impl Parse for In

source§

impl Parse for LArrow

source§

impl Parse for Le

source§

impl Parse for Let

source§

impl Parse for Loop

source§

impl Parse for Lt

source§

impl Parse for syn::token::Macro

source§

impl Parse for Match

source§

impl Parse for Minus

source§

impl Parse for MinusEq

source§

impl Parse for Mod

source§

impl Parse for Move

source§

impl Parse for Mut

source§

impl Parse for Ne

source§

impl Parse for Not

source§

impl Parse for Or

source§

impl Parse for OrEq

source§

impl Parse for OrOr

source§

impl Parse for Override

source§

impl Parse for PathSep

source§

impl Parse for Percent

source§

impl Parse for PercentEq

source§

impl Parse for Plus

source§

impl Parse for PlusEq

source§

impl Parse for Pound

source§

impl Parse for Priv

source§

impl Parse for Pub

source§

impl Parse for Question

source§

impl Parse for RArrow

source§

impl Parse for Ref

source§

impl Parse for Return

source§

impl Parse for SelfType

source§

impl Parse for SelfValue

source§

impl Parse for Semi

source§

impl Parse for Shl

source§

impl Parse for ShlEq

source§

impl Parse for Shr

source§

impl Parse for ShrEq

source§

impl Parse for Slash

source§

impl Parse for SlashEq

source§

impl Parse for Star

source§

impl Parse for StarEq

source§

impl Parse for Static

source§

impl Parse for Struct

source§

impl Parse for Super

source§

impl Parse for Tilde

source§

impl Parse for Trait

source§

impl Parse for Try

source§

impl Parse for syn::token::Type

source§

impl Parse for Typeof

source§

impl Parse for Underscore

source§

impl Parse for Union

source§

impl Parse for Unsafe

source§

impl Parse for Unsized

source§

impl Parse for Use

source§

impl Parse for Virtual

source§

impl Parse for Where

source§

impl Parse for While

source§

impl Parse for Yield

source§

impl Parse for Nothing

\ No newline at end of file diff --git a/syn/parse/trait.Parser.html b/syn/parse/trait.Parser.html new file mode 100644 index 0000000..ebd0ea4 --- /dev/null +++ b/syn/parse/trait.Parser.html @@ -0,0 +1,25 @@ +Parser in syn::parse - Rust

Trait syn::parse::Parser

source ·
pub trait Parser: Sized {
+    type Output;
+
+    // Required method
+    fn parse2(self, tokens: TokenStream) -> Result<Self::Output>;
+
+    // Provided methods
+    fn parse(self, tokens: TokenStream) -> Result<Self::Output> { ... }
+    fn parse_str(self, s: &str) -> Result<Self::Output> { ... }
+}
Expand description

Parser that can parse Rust tokens into a particular syntax tree node.

+

Refer to the module documentation for details about parsing in Syn.

+

Required Associated Types§

Required Methods§

source

fn parse2(self, tokens: TokenStream) -> Result<Self::Output>

Parse a proc-macro2 token stream into the chosen syntax tree node.

+

This function will check that the input is fully parsed. If there are +any unparsed tokens at the end of the stream, an error is returned.

+

Provided Methods§

source

fn parse(self, tokens: TokenStream) -> Result<Self::Output>

Parse tokens of source code into the chosen syntax tree node.

+

This function will check that the input is fully parsed. If there are +any unparsed tokens at the end of the stream, an error is returned.

+
source

fn parse_str(self, s: &str) -> Result<Self::Output>

Parse a string of Rust code into the chosen syntax tree node.

+

This function will check that the input is fully parsed. If there are +any unparsed tokens at the end of the string, an error is returned.

+
§Hygiene
+

Every span in the resulting syntax tree will be set to resolve at the +macro call site.

+

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<F, T> Parser for F
where + F: FnOnce(ParseStream<'_>) -> Result<T>,

§

type Output = T

\ No newline at end of file diff --git a/syn/parse/trait.Peek.html b/syn/parse/trait.Peek.html new file mode 100644 index 0000000..7b6dcfc --- /dev/null +++ b/syn/parse/trait.Peek.html @@ -0,0 +1,5 @@ +Peek in syn::parse - Rust

Trait syn::parse::Peek

source ·
pub trait Peek: Sealed { }
Expand description

Types that can be parsed by looking at just one token.

+

Use ParseStream::peek to peek one of these types in a parse stream +without consuming it from the stream.

+

This trait is sealed and cannot be implemented for types outside of Syn.

+

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<F: Copy + FnOnce(TokenMarker) -> T, T: Token> Peek for F

\ No newline at end of file diff --git a/syn/parse/type.ParseStream.html b/syn/parse/type.ParseStream.html new file mode 100644 index 0000000..f1e93ec --- /dev/null +++ b/syn/parse/type.ParseStream.html @@ -0,0 +1,4 @@ +ParseStream in syn::parse - Rust

Type Alias syn::parse::ParseStream

source ·
pub type ParseStream<'a> = &'a ParseBuffer<'a>;
Expand description

Input to a Syn parser function.

+

See the methods of this type under the documentation of ParseBuffer. For +an overview of parsing in Syn, refer to the module documentation.

+
\ No newline at end of file diff --git a/syn/parse/type.Result.html b/syn/parse/type.Result.html new file mode 100644 index 0000000..7dce4fa --- /dev/null +++ b/syn/parse/type.Result.html @@ -0,0 +1,4 @@ +Result in syn::parse - Rust

Type Alias syn::parse::Result

source ·
pub type Result<T> = Result<T, Error>;
Expand description

The result of a Syn parser.

+

Aliased Type§

enum Result<T> {
+    // some variants omitted
+}

Variants§

\ No newline at end of file diff --git a/syn/pat/enum.Pat.html b/syn/pat/enum.Pat.html new file mode 100644 index 0000000..870e53d --- /dev/null +++ b/syn/pat/enum.Pat.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/enum.Pat.html...

+ + + \ No newline at end of file diff --git a/syn/pat/struct.FieldPat.html b/syn/pat/struct.FieldPat.html new file mode 100644 index 0000000..aac4d87 --- /dev/null +++ b/syn/pat/struct.FieldPat.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.FieldPat.html...

+ + + \ No newline at end of file diff --git a/syn/pat/struct.PatIdent.html b/syn/pat/struct.PatIdent.html new file mode 100644 index 0000000..a3dca67 --- /dev/null +++ b/syn/pat/struct.PatIdent.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.PatIdent.html...

+ + + \ No newline at end of file diff --git a/syn/pat/struct.PatOr.html b/syn/pat/struct.PatOr.html new file mode 100644 index 0000000..42d9963 --- /dev/null +++ b/syn/pat/struct.PatOr.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.PatOr.html...

+ + + \ No newline at end of file diff --git a/syn/pat/struct.PatParen.html b/syn/pat/struct.PatParen.html new file mode 100644 index 0000000..864fe9f --- /dev/null +++ b/syn/pat/struct.PatParen.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.PatParen.html...

+ + + \ No newline at end of file diff --git a/syn/pat/struct.PatReference.html b/syn/pat/struct.PatReference.html new file mode 100644 index 0000000..1869c38 --- /dev/null +++ b/syn/pat/struct.PatReference.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.PatReference.html...

+ + + \ No newline at end of file diff --git a/syn/pat/struct.PatRest.html b/syn/pat/struct.PatRest.html new file mode 100644 index 0000000..8f87f80 --- /dev/null +++ b/syn/pat/struct.PatRest.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.PatRest.html...

+ + + \ No newline at end of file diff --git a/syn/pat/struct.PatSlice.html b/syn/pat/struct.PatSlice.html new file mode 100644 index 0000000..6ed4541 --- /dev/null +++ b/syn/pat/struct.PatSlice.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.PatSlice.html...

+ + + \ No newline at end of file diff --git a/syn/pat/struct.PatStruct.html b/syn/pat/struct.PatStruct.html new file mode 100644 index 0000000..4bef17a --- /dev/null +++ b/syn/pat/struct.PatStruct.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.PatStruct.html...

+ + + \ No newline at end of file diff --git a/syn/pat/struct.PatTuple.html b/syn/pat/struct.PatTuple.html new file mode 100644 index 0000000..a072e1f --- /dev/null +++ b/syn/pat/struct.PatTuple.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.PatTuple.html...

+ + + \ No newline at end of file diff --git a/syn/pat/struct.PatTupleStruct.html b/syn/pat/struct.PatTupleStruct.html new file mode 100644 index 0000000..67fb289 --- /dev/null +++ b/syn/pat/struct.PatTupleStruct.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.PatTupleStruct.html...

+ + + \ No newline at end of file diff --git a/syn/pat/struct.PatType.html b/syn/pat/struct.PatType.html new file mode 100644 index 0000000..5d143df --- /dev/null +++ b/syn/pat/struct.PatType.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.PatType.html...

+ + + \ No newline at end of file diff --git a/syn/pat/struct.PatWild.html b/syn/pat/struct.PatWild.html new file mode 100644 index 0000000..2a912f7 --- /dev/null +++ b/syn/pat/struct.PatWild.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.PatWild.html...

+ + + \ No newline at end of file diff --git a/syn/path/enum.GenericArgument.html b/syn/path/enum.GenericArgument.html new file mode 100644 index 0000000..ff96d0c --- /dev/null +++ b/syn/path/enum.GenericArgument.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/enum.GenericArgument.html...

+ + + \ No newline at end of file diff --git a/syn/path/enum.PathArguments.html b/syn/path/enum.PathArguments.html new file mode 100644 index 0000000..7a47abd --- /dev/null +++ b/syn/path/enum.PathArguments.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/enum.PathArguments.html...

+ + + \ No newline at end of file diff --git a/syn/path/struct.AngleBracketedGenericArguments.html b/syn/path/struct.AngleBracketedGenericArguments.html new file mode 100644 index 0000000..bb6be23 --- /dev/null +++ b/syn/path/struct.AngleBracketedGenericArguments.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.AngleBracketedGenericArguments.html...

+ + + \ No newline at end of file diff --git a/syn/path/struct.AssocConst.html b/syn/path/struct.AssocConst.html new file mode 100644 index 0000000..47b15b3 --- /dev/null +++ b/syn/path/struct.AssocConst.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.AssocConst.html...

+ + + \ No newline at end of file diff --git a/syn/path/struct.AssocType.html b/syn/path/struct.AssocType.html new file mode 100644 index 0000000..50d074b --- /dev/null +++ b/syn/path/struct.AssocType.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.AssocType.html...

+ + + \ No newline at end of file diff --git a/syn/path/struct.Constraint.html b/syn/path/struct.Constraint.html new file mode 100644 index 0000000..630da5b --- /dev/null +++ b/syn/path/struct.Constraint.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.Constraint.html...

+ + + \ No newline at end of file diff --git a/syn/path/struct.ParenthesizedGenericArguments.html b/syn/path/struct.ParenthesizedGenericArguments.html new file mode 100644 index 0000000..65b389a --- /dev/null +++ b/syn/path/struct.ParenthesizedGenericArguments.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.ParenthesizedGenericArguments.html...

+ + + \ No newline at end of file diff --git a/syn/path/struct.Path.html b/syn/path/struct.Path.html new file mode 100644 index 0000000..6a2edd7 --- /dev/null +++ b/syn/path/struct.Path.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.Path.html...

+ + + \ No newline at end of file diff --git a/syn/path/struct.PathSegment.html b/syn/path/struct.PathSegment.html new file mode 100644 index 0000000..866d81e --- /dev/null +++ b/syn/path/struct.PathSegment.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.PathSegment.html...

+ + + \ No newline at end of file diff --git a/syn/path/struct.QSelf.html b/syn/path/struct.QSelf.html new file mode 100644 index 0000000..d22b48a --- /dev/null +++ b/syn/path/struct.QSelf.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.QSelf.html...

+ + + \ No newline at end of file diff --git a/syn/punctuated/enum.Pair.html b/syn/punctuated/enum.Pair.html new file mode 100644 index 0000000..dd8bf0e --- /dev/null +++ b/syn/punctuated/enum.Pair.html @@ -0,0 +1,59 @@ +Pair in syn::punctuated - Rust

Enum syn::punctuated::Pair

source ·
pub enum Pair<T, P> {
+    Punctuated(T, P),
+    End(T),
+}
Expand description

A single syntax tree node of type T followed by its trailing punctuation +of type P if any.

+

Refer to the module documentation for details about punctuated sequences.

+

Variants§

§

Punctuated(T, P)

§

End(T)

Implementations§

source§

impl<T, P> Pair<T, P>

source

pub fn into_value(self) -> T

Extracts the syntax tree node from this punctuated pair, discarding the +following punctuation.

+
source

pub fn value(&self) -> &T

Borrows the syntax tree node from this punctuated pair.

+
source

pub fn value_mut(&mut self) -> &mut T

Mutably borrows the syntax tree node from this punctuated pair.

+
source

pub fn punct(&self) -> Option<&P>

Borrows the punctuation from this punctuated pair, unless this pair is +the final one and there is no trailing punctuation.

+
source

pub fn punct_mut(&mut self) -> Option<&mut P>

Mutably borrows the punctuation from this punctuated pair, unless the +pair is the final one and there is no trailing punctuation.

+
§Example
+
punctuated.insert(0, parse_quote!('lifetime));
+if let Some(punct) = punctuated.pairs_mut().next().unwrap().punct_mut() {
+    punct.span = span;
+}
+
source

pub fn new(t: T, p: Option<P>) -> Self

Creates a punctuated pair out of a syntax tree node and an optional +following punctuation.

+
source

pub fn into_tuple(self) -> (T, Option<P>)

Produces this punctuated pair as a tuple of syntax tree node and +optional following punctuation.

+
source§

impl<T, P> Pair<&T, &P>

source

pub fn cloned(self) -> Pair<T, P>
where + T: Clone, + P: Clone,

Trait Implementations§

source§

impl<T, P> Clone for Pair<T, P>
where + T: Clone, + P: Clone,

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T, P> Extend<Pair<T, P>> for Punctuated<T, P>
where + P: Default,

source§

fn extend<I: IntoIterator<Item = Pair<T, P>>>(&mut self, i: I)

Extends a collection with the contents of an iterator. Read more
source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
source§

impl<T, P> FromIterator<Pair<T, P>> for Punctuated<T, P>

source§

fn from_iter<I: IntoIterator<Item = Pair<T, P>>>(i: I) -> Self

Creates a value from an iterator. Read more
source§

impl<T, P> ToTokens for Pair<T, P>
where + T: ToTokens, + P: ToTokens,

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl<T, P> Copy for Pair<T, P>
where + T: Copy, + P: Copy,

Auto Trait Implementations§

§

impl<T, P> Freeze for Pair<T, P>
where + T: Freeze, + P: Freeze,

§

impl<T, P> RefUnwindSafe for Pair<T, P>
where + T: RefUnwindSafe, + P: RefUnwindSafe,

§

impl<T, P> Send for Pair<T, P>
where + T: Send, + P: Send,

§

impl<T, P> Sync for Pair<T, P>
where + T: Sync, + P: Sync,

§

impl<T, P> Unpin for Pair<T, P>
where + T: Unpin, + P: Unpin,

§

impl<T, P> UnwindSafe for Pair<T, P>
where + T: UnwindSafe, + P: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/punctuated/index.html b/syn/punctuated/index.html new file mode 100644 index 0000000..3f01013 --- /dev/null +++ b/syn/punctuated/index.html @@ -0,0 +1,17 @@ +syn::punctuated - Rust

Module syn::punctuated

source ·
Expand description

A punctuated sequence of syntax tree nodes separated by punctuation.

+

Lots of things in Rust are punctuated sequences.

+
    +
  • The fields of a struct are Punctuated<Field, Token![,]>.
  • +
  • The segments of a path are Punctuated<PathSegment, Token![::]>.
  • +
  • The bounds on a generic parameter are Punctuated<TypeParamBound, Token![+]>.
  • +
  • The arguments to a function call are Punctuated<Expr, Token![,]>.
  • +
+

This module provides a common representation for these punctuated sequences +in the form of the Punctuated<T, P> type. We store a vector of pairs of +syntax tree node + punctuation, where every node in the sequence is followed +by punctuation except for possibly the final one.

+
a_function_call(arg1, arg2, arg3);
+                ~~~~^ ~~~~^ ~~~~
+

Structs§

  • An iterator over owned values of type T.
  • An iterator over owned pairs of type Pair<T, P>.
  • An iterator over borrowed values of type &T.
  • An iterator over mutably borrowed values of type &mut T.
  • An iterator over borrowed pairs of type Pair<&T, &P>.
  • An iterator over mutably borrowed pairs of type Pair<&mut T, &mut P>.
  • A punctuated sequence of syntax tree nodes of type T separated by +punctuation of type P.

Enums§

  • A single syntax tree node of type T followed by its trailing punctuation +of type P if any.
\ No newline at end of file diff --git a/syn/punctuated/sidebar-items.js b/syn/punctuated/sidebar-items.js new file mode 100644 index 0000000..ab0fbe3 --- /dev/null +++ b/syn/punctuated/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["Pair"],"struct":["IntoIter","IntoPairs","Iter","IterMut","Pairs","PairsMut","Punctuated"]}; \ No newline at end of file diff --git a/syn/punctuated/struct.IntoIter.html b/syn/punctuated/struct.IntoIter.html new file mode 100644 index 0000000..2421ddd --- /dev/null +++ b/syn/punctuated/struct.IntoIter.html @@ -0,0 +1,216 @@ +IntoIter in syn::punctuated - Rust

Struct syn::punctuated::IntoIter

source ·
pub struct IntoIter<T> { /* private fields */ }
Expand description

An iterator over owned values of type T.

+

Refer to the module documentation for details about punctuated sequences.

+

Trait Implementations§

source§

impl<T> Clone for IntoIter<T>
where + T: Clone,

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T> DoubleEndedIterator for IntoIter<T>

source§

fn next_back(&mut self) -> Option<Self::Item>

Removes and returns an element from the end of the iterator. Read more
source§

fn advance_back_by(&mut self, n: usize) -> Result<(), NonZero<usize>>

🔬This is a nightly-only experimental API. (iter_advance_by)
Advances the iterator from the back by n elements. Read more
1.37.0 · source§

fn nth_back(&mut self, n: usize) -> Option<Self::Item>

Returns the nth element from the end of the iterator. Read more
1.27.0 · source§

fn try_rfold<B, F, R>(&mut self, init: B, f: F) -> R
where + Self: Sized, + F: FnMut(B, Self::Item) -> R, + R: Try<Output = B>,

This is the reverse version of Iterator::try_fold(): it takes +elements starting from the back of the iterator. Read more
1.27.0 · source§

fn rfold<B, F>(self, init: B, f: F) -> B
where + Self: Sized, + F: FnMut(B, Self::Item) -> B,

An iterator method that reduces the iterator’s elements to a single, +final value, starting from the back. Read more
1.27.0 · source§

fn rfind<P>(&mut self, predicate: P) -> Option<Self::Item>
where + Self: Sized, + P: FnMut(&Self::Item) -> bool,

Searches for an element of an iterator from the back that satisfies a predicate. Read more
source§

impl<T> ExactSizeIterator for IntoIter<T>

source§

fn len(&self) -> usize

Returns the exact remaining length of the iterator. Read more
source§

fn is_empty(&self) -> bool

🔬This is a nightly-only experimental API. (exact_size_is_empty)
Returns true if the iterator is empty. Read more
source§

impl<T> Iterator for IntoIter<T>

§

type Item = T

The type of the elements being iterated over.
source§

fn next(&mut self) -> Option<Self::Item>

Advances the iterator and returns the next value. Read more
source§

fn size_hint(&self) -> (usize, Option<usize>)

Returns the bounds on the remaining length of the iterator. Read more
source§

fn next_chunk<const N: usize>( + &mut self +) -> Result<[Self::Item; N], IntoIter<Self::Item, N>>
where + Self: Sized,

🔬This is a nightly-only experimental API. (iter_next_chunk)
Advances the iterator and returns an array containing the next N values. Read more
1.0.0 · source§

fn count(self) -> usize
where + Self: Sized,

Consumes the iterator, counting the number of iterations and returning it. Read more
1.0.0 · source§

fn last(self) -> Option<Self::Item>
where + Self: Sized,

Consumes the iterator, returning the last element. Read more
source§

fn advance_by(&mut self, n: usize) -> Result<(), NonZero<usize>>

🔬This is a nightly-only experimental API. (iter_advance_by)
Advances the iterator by n elements. Read more
1.0.0 · source§

fn nth(&mut self, n: usize) -> Option<Self::Item>

Returns the nth element of the iterator. Read more
1.28.0 · source§

fn step_by(self, step: usize) -> StepBy<Self>
where + Self: Sized,

Creates an iterator starting at the same point, but stepping by +the given amount at each iteration. Read more
1.0.0 · source§

fn chain<U>(self, other: U) -> Chain<Self, <U as IntoIterator>::IntoIter>
where + Self: Sized, + U: IntoIterator<Item = Self::Item>,

Takes two iterators and creates a new iterator over both in sequence. Read more
1.0.0 · source§

fn zip<U>(self, other: U) -> Zip<Self, <U as IntoIterator>::IntoIter>
where + Self: Sized, + U: IntoIterator,

‘Zips up’ two iterators into a single iterator of pairs. Read more
source§

fn intersperse_with<G>(self, separator: G) -> IntersperseWith<Self, G>
where + Self: Sized, + G: FnMut() -> Self::Item,

🔬This is a nightly-only experimental API. (iter_intersperse)
Creates a new iterator which places an item generated by separator +between adjacent items of the original iterator. Read more
1.0.0 · source§

fn map<B, F>(self, f: F) -> Map<Self, F>
where + Self: Sized, + F: FnMut(Self::Item) -> B,

Takes a closure and creates an iterator which calls that closure on each +element. Read more
1.21.0 · source§

fn for_each<F>(self, f: F)
where + Self: Sized, + F: FnMut(Self::Item),

Calls a closure on each element of an iterator. Read more
1.0.0 · source§

fn filter<P>(self, predicate: P) -> Filter<Self, P>
where + Self: Sized, + P: FnMut(&Self::Item) -> bool,

Creates an iterator which uses a closure to determine if an element +should be yielded. Read more
1.0.0 · source§

fn filter_map<B, F>(self, f: F) -> FilterMap<Self, F>
where + Self: Sized, + F: FnMut(Self::Item) -> Option<B>,

Creates an iterator that both filters and maps. Read more
1.0.0 · source§

fn enumerate(self) -> Enumerate<Self>
where + Self: Sized,

Creates an iterator which gives the current iteration count as well as +the next value. Read more
1.0.0 · source§

fn peekable(self) -> Peekable<Self>
where + Self: Sized,

Creates an iterator which can use the peek and peek_mut methods +to look at the next element of the iterator without consuming it. See +their documentation for more information. Read more
1.0.0 · source§

fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P>
where + Self: Sized, + P: FnMut(&Self::Item) -> bool,

Creates an iterator that skips elements based on a predicate. Read more
1.0.0 · source§

fn take_while<P>(self, predicate: P) -> TakeWhile<Self, P>
where + Self: Sized, + P: FnMut(&Self::Item) -> bool,

Creates an iterator that yields elements based on a predicate. Read more
1.57.0 · source§

fn map_while<B, P>(self, predicate: P) -> MapWhile<Self, P>
where + Self: Sized, + P: FnMut(Self::Item) -> Option<B>,

Creates an iterator that both yields elements based on a predicate and maps. Read more
1.0.0 · source§

fn skip(self, n: usize) -> Skip<Self>
where + Self: Sized,

Creates an iterator that skips the first n elements. Read more
1.0.0 · source§

fn take(self, n: usize) -> Take<Self>
where + Self: Sized,

Creates an iterator that yields the first n elements, or fewer +if the underlying iterator ends sooner. Read more
1.0.0 · source§

fn scan<St, B, F>(self, initial_state: St, f: F) -> Scan<Self, St, F>
where + Self: Sized, + F: FnMut(&mut St, Self::Item) -> Option<B>,

An iterator adapter which, like fold, holds internal state, but +unlike fold, produces a new iterator. Read more
1.0.0 · source§

fn flat_map<U, F>(self, f: F) -> FlatMap<Self, U, F>
where + Self: Sized, + U: IntoIterator, + F: FnMut(Self::Item) -> U,

Creates an iterator that works like map, but flattens nested structure. Read more
source§

fn map_windows<F, R, const N: usize>(self, f: F) -> MapWindows<Self, F, N>
where + Self: Sized, + F: FnMut(&[Self::Item; N]) -> R,

🔬This is a nightly-only experimental API. (iter_map_windows)
Calls the given function f for each contiguous window of size N over +self and returns an iterator over the outputs of f. Like slice::windows(), +the windows during mapping overlap as well. Read more
1.0.0 · source§

fn fuse(self) -> Fuse<Self>
where + Self: Sized,

Creates an iterator which ends after the first None. Read more
1.0.0 · source§

fn inspect<F>(self, f: F) -> Inspect<Self, F>
where + Self: Sized, + F: FnMut(&Self::Item),

Does something with each element of an iterator, passing the value on. Read more
1.0.0 · source§

fn by_ref(&mut self) -> &mut Self
where + Self: Sized,

Borrows an iterator, rather than consuming it. Read more
1.0.0 · source§

fn collect<B>(self) -> B
where + B: FromIterator<Self::Item>, + Self: Sized,

Transforms an iterator into a collection. Read more
source§

fn collect_into<E>(self, collection: &mut E) -> &mut E
where + E: Extend<Self::Item>, + Self: Sized,

🔬This is a nightly-only experimental API. (iter_collect_into)
Collects all the items from an iterator into a collection. Read more
1.0.0 · source§

fn partition<B, F>(self, f: F) -> (B, B)
where + Self: Sized, + B: Default + Extend<Self::Item>, + F: FnMut(&Self::Item) -> bool,

Consumes an iterator, creating two collections from it. Read more
source§

fn partition_in_place<'a, T, P>(self, predicate: P) -> usize
where + T: 'a, + Self: Sized + DoubleEndedIterator<Item = &'a mut T>, + P: FnMut(&T) -> bool,

🔬This is a nightly-only experimental API. (iter_partition_in_place)
Reorders the elements of this iterator in-place according to the given predicate, +such that all those that return true precede all those that return false. +Returns the number of true elements found. Read more
source§

fn is_partitioned<P>(self, predicate: P) -> bool
where + Self: Sized, + P: FnMut(Self::Item) -> bool,

🔬This is a nightly-only experimental API. (iter_is_partitioned)
Checks if the elements of this iterator are partitioned according to the given predicate, +such that all those that return true precede all those that return false. Read more
1.27.0 · source§

fn try_fold<B, F, R>(&mut self, init: B, f: F) -> R
where + Self: Sized, + F: FnMut(B, Self::Item) -> R, + R: Try<Output = B>,

An iterator method that applies a function as long as it returns +successfully, producing a single, final value. Read more
1.27.0 · source§

fn try_for_each<F, R>(&mut self, f: F) -> R
where + Self: Sized, + F: FnMut(Self::Item) -> R, + R: Try<Output = ()>,

An iterator method that applies a fallible function to each item in the +iterator, stopping at the first error and returning that error. Read more
1.0.0 · source§

fn fold<B, F>(self, init: B, f: F) -> B
where + Self: Sized, + F: FnMut(B, Self::Item) -> B,

Folds every element into an accumulator by applying an operation, +returning the final result. Read more
1.51.0 · source§

fn reduce<F>(self, f: F) -> Option<Self::Item>
where + Self: Sized, + F: FnMut(Self::Item, Self::Item) -> Self::Item,

Reduces the elements to a single one, by repeatedly applying a reducing +operation. Read more
source§

fn try_reduce<F, R>( + &mut self, + f: F +) -> <<R as Try>::Residual as Residual<Option<<R as Try>::Output>>>::TryType
where + Self: Sized, + F: FnMut(Self::Item, Self::Item) -> R, + R: Try<Output = Self::Item>, + <R as Try>::Residual: Residual<Option<Self::Item>>,

🔬This is a nightly-only experimental API. (iterator_try_reduce)
Reduces the elements to a single one by repeatedly applying a reducing operation. If the +closure returns a failure, the failure is propagated back to the caller immediately. Read more
1.0.0 · source§

fn all<F>(&mut self, f: F) -> bool
where + Self: Sized, + F: FnMut(Self::Item) -> bool,

Tests if every element of the iterator matches a predicate. Read more
1.0.0 · source§

fn any<F>(&mut self, f: F) -> bool
where + Self: Sized, + F: FnMut(Self::Item) -> bool,

Tests if any element of the iterator matches a predicate. Read more
1.0.0 · source§

fn find<P>(&mut self, predicate: P) -> Option<Self::Item>
where + Self: Sized, + P: FnMut(&Self::Item) -> bool,

Searches for an element of an iterator that satisfies a predicate. Read more
1.30.0 · source§

fn find_map<B, F>(&mut self, f: F) -> Option<B>
where + Self: Sized, + F: FnMut(Self::Item) -> Option<B>,

Applies function to the elements of iterator and returns +the first non-none result. Read more
source§

fn try_find<F, R>( + &mut self, + f: F +) -> <<R as Try>::Residual as Residual<Option<Self::Item>>>::TryType
where + Self: Sized, + F: FnMut(&Self::Item) -> R, + R: Try<Output = bool>, + <R as Try>::Residual: Residual<Option<Self::Item>>,

🔬This is a nightly-only experimental API. (try_find)
Applies function to the elements of iterator and returns +the first true result or the first error. Read more
1.0.0 · source§

fn position<P>(&mut self, predicate: P) -> Option<usize>
where + Self: Sized, + P: FnMut(Self::Item) -> bool,

Searches for an element in an iterator, returning its index. Read more
1.0.0 · source§

fn rposition<P>(&mut self, predicate: P) -> Option<usize>
where + P: FnMut(Self::Item) -> bool, + Self: Sized + ExactSizeIterator + DoubleEndedIterator,

Searches for an element in an iterator from the right, returning its +index. Read more
1.6.0 · source§

fn max_by_key<B, F>(self, f: F) -> Option<Self::Item>
where + B: Ord, + Self: Sized, + F: FnMut(&Self::Item) -> B,

Returns the element that gives the maximum value from the +specified function. Read more
1.15.0 · source§

fn max_by<F>(self, compare: F) -> Option<Self::Item>
where + Self: Sized, + F: FnMut(&Self::Item, &Self::Item) -> Ordering,

Returns the element that gives the maximum value with respect to the +specified comparison function. Read more
1.6.0 · source§

fn min_by_key<B, F>(self, f: F) -> Option<Self::Item>
where + B: Ord, + Self: Sized, + F: FnMut(&Self::Item) -> B,

Returns the element that gives the minimum value from the +specified function. Read more
1.15.0 · source§

fn min_by<F>(self, compare: F) -> Option<Self::Item>
where + Self: Sized, + F: FnMut(&Self::Item, &Self::Item) -> Ordering,

Returns the element that gives the minimum value with respect to the +specified comparison function. Read more
1.0.0 · source§

fn rev(self) -> Rev<Self>
where + Self: Sized + DoubleEndedIterator,

Reverses an iterator’s direction. Read more
1.0.0 · source§

fn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB)
where + FromA: Default + Extend<A>, + FromB: Default + Extend<B>, + Self: Sized + Iterator<Item = (A, B)>,

Converts an iterator of pairs into a pair of containers. Read more
1.36.0 · source§

fn copied<'a, T>(self) -> Copied<Self>
where + T: 'a + Copy, + Self: Sized + Iterator<Item = &'a T>,

Creates an iterator which copies all of its elements. Read more
1.0.0 · source§

fn cloned<'a, T>(self) -> Cloned<Self>
where + T: 'a + Clone, + Self: Sized + Iterator<Item = &'a T>,

Creates an iterator which clones all of its elements. Read more
source§

fn array_chunks<const N: usize>(self) -> ArrayChunks<Self, N>
where + Self: Sized,

🔬This is a nightly-only experimental API. (iter_array_chunks)
Returns an iterator over N elements of the iterator at a time. Read more
1.11.0 · source§

fn sum<S>(self) -> S
where + Self: Sized, + S: Sum<Self::Item>,

Sums the elements of an iterator. Read more
1.11.0 · source§

fn product<P>(self) -> P
where + Self: Sized, + P: Product<Self::Item>,

Iterates over the entire iterator, multiplying all the elements Read more
source§

fn cmp_by<I, F>(self, other: I, cmp: F) -> Ordering
where + Self: Sized, + I: IntoIterator, + F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Ordering,

🔬This is a nightly-only experimental API. (iter_order_by)
Lexicographically compares the elements of this Iterator with those +of another with respect to the specified comparison function. Read more
1.5.0 · source§

fn partial_cmp<I>(self, other: I) -> Option<Ordering>
where + I: IntoIterator, + Self::Item: PartialOrd<<I as IntoIterator>::Item>, + Self: Sized,

Lexicographically compares the PartialOrd elements of +this Iterator with those of another. The comparison works like short-circuit +evaluation, returning a result without comparing the remaining elements. +As soon as an order can be determined, the evaluation stops and a result is returned. Read more
source§

fn partial_cmp_by<I, F>(self, other: I, partial_cmp: F) -> Option<Ordering>
where + Self: Sized, + I: IntoIterator, + F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Option<Ordering>,

🔬This is a nightly-only experimental API. (iter_order_by)
Lexicographically compares the elements of this Iterator with those +of another with respect to the specified comparison function. Read more
1.5.0 · source§

fn eq<I>(self, other: I) -> bool
where + I: IntoIterator, + Self::Item: PartialEq<<I as IntoIterator>::Item>, + Self: Sized,

Determines if the elements of this Iterator are equal to those of +another. Read more
source§

fn eq_by<I, F>(self, other: I, eq: F) -> bool
where + Self: Sized, + I: IntoIterator, + F: FnMut(Self::Item, <I as IntoIterator>::Item) -> bool,

🔬This is a nightly-only experimental API. (iter_order_by)
Determines if the elements of this Iterator are equal to those of +another with respect to the specified equality function. Read more
1.5.0 · source§

fn ne<I>(self, other: I) -> bool
where + I: IntoIterator, + Self::Item: PartialEq<<I as IntoIterator>::Item>, + Self: Sized,

Determines if the elements of this Iterator are not equal to those of +another. Read more
1.5.0 · source§

fn lt<I>(self, other: I) -> bool
where + I: IntoIterator, + Self::Item: PartialOrd<<I as IntoIterator>::Item>, + Self: Sized,

Determines if the elements of this Iterator are lexicographically +less than those of another. Read more
1.5.0 · source§

fn le<I>(self, other: I) -> bool
where + I: IntoIterator, + Self::Item: PartialOrd<<I as IntoIterator>::Item>, + Self: Sized,

Determines if the elements of this Iterator are lexicographically +less or equal to those of another. Read more
1.5.0 · source§

fn gt<I>(self, other: I) -> bool
where + I: IntoIterator, + Self::Item: PartialOrd<<I as IntoIterator>::Item>, + Self: Sized,

Determines if the elements of this Iterator are lexicographically +greater than those of another. Read more
1.5.0 · source§

fn ge<I>(self, other: I) -> bool
where + I: IntoIterator, + Self::Item: PartialOrd<<I as IntoIterator>::Item>, + Self: Sized,

Determines if the elements of this Iterator are lexicographically +greater than or equal to those of another. Read more
source§

fn is_sorted_by<F>(self, compare: F) -> bool
where + Self: Sized, + F: FnMut(&Self::Item, &Self::Item) -> bool,

🔬This is a nightly-only experimental API. (is_sorted)
Checks if the elements of this iterator are sorted using the given comparator function. Read more
source§

fn is_sorted_by_key<F, K>(self, f: F) -> bool
where + Self: Sized, + F: FnMut(Self::Item) -> K, + K: PartialOrd,

🔬This is a nightly-only experimental API. (is_sorted)
Checks if the elements of this iterator are sorted using the given key extraction +function. Read more

Auto Trait Implementations§

§

impl<T> Freeze for IntoIter<T>

§

impl<T> RefUnwindSafe for IntoIter<T>
where + T: RefUnwindSafe,

§

impl<T> Send for IntoIter<T>
where + T: Send,

§

impl<T> Sync for IntoIter<T>
where + T: Sync,

§

impl<T> Unpin for IntoIter<T>
where + T: Unpin,

§

impl<T> UnwindSafe for IntoIter<T>

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<I> IntoIterator for I
where + I: Iterator,

§

type Item = <I as Iterator>::Item

The type of the elements being iterated over.
§

type IntoIter = I

Which kind of iterator are we turning this into?
const: unstable · source§

fn into_iter(self) -> I

Creates an iterator from a value. Read more
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/punctuated/struct.IntoPairs.html b/syn/punctuated/struct.IntoPairs.html new file mode 100644 index 0000000..986db3c --- /dev/null +++ b/syn/punctuated/struct.IntoPairs.html @@ -0,0 +1,223 @@ +IntoPairs in syn::punctuated - Rust

Struct syn::punctuated::IntoPairs

source ·
pub struct IntoPairs<T, P> { /* private fields */ }
Expand description

An iterator over owned pairs of type Pair<T, P>.

+

Refer to the module documentation for details about punctuated sequences.

+

Trait Implementations§

source§

impl<T, P> Clone for IntoPairs<T, P>
where + T: Clone, + P: Clone,

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T, P> DoubleEndedIterator for IntoPairs<T, P>

source§

fn next_back(&mut self) -> Option<Self::Item>

Removes and returns an element from the end of the iterator. Read more
source§

fn advance_back_by(&mut self, n: usize) -> Result<(), NonZero<usize>>

🔬This is a nightly-only experimental API. (iter_advance_by)
Advances the iterator from the back by n elements. Read more
1.37.0 · source§

fn nth_back(&mut self, n: usize) -> Option<Self::Item>

Returns the nth element from the end of the iterator. Read more
1.27.0 · source§

fn try_rfold<B, F, R>(&mut self, init: B, f: F) -> R
where + Self: Sized, + F: FnMut(B, Self::Item) -> R, + R: Try<Output = B>,

This is the reverse version of Iterator::try_fold(): it takes +elements starting from the back of the iterator. Read more
1.27.0 · source§

fn rfold<B, F>(self, init: B, f: F) -> B
where + Self: Sized, + F: FnMut(B, Self::Item) -> B,

An iterator method that reduces the iterator’s elements to a single, +final value, starting from the back. Read more
1.27.0 · source§

fn rfind<P>(&mut self, predicate: P) -> Option<Self::Item>
where + Self: Sized, + P: FnMut(&Self::Item) -> bool,

Searches for an element of an iterator from the back that satisfies a predicate. Read more
source§

impl<T, P> ExactSizeIterator for IntoPairs<T, P>

source§

fn len(&self) -> usize

Returns the exact remaining length of the iterator. Read more
source§

fn is_empty(&self) -> bool

🔬This is a nightly-only experimental API. (exact_size_is_empty)
Returns true if the iterator is empty. Read more
source§

impl<T, P> Iterator for IntoPairs<T, P>

§

type Item = Pair<T, P>

The type of the elements being iterated over.
source§

fn next(&mut self) -> Option<Self::Item>

Advances the iterator and returns the next value. Read more
source§

fn size_hint(&self) -> (usize, Option<usize>)

Returns the bounds on the remaining length of the iterator. Read more
source§

fn next_chunk<const N: usize>( + &mut self +) -> Result<[Self::Item; N], IntoIter<Self::Item, N>>
where + Self: Sized,

🔬This is a nightly-only experimental API. (iter_next_chunk)
Advances the iterator and returns an array containing the next N values. Read more
1.0.0 · source§

fn count(self) -> usize
where + Self: Sized,

Consumes the iterator, counting the number of iterations and returning it. Read more
1.0.0 · source§

fn last(self) -> Option<Self::Item>
where + Self: Sized,

Consumes the iterator, returning the last element. Read more
source§

fn advance_by(&mut self, n: usize) -> Result<(), NonZero<usize>>

🔬This is a nightly-only experimental API. (iter_advance_by)
Advances the iterator by n elements. Read more
1.0.0 · source§

fn nth(&mut self, n: usize) -> Option<Self::Item>

Returns the nth element of the iterator. Read more
1.28.0 · source§

fn step_by(self, step: usize) -> StepBy<Self>
where + Self: Sized,

Creates an iterator starting at the same point, but stepping by +the given amount at each iteration. Read more
1.0.0 · source§

fn chain<U>(self, other: U) -> Chain<Self, <U as IntoIterator>::IntoIter>
where + Self: Sized, + U: IntoIterator<Item = Self::Item>,

Takes two iterators and creates a new iterator over both in sequence. Read more
1.0.0 · source§

fn zip<U>(self, other: U) -> Zip<Self, <U as IntoIterator>::IntoIter>
where + Self: Sized, + U: IntoIterator,

‘Zips up’ two iterators into a single iterator of pairs. Read more
source§

fn intersperse_with<G>(self, separator: G) -> IntersperseWith<Self, G>
where + Self: Sized, + G: FnMut() -> Self::Item,

🔬This is a nightly-only experimental API. (iter_intersperse)
Creates a new iterator which places an item generated by separator +between adjacent items of the original iterator. Read more
1.0.0 · source§

fn map<B, F>(self, f: F) -> Map<Self, F>
where + Self: Sized, + F: FnMut(Self::Item) -> B,

Takes a closure and creates an iterator which calls that closure on each +element. Read more
1.21.0 · source§

fn for_each<F>(self, f: F)
where + Self: Sized, + F: FnMut(Self::Item),

Calls a closure on each element of an iterator. Read more
1.0.0 · source§

fn filter<P>(self, predicate: P) -> Filter<Self, P>
where + Self: Sized, + P: FnMut(&Self::Item) -> bool,

Creates an iterator which uses a closure to determine if an element +should be yielded. Read more
1.0.0 · source§

fn filter_map<B, F>(self, f: F) -> FilterMap<Self, F>
where + Self: Sized, + F: FnMut(Self::Item) -> Option<B>,

Creates an iterator that both filters and maps. Read more
1.0.0 · source§

fn enumerate(self) -> Enumerate<Self>
where + Self: Sized,

Creates an iterator which gives the current iteration count as well as +the next value. Read more
1.0.0 · source§

fn peekable(self) -> Peekable<Self>
where + Self: Sized,

Creates an iterator which can use the peek and peek_mut methods +to look at the next element of the iterator without consuming it. See +their documentation for more information. Read more
1.0.0 · source§

fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P>
where + Self: Sized, + P: FnMut(&Self::Item) -> bool,

Creates an iterator that skips elements based on a predicate. Read more
1.0.0 · source§

fn take_while<P>(self, predicate: P) -> TakeWhile<Self, P>
where + Self: Sized, + P: FnMut(&Self::Item) -> bool,

Creates an iterator that yields elements based on a predicate. Read more
1.57.0 · source§

fn map_while<B, P>(self, predicate: P) -> MapWhile<Self, P>
where + Self: Sized, + P: FnMut(Self::Item) -> Option<B>,

Creates an iterator that both yields elements based on a predicate and maps. Read more
1.0.0 · source§

fn skip(self, n: usize) -> Skip<Self>
where + Self: Sized,

Creates an iterator that skips the first n elements. Read more
1.0.0 · source§

fn take(self, n: usize) -> Take<Self>
where + Self: Sized,

Creates an iterator that yields the first n elements, or fewer +if the underlying iterator ends sooner. Read more
1.0.0 · source§

fn scan<St, B, F>(self, initial_state: St, f: F) -> Scan<Self, St, F>
where + Self: Sized, + F: FnMut(&mut St, Self::Item) -> Option<B>,

An iterator adapter which, like fold, holds internal state, but +unlike fold, produces a new iterator. Read more
1.0.0 · source§

fn flat_map<U, F>(self, f: F) -> FlatMap<Self, U, F>
where + Self: Sized, + U: IntoIterator, + F: FnMut(Self::Item) -> U,

Creates an iterator that works like map, but flattens nested structure. Read more
source§

fn map_windows<F, R, const N: usize>(self, f: F) -> MapWindows<Self, F, N>
where + Self: Sized, + F: FnMut(&[Self::Item; N]) -> R,

🔬This is a nightly-only experimental API. (iter_map_windows)
Calls the given function f for each contiguous window of size N over +self and returns an iterator over the outputs of f. Like slice::windows(), +the windows during mapping overlap as well. Read more
1.0.0 · source§

fn fuse(self) -> Fuse<Self>
where + Self: Sized,

Creates an iterator which ends after the first None. Read more
1.0.0 · source§

fn inspect<F>(self, f: F) -> Inspect<Self, F>
where + Self: Sized, + F: FnMut(&Self::Item),

Does something with each element of an iterator, passing the value on. Read more
1.0.0 · source§

fn by_ref(&mut self) -> &mut Self
where + Self: Sized,

Borrows an iterator, rather than consuming it. Read more
1.0.0 · source§

fn collect<B>(self) -> B
where + B: FromIterator<Self::Item>, + Self: Sized,

Transforms an iterator into a collection. Read more
source§

fn collect_into<E>(self, collection: &mut E) -> &mut E
where + E: Extend<Self::Item>, + Self: Sized,

🔬This is a nightly-only experimental API. (iter_collect_into)
Collects all the items from an iterator into a collection. Read more
1.0.0 · source§

fn partition<B, F>(self, f: F) -> (B, B)
where + Self: Sized, + B: Default + Extend<Self::Item>, + F: FnMut(&Self::Item) -> bool,

Consumes an iterator, creating two collections from it. Read more
source§

fn partition_in_place<'a, T, P>(self, predicate: P) -> usize
where + T: 'a, + Self: Sized + DoubleEndedIterator<Item = &'a mut T>, + P: FnMut(&T) -> bool,

🔬This is a nightly-only experimental API. (iter_partition_in_place)
Reorders the elements of this iterator in-place according to the given predicate, +such that all those that return true precede all those that return false. +Returns the number of true elements found. Read more
source§

fn is_partitioned<P>(self, predicate: P) -> bool
where + Self: Sized, + P: FnMut(Self::Item) -> bool,

🔬This is a nightly-only experimental API. (iter_is_partitioned)
Checks if the elements of this iterator are partitioned according to the given predicate, +such that all those that return true precede all those that return false. Read more
1.27.0 · source§

fn try_fold<B, F, R>(&mut self, init: B, f: F) -> R
where + Self: Sized, + F: FnMut(B, Self::Item) -> R, + R: Try<Output = B>,

An iterator method that applies a function as long as it returns +successfully, producing a single, final value. Read more
1.27.0 · source§

fn try_for_each<F, R>(&mut self, f: F) -> R
where + Self: Sized, + F: FnMut(Self::Item) -> R, + R: Try<Output = ()>,

An iterator method that applies a fallible function to each item in the +iterator, stopping at the first error and returning that error. Read more
1.0.0 · source§

fn fold<B, F>(self, init: B, f: F) -> B
where + Self: Sized, + F: FnMut(B, Self::Item) -> B,

Folds every element into an accumulator by applying an operation, +returning the final result. Read more
1.51.0 · source§

fn reduce<F>(self, f: F) -> Option<Self::Item>
where + Self: Sized, + F: FnMut(Self::Item, Self::Item) -> Self::Item,

Reduces the elements to a single one, by repeatedly applying a reducing +operation. Read more
source§

fn try_reduce<F, R>( + &mut self, + f: F +) -> <<R as Try>::Residual as Residual<Option<<R as Try>::Output>>>::TryType
where + Self: Sized, + F: FnMut(Self::Item, Self::Item) -> R, + R: Try<Output = Self::Item>, + <R as Try>::Residual: Residual<Option<Self::Item>>,

🔬This is a nightly-only experimental API. (iterator_try_reduce)
Reduces the elements to a single one by repeatedly applying a reducing operation. If the +closure returns a failure, the failure is propagated back to the caller immediately. Read more
1.0.0 · source§

fn all<F>(&mut self, f: F) -> bool
where + Self: Sized, + F: FnMut(Self::Item) -> bool,

Tests if every element of the iterator matches a predicate. Read more
1.0.0 · source§

fn any<F>(&mut self, f: F) -> bool
where + Self: Sized, + F: FnMut(Self::Item) -> bool,

Tests if any element of the iterator matches a predicate. Read more
1.0.0 · source§

fn find<P>(&mut self, predicate: P) -> Option<Self::Item>
where + Self: Sized, + P: FnMut(&Self::Item) -> bool,

Searches for an element of an iterator that satisfies a predicate. Read more
1.30.0 · source§

fn find_map<B, F>(&mut self, f: F) -> Option<B>
where + Self: Sized, + F: FnMut(Self::Item) -> Option<B>,

Applies function to the elements of iterator and returns +the first non-none result. Read more
source§

fn try_find<F, R>( + &mut self, + f: F +) -> <<R as Try>::Residual as Residual<Option<Self::Item>>>::TryType
where + Self: Sized, + F: FnMut(&Self::Item) -> R, + R: Try<Output = bool>, + <R as Try>::Residual: Residual<Option<Self::Item>>,

🔬This is a nightly-only experimental API. (try_find)
Applies function to the elements of iterator and returns +the first true result or the first error. Read more
1.0.0 · source§

fn position<P>(&mut self, predicate: P) -> Option<usize>
where + Self: Sized, + P: FnMut(Self::Item) -> bool,

Searches for an element in an iterator, returning its index. Read more
1.0.0 · source§

fn rposition<P>(&mut self, predicate: P) -> Option<usize>
where + P: FnMut(Self::Item) -> bool, + Self: Sized + ExactSizeIterator + DoubleEndedIterator,

Searches for an element in an iterator from the right, returning its +index. Read more
1.6.0 · source§

fn max_by_key<B, F>(self, f: F) -> Option<Self::Item>
where + B: Ord, + Self: Sized, + F: FnMut(&Self::Item) -> B,

Returns the element that gives the maximum value from the +specified function. Read more
1.15.0 · source§

fn max_by<F>(self, compare: F) -> Option<Self::Item>
where + Self: Sized, + F: FnMut(&Self::Item, &Self::Item) -> Ordering,

Returns the element that gives the maximum value with respect to the +specified comparison function. Read more
1.6.0 · source§

fn min_by_key<B, F>(self, f: F) -> Option<Self::Item>
where + B: Ord, + Self: Sized, + F: FnMut(&Self::Item) -> B,

Returns the element that gives the minimum value from the +specified function. Read more
1.15.0 · source§

fn min_by<F>(self, compare: F) -> Option<Self::Item>
where + Self: Sized, + F: FnMut(&Self::Item, &Self::Item) -> Ordering,

Returns the element that gives the minimum value with respect to the +specified comparison function. Read more
1.0.0 · source§

fn rev(self) -> Rev<Self>
where + Self: Sized + DoubleEndedIterator,

Reverses an iterator’s direction. Read more
1.0.0 · source§

fn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB)
where + FromA: Default + Extend<A>, + FromB: Default + Extend<B>, + Self: Sized + Iterator<Item = (A, B)>,

Converts an iterator of pairs into a pair of containers. Read more
1.36.0 · source§

fn copied<'a, T>(self) -> Copied<Self>
where + T: 'a + Copy, + Self: Sized + Iterator<Item = &'a T>,

Creates an iterator which copies all of its elements. Read more
1.0.0 · source§

fn cloned<'a, T>(self) -> Cloned<Self>
where + T: 'a + Clone, + Self: Sized + Iterator<Item = &'a T>,

Creates an iterator which clones all of its elements. Read more
source§

fn array_chunks<const N: usize>(self) -> ArrayChunks<Self, N>
where + Self: Sized,

🔬This is a nightly-only experimental API. (iter_array_chunks)
Returns an iterator over N elements of the iterator at a time. Read more
1.11.0 · source§

fn sum<S>(self) -> S
where + Self: Sized, + S: Sum<Self::Item>,

Sums the elements of an iterator. Read more
1.11.0 · source§

fn product<P>(self) -> P
where + Self: Sized, + P: Product<Self::Item>,

Iterates over the entire iterator, multiplying all the elements Read more
source§

fn cmp_by<I, F>(self, other: I, cmp: F) -> Ordering
where + Self: Sized, + I: IntoIterator, + F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Ordering,

🔬This is a nightly-only experimental API. (iter_order_by)
Lexicographically compares the elements of this Iterator with those +of another with respect to the specified comparison function. Read more
1.5.0 · source§

fn partial_cmp<I>(self, other: I) -> Option<Ordering>
where + I: IntoIterator, + Self::Item: PartialOrd<<I as IntoIterator>::Item>, + Self: Sized,

Lexicographically compares the PartialOrd elements of +this Iterator with those of another. The comparison works like short-circuit +evaluation, returning a result without comparing the remaining elements. +As soon as an order can be determined, the evaluation stops and a result is returned. Read more
source§

fn partial_cmp_by<I, F>(self, other: I, partial_cmp: F) -> Option<Ordering>
where + Self: Sized, + I: IntoIterator, + F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Option<Ordering>,

🔬This is a nightly-only experimental API. (iter_order_by)
Lexicographically compares the elements of this Iterator with those +of another with respect to the specified comparison function. Read more
1.5.0 · source§

fn eq<I>(self, other: I) -> bool
where + I: IntoIterator, + Self::Item: PartialEq<<I as IntoIterator>::Item>, + Self: Sized,

Determines if the elements of this Iterator are equal to those of +another. Read more
source§

fn eq_by<I, F>(self, other: I, eq: F) -> bool
where + Self: Sized, + I: IntoIterator, + F: FnMut(Self::Item, <I as IntoIterator>::Item) -> bool,

🔬This is a nightly-only experimental API. (iter_order_by)
Determines if the elements of this Iterator are equal to those of +another with respect to the specified equality function. Read more
1.5.0 · source§

fn ne<I>(self, other: I) -> bool
where + I: IntoIterator, + Self::Item: PartialEq<<I as IntoIterator>::Item>, + Self: Sized,

Determines if the elements of this Iterator are not equal to those of +another. Read more
1.5.0 · source§

fn lt<I>(self, other: I) -> bool
where + I: IntoIterator, + Self::Item: PartialOrd<<I as IntoIterator>::Item>, + Self: Sized,

Determines if the elements of this Iterator are lexicographically +less than those of another. Read more
1.5.0 · source§

fn le<I>(self, other: I) -> bool
where + I: IntoIterator, + Self::Item: PartialOrd<<I as IntoIterator>::Item>, + Self: Sized,

Determines if the elements of this Iterator are lexicographically +less or equal to those of another. Read more
1.5.0 · source§

fn gt<I>(self, other: I) -> bool
where + I: IntoIterator, + Self::Item: PartialOrd<<I as IntoIterator>::Item>, + Self: Sized,

Determines if the elements of this Iterator are lexicographically +greater than those of another. Read more
1.5.0 · source§

fn ge<I>(self, other: I) -> bool
where + I: IntoIterator, + Self::Item: PartialOrd<<I as IntoIterator>::Item>, + Self: Sized,

Determines if the elements of this Iterator are lexicographically +greater than or equal to those of another. Read more
source§

fn is_sorted_by<F>(self, compare: F) -> bool
where + Self: Sized, + F: FnMut(&Self::Item, &Self::Item) -> bool,

🔬This is a nightly-only experimental API. (is_sorted)
Checks if the elements of this iterator are sorted using the given comparator function. Read more
source§

fn is_sorted_by_key<F, K>(self, f: F) -> bool
where + Self: Sized, + F: FnMut(Self::Item) -> K, + K: PartialOrd,

🔬This is a nightly-only experimental API. (is_sorted)
Checks if the elements of this iterator are sorted using the given key extraction +function. Read more

Auto Trait Implementations§

§

impl<T, P> Freeze for IntoPairs<T, P>
where + T: Freeze,

§

impl<T, P> RefUnwindSafe for IntoPairs<T, P>
where + T: RefUnwindSafe, + P: RefUnwindSafe,

§

impl<T, P> Send for IntoPairs<T, P>
where + T: Send, + P: Send,

§

impl<T, P> Sync for IntoPairs<T, P>
where + T: Sync, + P: Sync,

§

impl<T, P> Unpin for IntoPairs<T, P>
where + T: Unpin, + P: Unpin,

§

impl<T, P> UnwindSafe for IntoPairs<T, P>

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<I> IntoIterator for I
where + I: Iterator,

§

type Item = <I as Iterator>::Item

The type of the elements being iterated over.
§

type IntoIter = I

Which kind of iterator are we turning this into?
const: unstable · source§

fn into_iter(self) -> I

Creates an iterator from a value. Read more
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/punctuated/struct.Iter.html b/syn/punctuated/struct.Iter.html new file mode 100644 index 0000000..8e1a11d --- /dev/null +++ b/syn/punctuated/struct.Iter.html @@ -0,0 +1,211 @@ +Iter in syn::punctuated - Rust

Struct syn::punctuated::Iter

source ·
pub struct Iter<'a, T: 'a> { /* private fields */ }
Expand description

An iterator over borrowed values of type &T.

+

Refer to the module documentation for details about punctuated sequences.

+

Trait Implementations§

source§

impl<'a, T> Clone for Iter<'a, T>

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'a, T> DoubleEndedIterator for Iter<'a, T>

source§

fn next_back(&mut self) -> Option<Self::Item>

Removes and returns an element from the end of the iterator. Read more
source§

fn advance_back_by(&mut self, n: usize) -> Result<(), NonZero<usize>>

🔬This is a nightly-only experimental API. (iter_advance_by)
Advances the iterator from the back by n elements. Read more
1.37.0 · source§

fn nth_back(&mut self, n: usize) -> Option<Self::Item>

Returns the nth element from the end of the iterator. Read more
1.27.0 · source§

fn try_rfold<B, F, R>(&mut self, init: B, f: F) -> R
where + Self: Sized, + F: FnMut(B, Self::Item) -> R, + R: Try<Output = B>,

This is the reverse version of Iterator::try_fold(): it takes +elements starting from the back of the iterator. Read more
1.27.0 · source§

fn rfold<B, F>(self, init: B, f: F) -> B
where + Self: Sized, + F: FnMut(B, Self::Item) -> B,

An iterator method that reduces the iterator’s elements to a single, +final value, starting from the back. Read more
1.27.0 · source§

fn rfind<P>(&mut self, predicate: P) -> Option<Self::Item>
where + Self: Sized, + P: FnMut(&Self::Item) -> bool,

Searches for an element of an iterator from the back that satisfies a predicate. Read more
source§

impl<'a, T> ExactSizeIterator for Iter<'a, T>

source§

fn len(&self) -> usize

Returns the exact remaining length of the iterator. Read more
source§

fn is_empty(&self) -> bool

🔬This is a nightly-only experimental API. (exact_size_is_empty)
Returns true if the iterator is empty. Read more
source§

impl<'a, T> Iterator for Iter<'a, T>

§

type Item = &'a T

The type of the elements being iterated over.
source§

fn next(&mut self) -> Option<Self::Item>

Advances the iterator and returns the next value. Read more
source§

fn size_hint(&self) -> (usize, Option<usize>)

Returns the bounds on the remaining length of the iterator. Read more
source§

fn next_chunk<const N: usize>( + &mut self +) -> Result<[Self::Item; N], IntoIter<Self::Item, N>>
where + Self: Sized,

🔬This is a nightly-only experimental API. (iter_next_chunk)
Advances the iterator and returns an array containing the next N values. Read more
1.0.0 · source§

fn count(self) -> usize
where + Self: Sized,

Consumes the iterator, counting the number of iterations and returning it. Read more
1.0.0 · source§

fn last(self) -> Option<Self::Item>
where + Self: Sized,

Consumes the iterator, returning the last element. Read more
source§

fn advance_by(&mut self, n: usize) -> Result<(), NonZero<usize>>

🔬This is a nightly-only experimental API. (iter_advance_by)
Advances the iterator by n elements. Read more
1.0.0 · source§

fn nth(&mut self, n: usize) -> Option<Self::Item>

Returns the nth element of the iterator. Read more
1.28.0 · source§

fn step_by(self, step: usize) -> StepBy<Self>
where + Self: Sized,

Creates an iterator starting at the same point, but stepping by +the given amount at each iteration. Read more
1.0.0 · source§

fn chain<U>(self, other: U) -> Chain<Self, <U as IntoIterator>::IntoIter>
where + Self: Sized, + U: IntoIterator<Item = Self::Item>,

Takes two iterators and creates a new iterator over both in sequence. Read more
1.0.0 · source§

fn zip<U>(self, other: U) -> Zip<Self, <U as IntoIterator>::IntoIter>
where + Self: Sized, + U: IntoIterator,

‘Zips up’ two iterators into a single iterator of pairs. Read more
source§

fn intersperse_with<G>(self, separator: G) -> IntersperseWith<Self, G>
where + Self: Sized, + G: FnMut() -> Self::Item,

🔬This is a nightly-only experimental API. (iter_intersperse)
Creates a new iterator which places an item generated by separator +between adjacent items of the original iterator. Read more
1.0.0 · source§

fn map<B, F>(self, f: F) -> Map<Self, F>
where + Self: Sized, + F: FnMut(Self::Item) -> B,

Takes a closure and creates an iterator which calls that closure on each +element. Read more
1.21.0 · source§

fn for_each<F>(self, f: F)
where + Self: Sized, + F: FnMut(Self::Item),

Calls a closure on each element of an iterator. Read more
1.0.0 · source§

fn filter<P>(self, predicate: P) -> Filter<Self, P>
where + Self: Sized, + P: FnMut(&Self::Item) -> bool,

Creates an iterator which uses a closure to determine if an element +should be yielded. Read more
1.0.0 · source§

fn filter_map<B, F>(self, f: F) -> FilterMap<Self, F>
where + Self: Sized, + F: FnMut(Self::Item) -> Option<B>,

Creates an iterator that both filters and maps. Read more
1.0.0 · source§

fn enumerate(self) -> Enumerate<Self>
where + Self: Sized,

Creates an iterator which gives the current iteration count as well as +the next value. Read more
1.0.0 · source§

fn peekable(self) -> Peekable<Self>
where + Self: Sized,

Creates an iterator which can use the peek and peek_mut methods +to look at the next element of the iterator without consuming it. See +their documentation for more information. Read more
1.0.0 · source§

fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P>
where + Self: Sized, + P: FnMut(&Self::Item) -> bool,

Creates an iterator that skips elements based on a predicate. Read more
1.0.0 · source§

fn take_while<P>(self, predicate: P) -> TakeWhile<Self, P>
where + Self: Sized, + P: FnMut(&Self::Item) -> bool,

Creates an iterator that yields elements based on a predicate. Read more
1.57.0 · source§

fn map_while<B, P>(self, predicate: P) -> MapWhile<Self, P>
where + Self: Sized, + P: FnMut(Self::Item) -> Option<B>,

Creates an iterator that both yields elements based on a predicate and maps. Read more
1.0.0 · source§

fn skip(self, n: usize) -> Skip<Self>
where + Self: Sized,

Creates an iterator that skips the first n elements. Read more
1.0.0 · source§

fn take(self, n: usize) -> Take<Self>
where + Self: Sized,

Creates an iterator that yields the first n elements, or fewer +if the underlying iterator ends sooner. Read more
1.0.0 · source§

fn scan<St, B, F>(self, initial_state: St, f: F) -> Scan<Self, St, F>
where + Self: Sized, + F: FnMut(&mut St, Self::Item) -> Option<B>,

An iterator adapter which, like fold, holds internal state, but +unlike fold, produces a new iterator. Read more
1.0.0 · source§

fn flat_map<U, F>(self, f: F) -> FlatMap<Self, U, F>
where + Self: Sized, + U: IntoIterator, + F: FnMut(Self::Item) -> U,

Creates an iterator that works like map, but flattens nested structure. Read more
source§

fn map_windows<F, R, const N: usize>(self, f: F) -> MapWindows<Self, F, N>
where + Self: Sized, + F: FnMut(&[Self::Item; N]) -> R,

🔬This is a nightly-only experimental API. (iter_map_windows)
Calls the given function f for each contiguous window of size N over +self and returns an iterator over the outputs of f. Like slice::windows(), +the windows during mapping overlap as well. Read more
1.0.0 · source§

fn fuse(self) -> Fuse<Self>
where + Self: Sized,

Creates an iterator which ends after the first None. Read more
1.0.0 · source§

fn inspect<F>(self, f: F) -> Inspect<Self, F>
where + Self: Sized, + F: FnMut(&Self::Item),

Does something with each element of an iterator, passing the value on. Read more
1.0.0 · source§

fn by_ref(&mut self) -> &mut Self
where + Self: Sized,

Borrows an iterator, rather than consuming it. Read more
1.0.0 · source§

fn collect<B>(self) -> B
where + B: FromIterator<Self::Item>, + Self: Sized,

Transforms an iterator into a collection. Read more
source§

fn collect_into<E>(self, collection: &mut E) -> &mut E
where + E: Extend<Self::Item>, + Self: Sized,

🔬This is a nightly-only experimental API. (iter_collect_into)
Collects all the items from an iterator into a collection. Read more
1.0.0 · source§

fn partition<B, F>(self, f: F) -> (B, B)
where + Self: Sized, + B: Default + Extend<Self::Item>, + F: FnMut(&Self::Item) -> bool,

Consumes an iterator, creating two collections from it. Read more
source§

fn partition_in_place<'a, T, P>(self, predicate: P) -> usize
where + T: 'a, + Self: Sized + DoubleEndedIterator<Item = &'a mut T>, + P: FnMut(&T) -> bool,

🔬This is a nightly-only experimental API. (iter_partition_in_place)
Reorders the elements of this iterator in-place according to the given predicate, +such that all those that return true precede all those that return false. +Returns the number of true elements found. Read more
source§

fn is_partitioned<P>(self, predicate: P) -> bool
where + Self: Sized, + P: FnMut(Self::Item) -> bool,

🔬This is a nightly-only experimental API. (iter_is_partitioned)
Checks if the elements of this iterator are partitioned according to the given predicate, +such that all those that return true precede all those that return false. Read more
1.27.0 · source§

fn try_fold<B, F, R>(&mut self, init: B, f: F) -> R
where + Self: Sized, + F: FnMut(B, Self::Item) -> R, + R: Try<Output = B>,

An iterator method that applies a function as long as it returns +successfully, producing a single, final value. Read more
1.27.0 · source§

fn try_for_each<F, R>(&mut self, f: F) -> R
where + Self: Sized, + F: FnMut(Self::Item) -> R, + R: Try<Output = ()>,

An iterator method that applies a fallible function to each item in the +iterator, stopping at the first error and returning that error. Read more
1.0.0 · source§

fn fold<B, F>(self, init: B, f: F) -> B
where + Self: Sized, + F: FnMut(B, Self::Item) -> B,

Folds every element into an accumulator by applying an operation, +returning the final result. Read more
1.51.0 · source§

fn reduce<F>(self, f: F) -> Option<Self::Item>
where + Self: Sized, + F: FnMut(Self::Item, Self::Item) -> Self::Item,

Reduces the elements to a single one, by repeatedly applying a reducing +operation. Read more
source§

fn try_reduce<F, R>( + &mut self, + f: F +) -> <<R as Try>::Residual as Residual<Option<<R as Try>::Output>>>::TryType
where + Self: Sized, + F: FnMut(Self::Item, Self::Item) -> R, + R: Try<Output = Self::Item>, + <R as Try>::Residual: Residual<Option<Self::Item>>,

🔬This is a nightly-only experimental API. (iterator_try_reduce)
Reduces the elements to a single one by repeatedly applying a reducing operation. If the +closure returns a failure, the failure is propagated back to the caller immediately. Read more
1.0.0 · source§

fn all<F>(&mut self, f: F) -> bool
where + Self: Sized, + F: FnMut(Self::Item) -> bool,

Tests if every element of the iterator matches a predicate. Read more
1.0.0 · source§

fn any<F>(&mut self, f: F) -> bool
where + Self: Sized, + F: FnMut(Self::Item) -> bool,

Tests if any element of the iterator matches a predicate. Read more
1.0.0 · source§

fn find<P>(&mut self, predicate: P) -> Option<Self::Item>
where + Self: Sized, + P: FnMut(&Self::Item) -> bool,

Searches for an element of an iterator that satisfies a predicate. Read more
1.30.0 · source§

fn find_map<B, F>(&mut self, f: F) -> Option<B>
where + Self: Sized, + F: FnMut(Self::Item) -> Option<B>,

Applies function to the elements of iterator and returns +the first non-none result. Read more
source§

fn try_find<F, R>( + &mut self, + f: F +) -> <<R as Try>::Residual as Residual<Option<Self::Item>>>::TryType
where + Self: Sized, + F: FnMut(&Self::Item) -> R, + R: Try<Output = bool>, + <R as Try>::Residual: Residual<Option<Self::Item>>,

🔬This is a nightly-only experimental API. (try_find)
Applies function to the elements of iterator and returns +the first true result or the first error. Read more
1.0.0 · source§

fn position<P>(&mut self, predicate: P) -> Option<usize>
where + Self: Sized, + P: FnMut(Self::Item) -> bool,

Searches for an element in an iterator, returning its index. Read more
1.0.0 · source§

fn rposition<P>(&mut self, predicate: P) -> Option<usize>
where + P: FnMut(Self::Item) -> bool, + Self: Sized + ExactSizeIterator + DoubleEndedIterator,

Searches for an element in an iterator from the right, returning its +index. Read more
1.6.0 · source§

fn max_by_key<B, F>(self, f: F) -> Option<Self::Item>
where + B: Ord, + Self: Sized, + F: FnMut(&Self::Item) -> B,

Returns the element that gives the maximum value from the +specified function. Read more
1.15.0 · source§

fn max_by<F>(self, compare: F) -> Option<Self::Item>
where + Self: Sized, + F: FnMut(&Self::Item, &Self::Item) -> Ordering,

Returns the element that gives the maximum value with respect to the +specified comparison function. Read more
1.6.0 · source§

fn min_by_key<B, F>(self, f: F) -> Option<Self::Item>
where + B: Ord, + Self: Sized, + F: FnMut(&Self::Item) -> B,

Returns the element that gives the minimum value from the +specified function. Read more
1.15.0 · source§

fn min_by<F>(self, compare: F) -> Option<Self::Item>
where + Self: Sized, + F: FnMut(&Self::Item, &Self::Item) -> Ordering,

Returns the element that gives the minimum value with respect to the +specified comparison function. Read more
1.0.0 · source§

fn rev(self) -> Rev<Self>
where + Self: Sized + DoubleEndedIterator,

Reverses an iterator’s direction. Read more
1.0.0 · source§

fn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB)
where + FromA: Default + Extend<A>, + FromB: Default + Extend<B>, + Self: Sized + Iterator<Item = (A, B)>,

Converts an iterator of pairs into a pair of containers. Read more
1.36.0 · source§

fn copied<'a, T>(self) -> Copied<Self>
where + T: 'a + Copy, + Self: Sized + Iterator<Item = &'a T>,

Creates an iterator which copies all of its elements. Read more
1.0.0 · source§

fn cloned<'a, T>(self) -> Cloned<Self>
where + T: 'a + Clone, + Self: Sized + Iterator<Item = &'a T>,

Creates an iterator which clones all of its elements. Read more
1.0.0 · source§

fn cycle(self) -> Cycle<Self>
where + Self: Sized + Clone,

Repeats an iterator endlessly. Read more
source§

fn array_chunks<const N: usize>(self) -> ArrayChunks<Self, N>
where + Self: Sized,

🔬This is a nightly-only experimental API. (iter_array_chunks)
Returns an iterator over N elements of the iterator at a time. Read more
1.11.0 · source§

fn sum<S>(self) -> S
where + Self: Sized, + S: Sum<Self::Item>,

Sums the elements of an iterator. Read more
1.11.0 · source§

fn product<P>(self) -> P
where + Self: Sized, + P: Product<Self::Item>,

Iterates over the entire iterator, multiplying all the elements Read more
source§

fn cmp_by<I, F>(self, other: I, cmp: F) -> Ordering
where + Self: Sized, + I: IntoIterator, + F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Ordering,

🔬This is a nightly-only experimental API. (iter_order_by)
Lexicographically compares the elements of this Iterator with those +of another with respect to the specified comparison function. Read more
1.5.0 · source§

fn partial_cmp<I>(self, other: I) -> Option<Ordering>
where + I: IntoIterator, + Self::Item: PartialOrd<<I as IntoIterator>::Item>, + Self: Sized,

Lexicographically compares the PartialOrd elements of +this Iterator with those of another. The comparison works like short-circuit +evaluation, returning a result without comparing the remaining elements. +As soon as an order can be determined, the evaluation stops and a result is returned. Read more
source§

fn partial_cmp_by<I, F>(self, other: I, partial_cmp: F) -> Option<Ordering>
where + Self: Sized, + I: IntoIterator, + F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Option<Ordering>,

🔬This is a nightly-only experimental API. (iter_order_by)
Lexicographically compares the elements of this Iterator with those +of another with respect to the specified comparison function. Read more
1.5.0 · source§

fn eq<I>(self, other: I) -> bool
where + I: IntoIterator, + Self::Item: PartialEq<<I as IntoIterator>::Item>, + Self: Sized,

Determines if the elements of this Iterator are equal to those of +another. Read more
source§

fn eq_by<I, F>(self, other: I, eq: F) -> bool
where + Self: Sized, + I: IntoIterator, + F: FnMut(Self::Item, <I as IntoIterator>::Item) -> bool,

🔬This is a nightly-only experimental API. (iter_order_by)
Determines if the elements of this Iterator are equal to those of +another with respect to the specified equality function. Read more
1.5.0 · source§

fn ne<I>(self, other: I) -> bool
where + I: IntoIterator, + Self::Item: PartialEq<<I as IntoIterator>::Item>, + Self: Sized,

Determines if the elements of this Iterator are not equal to those of +another. Read more
1.5.0 · source§

fn lt<I>(self, other: I) -> bool
where + I: IntoIterator, + Self::Item: PartialOrd<<I as IntoIterator>::Item>, + Self: Sized,

Determines if the elements of this Iterator are lexicographically +less than those of another. Read more
1.5.0 · source§

fn le<I>(self, other: I) -> bool
where + I: IntoIterator, + Self::Item: PartialOrd<<I as IntoIterator>::Item>, + Self: Sized,

Determines if the elements of this Iterator are lexicographically +less or equal to those of another. Read more
1.5.0 · source§

fn gt<I>(self, other: I) -> bool
where + I: IntoIterator, + Self::Item: PartialOrd<<I as IntoIterator>::Item>, + Self: Sized,

Determines if the elements of this Iterator are lexicographically +greater than those of another. Read more
1.5.0 · source§

fn ge<I>(self, other: I) -> bool
where + I: IntoIterator, + Self::Item: PartialOrd<<I as IntoIterator>::Item>, + Self: Sized,

Determines if the elements of this Iterator are lexicographically +greater than or equal to those of another. Read more
source§

fn is_sorted_by<F>(self, compare: F) -> bool
where + Self: Sized, + F: FnMut(&Self::Item, &Self::Item) -> bool,

🔬This is a nightly-only experimental API. (is_sorted)
Checks if the elements of this iterator are sorted using the given comparator function. Read more
source§

fn is_sorted_by_key<F, K>(self, f: F) -> bool
where + Self: Sized, + F: FnMut(Self::Item) -> K, + K: PartialOrd,

🔬This is a nightly-only experimental API. (is_sorted)
Checks if the elements of this iterator are sorted using the given key extraction +function. Read more

Auto Trait Implementations§

§

impl<'a, T> Freeze for Iter<'a, T>

§

impl<'a, T> !RefUnwindSafe for Iter<'a, T>

§

impl<'a, T> !Send for Iter<'a, T>

§

impl<'a, T> !Sync for Iter<'a, T>

§

impl<'a, T> Unpin for Iter<'a, T>

§

impl<'a, T> !UnwindSafe for Iter<'a, T>

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<I> IntoIterator for I
where + I: Iterator,

§

type Item = <I as Iterator>::Item

The type of the elements being iterated over.
§

type IntoIter = I

Which kind of iterator are we turning this into?
const: unstable · source§

fn into_iter(self) -> I

Creates an iterator from a value. Read more
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/punctuated/struct.IterMut.html b/syn/punctuated/struct.IterMut.html new file mode 100644 index 0000000..7c31b2e --- /dev/null +++ b/syn/punctuated/struct.IterMut.html @@ -0,0 +1,209 @@ +IterMut in syn::punctuated - Rust

Struct syn::punctuated::IterMut

source ·
pub struct IterMut<'a, T: 'a> { /* private fields */ }
Expand description

An iterator over mutably borrowed values of type &mut T.

+

Refer to the module documentation for details about punctuated sequences.

+

Trait Implementations§

source§

impl<'a, T> DoubleEndedIterator for IterMut<'a, T>

source§

fn next_back(&mut self) -> Option<Self::Item>

Removes and returns an element from the end of the iterator. Read more
source§

fn advance_back_by(&mut self, n: usize) -> Result<(), NonZero<usize>>

🔬This is a nightly-only experimental API. (iter_advance_by)
Advances the iterator from the back by n elements. Read more
1.37.0 · source§

fn nth_back(&mut self, n: usize) -> Option<Self::Item>

Returns the nth element from the end of the iterator. Read more
1.27.0 · source§

fn try_rfold<B, F, R>(&mut self, init: B, f: F) -> R
where + Self: Sized, + F: FnMut(B, Self::Item) -> R, + R: Try<Output = B>,

This is the reverse version of Iterator::try_fold(): it takes +elements starting from the back of the iterator. Read more
1.27.0 · source§

fn rfold<B, F>(self, init: B, f: F) -> B
where + Self: Sized, + F: FnMut(B, Self::Item) -> B,

An iterator method that reduces the iterator’s elements to a single, +final value, starting from the back. Read more
1.27.0 · source§

fn rfind<P>(&mut self, predicate: P) -> Option<Self::Item>
where + Self: Sized, + P: FnMut(&Self::Item) -> bool,

Searches for an element of an iterator from the back that satisfies a predicate. Read more
source§

impl<'a, T> ExactSizeIterator for IterMut<'a, T>

source§

fn len(&self) -> usize

Returns the exact remaining length of the iterator. Read more
source§

fn is_empty(&self) -> bool

🔬This is a nightly-only experimental API. (exact_size_is_empty)
Returns true if the iterator is empty. Read more
source§

impl<'a, T> Iterator for IterMut<'a, T>

§

type Item = &'a mut T

The type of the elements being iterated over.
source§

fn next(&mut self) -> Option<Self::Item>

Advances the iterator and returns the next value. Read more
source§

fn size_hint(&self) -> (usize, Option<usize>)

Returns the bounds on the remaining length of the iterator. Read more
source§

fn next_chunk<const N: usize>( + &mut self +) -> Result<[Self::Item; N], IntoIter<Self::Item, N>>
where + Self: Sized,

🔬This is a nightly-only experimental API. (iter_next_chunk)
Advances the iterator and returns an array containing the next N values. Read more
1.0.0 · source§

fn count(self) -> usize
where + Self: Sized,

Consumes the iterator, counting the number of iterations and returning it. Read more
1.0.0 · source§

fn last(self) -> Option<Self::Item>
where + Self: Sized,

Consumes the iterator, returning the last element. Read more
source§

fn advance_by(&mut self, n: usize) -> Result<(), NonZero<usize>>

🔬This is a nightly-only experimental API. (iter_advance_by)
Advances the iterator by n elements. Read more
1.0.0 · source§

fn nth(&mut self, n: usize) -> Option<Self::Item>

Returns the nth element of the iterator. Read more
1.28.0 · source§

fn step_by(self, step: usize) -> StepBy<Self>
where + Self: Sized,

Creates an iterator starting at the same point, but stepping by +the given amount at each iteration. Read more
1.0.0 · source§

fn chain<U>(self, other: U) -> Chain<Self, <U as IntoIterator>::IntoIter>
where + Self: Sized, + U: IntoIterator<Item = Self::Item>,

Takes two iterators and creates a new iterator over both in sequence. Read more
1.0.0 · source§

fn zip<U>(self, other: U) -> Zip<Self, <U as IntoIterator>::IntoIter>
where + Self: Sized, + U: IntoIterator,

‘Zips up’ two iterators into a single iterator of pairs. Read more
source§

fn intersperse_with<G>(self, separator: G) -> IntersperseWith<Self, G>
where + Self: Sized, + G: FnMut() -> Self::Item,

🔬This is a nightly-only experimental API. (iter_intersperse)
Creates a new iterator which places an item generated by separator +between adjacent items of the original iterator. Read more
1.0.0 · source§

fn map<B, F>(self, f: F) -> Map<Self, F>
where + Self: Sized, + F: FnMut(Self::Item) -> B,

Takes a closure and creates an iterator which calls that closure on each +element. Read more
1.21.0 · source§

fn for_each<F>(self, f: F)
where + Self: Sized, + F: FnMut(Self::Item),

Calls a closure on each element of an iterator. Read more
1.0.0 · source§

fn filter<P>(self, predicate: P) -> Filter<Self, P>
where + Self: Sized, + P: FnMut(&Self::Item) -> bool,

Creates an iterator which uses a closure to determine if an element +should be yielded. Read more
1.0.0 · source§

fn filter_map<B, F>(self, f: F) -> FilterMap<Self, F>
where + Self: Sized, + F: FnMut(Self::Item) -> Option<B>,

Creates an iterator that both filters and maps. Read more
1.0.0 · source§

fn enumerate(self) -> Enumerate<Self>
where + Self: Sized,

Creates an iterator which gives the current iteration count as well as +the next value. Read more
1.0.0 · source§

fn peekable(self) -> Peekable<Self>
where + Self: Sized,

Creates an iterator which can use the peek and peek_mut methods +to look at the next element of the iterator without consuming it. See +their documentation for more information. Read more
1.0.0 · source§

fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P>
where + Self: Sized, + P: FnMut(&Self::Item) -> bool,

Creates an iterator that skips elements based on a predicate. Read more
1.0.0 · source§

fn take_while<P>(self, predicate: P) -> TakeWhile<Self, P>
where + Self: Sized, + P: FnMut(&Self::Item) -> bool,

Creates an iterator that yields elements based on a predicate. Read more
1.57.0 · source§

fn map_while<B, P>(self, predicate: P) -> MapWhile<Self, P>
where + Self: Sized, + P: FnMut(Self::Item) -> Option<B>,

Creates an iterator that both yields elements based on a predicate and maps. Read more
1.0.0 · source§

fn skip(self, n: usize) -> Skip<Self>
where + Self: Sized,

Creates an iterator that skips the first n elements. Read more
1.0.0 · source§

fn take(self, n: usize) -> Take<Self>
where + Self: Sized,

Creates an iterator that yields the first n elements, or fewer +if the underlying iterator ends sooner. Read more
1.0.0 · source§

fn scan<St, B, F>(self, initial_state: St, f: F) -> Scan<Self, St, F>
where + Self: Sized, + F: FnMut(&mut St, Self::Item) -> Option<B>,

An iterator adapter which, like fold, holds internal state, but +unlike fold, produces a new iterator. Read more
1.0.0 · source§

fn flat_map<U, F>(self, f: F) -> FlatMap<Self, U, F>
where + Self: Sized, + U: IntoIterator, + F: FnMut(Self::Item) -> U,

Creates an iterator that works like map, but flattens nested structure. Read more
source§

fn map_windows<F, R, const N: usize>(self, f: F) -> MapWindows<Self, F, N>
where + Self: Sized, + F: FnMut(&[Self::Item; N]) -> R,

🔬This is a nightly-only experimental API. (iter_map_windows)
Calls the given function f for each contiguous window of size N over +self and returns an iterator over the outputs of f. Like slice::windows(), +the windows during mapping overlap as well. Read more
1.0.0 · source§

fn fuse(self) -> Fuse<Self>
where + Self: Sized,

Creates an iterator which ends after the first None. Read more
1.0.0 · source§

fn inspect<F>(self, f: F) -> Inspect<Self, F>
where + Self: Sized, + F: FnMut(&Self::Item),

Does something with each element of an iterator, passing the value on. Read more
1.0.0 · source§

fn by_ref(&mut self) -> &mut Self
where + Self: Sized,

Borrows an iterator, rather than consuming it. Read more
1.0.0 · source§

fn collect<B>(self) -> B
where + B: FromIterator<Self::Item>, + Self: Sized,

Transforms an iterator into a collection. Read more
source§

fn collect_into<E>(self, collection: &mut E) -> &mut E
where + E: Extend<Self::Item>, + Self: Sized,

🔬This is a nightly-only experimental API. (iter_collect_into)
Collects all the items from an iterator into a collection. Read more
1.0.0 · source§

fn partition<B, F>(self, f: F) -> (B, B)
where + Self: Sized, + B: Default + Extend<Self::Item>, + F: FnMut(&Self::Item) -> bool,

Consumes an iterator, creating two collections from it. Read more
source§

fn partition_in_place<'a, T, P>(self, predicate: P) -> usize
where + T: 'a, + Self: Sized + DoubleEndedIterator<Item = &'a mut T>, + P: FnMut(&T) -> bool,

🔬This is a nightly-only experimental API. (iter_partition_in_place)
Reorders the elements of this iterator in-place according to the given predicate, +such that all those that return true precede all those that return false. +Returns the number of true elements found. Read more
source§

fn is_partitioned<P>(self, predicate: P) -> bool
where + Self: Sized, + P: FnMut(Self::Item) -> bool,

🔬This is a nightly-only experimental API. (iter_is_partitioned)
Checks if the elements of this iterator are partitioned according to the given predicate, +such that all those that return true precede all those that return false. Read more
1.27.0 · source§

fn try_fold<B, F, R>(&mut self, init: B, f: F) -> R
where + Self: Sized, + F: FnMut(B, Self::Item) -> R, + R: Try<Output = B>,

An iterator method that applies a function as long as it returns +successfully, producing a single, final value. Read more
1.27.0 · source§

fn try_for_each<F, R>(&mut self, f: F) -> R
where + Self: Sized, + F: FnMut(Self::Item) -> R, + R: Try<Output = ()>,

An iterator method that applies a fallible function to each item in the +iterator, stopping at the first error and returning that error. Read more
1.0.0 · source§

fn fold<B, F>(self, init: B, f: F) -> B
where + Self: Sized, + F: FnMut(B, Self::Item) -> B,

Folds every element into an accumulator by applying an operation, +returning the final result. Read more
1.51.0 · source§

fn reduce<F>(self, f: F) -> Option<Self::Item>
where + Self: Sized, + F: FnMut(Self::Item, Self::Item) -> Self::Item,

Reduces the elements to a single one, by repeatedly applying a reducing +operation. Read more
source§

fn try_reduce<F, R>( + &mut self, + f: F +) -> <<R as Try>::Residual as Residual<Option<<R as Try>::Output>>>::TryType
where + Self: Sized, + F: FnMut(Self::Item, Self::Item) -> R, + R: Try<Output = Self::Item>, + <R as Try>::Residual: Residual<Option<Self::Item>>,

🔬This is a nightly-only experimental API. (iterator_try_reduce)
Reduces the elements to a single one by repeatedly applying a reducing operation. If the +closure returns a failure, the failure is propagated back to the caller immediately. Read more
1.0.0 · source§

fn all<F>(&mut self, f: F) -> bool
where + Self: Sized, + F: FnMut(Self::Item) -> bool,

Tests if every element of the iterator matches a predicate. Read more
1.0.0 · source§

fn any<F>(&mut self, f: F) -> bool
where + Self: Sized, + F: FnMut(Self::Item) -> bool,

Tests if any element of the iterator matches a predicate. Read more
1.0.0 · source§

fn find<P>(&mut self, predicate: P) -> Option<Self::Item>
where + Self: Sized, + P: FnMut(&Self::Item) -> bool,

Searches for an element of an iterator that satisfies a predicate. Read more
1.30.0 · source§

fn find_map<B, F>(&mut self, f: F) -> Option<B>
where + Self: Sized, + F: FnMut(Self::Item) -> Option<B>,

Applies function to the elements of iterator and returns +the first non-none result. Read more
source§

fn try_find<F, R>( + &mut self, + f: F +) -> <<R as Try>::Residual as Residual<Option<Self::Item>>>::TryType
where + Self: Sized, + F: FnMut(&Self::Item) -> R, + R: Try<Output = bool>, + <R as Try>::Residual: Residual<Option<Self::Item>>,

🔬This is a nightly-only experimental API. (try_find)
Applies function to the elements of iterator and returns +the first true result or the first error. Read more
1.0.0 · source§

fn position<P>(&mut self, predicate: P) -> Option<usize>
where + Self: Sized, + P: FnMut(Self::Item) -> bool,

Searches for an element in an iterator, returning its index. Read more
1.0.0 · source§

fn rposition<P>(&mut self, predicate: P) -> Option<usize>
where + P: FnMut(Self::Item) -> bool, + Self: Sized + ExactSizeIterator + DoubleEndedIterator,

Searches for an element in an iterator from the right, returning its +index. Read more
1.6.0 · source§

fn max_by_key<B, F>(self, f: F) -> Option<Self::Item>
where + B: Ord, + Self: Sized, + F: FnMut(&Self::Item) -> B,

Returns the element that gives the maximum value from the +specified function. Read more
1.15.0 · source§

fn max_by<F>(self, compare: F) -> Option<Self::Item>
where + Self: Sized, + F: FnMut(&Self::Item, &Self::Item) -> Ordering,

Returns the element that gives the maximum value with respect to the +specified comparison function. Read more
1.6.0 · source§

fn min_by_key<B, F>(self, f: F) -> Option<Self::Item>
where + B: Ord, + Self: Sized, + F: FnMut(&Self::Item) -> B,

Returns the element that gives the minimum value from the +specified function. Read more
1.15.0 · source§

fn min_by<F>(self, compare: F) -> Option<Self::Item>
where + Self: Sized, + F: FnMut(&Self::Item, &Self::Item) -> Ordering,

Returns the element that gives the minimum value with respect to the +specified comparison function. Read more
1.0.0 · source§

fn rev(self) -> Rev<Self>
where + Self: Sized + DoubleEndedIterator,

Reverses an iterator’s direction. Read more
1.0.0 · source§

fn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB)
where + FromA: Default + Extend<A>, + FromB: Default + Extend<B>, + Self: Sized + Iterator<Item = (A, B)>,

Converts an iterator of pairs into a pair of containers. Read more
1.36.0 · source§

fn copied<'a, T>(self) -> Copied<Self>
where + T: 'a + Copy, + Self: Sized + Iterator<Item = &'a T>,

Creates an iterator which copies all of its elements. Read more
1.0.0 · source§

fn cloned<'a, T>(self) -> Cloned<Self>
where + T: 'a + Clone, + Self: Sized + Iterator<Item = &'a T>,

Creates an iterator which clones all of its elements. Read more
source§

fn array_chunks<const N: usize>(self) -> ArrayChunks<Self, N>
where + Self: Sized,

🔬This is a nightly-only experimental API. (iter_array_chunks)
Returns an iterator over N elements of the iterator at a time. Read more
1.11.0 · source§

fn sum<S>(self) -> S
where + Self: Sized, + S: Sum<Self::Item>,

Sums the elements of an iterator. Read more
1.11.0 · source§

fn product<P>(self) -> P
where + Self: Sized, + P: Product<Self::Item>,

Iterates over the entire iterator, multiplying all the elements Read more
source§

fn cmp_by<I, F>(self, other: I, cmp: F) -> Ordering
where + Self: Sized, + I: IntoIterator, + F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Ordering,

🔬This is a nightly-only experimental API. (iter_order_by)
Lexicographically compares the elements of this Iterator with those +of another with respect to the specified comparison function. Read more
1.5.0 · source§

fn partial_cmp<I>(self, other: I) -> Option<Ordering>
where + I: IntoIterator, + Self::Item: PartialOrd<<I as IntoIterator>::Item>, + Self: Sized,

Lexicographically compares the PartialOrd elements of +this Iterator with those of another. The comparison works like short-circuit +evaluation, returning a result without comparing the remaining elements. +As soon as an order can be determined, the evaluation stops and a result is returned. Read more
source§

fn partial_cmp_by<I, F>(self, other: I, partial_cmp: F) -> Option<Ordering>
where + Self: Sized, + I: IntoIterator, + F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Option<Ordering>,

🔬This is a nightly-only experimental API. (iter_order_by)
Lexicographically compares the elements of this Iterator with those +of another with respect to the specified comparison function. Read more
1.5.0 · source§

fn eq<I>(self, other: I) -> bool
where + I: IntoIterator, + Self::Item: PartialEq<<I as IntoIterator>::Item>, + Self: Sized,

Determines if the elements of this Iterator are equal to those of +another. Read more
source§

fn eq_by<I, F>(self, other: I, eq: F) -> bool
where + Self: Sized, + I: IntoIterator, + F: FnMut(Self::Item, <I as IntoIterator>::Item) -> bool,

🔬This is a nightly-only experimental API. (iter_order_by)
Determines if the elements of this Iterator are equal to those of +another with respect to the specified equality function. Read more
1.5.0 · source§

fn ne<I>(self, other: I) -> bool
where + I: IntoIterator, + Self::Item: PartialEq<<I as IntoIterator>::Item>, + Self: Sized,

Determines if the elements of this Iterator are not equal to those of +another. Read more
1.5.0 · source§

fn lt<I>(self, other: I) -> bool
where + I: IntoIterator, + Self::Item: PartialOrd<<I as IntoIterator>::Item>, + Self: Sized,

Determines if the elements of this Iterator are lexicographically +less than those of another. Read more
1.5.0 · source§

fn le<I>(self, other: I) -> bool
where + I: IntoIterator, + Self::Item: PartialOrd<<I as IntoIterator>::Item>, + Self: Sized,

Determines if the elements of this Iterator are lexicographically +less or equal to those of another. Read more
1.5.0 · source§

fn gt<I>(self, other: I) -> bool
where + I: IntoIterator, + Self::Item: PartialOrd<<I as IntoIterator>::Item>, + Self: Sized,

Determines if the elements of this Iterator are lexicographically +greater than those of another. Read more
1.5.0 · source§

fn ge<I>(self, other: I) -> bool
where + I: IntoIterator, + Self::Item: PartialOrd<<I as IntoIterator>::Item>, + Self: Sized,

Determines if the elements of this Iterator are lexicographically +greater than or equal to those of another. Read more
source§

fn is_sorted_by<F>(self, compare: F) -> bool
where + Self: Sized, + F: FnMut(&Self::Item, &Self::Item) -> bool,

🔬This is a nightly-only experimental API. (is_sorted)
Checks if the elements of this iterator are sorted using the given comparator function. Read more
source§

fn is_sorted_by_key<F, K>(self, f: F) -> bool
where + Self: Sized, + F: FnMut(Self::Item) -> K, + K: PartialOrd,

🔬This is a nightly-only experimental API. (is_sorted)
Checks if the elements of this iterator are sorted using the given key extraction +function. Read more

Auto Trait Implementations§

§

impl<'a, T> Freeze for IterMut<'a, T>

§

impl<'a, T> !RefUnwindSafe for IterMut<'a, T>

§

impl<'a, T> !Send for IterMut<'a, T>

§

impl<'a, T> !Sync for IterMut<'a, T>

§

impl<'a, T> Unpin for IterMut<'a, T>

§

impl<'a, T> !UnwindSafe for IterMut<'a, T>

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<I> IntoIterator for I
where + I: Iterator,

§

type Item = <I as Iterator>::Item

The type of the elements being iterated over.
§

type IntoIter = I

Which kind of iterator are we turning this into?
const: unstable · source§

fn into_iter(self) -> I

Creates an iterator from a value. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/punctuated/struct.Pairs.html b/syn/punctuated/struct.Pairs.html new file mode 100644 index 0000000..404faf2 --- /dev/null +++ b/syn/punctuated/struct.Pairs.html @@ -0,0 +1,219 @@ +Pairs in syn::punctuated - Rust

Struct syn::punctuated::Pairs

source ·
pub struct Pairs<'a, T: 'a, P: 'a> { /* private fields */ }
Expand description

An iterator over borrowed pairs of type Pair<&T, &P>.

+

Refer to the module documentation for details about punctuated sequences.

+

Trait Implementations§

source§

impl<'a, T, P> Clone for Pairs<'a, T, P>

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'a, T, P> DoubleEndedIterator for Pairs<'a, T, P>

source§

fn next_back(&mut self) -> Option<Self::Item>

Removes and returns an element from the end of the iterator. Read more
source§

fn advance_back_by(&mut self, n: usize) -> Result<(), NonZero<usize>>

🔬This is a nightly-only experimental API. (iter_advance_by)
Advances the iterator from the back by n elements. Read more
1.37.0 · source§

fn nth_back(&mut self, n: usize) -> Option<Self::Item>

Returns the nth element from the end of the iterator. Read more
1.27.0 · source§

fn try_rfold<B, F, R>(&mut self, init: B, f: F) -> R
where + Self: Sized, + F: FnMut(B, Self::Item) -> R, + R: Try<Output = B>,

This is the reverse version of Iterator::try_fold(): it takes +elements starting from the back of the iterator. Read more
1.27.0 · source§

fn rfold<B, F>(self, init: B, f: F) -> B
where + Self: Sized, + F: FnMut(B, Self::Item) -> B,

An iterator method that reduces the iterator’s elements to a single, +final value, starting from the back. Read more
1.27.0 · source§

fn rfind<P>(&mut self, predicate: P) -> Option<Self::Item>
where + Self: Sized, + P: FnMut(&Self::Item) -> bool,

Searches for an element of an iterator from the back that satisfies a predicate. Read more
source§

impl<'a, T, P> ExactSizeIterator for Pairs<'a, T, P>

source§

fn len(&self) -> usize

Returns the exact remaining length of the iterator. Read more
source§

fn is_empty(&self) -> bool

🔬This is a nightly-only experimental API. (exact_size_is_empty)
Returns true if the iterator is empty. Read more
source§

impl<'a, T, P> Iterator for Pairs<'a, T, P>

§

type Item = Pair<&'a T, &'a P>

The type of the elements being iterated over.
source§

fn next(&mut self) -> Option<Self::Item>

Advances the iterator and returns the next value. Read more
source§

fn size_hint(&self) -> (usize, Option<usize>)

Returns the bounds on the remaining length of the iterator. Read more
source§

fn next_chunk<const N: usize>( + &mut self +) -> Result<[Self::Item; N], IntoIter<Self::Item, N>>
where + Self: Sized,

🔬This is a nightly-only experimental API. (iter_next_chunk)
Advances the iterator and returns an array containing the next N values. Read more
1.0.0 · source§

fn count(self) -> usize
where + Self: Sized,

Consumes the iterator, counting the number of iterations and returning it. Read more
1.0.0 · source§

fn last(self) -> Option<Self::Item>
where + Self: Sized,

Consumes the iterator, returning the last element. Read more
source§

fn advance_by(&mut self, n: usize) -> Result<(), NonZero<usize>>

🔬This is a nightly-only experimental API. (iter_advance_by)
Advances the iterator by n elements. Read more
1.0.0 · source§

fn nth(&mut self, n: usize) -> Option<Self::Item>

Returns the nth element of the iterator. Read more
1.28.0 · source§

fn step_by(self, step: usize) -> StepBy<Self>
where + Self: Sized,

Creates an iterator starting at the same point, but stepping by +the given amount at each iteration. Read more
1.0.0 · source§

fn chain<U>(self, other: U) -> Chain<Self, <U as IntoIterator>::IntoIter>
where + Self: Sized, + U: IntoIterator<Item = Self::Item>,

Takes two iterators and creates a new iterator over both in sequence. Read more
1.0.0 · source§

fn zip<U>(self, other: U) -> Zip<Self, <U as IntoIterator>::IntoIter>
where + Self: Sized, + U: IntoIterator,

‘Zips up’ two iterators into a single iterator of pairs. Read more
source§

fn intersperse_with<G>(self, separator: G) -> IntersperseWith<Self, G>
where + Self: Sized, + G: FnMut() -> Self::Item,

🔬This is a nightly-only experimental API. (iter_intersperse)
Creates a new iterator which places an item generated by separator +between adjacent items of the original iterator. Read more
1.0.0 · source§

fn map<B, F>(self, f: F) -> Map<Self, F>
where + Self: Sized, + F: FnMut(Self::Item) -> B,

Takes a closure and creates an iterator which calls that closure on each +element. Read more
1.21.0 · source§

fn for_each<F>(self, f: F)
where + Self: Sized, + F: FnMut(Self::Item),

Calls a closure on each element of an iterator. Read more
1.0.0 · source§

fn filter<P>(self, predicate: P) -> Filter<Self, P>
where + Self: Sized, + P: FnMut(&Self::Item) -> bool,

Creates an iterator which uses a closure to determine if an element +should be yielded. Read more
1.0.0 · source§

fn filter_map<B, F>(self, f: F) -> FilterMap<Self, F>
where + Self: Sized, + F: FnMut(Self::Item) -> Option<B>,

Creates an iterator that both filters and maps. Read more
1.0.0 · source§

fn enumerate(self) -> Enumerate<Self>
where + Self: Sized,

Creates an iterator which gives the current iteration count as well as +the next value. Read more
1.0.0 · source§

fn peekable(self) -> Peekable<Self>
where + Self: Sized,

Creates an iterator which can use the peek and peek_mut methods +to look at the next element of the iterator without consuming it. See +their documentation for more information. Read more
1.0.0 · source§

fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P>
where + Self: Sized, + P: FnMut(&Self::Item) -> bool,

Creates an iterator that skips elements based on a predicate. Read more
1.0.0 · source§

fn take_while<P>(self, predicate: P) -> TakeWhile<Self, P>
where + Self: Sized, + P: FnMut(&Self::Item) -> bool,

Creates an iterator that yields elements based on a predicate. Read more
1.57.0 · source§

fn map_while<B, P>(self, predicate: P) -> MapWhile<Self, P>
where + Self: Sized, + P: FnMut(Self::Item) -> Option<B>,

Creates an iterator that both yields elements based on a predicate and maps. Read more
1.0.0 · source§

fn skip(self, n: usize) -> Skip<Self>
where + Self: Sized,

Creates an iterator that skips the first n elements. Read more
1.0.0 · source§

fn take(self, n: usize) -> Take<Self>
where + Self: Sized,

Creates an iterator that yields the first n elements, or fewer +if the underlying iterator ends sooner. Read more
1.0.0 · source§

fn scan<St, B, F>(self, initial_state: St, f: F) -> Scan<Self, St, F>
where + Self: Sized, + F: FnMut(&mut St, Self::Item) -> Option<B>,

An iterator adapter which, like fold, holds internal state, but +unlike fold, produces a new iterator. Read more
1.0.0 · source§

fn flat_map<U, F>(self, f: F) -> FlatMap<Self, U, F>
where + Self: Sized, + U: IntoIterator, + F: FnMut(Self::Item) -> U,

Creates an iterator that works like map, but flattens nested structure. Read more
source§

fn map_windows<F, R, const N: usize>(self, f: F) -> MapWindows<Self, F, N>
where + Self: Sized, + F: FnMut(&[Self::Item; N]) -> R,

🔬This is a nightly-only experimental API. (iter_map_windows)
Calls the given function f for each contiguous window of size N over +self and returns an iterator over the outputs of f. Like slice::windows(), +the windows during mapping overlap as well. Read more
1.0.0 · source§

fn fuse(self) -> Fuse<Self>
where + Self: Sized,

Creates an iterator which ends after the first None. Read more
1.0.0 · source§

fn inspect<F>(self, f: F) -> Inspect<Self, F>
where + Self: Sized, + F: FnMut(&Self::Item),

Does something with each element of an iterator, passing the value on. Read more
1.0.0 · source§

fn by_ref(&mut self) -> &mut Self
where + Self: Sized,

Borrows an iterator, rather than consuming it. Read more
1.0.0 · source§

fn collect<B>(self) -> B
where + B: FromIterator<Self::Item>, + Self: Sized,

Transforms an iterator into a collection. Read more
source§

fn collect_into<E>(self, collection: &mut E) -> &mut E
where + E: Extend<Self::Item>, + Self: Sized,

🔬This is a nightly-only experimental API. (iter_collect_into)
Collects all the items from an iterator into a collection. Read more
1.0.0 · source§

fn partition<B, F>(self, f: F) -> (B, B)
where + Self: Sized, + B: Default + Extend<Self::Item>, + F: FnMut(&Self::Item) -> bool,

Consumes an iterator, creating two collections from it. Read more
source§

fn partition_in_place<'a, T, P>(self, predicate: P) -> usize
where + T: 'a, + Self: Sized + DoubleEndedIterator<Item = &'a mut T>, + P: FnMut(&T) -> bool,

🔬This is a nightly-only experimental API. (iter_partition_in_place)
Reorders the elements of this iterator in-place according to the given predicate, +such that all those that return true precede all those that return false. +Returns the number of true elements found. Read more
source§

fn is_partitioned<P>(self, predicate: P) -> bool
where + Self: Sized, + P: FnMut(Self::Item) -> bool,

🔬This is a nightly-only experimental API. (iter_is_partitioned)
Checks if the elements of this iterator are partitioned according to the given predicate, +such that all those that return true precede all those that return false. Read more
1.27.0 · source§

fn try_fold<B, F, R>(&mut self, init: B, f: F) -> R
where + Self: Sized, + F: FnMut(B, Self::Item) -> R, + R: Try<Output = B>,

An iterator method that applies a function as long as it returns +successfully, producing a single, final value. Read more
1.27.0 · source§

fn try_for_each<F, R>(&mut self, f: F) -> R
where + Self: Sized, + F: FnMut(Self::Item) -> R, + R: Try<Output = ()>,

An iterator method that applies a fallible function to each item in the +iterator, stopping at the first error and returning that error. Read more
1.0.0 · source§

fn fold<B, F>(self, init: B, f: F) -> B
where + Self: Sized, + F: FnMut(B, Self::Item) -> B,

Folds every element into an accumulator by applying an operation, +returning the final result. Read more
1.51.0 · source§

fn reduce<F>(self, f: F) -> Option<Self::Item>
where + Self: Sized, + F: FnMut(Self::Item, Self::Item) -> Self::Item,

Reduces the elements to a single one, by repeatedly applying a reducing +operation. Read more
source§

fn try_reduce<F, R>( + &mut self, + f: F +) -> <<R as Try>::Residual as Residual<Option<<R as Try>::Output>>>::TryType
where + Self: Sized, + F: FnMut(Self::Item, Self::Item) -> R, + R: Try<Output = Self::Item>, + <R as Try>::Residual: Residual<Option<Self::Item>>,

🔬This is a nightly-only experimental API. (iterator_try_reduce)
Reduces the elements to a single one by repeatedly applying a reducing operation. If the +closure returns a failure, the failure is propagated back to the caller immediately. Read more
1.0.0 · source§

fn all<F>(&mut self, f: F) -> bool
where + Self: Sized, + F: FnMut(Self::Item) -> bool,

Tests if every element of the iterator matches a predicate. Read more
1.0.0 · source§

fn any<F>(&mut self, f: F) -> bool
where + Self: Sized, + F: FnMut(Self::Item) -> bool,

Tests if any element of the iterator matches a predicate. Read more
1.0.0 · source§

fn find<P>(&mut self, predicate: P) -> Option<Self::Item>
where + Self: Sized, + P: FnMut(&Self::Item) -> bool,

Searches for an element of an iterator that satisfies a predicate. Read more
1.30.0 · source§

fn find_map<B, F>(&mut self, f: F) -> Option<B>
where + Self: Sized, + F: FnMut(Self::Item) -> Option<B>,

Applies function to the elements of iterator and returns +the first non-none result. Read more
source§

fn try_find<F, R>( + &mut self, + f: F +) -> <<R as Try>::Residual as Residual<Option<Self::Item>>>::TryType
where + Self: Sized, + F: FnMut(&Self::Item) -> R, + R: Try<Output = bool>, + <R as Try>::Residual: Residual<Option<Self::Item>>,

🔬This is a nightly-only experimental API. (try_find)
Applies function to the elements of iterator and returns +the first true result or the first error. Read more
1.0.0 · source§

fn position<P>(&mut self, predicate: P) -> Option<usize>
where + Self: Sized, + P: FnMut(Self::Item) -> bool,

Searches for an element in an iterator, returning its index. Read more
1.0.0 · source§

fn rposition<P>(&mut self, predicate: P) -> Option<usize>
where + P: FnMut(Self::Item) -> bool, + Self: Sized + ExactSizeIterator + DoubleEndedIterator,

Searches for an element in an iterator from the right, returning its +index. Read more
1.6.0 · source§

fn max_by_key<B, F>(self, f: F) -> Option<Self::Item>
where + B: Ord, + Self: Sized, + F: FnMut(&Self::Item) -> B,

Returns the element that gives the maximum value from the +specified function. Read more
1.15.0 · source§

fn max_by<F>(self, compare: F) -> Option<Self::Item>
where + Self: Sized, + F: FnMut(&Self::Item, &Self::Item) -> Ordering,

Returns the element that gives the maximum value with respect to the +specified comparison function. Read more
1.6.0 · source§

fn min_by_key<B, F>(self, f: F) -> Option<Self::Item>
where + B: Ord, + Self: Sized, + F: FnMut(&Self::Item) -> B,

Returns the element that gives the minimum value from the +specified function. Read more
1.15.0 · source§

fn min_by<F>(self, compare: F) -> Option<Self::Item>
where + Self: Sized, + F: FnMut(&Self::Item, &Self::Item) -> Ordering,

Returns the element that gives the minimum value with respect to the +specified comparison function. Read more
1.0.0 · source§

fn rev(self) -> Rev<Self>
where + Self: Sized + DoubleEndedIterator,

Reverses an iterator’s direction. Read more
1.0.0 · source§

fn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB)
where + FromA: Default + Extend<A>, + FromB: Default + Extend<B>, + Self: Sized + Iterator<Item = (A, B)>,

Converts an iterator of pairs into a pair of containers. Read more
1.36.0 · source§

fn copied<'a, T>(self) -> Copied<Self>
where + T: 'a + Copy, + Self: Sized + Iterator<Item = &'a T>,

Creates an iterator which copies all of its elements. Read more
1.0.0 · source§

fn cloned<'a, T>(self) -> Cloned<Self>
where + T: 'a + Clone, + Self: Sized + Iterator<Item = &'a T>,

Creates an iterator which clones all of its elements. Read more
1.0.0 · source§

fn cycle(self) -> Cycle<Self>
where + Self: Sized + Clone,

Repeats an iterator endlessly. Read more
source§

fn array_chunks<const N: usize>(self) -> ArrayChunks<Self, N>
where + Self: Sized,

🔬This is a nightly-only experimental API. (iter_array_chunks)
Returns an iterator over N elements of the iterator at a time. Read more
1.11.0 · source§

fn sum<S>(self) -> S
where + Self: Sized, + S: Sum<Self::Item>,

Sums the elements of an iterator. Read more
1.11.0 · source§

fn product<P>(self) -> P
where + Self: Sized, + P: Product<Self::Item>,

Iterates over the entire iterator, multiplying all the elements Read more
source§

fn cmp_by<I, F>(self, other: I, cmp: F) -> Ordering
where + Self: Sized, + I: IntoIterator, + F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Ordering,

🔬This is a nightly-only experimental API. (iter_order_by)
Lexicographically compares the elements of this Iterator with those +of another with respect to the specified comparison function. Read more
1.5.0 · source§

fn partial_cmp<I>(self, other: I) -> Option<Ordering>
where + I: IntoIterator, + Self::Item: PartialOrd<<I as IntoIterator>::Item>, + Self: Sized,

Lexicographically compares the PartialOrd elements of +this Iterator with those of another. The comparison works like short-circuit +evaluation, returning a result without comparing the remaining elements. +As soon as an order can be determined, the evaluation stops and a result is returned. Read more
source§

fn partial_cmp_by<I, F>(self, other: I, partial_cmp: F) -> Option<Ordering>
where + Self: Sized, + I: IntoIterator, + F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Option<Ordering>,

🔬This is a nightly-only experimental API. (iter_order_by)
Lexicographically compares the elements of this Iterator with those +of another with respect to the specified comparison function. Read more
1.5.0 · source§

fn eq<I>(self, other: I) -> bool
where + I: IntoIterator, + Self::Item: PartialEq<<I as IntoIterator>::Item>, + Self: Sized,

Determines if the elements of this Iterator are equal to those of +another. Read more
source§

fn eq_by<I, F>(self, other: I, eq: F) -> bool
where + Self: Sized, + I: IntoIterator, + F: FnMut(Self::Item, <I as IntoIterator>::Item) -> bool,

🔬This is a nightly-only experimental API. (iter_order_by)
Determines if the elements of this Iterator are equal to those of +another with respect to the specified equality function. Read more
1.5.0 · source§

fn ne<I>(self, other: I) -> bool
where + I: IntoIterator, + Self::Item: PartialEq<<I as IntoIterator>::Item>, + Self: Sized,

Determines if the elements of this Iterator are not equal to those of +another. Read more
1.5.0 · source§

fn lt<I>(self, other: I) -> bool
where + I: IntoIterator, + Self::Item: PartialOrd<<I as IntoIterator>::Item>, + Self: Sized,

Determines if the elements of this Iterator are lexicographically +less than those of another. Read more
1.5.0 · source§

fn le<I>(self, other: I) -> bool
where + I: IntoIterator, + Self::Item: PartialOrd<<I as IntoIterator>::Item>, + Self: Sized,

Determines if the elements of this Iterator are lexicographically +less or equal to those of another. Read more
1.5.0 · source§

fn gt<I>(self, other: I) -> bool
where + I: IntoIterator, + Self::Item: PartialOrd<<I as IntoIterator>::Item>, + Self: Sized,

Determines if the elements of this Iterator are lexicographically +greater than those of another. Read more
1.5.0 · source§

fn ge<I>(self, other: I) -> bool
where + I: IntoIterator, + Self::Item: PartialOrd<<I as IntoIterator>::Item>, + Self: Sized,

Determines if the elements of this Iterator are lexicographically +greater than or equal to those of another. Read more
source§

fn is_sorted_by<F>(self, compare: F) -> bool
where + Self: Sized, + F: FnMut(&Self::Item, &Self::Item) -> bool,

🔬This is a nightly-only experimental API. (is_sorted)
Checks if the elements of this iterator are sorted using the given comparator function. Read more
source§

fn is_sorted_by_key<F, K>(self, f: F) -> bool
where + Self: Sized, + F: FnMut(Self::Item) -> K, + K: PartialOrd,

🔬This is a nightly-only experimental API. (is_sorted)
Checks if the elements of this iterator are sorted using the given key extraction +function. Read more

Auto Trait Implementations§

§

impl<'a, T, P> Freeze for Pairs<'a, T, P>

§

impl<'a, T, P> RefUnwindSafe for Pairs<'a, T, P>
where + T: RefUnwindSafe, + P: RefUnwindSafe,

§

impl<'a, T, P> Send for Pairs<'a, T, P>
where + T: Sync, + P: Sync,

§

impl<'a, T, P> Sync for Pairs<'a, T, P>
where + T: Sync, + P: Sync,

§

impl<'a, T, P> Unpin for Pairs<'a, T, P>

§

impl<'a, T, P> UnwindSafe for Pairs<'a, T, P>
where + T: RefUnwindSafe, + P: RefUnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<I> IntoIterator for I
where + I: Iterator,

§

type Item = <I as Iterator>::Item

The type of the elements being iterated over.
§

type IntoIter = I

Which kind of iterator are we turning this into?
const: unstable · source§

fn into_iter(self) -> I

Creates an iterator from a value. Read more
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/punctuated/struct.PairsMut.html b/syn/punctuated/struct.PairsMut.html new file mode 100644 index 0000000..8aeedb7 --- /dev/null +++ b/syn/punctuated/struct.PairsMut.html @@ -0,0 +1,215 @@ +PairsMut in syn::punctuated - Rust

Struct syn::punctuated::PairsMut

source ·
pub struct PairsMut<'a, T: 'a, P: 'a> { /* private fields */ }
Expand description

An iterator over mutably borrowed pairs of type Pair<&mut T, &mut P>.

+

Refer to the module documentation for details about punctuated sequences.

+

Trait Implementations§

source§

impl<'a, T, P> DoubleEndedIterator for PairsMut<'a, T, P>

source§

fn next_back(&mut self) -> Option<Self::Item>

Removes and returns an element from the end of the iterator. Read more
source§

fn advance_back_by(&mut self, n: usize) -> Result<(), NonZero<usize>>

🔬This is a nightly-only experimental API. (iter_advance_by)
Advances the iterator from the back by n elements. Read more
1.37.0 · source§

fn nth_back(&mut self, n: usize) -> Option<Self::Item>

Returns the nth element from the end of the iterator. Read more
1.27.0 · source§

fn try_rfold<B, F, R>(&mut self, init: B, f: F) -> R
where + Self: Sized, + F: FnMut(B, Self::Item) -> R, + R: Try<Output = B>,

This is the reverse version of Iterator::try_fold(): it takes +elements starting from the back of the iterator. Read more
1.27.0 · source§

fn rfold<B, F>(self, init: B, f: F) -> B
where + Self: Sized, + F: FnMut(B, Self::Item) -> B,

An iterator method that reduces the iterator’s elements to a single, +final value, starting from the back. Read more
1.27.0 · source§

fn rfind<P>(&mut self, predicate: P) -> Option<Self::Item>
where + Self: Sized, + P: FnMut(&Self::Item) -> bool,

Searches for an element of an iterator from the back that satisfies a predicate. Read more
source§

impl<'a, T, P> ExactSizeIterator for PairsMut<'a, T, P>

source§

fn len(&self) -> usize

Returns the exact remaining length of the iterator. Read more
source§

fn is_empty(&self) -> bool

🔬This is a nightly-only experimental API. (exact_size_is_empty)
Returns true if the iterator is empty. Read more
source§

impl<'a, T, P> Iterator for PairsMut<'a, T, P>

§

type Item = Pair<&'a mut T, &'a mut P>

The type of the elements being iterated over.
source§

fn next(&mut self) -> Option<Self::Item>

Advances the iterator and returns the next value. Read more
source§

fn size_hint(&self) -> (usize, Option<usize>)

Returns the bounds on the remaining length of the iterator. Read more
source§

fn next_chunk<const N: usize>( + &mut self +) -> Result<[Self::Item; N], IntoIter<Self::Item, N>>
where + Self: Sized,

🔬This is a nightly-only experimental API. (iter_next_chunk)
Advances the iterator and returns an array containing the next N values. Read more
1.0.0 · source§

fn count(self) -> usize
where + Self: Sized,

Consumes the iterator, counting the number of iterations and returning it. Read more
1.0.0 · source§

fn last(self) -> Option<Self::Item>
where + Self: Sized,

Consumes the iterator, returning the last element. Read more
source§

fn advance_by(&mut self, n: usize) -> Result<(), NonZero<usize>>

🔬This is a nightly-only experimental API. (iter_advance_by)
Advances the iterator by n elements. Read more
1.0.0 · source§

fn nth(&mut self, n: usize) -> Option<Self::Item>

Returns the nth element of the iterator. Read more
1.28.0 · source§

fn step_by(self, step: usize) -> StepBy<Self>
where + Self: Sized,

Creates an iterator starting at the same point, but stepping by +the given amount at each iteration. Read more
1.0.0 · source§

fn chain<U>(self, other: U) -> Chain<Self, <U as IntoIterator>::IntoIter>
where + Self: Sized, + U: IntoIterator<Item = Self::Item>,

Takes two iterators and creates a new iterator over both in sequence. Read more
1.0.0 · source§

fn zip<U>(self, other: U) -> Zip<Self, <U as IntoIterator>::IntoIter>
where + Self: Sized, + U: IntoIterator,

‘Zips up’ two iterators into a single iterator of pairs. Read more
source§

fn intersperse_with<G>(self, separator: G) -> IntersperseWith<Self, G>
where + Self: Sized, + G: FnMut() -> Self::Item,

🔬This is a nightly-only experimental API. (iter_intersperse)
Creates a new iterator which places an item generated by separator +between adjacent items of the original iterator. Read more
1.0.0 · source§

fn map<B, F>(self, f: F) -> Map<Self, F>
where + Self: Sized, + F: FnMut(Self::Item) -> B,

Takes a closure and creates an iterator which calls that closure on each +element. Read more
1.21.0 · source§

fn for_each<F>(self, f: F)
where + Self: Sized, + F: FnMut(Self::Item),

Calls a closure on each element of an iterator. Read more
1.0.0 · source§

fn filter<P>(self, predicate: P) -> Filter<Self, P>
where + Self: Sized, + P: FnMut(&Self::Item) -> bool,

Creates an iterator which uses a closure to determine if an element +should be yielded. Read more
1.0.0 · source§

fn filter_map<B, F>(self, f: F) -> FilterMap<Self, F>
where + Self: Sized, + F: FnMut(Self::Item) -> Option<B>,

Creates an iterator that both filters and maps. Read more
1.0.0 · source§

fn enumerate(self) -> Enumerate<Self>
where + Self: Sized,

Creates an iterator which gives the current iteration count as well as +the next value. Read more
1.0.0 · source§

fn peekable(self) -> Peekable<Self>
where + Self: Sized,

Creates an iterator which can use the peek and peek_mut methods +to look at the next element of the iterator without consuming it. See +their documentation for more information. Read more
1.0.0 · source§

fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P>
where + Self: Sized, + P: FnMut(&Self::Item) -> bool,

Creates an iterator that skips elements based on a predicate. Read more
1.0.0 · source§

fn take_while<P>(self, predicate: P) -> TakeWhile<Self, P>
where + Self: Sized, + P: FnMut(&Self::Item) -> bool,

Creates an iterator that yields elements based on a predicate. Read more
1.57.0 · source§

fn map_while<B, P>(self, predicate: P) -> MapWhile<Self, P>
where + Self: Sized, + P: FnMut(Self::Item) -> Option<B>,

Creates an iterator that both yields elements based on a predicate and maps. Read more
1.0.0 · source§

fn skip(self, n: usize) -> Skip<Self>
where + Self: Sized,

Creates an iterator that skips the first n elements. Read more
1.0.0 · source§

fn take(self, n: usize) -> Take<Self>
where + Self: Sized,

Creates an iterator that yields the first n elements, or fewer +if the underlying iterator ends sooner. Read more
1.0.0 · source§

fn scan<St, B, F>(self, initial_state: St, f: F) -> Scan<Self, St, F>
where + Self: Sized, + F: FnMut(&mut St, Self::Item) -> Option<B>,

An iterator adapter which, like fold, holds internal state, but +unlike fold, produces a new iterator. Read more
1.0.0 · source§

fn flat_map<U, F>(self, f: F) -> FlatMap<Self, U, F>
where + Self: Sized, + U: IntoIterator, + F: FnMut(Self::Item) -> U,

Creates an iterator that works like map, but flattens nested structure. Read more
source§

fn map_windows<F, R, const N: usize>(self, f: F) -> MapWindows<Self, F, N>
where + Self: Sized, + F: FnMut(&[Self::Item; N]) -> R,

🔬This is a nightly-only experimental API. (iter_map_windows)
Calls the given function f for each contiguous window of size N over +self and returns an iterator over the outputs of f. Like slice::windows(), +the windows during mapping overlap as well. Read more
1.0.0 · source§

fn fuse(self) -> Fuse<Self>
where + Self: Sized,

Creates an iterator which ends after the first None. Read more
1.0.0 · source§

fn inspect<F>(self, f: F) -> Inspect<Self, F>
where + Self: Sized, + F: FnMut(&Self::Item),

Does something with each element of an iterator, passing the value on. Read more
1.0.0 · source§

fn by_ref(&mut self) -> &mut Self
where + Self: Sized,

Borrows an iterator, rather than consuming it. Read more
1.0.0 · source§

fn collect<B>(self) -> B
where + B: FromIterator<Self::Item>, + Self: Sized,

Transforms an iterator into a collection. Read more
source§

fn collect_into<E>(self, collection: &mut E) -> &mut E
where + E: Extend<Self::Item>, + Self: Sized,

🔬This is a nightly-only experimental API. (iter_collect_into)
Collects all the items from an iterator into a collection. Read more
1.0.0 · source§

fn partition<B, F>(self, f: F) -> (B, B)
where + Self: Sized, + B: Default + Extend<Self::Item>, + F: FnMut(&Self::Item) -> bool,

Consumes an iterator, creating two collections from it. Read more
source§

fn partition_in_place<'a, T, P>(self, predicate: P) -> usize
where + T: 'a, + Self: Sized + DoubleEndedIterator<Item = &'a mut T>, + P: FnMut(&T) -> bool,

🔬This is a nightly-only experimental API. (iter_partition_in_place)
Reorders the elements of this iterator in-place according to the given predicate, +such that all those that return true precede all those that return false. +Returns the number of true elements found. Read more
source§

fn is_partitioned<P>(self, predicate: P) -> bool
where + Self: Sized, + P: FnMut(Self::Item) -> bool,

🔬This is a nightly-only experimental API. (iter_is_partitioned)
Checks if the elements of this iterator are partitioned according to the given predicate, +such that all those that return true precede all those that return false. Read more
1.27.0 · source§

fn try_fold<B, F, R>(&mut self, init: B, f: F) -> R
where + Self: Sized, + F: FnMut(B, Self::Item) -> R, + R: Try<Output = B>,

An iterator method that applies a function as long as it returns +successfully, producing a single, final value. Read more
1.27.0 · source§

fn try_for_each<F, R>(&mut self, f: F) -> R
where + Self: Sized, + F: FnMut(Self::Item) -> R, + R: Try<Output = ()>,

An iterator method that applies a fallible function to each item in the +iterator, stopping at the first error and returning that error. Read more
1.0.0 · source§

fn fold<B, F>(self, init: B, f: F) -> B
where + Self: Sized, + F: FnMut(B, Self::Item) -> B,

Folds every element into an accumulator by applying an operation, +returning the final result. Read more
1.51.0 · source§

fn reduce<F>(self, f: F) -> Option<Self::Item>
where + Self: Sized, + F: FnMut(Self::Item, Self::Item) -> Self::Item,

Reduces the elements to a single one, by repeatedly applying a reducing +operation. Read more
source§

fn try_reduce<F, R>( + &mut self, + f: F +) -> <<R as Try>::Residual as Residual<Option<<R as Try>::Output>>>::TryType
where + Self: Sized, + F: FnMut(Self::Item, Self::Item) -> R, + R: Try<Output = Self::Item>, + <R as Try>::Residual: Residual<Option<Self::Item>>,

🔬This is a nightly-only experimental API. (iterator_try_reduce)
Reduces the elements to a single one by repeatedly applying a reducing operation. If the +closure returns a failure, the failure is propagated back to the caller immediately. Read more
1.0.0 · source§

fn all<F>(&mut self, f: F) -> bool
where + Self: Sized, + F: FnMut(Self::Item) -> bool,

Tests if every element of the iterator matches a predicate. Read more
1.0.0 · source§

fn any<F>(&mut self, f: F) -> bool
where + Self: Sized, + F: FnMut(Self::Item) -> bool,

Tests if any element of the iterator matches a predicate. Read more
1.0.0 · source§

fn find<P>(&mut self, predicate: P) -> Option<Self::Item>
where + Self: Sized, + P: FnMut(&Self::Item) -> bool,

Searches for an element of an iterator that satisfies a predicate. Read more
1.30.0 · source§

fn find_map<B, F>(&mut self, f: F) -> Option<B>
where + Self: Sized, + F: FnMut(Self::Item) -> Option<B>,

Applies function to the elements of iterator and returns +the first non-none result. Read more
source§

fn try_find<F, R>( + &mut self, + f: F +) -> <<R as Try>::Residual as Residual<Option<Self::Item>>>::TryType
where + Self: Sized, + F: FnMut(&Self::Item) -> R, + R: Try<Output = bool>, + <R as Try>::Residual: Residual<Option<Self::Item>>,

🔬This is a nightly-only experimental API. (try_find)
Applies function to the elements of iterator and returns +the first true result or the first error. Read more
1.0.0 · source§

fn position<P>(&mut self, predicate: P) -> Option<usize>
where + Self: Sized, + P: FnMut(Self::Item) -> bool,

Searches for an element in an iterator, returning its index. Read more
1.0.0 · source§

fn rposition<P>(&mut self, predicate: P) -> Option<usize>
where + P: FnMut(Self::Item) -> bool, + Self: Sized + ExactSizeIterator + DoubleEndedIterator,

Searches for an element in an iterator from the right, returning its +index. Read more
1.6.0 · source§

fn max_by_key<B, F>(self, f: F) -> Option<Self::Item>
where + B: Ord, + Self: Sized, + F: FnMut(&Self::Item) -> B,

Returns the element that gives the maximum value from the +specified function. Read more
1.15.0 · source§

fn max_by<F>(self, compare: F) -> Option<Self::Item>
where + Self: Sized, + F: FnMut(&Self::Item, &Self::Item) -> Ordering,

Returns the element that gives the maximum value with respect to the +specified comparison function. Read more
1.6.0 · source§

fn min_by_key<B, F>(self, f: F) -> Option<Self::Item>
where + B: Ord, + Self: Sized, + F: FnMut(&Self::Item) -> B,

Returns the element that gives the minimum value from the +specified function. Read more
1.15.0 · source§

fn min_by<F>(self, compare: F) -> Option<Self::Item>
where + Self: Sized, + F: FnMut(&Self::Item, &Self::Item) -> Ordering,

Returns the element that gives the minimum value with respect to the +specified comparison function. Read more
1.0.0 · source§

fn rev(self) -> Rev<Self>
where + Self: Sized + DoubleEndedIterator,

Reverses an iterator’s direction. Read more
1.0.0 · source§

fn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB)
where + FromA: Default + Extend<A>, + FromB: Default + Extend<B>, + Self: Sized + Iterator<Item = (A, B)>,

Converts an iterator of pairs into a pair of containers. Read more
1.36.0 · source§

fn copied<'a, T>(self) -> Copied<Self>
where + T: 'a + Copy, + Self: Sized + Iterator<Item = &'a T>,

Creates an iterator which copies all of its elements. Read more
1.0.0 · source§

fn cloned<'a, T>(self) -> Cloned<Self>
where + T: 'a + Clone, + Self: Sized + Iterator<Item = &'a T>,

Creates an iterator which clones all of its elements. Read more
source§

fn array_chunks<const N: usize>(self) -> ArrayChunks<Self, N>
where + Self: Sized,

🔬This is a nightly-only experimental API. (iter_array_chunks)
Returns an iterator over N elements of the iterator at a time. Read more
1.11.0 · source§

fn sum<S>(self) -> S
where + Self: Sized, + S: Sum<Self::Item>,

Sums the elements of an iterator. Read more
1.11.0 · source§

fn product<P>(self) -> P
where + Self: Sized, + P: Product<Self::Item>,

Iterates over the entire iterator, multiplying all the elements Read more
source§

fn cmp_by<I, F>(self, other: I, cmp: F) -> Ordering
where + Self: Sized, + I: IntoIterator, + F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Ordering,

🔬This is a nightly-only experimental API. (iter_order_by)
Lexicographically compares the elements of this Iterator with those +of another with respect to the specified comparison function. Read more
1.5.0 · source§

fn partial_cmp<I>(self, other: I) -> Option<Ordering>
where + I: IntoIterator, + Self::Item: PartialOrd<<I as IntoIterator>::Item>, + Self: Sized,

Lexicographically compares the PartialOrd elements of +this Iterator with those of another. The comparison works like short-circuit +evaluation, returning a result without comparing the remaining elements. +As soon as an order can be determined, the evaluation stops and a result is returned. Read more
source§

fn partial_cmp_by<I, F>(self, other: I, partial_cmp: F) -> Option<Ordering>
where + Self: Sized, + I: IntoIterator, + F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Option<Ordering>,

🔬This is a nightly-only experimental API. (iter_order_by)
Lexicographically compares the elements of this Iterator with those +of another with respect to the specified comparison function. Read more
1.5.0 · source§

fn eq<I>(self, other: I) -> bool
where + I: IntoIterator, + Self::Item: PartialEq<<I as IntoIterator>::Item>, + Self: Sized,

Determines if the elements of this Iterator are equal to those of +another. Read more
source§

fn eq_by<I, F>(self, other: I, eq: F) -> bool
where + Self: Sized, + I: IntoIterator, + F: FnMut(Self::Item, <I as IntoIterator>::Item) -> bool,

🔬This is a nightly-only experimental API. (iter_order_by)
Determines if the elements of this Iterator are equal to those of +another with respect to the specified equality function. Read more
1.5.0 · source§

fn ne<I>(self, other: I) -> bool
where + I: IntoIterator, + Self::Item: PartialEq<<I as IntoIterator>::Item>, + Self: Sized,

Determines if the elements of this Iterator are not equal to those of +another. Read more
1.5.0 · source§

fn lt<I>(self, other: I) -> bool
where + I: IntoIterator, + Self::Item: PartialOrd<<I as IntoIterator>::Item>, + Self: Sized,

Determines if the elements of this Iterator are lexicographically +less than those of another. Read more
1.5.0 · source§

fn le<I>(self, other: I) -> bool
where + I: IntoIterator, + Self::Item: PartialOrd<<I as IntoIterator>::Item>, + Self: Sized,

Determines if the elements of this Iterator are lexicographically +less or equal to those of another. Read more
1.5.0 · source§

fn gt<I>(self, other: I) -> bool
where + I: IntoIterator, + Self::Item: PartialOrd<<I as IntoIterator>::Item>, + Self: Sized,

Determines if the elements of this Iterator are lexicographically +greater than those of another. Read more
1.5.0 · source§

fn ge<I>(self, other: I) -> bool
where + I: IntoIterator, + Self::Item: PartialOrd<<I as IntoIterator>::Item>, + Self: Sized,

Determines if the elements of this Iterator are lexicographically +greater than or equal to those of another. Read more
source§

fn is_sorted_by<F>(self, compare: F) -> bool
where + Self: Sized, + F: FnMut(&Self::Item, &Self::Item) -> bool,

🔬This is a nightly-only experimental API. (is_sorted)
Checks if the elements of this iterator are sorted using the given comparator function. Read more
source§

fn is_sorted_by_key<F, K>(self, f: F) -> bool
where + Self: Sized, + F: FnMut(Self::Item) -> K, + K: PartialOrd,

🔬This is a nightly-only experimental API. (is_sorted)
Checks if the elements of this iterator are sorted using the given key extraction +function. Read more

Auto Trait Implementations§

§

impl<'a, T, P> Freeze for PairsMut<'a, T, P>

§

impl<'a, T, P> RefUnwindSafe for PairsMut<'a, T, P>
where + T: RefUnwindSafe, + P: RefUnwindSafe,

§

impl<'a, T, P> Send for PairsMut<'a, T, P>
where + T: Send, + P: Send,

§

impl<'a, T, P> Sync for PairsMut<'a, T, P>
where + T: Sync, + P: Sync,

§

impl<'a, T, P> Unpin for PairsMut<'a, T, P>

§

impl<'a, T, P> !UnwindSafe for PairsMut<'a, T, P>

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<I> IntoIterator for I
where + I: Iterator,

§

type Item = <I as Iterator>::Item

The type of the elements being iterated over.
§

type IntoIter = I

Which kind of iterator are we turning this into?
const: unstable · source§

fn into_iter(self) -> I

Creates an iterator from a value. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/punctuated/struct.Punctuated.html b/syn/punctuated/struct.Punctuated.html new file mode 100644 index 0000000..0bce34f --- /dev/null +++ b/syn/punctuated/struct.Punctuated.html @@ -0,0 +1,118 @@ +Punctuated in syn::punctuated - Rust

Struct syn::punctuated::Punctuated

source ·
pub struct Punctuated<T, P> { /* private fields */ }
Expand description

A punctuated sequence of syntax tree nodes of type T separated by +punctuation of type P.

+

Refer to the module documentation for details about punctuated sequences.

+

Implementations§

source§

impl<T, P> Punctuated<T, P>

source

pub const fn new() -> Self

Creates an empty punctuated sequence.

+
source

pub fn is_empty(&self) -> bool

Determines whether this punctuated sequence is empty, meaning it +contains no syntax tree nodes or punctuation.

+
source

pub fn len(&self) -> usize

Returns the number of syntax tree nodes in this punctuated sequence.

+

This is the number of nodes of type T, not counting the punctuation of +type P.

+
source

pub fn first(&self) -> Option<&T>

Borrows the first element in this sequence.

+
source

pub fn first_mut(&mut self) -> Option<&mut T>

Mutably borrows the first element in this sequence.

+
source

pub fn last(&self) -> Option<&T>

Borrows the last element in this sequence.

+
source

pub fn last_mut(&mut self) -> Option<&mut T>

Mutably borrows the last element in this sequence.

+
source

pub fn iter(&self) -> Iter<'_, T>

Returns an iterator over borrowed syntax tree nodes of type &T.

+
source

pub fn iter_mut(&mut self) -> IterMut<'_, T>

Returns an iterator over mutably borrowed syntax tree nodes of type +&mut T.

+
source

pub fn pairs(&self) -> Pairs<'_, T, P>

Returns an iterator over the contents of this sequence as borrowed +punctuated pairs.

+
source

pub fn pairs_mut(&mut self) -> PairsMut<'_, T, P>

Returns an iterator over the contents of this sequence as mutably +borrowed punctuated pairs.

+
source

pub fn into_pairs(self) -> IntoPairs<T, P>

Returns an iterator over the contents of this sequence as owned +punctuated pairs.

+
source

pub fn push_value(&mut self, value: T)

Appends a syntax tree node onto the end of this punctuated sequence. The +sequence must already have a trailing punctuation, or be empty.

+

Use push instead if the punctuated sequence may or may not already +have trailing punctuation.

+
§Panics
+

Panics if the sequence is nonempty and does not already have a trailing +punctuation.

+
source

pub fn push_punct(&mut self, punctuation: P)

Appends a trailing punctuation onto the end of this punctuated sequence. +The sequence must be non-empty and must not already have trailing +punctuation.

+
§Panics
+

Panics if the sequence is empty or already has a trailing punctuation.

+
source

pub fn pop(&mut self) -> Option<Pair<T, P>>

Removes the last punctuated pair from this sequence, or None if the +sequence is empty.

+
source

pub fn pop_punct(&mut self) -> Option<P>

Removes the trailing punctuation from this punctuated sequence, or +None if there isn’t any.

+
source

pub fn trailing_punct(&self) -> bool

Determines whether this punctuated sequence ends with a trailing +punctuation.

+
source

pub fn empty_or_trailing(&self) -> bool

Returns true if either this Punctuated is empty, or it has a trailing +punctuation.

+

Equivalent to punctuated.is_empty() || punctuated.trailing_punct().

+
source

pub fn push(&mut self, value: T)
where + P: Default,

Appends a syntax tree node onto the end of this punctuated sequence.

+

If there is not a trailing punctuation in this sequence when this method +is called, the default value of punctuation type P is inserted before +the given value of type T.

+
source

pub fn insert(&mut self, index: usize, value: T)
where + P: Default,

Inserts an element at position index.

+
§Panics
+

Panics if index is greater than the number of elements previously in +this punctuated sequence.

+
source

pub fn clear(&mut self)

Clears the sequence of all values and punctuation, making it empty.

+
source

pub fn parse_terminated(input: ParseStream<'_>) -> Result<Self>
where + T: Parse, + P: Parse,

Parses zero or more occurrences of T separated by punctuation of type +P, with optional trailing punctuation.

+

Parsing continues until the end of this parse stream. The entire content +of this parse stream must consist of T and P.

+
source

pub fn parse_terminated_with( + input: ParseStream<'_>, + parser: fn(_: ParseStream<'_>) -> Result<T> +) -> Result<Self>
where + P: Parse,

Parses zero or more occurrences of T using the given parse function, +separated by punctuation of type P, with optional trailing +punctuation.

+

Like parse_terminated, the entire content of this stream is expected +to be parsed.

+
source

pub fn parse_separated_nonempty(input: ParseStream<'_>) -> Result<Self>
where + T: Parse, + P: Token + Parse,

Parses one or more occurrences of T separated by punctuation of type +P, not accepting trailing punctuation.

+

Parsing continues as long as punctuation P is present at the head of +the stream. This method returns upon parsing a T and observing that it +is not followed by a P, even if there are remaining tokens in the +stream.

+
source

pub fn parse_separated_nonempty_with( + input: ParseStream<'_>, + parser: fn(_: ParseStream<'_>) -> Result<T> +) -> Result<Self>
where + P: Token + Parse,

Parses one or more occurrences of T using the given parse function, +separated by punctuation of type P, not accepting trailing +punctuation.

+

Like parse_separated_nonempty, may complete early without parsing +the entire content of this stream.

+

Trait Implementations§

source§

impl<T, P> Clone for Punctuated<T, P>
where + T: Clone, + P: Clone,

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
source§

fn clone_from(&mut self, other: &Self)

Performs copy-assignment from source. Read more
source§

impl<T, P> Default for Punctuated<T, P>

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<T, P> Extend<Pair<T, P>> for Punctuated<T, P>
where + P: Default,

source§

fn extend<I: IntoIterator<Item = Pair<T, P>>>(&mut self, i: I)

Extends a collection with the contents of an iterator. Read more
source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
source§

impl<T, P> Extend<T> for Punctuated<T, P>
where + P: Default,

source§

fn extend<I: IntoIterator<Item = T>>(&mut self, i: I)

Extends a collection with the contents of an iterator. Read more
source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
source§

impl<T, P> FromIterator<Pair<T, P>> for Punctuated<T, P>

source§

fn from_iter<I: IntoIterator<Item = Pair<T, P>>>(i: I) -> Self

Creates a value from an iterator. Read more
source§

impl<T, P> FromIterator<T> for Punctuated<T, P>
where + P: Default,

source§

fn from_iter<I: IntoIterator<Item = T>>(i: I) -> Self

Creates a value from an iterator. Read more
source§

impl<T, P> Index<usize> for Punctuated<T, P>

§

type Output = T

The returned type after indexing.
source§

fn index(&self, index: usize) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
source§

impl<T, P> IndexMut<usize> for Punctuated<T, P>

source§

fn index_mut(&mut self, index: usize) -> &mut Self::Output

Performs the mutable indexing (container[index]) operation. Read more
source§

impl<'a, T, P> IntoIterator for &'a Punctuated<T, P>

§

type Item = &'a T

The type of the elements being iterated over.
§

type IntoIter = Iter<'a, T>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl<'a, T, P> IntoIterator for &'a mut Punctuated<T, P>

§

type Item = &'a mut T

The type of the elements being iterated over.
§

type IntoIter = IterMut<'a, T>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl<T, P> IntoIterator for Punctuated<T, P>

§

type Item = T

The type of the elements being iterated over.
§

type IntoIter = IntoIter<T>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl<T, P> ToTokens for Punctuated<T, P>
where + T: ToTokens, + P: ToTokens,

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

§

impl<T, P> Freeze for Punctuated<T, P>

§

impl<T, P> RefUnwindSafe for Punctuated<T, P>
where + T: RefUnwindSafe, + P: RefUnwindSafe,

§

impl<T, P> Send for Punctuated<T, P>
where + T: Send, + P: Send,

§

impl<T, P> Sync for Punctuated<T, P>
where + T: Sync, + P: Sync,

§

impl<T, P> Unpin for Punctuated<T, P>
where + T: Unpin, + P: Unpin,

§

impl<T, P> UnwindSafe for Punctuated<T, P>
where + T: UnwindSafe, + P: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/restriction/enum.FieldMutability.html b/syn/restriction/enum.FieldMutability.html new file mode 100644 index 0000000..2e39910 --- /dev/null +++ b/syn/restriction/enum.FieldMutability.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/enum.FieldMutability.html...

+ + + \ No newline at end of file diff --git a/syn/restriction/enum.Visibility.html b/syn/restriction/enum.Visibility.html new file mode 100644 index 0000000..e8f3232 --- /dev/null +++ b/syn/restriction/enum.Visibility.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/enum.Visibility.html...

+ + + \ No newline at end of file diff --git a/syn/restriction/struct.VisRestricted.html b/syn/restriction/struct.VisRestricted.html new file mode 100644 index 0000000..a1537b5 --- /dev/null +++ b/syn/restriction/struct.VisRestricted.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.VisRestricted.html...

+ + + \ No newline at end of file diff --git a/syn/sidebar-items.js b/syn/sidebar-items.js new file mode 100644 index 0000000..7584eb4 --- /dev/null +++ b/syn/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["AttrStyle","BinOp","Data","Expr","FieldMutability","Fields","FnArg","ForeignItem","GenericArgument","GenericParam","ImplItem","ImplRestriction","Item","Lit","MacroDelimiter","Member","Meta","Pat","PathArguments","RangeLimits","ReturnType","StaticMutability","Stmt","TraitBoundModifier","TraitItem","Type","TypeParamBound","UnOp","UseTree","Visibility","WherePredicate"],"fn":["parse","parse2","parse_file","parse_str"],"macro":["Token","braced","bracketed","custom_keyword","custom_punctuation","parenthesized","parse_macro_input","parse_quote","parse_quote_spanned"],"mod":["buffer","ext","meta","parse","punctuated","spanned","token"],"struct":["Abi","AngleBracketedGenericArguments","Arm","AssocConst","AssocType","Attribute","BareFnArg","BareVariadic","Block","BoundLifetimes","ConstParam","Constraint","DataEnum","DataStruct","DataUnion","DeriveInput","Error","ExprArray","ExprAssign","ExprAsync","ExprAwait","ExprBinary","ExprBlock","ExprBreak","ExprCall","ExprCast","ExprClosure","ExprConst","ExprContinue","ExprField","ExprForLoop","ExprGroup","ExprIf","ExprIndex","ExprInfer","ExprLet","ExprLit","ExprLoop","ExprMacro","ExprMatch","ExprMethodCall","ExprParen","ExprPath","ExprRange","ExprReference","ExprRepeat","ExprReturn","ExprStruct","ExprTry","ExprTryBlock","ExprTuple","ExprUnary","ExprUnsafe","ExprWhile","ExprYield","Field","FieldPat","FieldValue","FieldsNamed","FieldsUnnamed","File","ForeignItemFn","ForeignItemMacro","ForeignItemStatic","ForeignItemType","Generics","Ident","ImplGenerics","ImplItemConst","ImplItemFn","ImplItemMacro","ImplItemType","Index","ItemConst","ItemEnum","ItemExternCrate","ItemFn","ItemForeignMod","ItemImpl","ItemMacro","ItemMod","ItemStatic","ItemStruct","ItemTrait","ItemTraitAlias","ItemType","ItemUnion","ItemUse","Label","Lifetime","LifetimeParam","LitBool","LitByte","LitByteStr","LitCStr","LitChar","LitFloat","LitInt","LitStr","Local","LocalInit","Macro","MetaList","MetaNameValue","ParenthesizedGenericArguments","PatConst","PatIdent","PatLit","PatMacro","PatOr","PatParen","PatPath","PatRange","PatReference","PatRest","PatSlice","PatStruct","PatTuple","PatTupleStruct","PatType","PatWild","Path","PathSegment","PredicateLifetime","PredicateType","QSelf","Receiver","Signature","StmtMacro","TraitBound","TraitItemConst","TraitItemFn","TraitItemMacro","TraitItemType","Turbofish","TypeArray","TypeBareFn","TypeGenerics","TypeGroup","TypeImplTrait","TypeInfer","TypeMacro","TypeNever","TypeParam","TypeParen","TypePath","TypePtr","TypeReference","TypeSlice","TypeTraitObject","TypeTuple","UseGlob","UseGroup","UseName","UsePath","UseRename","Variadic","Variant","VisRestricted","WhereClause"],"type":["Result"]}; \ No newline at end of file diff --git a/syn/spanned/index.html b/syn/spanned/index.html new file mode 100644 index 0000000..bfdf1ad --- /dev/null +++ b/syn/spanned/index.html @@ -0,0 +1,52 @@ +syn::spanned - Rust

Module syn::spanned

source ·
Expand description

A trait that can provide the Span of the complete contents of a syntax +tree node.

+
+

§Example

+

Suppose in a procedural macro we have a Type that we want to assert +implements the Sync trait. Maybe this is the type of one of the fields +of a struct for which we are deriving a trait implementation, and we need to +be able to pass a reference to one of those fields across threads.

+

If the field type does not implement Sync as required, we want the +compiler to report an error pointing out exactly which type it was.

+

The following macro code takes a variable ty of type Type and produces a +static assertion that Sync is implemented for that type.

+ +
use proc_macro::TokenStream;
+use proc_macro2::Span;
+use quote::quote_spanned;
+use syn::Type;
+use syn::spanned::Spanned;
+
+#[proc_macro_derive(MyMacro)]
+pub fn my_macro(input: TokenStream) -> TokenStream {
+    /* ... */
+
+    let assert_sync = quote_spanned! {ty.span()=>
+        struct _AssertSync where #ty: Sync;
+    };
+
+    /* ... */
+}
+

By inserting this assert_sync fragment into the output code generated by +our macro, the user’s code will fail to compile if ty does not implement +Sync. The errors they would see look like the following.

+
error[E0277]: the trait bound `*const i32: std::marker::Sync` is not satisfied
+  --> src/main.rs:10:21
+   |
+10 |     bad_field: *const i32,
+   |                ^^^^^^^^^^ `*const i32` cannot be shared between threads safely
+
+

In this technique, using the Type’s span for the error message makes the +error appear in the correct place underlining the right type.

+
+

§Limitations

+

The underlying proc_macro::Span::join method is nightly-only. When +called from within a procedural macro in a nightly compiler, Spanned will +use join to produce the intended span. When not using a nightly compiler, +only the span of the first token of the syntax tree node is returned.

+

In the common case of wanting to use the joined span as the span of a +syn::Error, consider instead using syn::Error::new_spanned which is +able to span the error correctly under the complete syntax tree node without +needing the unstable join.

+

Traits§

  • A trait that can provide the Span of the complete contents of a syntax +tree node.
\ No newline at end of file diff --git a/syn/spanned/sidebar-items.js b/syn/spanned/sidebar-items.js new file mode 100644 index 0000000..34f8fb6 --- /dev/null +++ b/syn/spanned/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"trait":["Spanned"]}; \ No newline at end of file diff --git a/syn/spanned/trait.Spanned.html b/syn/spanned/trait.Spanned.html new file mode 100644 index 0000000..7f3feae --- /dev/null +++ b/syn/spanned/trait.Spanned.html @@ -0,0 +1,11 @@ +Spanned in syn::spanned - Rust

Trait syn::spanned::Spanned

source ·
pub trait Spanned: Sealed {
+    // Required method
+    fn span(&self) -> Span;
+}
Expand description

A trait that can provide the Span of the complete contents of a syntax +tree node.

+

This trait is automatically implemented for all types that implement +ToTokens from the quote crate, as well as for Span itself.

+

See the module documentation for an example.

+

Required Methods§

source

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.

+

Implementors§

source§

impl Spanned for QSelf

source§

impl<T: ?Sized + ToTokens> Spanned for T

\ No newline at end of file diff --git a/syn/stmt/enum.Stmt.html b/syn/stmt/enum.Stmt.html new file mode 100644 index 0000000..d381e12 --- /dev/null +++ b/syn/stmt/enum.Stmt.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/enum.Stmt.html...

+ + + \ No newline at end of file diff --git a/syn/stmt/struct.Block.html b/syn/stmt/struct.Block.html new file mode 100644 index 0000000..9c0dbfe --- /dev/null +++ b/syn/stmt/struct.Block.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.Block.html...

+ + + \ No newline at end of file diff --git a/syn/stmt/struct.Local.html b/syn/stmt/struct.Local.html new file mode 100644 index 0000000..d490f64 --- /dev/null +++ b/syn/stmt/struct.Local.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.Local.html...

+ + + \ No newline at end of file diff --git a/syn/stmt/struct.LocalInit.html b/syn/stmt/struct.LocalInit.html new file mode 100644 index 0000000..1f37963 --- /dev/null +++ b/syn/stmt/struct.LocalInit.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.LocalInit.html...

+ + + \ No newline at end of file diff --git a/syn/stmt/struct.StmtMacro.html b/syn/stmt/struct.StmtMacro.html new file mode 100644 index 0000000..8003874 --- /dev/null +++ b/syn/stmt/struct.StmtMacro.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.StmtMacro.html...

+ + + \ No newline at end of file diff --git a/syn/struct.Abi.html b/syn/struct.Abi.html new file mode 100644 index 0000000..78d6295 --- /dev/null +++ b/syn/struct.Abi.html @@ -0,0 +1,19 @@ +Abi in syn - Rust

Struct syn::Abi

source ·
pub struct Abi {
+    pub extern_token: Extern,
+    pub name: Option<LitStr>,
+}
Expand description

The binary interface of a function: extern "C".

+

Fields§

§extern_token: Extern§name: Option<LitStr>

Trait Implementations§

source§

impl Clone for Abi

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Parse for Abi

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for Abi

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

§

impl Freeze for Abi

§

impl RefUnwindSafe for Abi

§

impl !Send for Abi

§

impl !Sync for Abi

§

impl Unpin for Abi

§

impl UnwindSafe for Abi

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.AngleBracketedGenericArguments.html b/syn/struct.AngleBracketedGenericArguments.html new file mode 100644 index 0000000..50b6c4a --- /dev/null +++ b/syn/struct.AngleBracketedGenericArguments.html @@ -0,0 +1,24 @@ +AngleBracketedGenericArguments in syn - Rust

Struct syn::AngleBracketedGenericArguments

source ·
pub struct AngleBracketedGenericArguments {
+    pub colon2_token: Option<PathSep>,
+    pub lt_token: Lt,
+    pub args: Punctuated<GenericArgument, Comma>,
+    pub gt_token: Gt,
+}
Expand description

Angle bracketed arguments of a path segment: the <K, V> in HashMap<K, V>.

+

Fields§

§colon2_token: Option<PathSep>§lt_token: Lt§args: Punctuated<GenericArgument, Comma>§gt_token: Gt

Implementations§

source§

impl AngleBracketedGenericArguments

source

pub fn parse_turbofish(input: ParseStream<'_>) -> Result<Self>

Parse ::<…> with mandatory leading ::.

+

The ordinary Parse impl for AngleBracketedGenericArguments +parses optional leading ::.

+

Trait Implementations§

source§

impl Clone for AngleBracketedGenericArguments

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Parse for AngleBracketedGenericArguments

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for AngleBracketedGenericArguments

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.Arm.html b/syn/struct.Arm.html new file mode 100644 index 0000000..6100ff1 --- /dev/null +++ b/syn/struct.Arm.html @@ -0,0 +1,31 @@ +Arm in syn - Rust

Struct syn::Arm

source ·
pub struct Arm {
+    pub attrs: Vec<Attribute>,
+    pub pat: Pat,
+    pub guard: Option<(If, Box<Expr>)>,
+    pub fat_arrow_token: FatArrow,
+    pub body: Box<Expr>,
+    pub comma: Option<Comma>,
+}
Expand description

One arm of a match expression: 0..=10 => { return true; }.

+

As in:

+ +
match n {
+    0..=10 => {
+        return true;
+    }
+    // ...
+}
+

Fields§

§attrs: Vec<Attribute>§pat: Pat§guard: Option<(If, Box<Expr>)>§fat_arrow_token: FatArrow§body: Box<Expr>§comma: Option<Comma>

Trait Implementations§

source§

impl Clone for Arm

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Parse for Arm

source§

fn parse(input: ParseStream<'_>) -> Result<Arm>

source§

impl ToTokens for Arm

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

§

impl Freeze for Arm

§

impl RefUnwindSafe for Arm

§

impl !Send for Arm

§

impl !Sync for Arm

§

impl Unpin for Arm

§

impl UnwindSafe for Arm

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.AssocConst.html b/syn/struct.AssocConst.html new file mode 100644 index 0000000..7f9ba31 --- /dev/null +++ b/syn/struct.AssocConst.html @@ -0,0 +1,22 @@ +AssocConst in syn - Rust

Struct syn::AssocConst

source ·
pub struct AssocConst {
+    pub ident: Ident,
+    pub generics: Option<AngleBracketedGenericArguments>,
+    pub eq_token: Eq,
+    pub value: Expr,
+}
Expand description

An equality constraint on an associated constant: the PANIC = false in +Trait<PANIC = false>.

+

Fields§

§ident: Ident§generics: Option<AngleBracketedGenericArguments>§eq_token: Eq§value: Expr

Trait Implementations§

source§

impl Clone for AssocConst

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl ToTokens for AssocConst

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.AssocType.html b/syn/struct.AssocType.html new file mode 100644 index 0000000..6add77d --- /dev/null +++ b/syn/struct.AssocType.html @@ -0,0 +1,22 @@ +AssocType in syn - Rust

Struct syn::AssocType

source ·
pub struct AssocType {
+    pub ident: Ident,
+    pub generics: Option<AngleBracketedGenericArguments>,
+    pub eq_token: Eq,
+    pub ty: Type,
+}
Expand description

A binding (equality constraint) on an associated type: the Item = u8 +in Iterator<Item = u8>.

+

Fields§

§ident: Ident§generics: Option<AngleBracketedGenericArguments>§eq_token: Eq§ty: Type

Trait Implementations§

source§

impl Clone for AssocType

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl ToTokens for AssocType

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.Attribute.html b/syn/struct.Attribute.html new file mode 100644 index 0000000..5cbac46 --- /dev/null +++ b/syn/struct.Attribute.html @@ -0,0 +1,299 @@ +Attribute in syn - Rust

Struct syn::Attribute

source ·
pub struct Attribute {
+    pub pound_token: Pound,
+    pub style: AttrStyle,
+    pub bracket_token: Bracket,
+    pub meta: Meta,
+}
Expand description

An attribute, like #[repr(transparent)].

+
+

§Syntax

+

Rust has six types of attributes.

+
    +
  • +

    Outer attributes like #[repr(transparent)]. These appear outside or +in front of the item they describe.

    +
  • +
  • +

    Inner attributes like #![feature(proc_macro)]. These appear inside +of the item they describe, usually a module.

    +
  • +
  • +

    Outer one-line doc comments like /// Example.

    +
  • +
  • +

    Inner one-line doc comments like //! Please file an issue.

    +
  • +
  • +

    Outer documentation blocks /** Example */.

    +
  • +
  • +

    Inner documentation blocks /*! Please file an issue */.

    +
  • +
+

The style field of type AttrStyle distinguishes whether an attribute +is outer or inner.

+

Every attribute has a path that indicates the intended interpretation +of the rest of the attribute’s contents. The path and the optional +additional contents are represented together in the meta field of the +attribute in three possible varieties:

+
    +
  • +

    Meta::Path — attributes whose information content conveys just a +path, for example the #[test] attribute.

    +
  • +
  • +

    Meta::List — attributes that carry arbitrary tokens after the +path, surrounded by a delimiter (parenthesis, bracket, or brace). For +example #[derive(Copy)] or #[precondition(x < 5)].

    +
  • +
  • +

    Meta::NameValue — attributes with an = sign after the path, +followed by a Rust expression. For example #[path = "sys/windows.rs"].

    +
  • +
+

All doc comments are represented in the NameValue style with a path of +“doc”, as this is how they are processed by the compiler and by +macro_rules! macros.

+
#[derive(Copy, Clone)]
+  ~~~~~~Path
+  ^^^^^^^^^^^^^^^^^^^Meta::List
+
+#[path = "sys/windows.rs"]
+  ~~~~Path
+  ^^^^^^^^^^^^^^^^^^^^^^^Meta::NameValue
+
+#[test]
+  ^^^^Meta::Path
+

+

§Parsing from tokens to Attribute

+

This type does not implement the Parse trait and thus cannot be +parsed directly by ParseStream::parse. Instead use +ParseStream::call with one of the two parser functions +Attribute::parse_outer or Attribute::parse_inner depending on +which you intend to parse.

+ +
use syn::{Attribute, Ident, Result, Token};
+use syn::parse::{Parse, ParseStream};
+
+// Parses a unit struct with attributes.
+//
+//     #[path = "s.tmpl"]
+//     struct S;
+struct UnitStruct {
+    attrs: Vec<Attribute>,
+    struct_token: Token![struct],
+    name: Ident,
+    semi_token: Token![;],
+}
+
+impl Parse for UnitStruct {
+    fn parse(input: ParseStream) -> Result<Self> {
+        Ok(UnitStruct {
+            attrs: input.call(Attribute::parse_outer)?,
+            struct_token: input.parse()?,
+            name: input.parse()?,
+            semi_token: input.parse()?,
+        })
+    }
+}
+


+

§Parsing from Attribute to structured arguments

+

The grammar of attributes in Rust is very flexible, which makes the +syntax tree not that useful on its own. In particular, arguments of the +Meta::List variety of attribute are held in an arbitrary tokens: TokenStream. Macros are expected to check the path of the attribute, +decide whether they recognize it, and then parse the remaining tokens +according to whatever grammar they wish to require for that kind of +attribute. Use parse_args() to parse those tokens into the expected +data structure.

+


+

§Doc comments

+

The compiler transforms doc comments, such as /// comment and /*! comment */, into attributes before macros are expanded. Each comment is +expanded into an attribute of the form #[doc = r"comment"].

+

As an example, the following mod items are expanded identically:

+ +
let doc: ItemMod = parse_quote! {
+    /// Single line doc comments
+    /// We write so many!
+    /**
+     * Multi-line comments...
+     * May span many lines
+     */
+    mod example {
+        //! Of course, they can be inner too
+        /*! And fit in a single line */
+    }
+};
+let attr: ItemMod = parse_quote! {
+    #[doc = r" Single line doc comments"]
+    #[doc = r" We write so many!"]
+    #[doc = r"
+     * Multi-line comments...
+     * May span many lines
+     "]
+    mod example {
+        #![doc = r" Of course, they can be inner too"]
+        #![doc = r" And fit in a single line "]
+    }
+};
+assert_eq!(doc, attr);
+

Fields§

§pound_token: Pound§style: AttrStyle§bracket_token: Bracket§meta: Meta

Implementations§

source§

impl Attribute

source

pub fn path(&self) -> &Path

Returns the path that identifies the interpretation of this attribute.

+

For example this would return the test in #[test], the derive in +#[derive(Copy)], and the path in #[path = "sys/windows.rs"].

+
source

pub fn parse_args<T: Parse>(&self) -> Result<T>

Parse the arguments to the attribute as a syntax tree.

+

This is similar to pulling out the TokenStream from Meta::List and +doing syn::parse2::<T>(meta_list.tokens), except that using +parse_args the error message has a more useful span when tokens is +empty.

+

The surrounding delimiters are not included in the input to the +parser.

+
#[my_attr(value < 5)]
+          ^^^^^^^^^ what gets parsed
+
§Example
+
use syn::{parse_quote, Attribute, Expr};
+
+let attr: Attribute = parse_quote! {
+    #[precondition(value < 5)]
+};
+
+if attr.path().is_ident("precondition") {
+    let precondition: Expr = attr.parse_args()?;
+    // ...
+}
+
source

pub fn parse_args_with<F: Parser>(&self, parser: F) -> Result<F::Output>

Parse the arguments to the attribute using the given parser.

+
§Example
+
use syn::{parse_quote, Attribute};
+
+let attr: Attribute = parse_quote! {
+    #[inception { #[brrrrrrraaaaawwwwrwrrrmrmrmmrmrmmmmm] }]
+};
+
+let bwom = attr.parse_args_with(Attribute::parse_outer)?;
+
+// Attribute does not have a Parse impl, so we couldn't directly do:
+// let bwom: Attribute = attr.parse_args()?;
+
source

pub fn parse_nested_meta( + &self, + logic: impl FnMut(ParseNestedMeta<'_>) -> Result<()> +) -> Result<()>

Parse the arguments to the attribute, expecting it to follow the +conventional structure used by most of Rust’s built-in attributes.

+

The Meta Item Attribute Syntax section in the Rust reference +explains the convention in more detail. Not all attributes follow this +convention, so parse_args() is available if you +need to parse arbitrarily goofy attribute syntax.

+
§Example
+

We’ll parse a struct, and then parse some of Rust’s #[repr] attribute +syntax.

+ +
use syn::{parenthesized, parse_quote, token, ItemStruct, LitInt};
+
+let input: ItemStruct = parse_quote! {
+    #[repr(C, align(4))]
+    pub struct MyStruct(u16, u32);
+};
+
+let mut repr_c = false;
+let mut repr_transparent = false;
+let mut repr_align = None::<usize>;
+let mut repr_packed = None::<usize>;
+for attr in &input.attrs {
+    if attr.path().is_ident("repr") {
+        attr.parse_nested_meta(|meta| {
+            // #[repr(C)]
+            if meta.path.is_ident("C") {
+                repr_c = true;
+                return Ok(());
+            }
+
+            // #[repr(transparent)]
+            if meta.path.is_ident("transparent") {
+                repr_transparent = true;
+                return Ok(());
+            }
+
+            // #[repr(align(N))]
+            if meta.path.is_ident("align") {
+                let content;
+                parenthesized!(content in meta.input);
+                let lit: LitInt = content.parse()?;
+                let n: usize = lit.base10_parse()?;
+                repr_align = Some(n);
+                return Ok(());
+            }
+
+            // #[repr(packed)] or #[repr(packed(N))], omitted N means 1
+            if meta.path.is_ident("packed") {
+                if meta.input.peek(token::Paren) {
+                    let content;
+                    parenthesized!(content in meta.input);
+                    let lit: LitInt = content.parse()?;
+                    let n: usize = lit.base10_parse()?;
+                    repr_packed = Some(n);
+                } else {
+                    repr_packed = Some(1);
+                }
+                return Ok(());
+            }
+
+            Err(meta.error("unrecognized repr"))
+        })?;
+    }
+}
+
§Alternatives
+

In some cases, for attributes which have nested layers of structured +content, the following less flexible approach might be more convenient:

+ +
use syn::punctuated::Punctuated;
+use syn::{parenthesized, token, Error, LitInt, Meta, Token};
+
+let mut repr_c = false;
+let mut repr_transparent = false;
+let mut repr_align = None::<usize>;
+let mut repr_packed = None::<usize>;
+for attr in &input.attrs {
+    if attr.path().is_ident("repr") {
+        let nested = attr.parse_args_with(Punctuated::<Meta, Token![,]>::parse_terminated)?;
+        for meta in nested {
+            match meta {
+                // #[repr(C)]
+                Meta::Path(path) if path.is_ident("C") => {
+                    repr_c = true;
+                }
+
+                // #[repr(align(N))]
+                Meta::List(meta) if meta.path.is_ident("align") => {
+                    let lit: LitInt = meta.parse_args()?;
+                    let n: usize = lit.base10_parse()?;
+                    repr_align = Some(n);
+                }
+
+                /* ... */
+
+                _ => {
+                    return Err(Error::new_spanned(meta, "unrecognized repr"));
+                }
+            }
+        }
+    }
+}
+
source

pub fn parse_outer(input: ParseStream<'_>) -> Result<Vec<Self>>

Parses zero or more outer attributes from the stream.

+
§Example
+

See +Parsing from tokens to Attribute.

+
source

pub fn parse_inner(input: ParseStream<'_>) -> Result<Vec<Self>>

Parses zero or more inner attributes from the stream.

+
§Example
+

See +Parsing from tokens to Attribute.

+

Trait Implementations§

source§

impl Clone for Attribute

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl ToTokens for Attribute

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.BareFnArg.html b/syn/struct.BareFnArg.html new file mode 100644 index 0000000..e435c7e --- /dev/null +++ b/syn/struct.BareFnArg.html @@ -0,0 +1,20 @@ +BareFnArg in syn - Rust

Struct syn::BareFnArg

source ·
pub struct BareFnArg {
+    pub attrs: Vec<Attribute>,
+    pub name: Option<(Ident, Colon)>,
+    pub ty: Type,
+}
Expand description

An argument in a function type: the usize in fn(usize) -> bool.

+

Fields§

§attrs: Vec<Attribute>§name: Option<(Ident, Colon)>§ty: Type

Trait Implementations§

source§

impl Clone for BareFnArg

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Parse for BareFnArg

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for BareFnArg

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.BareVariadic.html b/syn/struct.BareVariadic.html new file mode 100644 index 0000000..1ad8bbb --- /dev/null +++ b/syn/struct.BareVariadic.html @@ -0,0 +1,21 @@ +BareVariadic in syn - Rust

Struct syn::BareVariadic

source ·
pub struct BareVariadic {
+    pub attrs: Vec<Attribute>,
+    pub name: Option<(Ident, Colon)>,
+    pub dots: DotDotDot,
+    pub comma: Option<Comma>,
+}
Expand description

The variadic argument of a function pointer like fn(usize, ...).

+

Fields§

§attrs: Vec<Attribute>§name: Option<(Ident, Colon)>§dots: DotDotDot§comma: Option<Comma>

Trait Implementations§

source§

impl Clone for BareVariadic

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl ToTokens for BareVariadic

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.Block.html b/syn/struct.Block.html new file mode 100644 index 0000000..fea8940 --- /dev/null +++ b/syn/struct.Block.html @@ -0,0 +1,65 @@ +Block in syn - Rust

Struct syn::Block

source ·
pub struct Block {
+    pub brace_token: Brace,
+    pub stmts: Vec<Stmt>,
+}
Expand description

A braced block containing Rust statements.

+

Fields§

§brace_token: Brace§stmts: Vec<Stmt>

Statements in a block

+

Implementations§

source§

impl Block

source

pub fn parse_within(input: ParseStream<'_>) -> Result<Vec<Stmt>>

Parse the body of a block as zero or more statements, possibly +including one trailing expression.

+
§Example
+
use syn::{braced, token, Attribute, Block, Ident, Result, Stmt, Token};
+use syn::parse::{Parse, ParseStream};
+
+// Parse a function with no generics or parameter list.
+//
+//     fn playground {
+//         let mut x = 1;
+//         x += 1;
+//         println!("{}", x);
+//     }
+struct MiniFunction {
+    attrs: Vec<Attribute>,
+    fn_token: Token![fn],
+    name: Ident,
+    brace_token: token::Brace,
+    stmts: Vec<Stmt>,
+}
+
+impl Parse for MiniFunction {
+    fn parse(input: ParseStream) -> Result<Self> {
+        let outer_attrs = input.call(Attribute::parse_outer)?;
+        let fn_token: Token![fn] = input.parse()?;
+        let name: Ident = input.parse()?;
+
+        let content;
+        let brace_token = braced!(content in input);
+        let inner_attrs = content.call(Attribute::parse_inner)?;
+        let stmts = content.call(Block::parse_within)?;
+
+        Ok(MiniFunction {
+            attrs: {
+                let mut attrs = outer_attrs;
+                attrs.extend(inner_attrs);
+                attrs
+            },
+            fn_token,
+            name,
+            brace_token,
+            stmts,
+        })
+    }
+}
+

Trait Implementations§

source§

impl Clone for Block

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Parse for Block

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for Block

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

§

impl Freeze for Block

§

impl RefUnwindSafe for Block

§

impl !Send for Block

§

impl !Sync for Block

§

impl Unpin for Block

§

impl UnwindSafe for Block

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.BoundLifetimes.html b/syn/struct.BoundLifetimes.html new file mode 100644 index 0000000..72a340a --- /dev/null +++ b/syn/struct.BoundLifetimes.html @@ -0,0 +1,21 @@ +BoundLifetimes in syn - Rust

Struct syn::BoundLifetimes

source ·
pub struct BoundLifetimes {
+    pub for_token: For,
+    pub lt_token: Lt,
+    pub lifetimes: Punctuated<GenericParam, Comma>,
+    pub gt_token: Gt,
+}
Expand description

A set of bound lifetimes: for<'a, 'b, 'c>.

+

Fields§

§for_token: For§lt_token: Lt§lifetimes: Punctuated<GenericParam, Comma>§gt_token: Gt

Trait Implementations§

source§

impl Clone for BoundLifetimes

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for BoundLifetimes

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Parse for BoundLifetimes

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for BoundLifetimes

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.ConstParam.html b/syn/struct.ConstParam.html new file mode 100644 index 0000000..fa71d4f --- /dev/null +++ b/syn/struct.ConstParam.html @@ -0,0 +1,24 @@ +ConstParam in syn - Rust

Struct syn::ConstParam

source ·
pub struct ConstParam {
+    pub attrs: Vec<Attribute>,
+    pub const_token: Const,
+    pub ident: Ident,
+    pub colon_token: Colon,
+    pub ty: Type,
+    pub eq_token: Option<Eq>,
+    pub default: Option<Expr>,
+}
Expand description

A const generic parameter: const LENGTH: usize.

+

Fields§

§attrs: Vec<Attribute>§const_token: Const§ident: Ident§colon_token: Colon§ty: Type§eq_token: Option<Eq>§default: Option<Expr>

Trait Implementations§

source§

impl Clone for ConstParam

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<ConstParam> for GenericParam

source§

fn from(e: ConstParam) -> GenericParam

Converts to this type from the input type.
source§

impl Parse for ConstParam

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for ConstParam

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.Constraint.html b/syn/struct.Constraint.html new file mode 100644 index 0000000..9ea495c --- /dev/null +++ b/syn/struct.Constraint.html @@ -0,0 +1,21 @@ +Constraint in syn - Rust

Struct syn::Constraint

source ·
pub struct Constraint {
+    pub ident: Ident,
+    pub generics: Option<AngleBracketedGenericArguments>,
+    pub colon_token: Colon,
+    pub bounds: Punctuated<TypeParamBound, Plus>,
+}
Expand description

An associated type bound: Iterator<Item: Display>.

+

Fields§

§ident: Ident§generics: Option<AngleBracketedGenericArguments>§colon_token: Colon§bounds: Punctuated<TypeParamBound, Plus>

Trait Implementations§

source§

impl Clone for Constraint

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl ToTokens for Constraint

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.DataEnum.html b/syn/struct.DataEnum.html new file mode 100644 index 0000000..9e8e365 --- /dev/null +++ b/syn/struct.DataEnum.html @@ -0,0 +1,17 @@ +DataEnum in syn - Rust

Struct syn::DataEnum

source ·
pub struct DataEnum {
+    pub enum_token: Enum,
+    pub brace_token: Brace,
+    pub variants: Punctuated<Variant, Comma>,
+}
Expand description

An enum input to a proc_macro_derive macro.

+

Fields§

§enum_token: Enum§brace_token: Brace§variants: Punctuated<Variant, Comma>

Trait Implementations§

source§

impl Clone for DataEnum

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.DataStruct.html b/syn/struct.DataStruct.html new file mode 100644 index 0000000..5f1e2a7 --- /dev/null +++ b/syn/struct.DataStruct.html @@ -0,0 +1,17 @@ +DataStruct in syn - Rust

Struct syn::DataStruct

source ·
pub struct DataStruct {
+    pub struct_token: Struct,
+    pub fields: Fields,
+    pub semi_token: Option<Semi>,
+}
Expand description

A struct input to a proc_macro_derive macro.

+

Fields§

§struct_token: Struct§fields: Fields§semi_token: Option<Semi>

Trait Implementations§

source§

impl Clone for DataStruct

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.DataUnion.html b/syn/struct.DataUnion.html new file mode 100644 index 0000000..0b2f8c3 --- /dev/null +++ b/syn/struct.DataUnion.html @@ -0,0 +1,16 @@ +DataUnion in syn - Rust

Struct syn::DataUnion

source ·
pub struct DataUnion {
+    pub union_token: Union,
+    pub fields: FieldsNamed,
+}
Expand description

An untagged union input to a proc_macro_derive macro.

+

Fields§

§union_token: Union§fields: FieldsNamed

Trait Implementations§

source§

impl Clone for DataUnion

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.DeriveInput.html b/syn/struct.DeriveInput.html new file mode 100644 index 0000000..b348aec --- /dev/null +++ b/syn/struct.DeriveInput.html @@ -0,0 +1,22 @@ +DeriveInput in syn - Rust

Struct syn::DeriveInput

source ·
pub struct DeriveInput {
+    pub attrs: Vec<Attribute>,
+    pub vis: Visibility,
+    pub ident: Ident,
+    pub generics: Generics,
+    pub data: Data,
+}
Expand description

Data structure sent to a proc_macro_derive macro.

+

Fields§

§attrs: Vec<Attribute>§vis: Visibility§ident: Ident§generics: Generics§data: Data

Trait Implementations§

source§

impl Clone for DeriveInput

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<DeriveInput> for Item

source§

fn from(input: DeriveInput) -> Item

Converts to this type from the input type.
source§

impl From<ItemEnum> for DeriveInput

source§

fn from(input: ItemEnum) -> DeriveInput

Converts to this type from the input type.
source§

impl From<ItemStruct> for DeriveInput

source§

fn from(input: ItemStruct) -> DeriveInput

Converts to this type from the input type.
source§

impl From<ItemUnion> for DeriveInput

source§

fn from(input: ItemUnion) -> DeriveInput

Converts to this type from the input type.
source§

impl Parse for DeriveInput

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for DeriveInput

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.Error.html b/syn/struct.Error.html new file mode 100644 index 0000000..c862a81 --- /dev/null +++ b/syn/struct.Error.html @@ -0,0 +1,120 @@ +Error in syn - Rust

Struct syn::Error

source ·
pub struct Error { /* private fields */ }
Expand description

Error returned when a Syn parser cannot parse the input tokens.

+

§Error reporting in proc macros

+

The correct way to report errors back to the compiler from a procedural +macro is by emitting an appropriately spanned invocation of +compile_error! in the generated code. This produces a better diagnostic +message than simply panicking the macro.

+

When parsing macro input, the parse_macro_input! macro handles the +conversion to compile_error! automatically.

+ +
use proc_macro::TokenStream;
+use syn::parse::{Parse, ParseStream, Result};
+use syn::{parse_macro_input, ItemFn};
+
+#[proc_macro_attribute]
+pub fn my_attr(args: TokenStream, input: TokenStream) -> TokenStream {
+    let args = parse_macro_input!(args as MyAttrArgs);
+    let input = parse_macro_input!(input as ItemFn);
+
+    /* ... */
+}
+
+struct MyAttrArgs {
+    ...
+}
+
+impl Parse for MyAttrArgs {
+    fn parse(input: ParseStream) -> Result<Self> {
+        ...
+    }
+}
+

For errors that arise later than the initial parsing stage, the +.to_compile_error() or .into_compile_error() methods can be used to +perform an explicit conversion to compile_error!.

+ +
#[proc_macro_derive(MyDerive)]
+pub fn my_derive(input: TokenStream) -> TokenStream {
+    let input = parse_macro_input!(input as DeriveInput);
+
+    // fn(DeriveInput) -> syn::Result<proc_macro2::TokenStream>
+    expand::my_derive(input)
+        .unwrap_or_else(syn::Error::into_compile_error)
+        .into()
+}
+

Implementations§

source§

impl Error

source

pub fn new<T: Display>(span: Span, message: T) -> Self

Usually the ParseStream::error method will be used instead, which +automatically uses the correct span from the current position of the +parse stream.

+

Use Error::new when the error needs to be triggered on some span other +than where the parse stream is currently positioned.

+
§Example
+
use syn::{Error, Ident, LitStr, Result, Token};
+use syn::parse::ParseStream;
+
+// Parses input that looks like `name = "string"` where the key must be
+// the identifier `name` and the value may be any string literal.
+// Returns the string literal.
+fn parse_name(input: ParseStream) -> Result<LitStr> {
+    let name_token: Ident = input.parse()?;
+    if name_token != "name" {
+        // Trigger an error not on the current position of the stream,
+        // but on the position of the unexpected identifier.
+        return Err(Error::new(name_token.span(), "expected `name`"));
+    }
+    input.parse::<Token![=]>()?;
+    let s: LitStr = input.parse()?;
+    Ok(s)
+}
+
source

pub fn new_spanned<T: ToTokens, U: Display>(tokens: T, message: U) -> Self

Creates an error with the specified message spanning the given syntax +tree node.

+

Unlike the Error::new constructor, this constructor takes an argument +tokens which is a syntax tree node. This allows the resulting Error +to attempt to span all tokens inside of tokens. While you would +typically be able to use the Spanned trait with the above Error::new +constructor, implementation limitations today mean that +Error::new_spanned may provide a higher-quality error message on +stable Rust.

+

When in doubt it’s recommended to stick to Error::new (or +ParseStream::error)!

+
source

pub fn span(&self) -> Span

The source location of the error.

+

Spans are not thread-safe so this function returns Span::call_site() +if called from a different thread than the one on which the Error was +originally created.

+
source

pub fn to_compile_error(&self) -> TokenStream

Render the error as an invocation of compile_error!.

+

The parse_macro_input! macro provides a convenient way to invoke +this method correctly in a procedural macro.

+
source

pub fn into_compile_error(self) -> TokenStream

Render the error as an invocation of compile_error!.

+
§Example
+
use proc_macro::TokenStream;
+use syn::{parse_macro_input, DeriveInput, Error};
+
+#[proc_macro_derive(MyTrait)]
+pub fn derive_my_trait(input: TokenStream) -> TokenStream {
+    let input = parse_macro_input!(input as DeriveInput);
+    my_trait::expand(input)
+        .unwrap_or_else(Error::into_compile_error)
+        .into()
+}
+
+mod my_trait {
+    use proc_macro2::TokenStream;
+    use syn::{DeriveInput, Result};
+
+    pub(crate) fn expand(input: DeriveInput) -> Result<TokenStream> {
+        /* ... */
+    }
+}
+
source

pub fn combine(&mut self, another: Error)

Add another error message to self such that when to_compile_error() is +called, both errors will be emitted together.

+

Trait Implementations§

source§

impl Clone for Error

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Error

source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for Error

source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for Error

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl Extend<Error> for Error

source§

fn extend<T: IntoIterator<Item = Error>>(&mut self, iter: T)

Extends a collection with the contents of an iterator. Read more
source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
source§

impl From<LexError> for Error

source§

fn from(err: LexError) -> Self

Converts to this type from the input type.
source§

impl<'a> IntoIterator for &'a Error

§

type Item = Error

The type of the elements being iterated over.
§

type IntoIter = Iter<'a>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl IntoIterator for Error

§

type Item = Error

The type of the elements being iterated over.
§

type IntoIter = IntoIter

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more

Auto Trait Implementations§

§

impl Freeze for Error

§

impl RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl UnwindSafe for Error

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.ExprArray.html b/syn/struct.ExprArray.html new file mode 100644 index 0000000..5adeda3 --- /dev/null +++ b/syn/struct.ExprArray.html @@ -0,0 +1,20 @@ +ExprArray in syn - Rust

Struct syn::ExprArray

source ·
pub struct ExprArray {
+    pub attrs: Vec<Attribute>,
+    pub bracket_token: Bracket,
+    pub elems: Punctuated<Expr, Comma>,
+}
Expand description

A slice literal expression: [a, b, c, d].

+

Fields§

§attrs: Vec<Attribute>§bracket_token: Bracket§elems: Punctuated<Expr, Comma>

Trait Implementations§

source§

impl Clone for ExprArray

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<ExprArray> for Expr

source§

fn from(e: ExprArray) -> Expr

Converts to this type from the input type.
source§

impl Parse for ExprArray

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for ExprArray

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.ExprAssign.html b/syn/struct.ExprAssign.html new file mode 100644 index 0000000..a702743 --- /dev/null +++ b/syn/struct.ExprAssign.html @@ -0,0 +1,21 @@ +ExprAssign in syn - Rust

Struct syn::ExprAssign

source ·
pub struct ExprAssign {
+    pub attrs: Vec<Attribute>,
+    pub left: Box<Expr>,
+    pub eq_token: Eq,
+    pub right: Box<Expr>,
+}
Expand description

An assignment expression: a = compute().

+

Fields§

§attrs: Vec<Attribute>§left: Box<Expr>§eq_token: Eq§right: Box<Expr>

Trait Implementations§

source§

impl Clone for ExprAssign

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<ExprAssign> for Expr

source§

fn from(e: ExprAssign) -> Expr

Converts to this type from the input type.
source§

impl Parse for ExprAssign

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for ExprAssign

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.ExprAsync.html b/syn/struct.ExprAsync.html new file mode 100644 index 0000000..00231fc --- /dev/null +++ b/syn/struct.ExprAsync.html @@ -0,0 +1,21 @@ +ExprAsync in syn - Rust

Struct syn::ExprAsync

source ·
pub struct ExprAsync {
+    pub attrs: Vec<Attribute>,
+    pub async_token: Async,
+    pub capture: Option<Move>,
+    pub block: Block,
+}
Expand description

An async block: async { ... }.

+

Fields§

§attrs: Vec<Attribute>§async_token: Async§capture: Option<Move>§block: Block

Trait Implementations§

source§

impl Clone for ExprAsync

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<ExprAsync> for Expr

source§

fn from(e: ExprAsync) -> Expr

Converts to this type from the input type.
source§

impl Parse for ExprAsync

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for ExprAsync

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.ExprAwait.html b/syn/struct.ExprAwait.html new file mode 100644 index 0000000..c3dc76b --- /dev/null +++ b/syn/struct.ExprAwait.html @@ -0,0 +1,21 @@ +ExprAwait in syn - Rust

Struct syn::ExprAwait

source ·
pub struct ExprAwait {
+    pub attrs: Vec<Attribute>,
+    pub base: Box<Expr>,
+    pub dot_token: Dot,
+    pub await_token: Await,
+}
Expand description

An await expression: fut.await.

+

Fields§

§attrs: Vec<Attribute>§base: Box<Expr>§dot_token: Dot§await_token: Await

Trait Implementations§

source§

impl Clone for ExprAwait

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<ExprAwait> for Expr

source§

fn from(e: ExprAwait) -> Expr

Converts to this type from the input type.
source§

impl Parse for ExprAwait

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for ExprAwait

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.ExprBinary.html b/syn/struct.ExprBinary.html new file mode 100644 index 0000000..7ca74fb --- /dev/null +++ b/syn/struct.ExprBinary.html @@ -0,0 +1,21 @@ +ExprBinary in syn - Rust

Struct syn::ExprBinary

source ·
pub struct ExprBinary {
+    pub attrs: Vec<Attribute>,
+    pub left: Box<Expr>,
+    pub op: BinOp,
+    pub right: Box<Expr>,
+}
Expand description

A binary operation: a + b, a += b.

+

Fields§

§attrs: Vec<Attribute>§left: Box<Expr>§op: BinOp§right: Box<Expr>

Trait Implementations§

source§

impl Clone for ExprBinary

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<ExprBinary> for Expr

source§

fn from(e: ExprBinary) -> Expr

Converts to this type from the input type.
source§

impl Parse for ExprBinary

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for ExprBinary

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.ExprBlock.html b/syn/struct.ExprBlock.html new file mode 100644 index 0000000..4a490f0 --- /dev/null +++ b/syn/struct.ExprBlock.html @@ -0,0 +1,20 @@ +ExprBlock in syn - Rust

Struct syn::ExprBlock

source ·
pub struct ExprBlock {
+    pub attrs: Vec<Attribute>,
+    pub label: Option<Label>,
+    pub block: Block,
+}
Expand description

A blocked scope: { ... }.

+

Fields§

§attrs: Vec<Attribute>§label: Option<Label>§block: Block

Trait Implementations§

source§

impl Clone for ExprBlock

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<ExprBlock> for Expr

source§

fn from(e: ExprBlock) -> Expr

Converts to this type from the input type.
source§

impl Parse for ExprBlock

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for ExprBlock

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.ExprBreak.html b/syn/struct.ExprBreak.html new file mode 100644 index 0000000..fff1776 --- /dev/null +++ b/syn/struct.ExprBreak.html @@ -0,0 +1,22 @@ +ExprBreak in syn - Rust

Struct syn::ExprBreak

source ·
pub struct ExprBreak {
+    pub attrs: Vec<Attribute>,
+    pub break_token: Break,
+    pub label: Option<Lifetime>,
+    pub expr: Option<Box<Expr>>,
+}
Expand description

A break, with an optional label to break and an optional +expression.

+

Fields§

§attrs: Vec<Attribute>§break_token: Break§label: Option<Lifetime>§expr: Option<Box<Expr>>

Trait Implementations§

source§

impl Clone for ExprBreak

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<ExprBreak> for Expr

source§

fn from(e: ExprBreak) -> Expr

Converts to this type from the input type.
source§

impl Parse for ExprBreak

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for ExprBreak

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.ExprCall.html b/syn/struct.ExprCall.html new file mode 100644 index 0000000..a912bf2 --- /dev/null +++ b/syn/struct.ExprCall.html @@ -0,0 +1,21 @@ +ExprCall in syn - Rust

Struct syn::ExprCall

source ·
pub struct ExprCall {
+    pub attrs: Vec<Attribute>,
+    pub func: Box<Expr>,
+    pub paren_token: Paren,
+    pub args: Punctuated<Expr, Comma>,
+}
Expand description

A function call expression: invoke(a, b).

+

Fields§

§attrs: Vec<Attribute>§func: Box<Expr>§paren_token: Paren§args: Punctuated<Expr, Comma>

Trait Implementations§

source§

impl Clone for ExprCall

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<ExprCall> for Expr

source§

fn from(e: ExprCall) -> Expr

Converts to this type from the input type.
source§

impl Parse for ExprCall

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for ExprCall

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.ExprCast.html b/syn/struct.ExprCast.html new file mode 100644 index 0000000..cd957b4 --- /dev/null +++ b/syn/struct.ExprCast.html @@ -0,0 +1,21 @@ +ExprCast in syn - Rust

Struct syn::ExprCast

source ·
pub struct ExprCast {
+    pub attrs: Vec<Attribute>,
+    pub expr: Box<Expr>,
+    pub as_token: As,
+    pub ty: Box<Type>,
+}
Expand description

A cast expression: foo as f64.

+

Fields§

§attrs: Vec<Attribute>§expr: Box<Expr>§as_token: As§ty: Box<Type>

Trait Implementations§

source§

impl Clone for ExprCast

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<ExprCast> for Expr

source§

fn from(e: ExprCast) -> Expr

Converts to this type from the input type.
source§

impl Parse for ExprCast

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for ExprCast

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.ExprClosure.html b/syn/struct.ExprClosure.html new file mode 100644 index 0000000..1658be4 --- /dev/null +++ b/syn/struct.ExprClosure.html @@ -0,0 +1,28 @@ +ExprClosure in syn - Rust

Struct syn::ExprClosure

source ·
pub struct ExprClosure {
+    pub attrs: Vec<Attribute>,
+    pub lifetimes: Option<BoundLifetimes>,
+    pub constness: Option<Const>,
+    pub movability: Option<Static>,
+    pub asyncness: Option<Async>,
+    pub capture: Option<Move>,
+    pub or1_token: Or,
+    pub inputs: Punctuated<Pat, Comma>,
+    pub or2_token: Or,
+    pub output: ReturnType,
+    pub body: Box<Expr>,
+}
Expand description

A closure expression: |a, b| a + b.

+

Fields§

§attrs: Vec<Attribute>§lifetimes: Option<BoundLifetimes>§constness: Option<Const>§movability: Option<Static>§asyncness: Option<Async>§capture: Option<Move>§or1_token: Or§inputs: Punctuated<Pat, Comma>§or2_token: Or§output: ReturnType§body: Box<Expr>

Trait Implementations§

source§

impl Clone for ExprClosure

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<ExprClosure> for Expr

source§

fn from(e: ExprClosure) -> Expr

Converts to this type from the input type.
source§

impl Parse for ExprClosure

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for ExprClosure

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.ExprConst.html b/syn/struct.ExprConst.html new file mode 100644 index 0000000..a9ceebd --- /dev/null +++ b/syn/struct.ExprConst.html @@ -0,0 +1,20 @@ +ExprConst in syn - Rust

Struct syn::ExprConst

source ·
pub struct ExprConst {
+    pub attrs: Vec<Attribute>,
+    pub const_token: Const,
+    pub block: Block,
+}
Expand description

A const block: const { ... }.

+

Fields§

§attrs: Vec<Attribute>§const_token: Const§block: Block

Trait Implementations§

source§

impl Clone for ExprConst

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<ExprConst> for Expr

source§

fn from(e: ExprConst) -> Expr

Converts to this type from the input type.
source§

impl From<ExprConst> for Pat

source§

fn from(e: PatConst) -> Pat

Converts to this type from the input type.
source§

impl Parse for ExprConst

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for ExprConst

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.ExprContinue.html b/syn/struct.ExprContinue.html new file mode 100644 index 0000000..a6d5add --- /dev/null +++ b/syn/struct.ExprContinue.html @@ -0,0 +1,20 @@ +ExprContinue in syn - Rust

Struct syn::ExprContinue

source ·
pub struct ExprContinue {
+    pub attrs: Vec<Attribute>,
+    pub continue_token: Continue,
+    pub label: Option<Lifetime>,
+}
Expand description

A continue, with an optional label.

+

Fields§

§attrs: Vec<Attribute>§continue_token: Continue§label: Option<Lifetime>

Trait Implementations§

source§

impl Clone for ExprContinue

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<ExprContinue> for Expr

source§

fn from(e: ExprContinue) -> Expr

Converts to this type from the input type.
source§

impl Parse for ExprContinue

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for ExprContinue

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.ExprField.html b/syn/struct.ExprField.html new file mode 100644 index 0000000..9074a74 --- /dev/null +++ b/syn/struct.ExprField.html @@ -0,0 +1,22 @@ +ExprField in syn - Rust

Struct syn::ExprField

source ·
pub struct ExprField {
+    pub attrs: Vec<Attribute>,
+    pub base: Box<Expr>,
+    pub dot_token: Dot,
+    pub member: Member,
+}
Expand description

Access of a named struct field (obj.k) or unnamed tuple struct +field (obj.0).

+

Fields§

§attrs: Vec<Attribute>§base: Box<Expr>§dot_token: Dot§member: Member

Trait Implementations§

source§

impl Clone for ExprField

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<ExprField> for Expr

source§

fn from(e: ExprField) -> Expr

Converts to this type from the input type.
source§

impl Parse for ExprField

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for ExprField

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.ExprForLoop.html b/syn/struct.ExprForLoop.html new file mode 100644 index 0000000..f5363ea --- /dev/null +++ b/syn/struct.ExprForLoop.html @@ -0,0 +1,24 @@ +ExprForLoop in syn - Rust

Struct syn::ExprForLoop

source ·
pub struct ExprForLoop {
+    pub attrs: Vec<Attribute>,
+    pub label: Option<Label>,
+    pub for_token: For,
+    pub pat: Box<Pat>,
+    pub in_token: In,
+    pub expr: Box<Expr>,
+    pub body: Block,
+}
Expand description

A for loop: for pat in expr { ... }.

+

Fields§

§attrs: Vec<Attribute>§label: Option<Label>§for_token: For§pat: Box<Pat>§in_token: In§expr: Box<Expr>§body: Block

Trait Implementations§

source§

impl Clone for ExprForLoop

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<ExprForLoop> for Expr

source§

fn from(e: ExprForLoop) -> Expr

Converts to this type from the input type.
source§

impl Parse for ExprForLoop

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for ExprForLoop

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.ExprGroup.html b/syn/struct.ExprGroup.html new file mode 100644 index 0000000..1a50062 --- /dev/null +++ b/syn/struct.ExprGroup.html @@ -0,0 +1,23 @@ +ExprGroup in syn - Rust

Struct syn::ExprGroup

source ·
pub struct ExprGroup {
+    pub attrs: Vec<Attribute>,
+    pub group_token: Group,
+    pub expr: Box<Expr>,
+}
Expand description

An expression contained within invisible delimiters.

+

This variant is important for faithfully representing the precedence +of expressions and is related to None-delimited spans in a +TokenStream.

+

Fields§

§attrs: Vec<Attribute>§group_token: Group§expr: Box<Expr>

Trait Implementations§

source§

impl Clone for ExprGroup

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<ExprGroup> for Expr

source§

fn from(e: ExprGroup) -> Expr

Converts to this type from the input type.
source§

impl ToTokens for ExprGroup

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.ExprIf.html b/syn/struct.ExprIf.html new file mode 100644 index 0000000..83b7446 --- /dev/null +++ b/syn/struct.ExprIf.html @@ -0,0 +1,24 @@ +ExprIf in syn - Rust

Struct syn::ExprIf

source ·
pub struct ExprIf {
+    pub attrs: Vec<Attribute>,
+    pub if_token: If,
+    pub cond: Box<Expr>,
+    pub then_branch: Block,
+    pub else_branch: Option<(Else, Box<Expr>)>,
+}
Expand description

An if expression with an optional else block: if expr { ... } else { ... }.

+

The else branch expression may only be an If or Block +expression, not any of the other types of expression.

+

Fields§

§attrs: Vec<Attribute>§if_token: If§cond: Box<Expr>§then_branch: Block§else_branch: Option<(Else, Box<Expr>)>

Trait Implementations§

source§

impl Clone for ExprIf

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<ExprIf> for Expr

source§

fn from(e: ExprIf) -> Expr

Converts to this type from the input type.
source§

impl Parse for ExprIf

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for ExprIf

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

§

impl Freeze for ExprIf

§

impl RefUnwindSafe for ExprIf

§

impl !Send for ExprIf

§

impl !Sync for ExprIf

§

impl Unpin for ExprIf

§

impl UnwindSafe for ExprIf

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.ExprIndex.html b/syn/struct.ExprIndex.html new file mode 100644 index 0000000..d0acacf --- /dev/null +++ b/syn/struct.ExprIndex.html @@ -0,0 +1,21 @@ +ExprIndex in syn - Rust

Struct syn::ExprIndex

source ·
pub struct ExprIndex {
+    pub attrs: Vec<Attribute>,
+    pub expr: Box<Expr>,
+    pub bracket_token: Bracket,
+    pub index: Box<Expr>,
+}
Expand description

A square bracketed indexing expression: vector[2].

+

Fields§

§attrs: Vec<Attribute>§expr: Box<Expr>§bracket_token: Bracket§index: Box<Expr>

Trait Implementations§

source§

impl Clone for ExprIndex

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<ExprIndex> for Expr

source§

fn from(e: ExprIndex) -> Expr

Converts to this type from the input type.
source§

impl Parse for ExprIndex

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for ExprIndex

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.ExprInfer.html b/syn/struct.ExprInfer.html new file mode 100644 index 0000000..cb067e6 --- /dev/null +++ b/syn/struct.ExprInfer.html @@ -0,0 +1,19 @@ +ExprInfer in syn - Rust

Struct syn::ExprInfer

source ·
pub struct ExprInfer {
+    pub attrs: Vec<Attribute>,
+    pub underscore_token: Underscore,
+}
Expand description

The inferred value of a const generic argument, denoted _.

+

Fields§

§attrs: Vec<Attribute>§underscore_token: Underscore

Trait Implementations§

source§

impl Clone for ExprInfer

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<ExprInfer> for Expr

source§

fn from(e: ExprInfer) -> Expr

Converts to this type from the input type.
source§

impl Parse for ExprInfer

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for ExprInfer

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.ExprLet.html b/syn/struct.ExprLet.html new file mode 100644 index 0000000..827dde3 --- /dev/null +++ b/syn/struct.ExprLet.html @@ -0,0 +1,22 @@ +ExprLet in syn - Rust

Struct syn::ExprLet

source ·
pub struct ExprLet {
+    pub attrs: Vec<Attribute>,
+    pub let_token: Let,
+    pub pat: Box<Pat>,
+    pub eq_token: Eq,
+    pub expr: Box<Expr>,
+}
Expand description

A let guard: let Some(x) = opt.

+

Fields§

§attrs: Vec<Attribute>§let_token: Let§pat: Box<Pat>§eq_token: Eq§expr: Box<Expr>

Trait Implementations§

source§

impl Clone for ExprLet

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<ExprLet> for Expr

source§

fn from(e: ExprLet) -> Expr

Converts to this type from the input type.
source§

impl Parse for ExprLet

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for ExprLet

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.ExprLit.html b/syn/struct.ExprLit.html new file mode 100644 index 0000000..d5ed8c7 --- /dev/null +++ b/syn/struct.ExprLit.html @@ -0,0 +1,19 @@ +ExprLit in syn - Rust

Struct syn::ExprLit

source ·
pub struct ExprLit {
+    pub attrs: Vec<Attribute>,
+    pub lit: Lit,
+}
Expand description

A literal in place of an expression: 1, "foo".

+

Fields§

§attrs: Vec<Attribute>§lit: Lit

Trait Implementations§

source§

impl Clone for ExprLit

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<ExprLit> for Expr

source§

fn from(e: ExprLit) -> Expr

Converts to this type from the input type.
source§

impl From<ExprLit> for Pat

source§

fn from(e: PatLit) -> Pat

Converts to this type from the input type.
source§

impl Parse for ExprLit

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for ExprLit

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.ExprLoop.html b/syn/struct.ExprLoop.html new file mode 100644 index 0000000..54bb2ad --- /dev/null +++ b/syn/struct.ExprLoop.html @@ -0,0 +1,21 @@ +ExprLoop in syn - Rust

Struct syn::ExprLoop

source ·
pub struct ExprLoop {
+    pub attrs: Vec<Attribute>,
+    pub label: Option<Label>,
+    pub loop_token: Loop,
+    pub body: Block,
+}
Expand description

Conditionless loop: loop { ... }.

+

Fields§

§attrs: Vec<Attribute>§label: Option<Label>§loop_token: Loop§body: Block

Trait Implementations§

source§

impl Clone for ExprLoop

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<ExprLoop> for Expr

source§

fn from(e: ExprLoop) -> Expr

Converts to this type from the input type.
source§

impl Parse for ExprLoop

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for ExprLoop

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.ExprMacro.html b/syn/struct.ExprMacro.html new file mode 100644 index 0000000..0f089c9 --- /dev/null +++ b/syn/struct.ExprMacro.html @@ -0,0 +1,19 @@ +ExprMacro in syn - Rust

Struct syn::ExprMacro

source ·
pub struct ExprMacro {
+    pub attrs: Vec<Attribute>,
+    pub mac: Macro,
+}
Expand description

A macro invocation expression: format!("{}", q).

+

Fields§

§attrs: Vec<Attribute>§mac: Macro

Trait Implementations§

source§

impl Clone for ExprMacro

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<ExprMacro> for Expr

source§

fn from(e: ExprMacro) -> Expr

Converts to this type from the input type.
source§

impl From<ExprMacro> for Pat

source§

fn from(e: PatMacro) -> Pat

Converts to this type from the input type.
source§

impl Parse for ExprMacro

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for ExprMacro

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.ExprMatch.html b/syn/struct.ExprMatch.html new file mode 100644 index 0000000..4baf4ba --- /dev/null +++ b/syn/struct.ExprMatch.html @@ -0,0 +1,22 @@ +ExprMatch in syn - Rust

Struct syn::ExprMatch

source ·
pub struct ExprMatch {
+    pub attrs: Vec<Attribute>,
+    pub match_token: Match,
+    pub expr: Box<Expr>,
+    pub brace_token: Brace,
+    pub arms: Vec<Arm>,
+}
Expand description

A match expression: match n { Some(n) => {}, None => {} }.

+

Fields§

§attrs: Vec<Attribute>§match_token: Match§expr: Box<Expr>§brace_token: Brace§arms: Vec<Arm>

Trait Implementations§

source§

impl Clone for ExprMatch

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<ExprMatch> for Expr

source§

fn from(e: ExprMatch) -> Expr

Converts to this type from the input type.
source§

impl Parse for ExprMatch

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for ExprMatch

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.ExprMethodCall.html b/syn/struct.ExprMethodCall.html new file mode 100644 index 0000000..67f586f --- /dev/null +++ b/syn/struct.ExprMethodCall.html @@ -0,0 +1,24 @@ +ExprMethodCall in syn - Rust

Struct syn::ExprMethodCall

source ·
pub struct ExprMethodCall {
+    pub attrs: Vec<Attribute>,
+    pub receiver: Box<Expr>,
+    pub dot_token: Dot,
+    pub method: Ident,
+    pub turbofish: Option<AngleBracketedGenericArguments>,
+    pub paren_token: Paren,
+    pub args: Punctuated<Expr, Comma>,
+}
Expand description

A method call expression: x.foo::<T>(a, b).

+

Fields§

§attrs: Vec<Attribute>§receiver: Box<Expr>§dot_token: Dot§method: Ident§turbofish: Option<AngleBracketedGenericArguments>§paren_token: Paren§args: Punctuated<Expr, Comma>

Trait Implementations§

source§

impl Clone for ExprMethodCall

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<ExprMethodCall> for Expr

source§

fn from(e: ExprMethodCall) -> Expr

Converts to this type from the input type.
source§

impl Parse for ExprMethodCall

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for ExprMethodCall

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.ExprParen.html b/syn/struct.ExprParen.html new file mode 100644 index 0000000..d745405 --- /dev/null +++ b/syn/struct.ExprParen.html @@ -0,0 +1,20 @@ +ExprParen in syn - Rust

Struct syn::ExprParen

source ·
pub struct ExprParen {
+    pub attrs: Vec<Attribute>,
+    pub paren_token: Paren,
+    pub expr: Box<Expr>,
+}
Expand description

A parenthesized expression: (a + b).

+

Fields§

§attrs: Vec<Attribute>§paren_token: Paren§expr: Box<Expr>

Trait Implementations§

source§

impl Clone for ExprParen

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<ExprParen> for Expr

source§

fn from(e: ExprParen) -> Expr

Converts to this type from the input type.
source§

impl Parse for ExprParen

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for ExprParen

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.ExprPath.html b/syn/struct.ExprPath.html new file mode 100644 index 0000000..8aa94b1 --- /dev/null +++ b/syn/struct.ExprPath.html @@ -0,0 +1,22 @@ +ExprPath in syn - Rust

Struct syn::ExprPath

source ·
pub struct ExprPath {
+    pub attrs: Vec<Attribute>,
+    pub qself: Option<QSelf>,
+    pub path: Path,
+}
Expand description

A path like std::mem::replace possibly containing generic +parameters and a qualified self-type.

+

A plain identifier like x is a path of length 1.

+

Fields§

§attrs: Vec<Attribute>§qself: Option<QSelf>§path: Path

Trait Implementations§

source§

impl Clone for ExprPath

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<ExprPath> for Expr

source§

fn from(e: ExprPath) -> Expr

Converts to this type from the input type.
source§

impl From<ExprPath> for Pat

source§

fn from(e: PatPath) -> Pat

Converts to this type from the input type.
source§

impl Parse for ExprPath

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for ExprPath

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.ExprRange.html b/syn/struct.ExprRange.html new file mode 100644 index 0000000..d092032 --- /dev/null +++ b/syn/struct.ExprRange.html @@ -0,0 +1,21 @@ +ExprRange in syn - Rust

Struct syn::ExprRange

source ·
pub struct ExprRange {
+    pub attrs: Vec<Attribute>,
+    pub start: Option<Box<Expr>>,
+    pub limits: RangeLimits,
+    pub end: Option<Box<Expr>>,
+}
Expand description

A range expression: 1..2, 1.., ..2, 1..=2, ..=2.

+

Fields§

§attrs: Vec<Attribute>§start: Option<Box<Expr>>§limits: RangeLimits§end: Option<Box<Expr>>

Trait Implementations§

source§

impl Clone for ExprRange

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<ExprRange> for Expr

source§

fn from(e: ExprRange) -> Expr

Converts to this type from the input type.
source§

impl From<ExprRange> for Pat

source§

fn from(e: PatRange) -> Pat

Converts to this type from the input type.
source§

impl Parse for ExprRange

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for ExprRange

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.ExprReference.html b/syn/struct.ExprReference.html new file mode 100644 index 0000000..8e9b6e6 --- /dev/null +++ b/syn/struct.ExprReference.html @@ -0,0 +1,21 @@ +ExprReference in syn - Rust

Struct syn::ExprReference

source ·
pub struct ExprReference {
+    pub attrs: Vec<Attribute>,
+    pub and_token: And,
+    pub mutability: Option<Mut>,
+    pub expr: Box<Expr>,
+}
Expand description

A referencing operation: &a or &mut a.

+

Fields§

§attrs: Vec<Attribute>§and_token: And§mutability: Option<Mut>§expr: Box<Expr>

Trait Implementations§

source§

impl Clone for ExprReference

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<ExprReference> for Expr

source§

fn from(e: ExprReference) -> Expr

Converts to this type from the input type.
source§

impl Parse for ExprReference

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for ExprReference

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.ExprRepeat.html b/syn/struct.ExprRepeat.html new file mode 100644 index 0000000..1f5b6c9 --- /dev/null +++ b/syn/struct.ExprRepeat.html @@ -0,0 +1,22 @@ +ExprRepeat in syn - Rust

Struct syn::ExprRepeat

source ·
pub struct ExprRepeat {
+    pub attrs: Vec<Attribute>,
+    pub bracket_token: Bracket,
+    pub expr: Box<Expr>,
+    pub semi_token: Semi,
+    pub len: Box<Expr>,
+}
Expand description

An array literal constructed from one repeated element: [0u8; N].

+

Fields§

§attrs: Vec<Attribute>§bracket_token: Bracket§expr: Box<Expr>§semi_token: Semi§len: Box<Expr>

Trait Implementations§

source§

impl Clone for ExprRepeat

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<ExprRepeat> for Expr

source§

fn from(e: ExprRepeat) -> Expr

Converts to this type from the input type.
source§

impl Parse for ExprRepeat

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for ExprRepeat

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.ExprReturn.html b/syn/struct.ExprReturn.html new file mode 100644 index 0000000..b456bf9 --- /dev/null +++ b/syn/struct.ExprReturn.html @@ -0,0 +1,20 @@ +ExprReturn in syn - Rust

Struct syn::ExprReturn

source ·
pub struct ExprReturn {
+    pub attrs: Vec<Attribute>,
+    pub return_token: Return,
+    pub expr: Option<Box<Expr>>,
+}
Expand description

A return, with an optional value to be returned.

+

Fields§

§attrs: Vec<Attribute>§return_token: Return§expr: Option<Box<Expr>>

Trait Implementations§

source§

impl Clone for ExprReturn

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<ExprReturn> for Expr

source§

fn from(e: ExprReturn) -> Expr

Converts to this type from the input type.
source§

impl Parse for ExprReturn

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for ExprReturn

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.ExprStruct.html b/syn/struct.ExprStruct.html new file mode 100644 index 0000000..339240a --- /dev/null +++ b/syn/struct.ExprStruct.html @@ -0,0 +1,25 @@ +ExprStruct in syn - Rust

Struct syn::ExprStruct

source ·
pub struct ExprStruct {
+    pub attrs: Vec<Attribute>,
+    pub qself: Option<QSelf>,
+    pub path: Path,
+    pub brace_token: Brace,
+    pub fields: Punctuated<FieldValue, Comma>,
+    pub dot2_token: Option<DotDot>,
+    pub rest: Option<Box<Expr>>,
+}
Expand description

A struct literal expression: Point { x: 1, y: 1 }.

+

The rest provides the value of the remaining fields as in S { a: 1, b: 1, ..rest }.

+

Fields§

§attrs: Vec<Attribute>§qself: Option<QSelf>§path: Path§brace_token: Brace§fields: Punctuated<FieldValue, Comma>§dot2_token: Option<DotDot>§rest: Option<Box<Expr>>

Trait Implementations§

source§

impl Clone for ExprStruct

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<ExprStruct> for Expr

source§

fn from(e: ExprStruct) -> Expr

Converts to this type from the input type.
source§

impl Parse for ExprStruct

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for ExprStruct

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.ExprTry.html b/syn/struct.ExprTry.html new file mode 100644 index 0000000..18525e9 --- /dev/null +++ b/syn/struct.ExprTry.html @@ -0,0 +1,20 @@ +ExprTry in syn - Rust

Struct syn::ExprTry

source ·
pub struct ExprTry {
+    pub attrs: Vec<Attribute>,
+    pub expr: Box<Expr>,
+    pub question_token: Question,
+}
Expand description

A try-expression: expr?.

+

Fields§

§attrs: Vec<Attribute>§expr: Box<Expr>§question_token: Question

Trait Implementations§

source§

impl Clone for ExprTry

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<ExprTry> for Expr

source§

fn from(e: ExprTry) -> Expr

Converts to this type from the input type.
source§

impl Parse for ExprTry

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for ExprTry

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.ExprTryBlock.html b/syn/struct.ExprTryBlock.html new file mode 100644 index 0000000..b390686 --- /dev/null +++ b/syn/struct.ExprTryBlock.html @@ -0,0 +1,20 @@ +ExprTryBlock in syn - Rust

Struct syn::ExprTryBlock

source ·
pub struct ExprTryBlock {
+    pub attrs: Vec<Attribute>,
+    pub try_token: Try,
+    pub block: Block,
+}
Expand description

A try block: try { ... }.

+

Fields§

§attrs: Vec<Attribute>§try_token: Try§block: Block

Trait Implementations§

source§

impl Clone for ExprTryBlock

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<ExprTryBlock> for Expr

source§

fn from(e: ExprTryBlock) -> Expr

Converts to this type from the input type.
source§

impl Parse for ExprTryBlock

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for ExprTryBlock

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.ExprTuple.html b/syn/struct.ExprTuple.html new file mode 100644 index 0000000..a376a48 --- /dev/null +++ b/syn/struct.ExprTuple.html @@ -0,0 +1,20 @@ +ExprTuple in syn - Rust

Struct syn::ExprTuple

source ·
pub struct ExprTuple {
+    pub attrs: Vec<Attribute>,
+    pub paren_token: Paren,
+    pub elems: Punctuated<Expr, Comma>,
+}
Expand description

A tuple expression: (a, b, c, d).

+

Fields§

§attrs: Vec<Attribute>§paren_token: Paren§elems: Punctuated<Expr, Comma>

Trait Implementations§

source§

impl Clone for ExprTuple

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<ExprTuple> for Expr

source§

fn from(e: ExprTuple) -> Expr

Converts to this type from the input type.
source§

impl Parse for ExprTuple

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for ExprTuple

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.ExprUnary.html b/syn/struct.ExprUnary.html new file mode 100644 index 0000000..4bed4b2 --- /dev/null +++ b/syn/struct.ExprUnary.html @@ -0,0 +1,20 @@ +ExprUnary in syn - Rust

Struct syn::ExprUnary

source ·
pub struct ExprUnary {
+    pub attrs: Vec<Attribute>,
+    pub op: UnOp,
+    pub expr: Box<Expr>,
+}
Expand description

A unary operation: !x, *x.

+

Fields§

§attrs: Vec<Attribute>§op: UnOp§expr: Box<Expr>

Trait Implementations§

source§

impl Clone for ExprUnary

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<ExprUnary> for Expr

source§

fn from(e: ExprUnary) -> Expr

Converts to this type from the input type.
source§

impl Parse for ExprUnary

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for ExprUnary

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.ExprUnsafe.html b/syn/struct.ExprUnsafe.html new file mode 100644 index 0000000..d116f1c --- /dev/null +++ b/syn/struct.ExprUnsafe.html @@ -0,0 +1,20 @@ +ExprUnsafe in syn - Rust

Struct syn::ExprUnsafe

source ·
pub struct ExprUnsafe {
+    pub attrs: Vec<Attribute>,
+    pub unsafe_token: Unsafe,
+    pub block: Block,
+}
Expand description

An unsafe block: unsafe { ... }.

+

Fields§

§attrs: Vec<Attribute>§unsafe_token: Unsafe§block: Block

Trait Implementations§

source§

impl Clone for ExprUnsafe

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<ExprUnsafe> for Expr

source§

fn from(e: ExprUnsafe) -> Expr

Converts to this type from the input type.
source§

impl Parse for ExprUnsafe

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for ExprUnsafe

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.ExprWhile.html b/syn/struct.ExprWhile.html new file mode 100644 index 0000000..365ce84 --- /dev/null +++ b/syn/struct.ExprWhile.html @@ -0,0 +1,22 @@ +ExprWhile in syn - Rust

Struct syn::ExprWhile

source ·
pub struct ExprWhile {
+    pub attrs: Vec<Attribute>,
+    pub label: Option<Label>,
+    pub while_token: While,
+    pub cond: Box<Expr>,
+    pub body: Block,
+}
Expand description

A while loop: while expr { ... }.

+

Fields§

§attrs: Vec<Attribute>§label: Option<Label>§while_token: While§cond: Box<Expr>§body: Block

Trait Implementations§

source§

impl Clone for ExprWhile

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<ExprWhile> for Expr

source§

fn from(e: ExprWhile) -> Expr

Converts to this type from the input type.
source§

impl Parse for ExprWhile

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for ExprWhile

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.ExprYield.html b/syn/struct.ExprYield.html new file mode 100644 index 0000000..535fb61 --- /dev/null +++ b/syn/struct.ExprYield.html @@ -0,0 +1,20 @@ +ExprYield in syn - Rust

Struct syn::ExprYield

source ·
pub struct ExprYield {
+    pub attrs: Vec<Attribute>,
+    pub yield_token: Yield,
+    pub expr: Option<Box<Expr>>,
+}
Expand description

A yield expression: yield expr.

+

Fields§

§attrs: Vec<Attribute>§yield_token: Yield§expr: Option<Box<Expr>>

Trait Implementations§

source§

impl Clone for ExprYield

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<ExprYield> for Expr

source§

fn from(e: ExprYield) -> Expr

Converts to this type from the input type.
source§

impl Parse for ExprYield

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for ExprYield

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.Field.html b/syn/struct.Field.html new file mode 100644 index 0000000..a1742e2 --- /dev/null +++ b/syn/struct.Field.html @@ -0,0 +1,27 @@ +Field in syn - Rust

Struct syn::Field

source ·
pub struct Field {
+    pub attrs: Vec<Attribute>,
+    pub vis: Visibility,
+    pub mutability: FieldMutability,
+    pub ident: Option<Ident>,
+    pub colon_token: Option<Colon>,
+    pub ty: Type,
+}
Expand description

A field of a struct or enum variant.

+

Fields§

§attrs: Vec<Attribute>§vis: Visibility§mutability: FieldMutability§ident: Option<Ident>

Name of the field, if any.

+

Fields of tuple structs have no names.

+
§colon_token: Option<Colon>§ty: Type

Implementations§

source§

impl Field

source

pub fn parse_named(input: ParseStream<'_>) -> Result<Self>

Parses a named (braced struct) field.

+
source

pub fn parse_unnamed(input: ParseStream<'_>) -> Result<Self>

Parses an unnamed (tuple struct) field.

+

Trait Implementations§

source§

impl Clone for Field

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl ToTokens for Field

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

§

impl Freeze for Field

§

impl RefUnwindSafe for Field

§

impl !Send for Field

§

impl !Sync for Field

§

impl Unpin for Field

§

impl UnwindSafe for Field

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.FieldPat.html b/syn/struct.FieldPat.html new file mode 100644 index 0000000..c44507b --- /dev/null +++ b/syn/struct.FieldPat.html @@ -0,0 +1,23 @@ +FieldPat in syn - Rust

Struct syn::FieldPat

source ·
pub struct FieldPat {
+    pub attrs: Vec<Attribute>,
+    pub member: Member,
+    pub colon_token: Option<Colon>,
+    pub pat: Box<Pat>,
+}
Expand description

A single field in a struct pattern.

+

Patterns like the fields of Foo { x, ref y, ref mut z } are treated +the same as x: x, y: ref y, z: ref mut z but there is no colon token.

+

Fields§

§attrs: Vec<Attribute>§member: Member§colon_token: Option<Colon>§pat: Box<Pat>

Trait Implementations§

source§

impl Clone for FieldPat

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl ToTokens for FieldPat

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.FieldValue.html b/syn/struct.FieldValue.html new file mode 100644 index 0000000..b0826c8 --- /dev/null +++ b/syn/struct.FieldValue.html @@ -0,0 +1,23 @@ +FieldValue in syn - Rust

Struct syn::FieldValue

source ·
pub struct FieldValue {
+    pub attrs: Vec<Attribute>,
+    pub member: Member,
+    pub colon_token: Option<Colon>,
+    pub expr: Expr,
+}
Expand description

A field-value pair in a struct literal.

+

Fields§

§attrs: Vec<Attribute>§member: Member§colon_token: Option<Colon>

The colon in Struct { x: x }. If written in shorthand like +Struct { x }, there is no colon.

+
§expr: Expr

Trait Implementations§

source§

impl Clone for FieldValue

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Parse for FieldValue

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for FieldValue

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.FieldsNamed.html b/syn/struct.FieldsNamed.html new file mode 100644 index 0000000..bfc5d6e --- /dev/null +++ b/syn/struct.FieldsNamed.html @@ -0,0 +1,19 @@ +FieldsNamed in syn - Rust

Struct syn::FieldsNamed

source ·
pub struct FieldsNamed {
+    pub brace_token: Brace,
+    pub named: Punctuated<Field, Comma>,
+}
Expand description

Named fields of a struct or struct variant such as Point { x: f64, y: f64 }.

+

Fields§

§brace_token: Brace§named: Punctuated<Field, Comma>

Trait Implementations§

source§

impl Clone for FieldsNamed

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<FieldsNamed> for Fields

source§

fn from(e: FieldsNamed) -> Fields

Converts to this type from the input type.
source§

impl Parse for FieldsNamed

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for FieldsNamed

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.FieldsUnnamed.html b/syn/struct.FieldsUnnamed.html new file mode 100644 index 0000000..54185c2 --- /dev/null +++ b/syn/struct.FieldsUnnamed.html @@ -0,0 +1,19 @@ +FieldsUnnamed in syn - Rust

Struct syn::FieldsUnnamed

source ·
pub struct FieldsUnnamed {
+    pub paren_token: Paren,
+    pub unnamed: Punctuated<Field, Comma>,
+}
Expand description

Unnamed fields of a tuple struct or tuple variant such as Some(T).

+

Fields§

§paren_token: Paren§unnamed: Punctuated<Field, Comma>

Trait Implementations§

source§

impl Clone for FieldsUnnamed

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<FieldsUnnamed> for Fields

source§

fn from(e: FieldsUnnamed) -> Fields

Converts to this type from the input type.
source§

impl Parse for FieldsUnnamed

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for FieldsUnnamed

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.File.html b/syn/struct.File.html new file mode 100644 index 0000000..6de6540 --- /dev/null +++ b/syn/struct.File.html @@ -0,0 +1,83 @@ +File in syn - Rust

Struct syn::File

source ·
pub struct File {
+    pub shebang: Option<String>,
+    pub attrs: Vec<Attribute>,
+    pub items: Vec<Item>,
+}
Expand description

A complete file of Rust source code.

+

Typically File objects are created with parse_file.

+

§Example

+

Parse a Rust source file into a syn::File and print out a debug +representation of the syntax tree.

+ +
use std::env;
+use std::fs::File;
+use std::io::Read;
+use std::process;
+
+fn main() {
+    let mut args = env::args();
+    let _ = args.next(); // executable name
+
+    let filename = match (args.next(), args.next()) {
+        (Some(filename), None) => filename,
+        _ => {
+            eprintln!("Usage: dump-syntax path/to/filename.rs");
+            process::exit(1);
+        }
+    };
+
+    let mut file = File::open(&filename).expect("unable to open file");
+
+    let mut src = String::new();
+    file.read_to_string(&mut src).expect("unable to read file");
+
+    let syntax = syn::parse_file(&src).expect("unable to parse file");
+
+    // Debug impl is available if Syn is built with "extra-traits" feature.
+    println!("{:#?}", syntax);
+}
+

Running with its own source code as input, this program prints output +that begins with:

+
File {
+    shebang: None,
+    attrs: [],
+    items: [
+        Use(
+            ItemUse {
+                attrs: [],
+                vis: Inherited,
+                use_token: Use,
+                leading_colon: None,
+                tree: Path(
+                    UsePath {
+                        ident: Ident(
+                            std,
+                        ),
+                        colon2_token: Colon2,
+                        tree: Name(
+                            UseName {
+                                ident: Ident(
+                                    env,
+                                ),
+                            },
+                        ),
+                    },
+                ),
+                semi_token: Semi,
+            },
+        ),
+...
+

Fields§

§shebang: Option<String>§attrs: Vec<Attribute>§items: Vec<Item>

Trait Implementations§

source§

impl Clone for File

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Parse for File

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for File

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

§

impl Freeze for File

§

impl RefUnwindSafe for File

§

impl !Send for File

§

impl !Sync for File

§

impl Unpin for File

§

impl UnwindSafe for File

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.ForeignItemFn.html b/syn/struct.ForeignItemFn.html new file mode 100644 index 0000000..05d4fa6 --- /dev/null +++ b/syn/struct.ForeignItemFn.html @@ -0,0 +1,21 @@ +ForeignItemFn in syn - Rust

Struct syn::ForeignItemFn

source ·
pub struct ForeignItemFn {
+    pub attrs: Vec<Attribute>,
+    pub vis: Visibility,
+    pub sig: Signature,
+    pub semi_token: Semi,
+}
Expand description

A foreign function in an extern block.

+

Fields§

§attrs: Vec<Attribute>§vis: Visibility§sig: Signature§semi_token: Semi

Trait Implementations§

source§

impl Clone for ForeignItemFn

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<ForeignItemFn> for ForeignItem

source§

fn from(e: ForeignItemFn) -> ForeignItem

Converts to this type from the input type.
source§

impl Parse for ForeignItemFn

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for ForeignItemFn

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.ForeignItemMacro.html b/syn/struct.ForeignItemMacro.html new file mode 100644 index 0000000..69920d0 --- /dev/null +++ b/syn/struct.ForeignItemMacro.html @@ -0,0 +1,20 @@ +ForeignItemMacro in syn - Rust

Struct syn::ForeignItemMacro

source ·
pub struct ForeignItemMacro {
+    pub attrs: Vec<Attribute>,
+    pub mac: Macro,
+    pub semi_token: Option<Semi>,
+}
Expand description

A macro invocation within an extern block.

+

Fields§

§attrs: Vec<Attribute>§mac: Macro§semi_token: Option<Semi>

Trait Implementations§

source§

impl Clone for ForeignItemMacro

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<ForeignItemMacro> for ForeignItem

source§

fn from(e: ForeignItemMacro) -> ForeignItem

Converts to this type from the input type.
source§

impl Parse for ForeignItemMacro

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for ForeignItemMacro

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.ForeignItemStatic.html b/syn/struct.ForeignItemStatic.html new file mode 100644 index 0000000..410df48 --- /dev/null +++ b/syn/struct.ForeignItemStatic.html @@ -0,0 +1,25 @@ +ForeignItemStatic in syn - Rust

Struct syn::ForeignItemStatic

source ·
pub struct ForeignItemStatic {
+    pub attrs: Vec<Attribute>,
+    pub vis: Visibility,
+    pub static_token: Static,
+    pub mutability: StaticMutability,
+    pub ident: Ident,
+    pub colon_token: Colon,
+    pub ty: Box<Type>,
+    pub semi_token: Semi,
+}
Expand description

A foreign static item in an extern block: static ext: u8.

+

Fields§

§attrs: Vec<Attribute>§vis: Visibility§static_token: Static§mutability: StaticMutability§ident: Ident§colon_token: Colon§ty: Box<Type>§semi_token: Semi

Trait Implementations§

source§

impl Clone for ForeignItemStatic

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<ForeignItemStatic> for ForeignItem

source§

fn from(e: ForeignItemStatic) -> ForeignItem

Converts to this type from the input type.
source§

impl Parse for ForeignItemStatic

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for ForeignItemStatic

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.ForeignItemType.html b/syn/struct.ForeignItemType.html new file mode 100644 index 0000000..ee043df --- /dev/null +++ b/syn/struct.ForeignItemType.html @@ -0,0 +1,23 @@ +ForeignItemType in syn - Rust

Struct syn::ForeignItemType

source ·
pub struct ForeignItemType {
+    pub attrs: Vec<Attribute>,
+    pub vis: Visibility,
+    pub type_token: Type,
+    pub ident: Ident,
+    pub generics: Generics,
+    pub semi_token: Semi,
+}
Expand description

A foreign type in an extern block: type void.

+

Fields§

§attrs: Vec<Attribute>§vis: Visibility§type_token: Type§ident: Ident§generics: Generics§semi_token: Semi

Trait Implementations§

source§

impl Clone for ForeignItemType

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<ForeignItemType> for ForeignItem

source§

fn from(e: ForeignItemType) -> ForeignItem

Converts to this type from the input type.
source§

impl Parse for ForeignItemType

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for ForeignItemType

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.Generics.html b/syn/struct.Generics.html new file mode 100644 index 0000000..a75755f --- /dev/null +++ b/syn/struct.Generics.html @@ -0,0 +1,79 @@ +Generics in syn - Rust

Struct syn::Generics

source ·
pub struct Generics {
+    pub lt_token: Option<Lt>,
+    pub params: Punctuated<GenericParam, Comma>,
+    pub gt_token: Option<Gt>,
+    pub where_clause: Option<WhereClause>,
+}
Expand description

Lifetimes and type parameters attached to a declaration of a function, +enum, trait, etc.

+

This struct represents two distinct optional syntactic elements, +generic parameters and where clause. In some locations of the +grammar, there may be other tokens in between these two things.

+

Fields§

§lt_token: Option<Lt>§params: Punctuated<GenericParam, Comma>§gt_token: Option<Gt>§where_clause: Option<WhereClause>

Implementations§

source§

impl Generics

source

pub fn lifetimes(&self) -> Lifetimes<'_>

Returns an +Iterator<Item = &LifetimeParam> +over the lifetime parameters in self.params.

+
source

pub fn lifetimes_mut(&mut self) -> LifetimesMut<'_>

Returns an +Iterator<Item = &mut LifetimeParam> +over the lifetime parameters in self.params.

+
source

pub fn type_params(&self) -> TypeParams<'_>

Returns an +Iterator<Item = &TypeParam> +over the type parameters in self.params.

+
source

pub fn type_params_mut(&mut self) -> TypeParamsMut<'_>

Returns an +Iterator<Item = &mut TypeParam> +over the type parameters in self.params.

+
source

pub fn const_params(&self) -> ConstParams<'_>

Returns an +Iterator<Item = &ConstParam> +over the constant parameters in self.params.

+
source

pub fn const_params_mut(&mut self) -> ConstParamsMut<'_>

Returns an +Iterator<Item = &mut ConstParam> +over the constant parameters in self.params.

+
source

pub fn make_where_clause(&mut self) -> &mut WhereClause

Initializes an empty where-clause if there is not one present already.

+
source§

impl Generics

source

pub fn split_for_impl( + &self +) -> (ImplGenerics<'_>, TypeGenerics<'_>, Option<&WhereClause>)

Split a type’s generics into the pieces required for impl’ing a trait +for that type.

+ +
let (impl_generics, ty_generics, where_clause) = generics.split_for_impl();
+quote! {
+    impl #impl_generics MyTrait for #name #ty_generics #where_clause {
+        // ...
+    }
+}
+

Trait Implementations§

source§

impl Clone for Generics

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for Generics

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Parse for Generics

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for Generics

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.Ident.html b/syn/struct.Ident.html new file mode 100644 index 0000000..c91d219 --- /dev/null +++ b/syn/struct.Ident.html @@ -0,0 +1,111 @@ +Ident in syn - Rust

Struct syn::Ident

source ·
pub struct Ident { /* private fields */ }
Expand description

A word of Rust code, which may be a keyword or legal variable name.

+

An identifier consists of at least one Unicode code point, the first of +which has the XID_Start property and the rest of which have the XID_Continue +property.

+
    +
  • The empty string is not an identifier. Use Option<Ident>.
  • +
  • A lifetime is not an identifier. Use syn::Lifetime instead.
  • +
+

An identifier constructed with Ident::new is permitted to be a Rust +keyword, though parsing one through its Parse implementation rejects +Rust keywords. Use input.call(Ident::parse_any) when parsing to match the +behaviour of Ident::new.

+

§Examples

+

A new ident can be created from a string using the Ident::new function. +A span must be provided explicitly which governs the name resolution +behavior of the resulting identifier.

+ +
use proc_macro2::{Ident, Span};
+
+fn main() {
+    let call_ident = Ident::new("calligraphy", Span::call_site());
+
+    println!("{}", call_ident);
+}
+

An ident can be interpolated into a token stream using the quote! macro.

+ +
use proc_macro2::{Ident, Span};
+use quote::quote;
+
+fn main() {
+    let ident = Ident::new("demo", Span::call_site());
+
+    // Create a variable binding whose name is this ident.
+    let expanded = quote! { let #ident = 10; };
+
+    // Create a variable binding with a slightly different name.
+    let temp_ident = Ident::new(&format!("new_{}", ident), Span::call_site());
+    let expanded = quote! { let #temp_ident = 10; };
+}
+

A string representation of the ident is available through the to_string() +method.

+ +
// Examine the ident as a string.
+let ident_string = ident.to_string();
+if ident_string.len() > 60 {
+    println!("Very long identifier: {}", ident_string)
+}
+

Implementations§

source§

impl Ident

source

pub fn new(string: &str, span: Span) -> Ident

Creates a new Ident with the given string as well as the specified +span.

+

The string argument must be a valid identifier permitted by the +language, otherwise the function will panic.

+

Note that span, currently in rustc, configures the hygiene information +for this identifier.

+

As of this time Span::call_site() explicitly opts-in to “call-site” +hygiene meaning that identifiers created with this span will be resolved +as if they were written directly at the location of the macro call, and +other code at the macro call site will be able to refer to them as well.

+

Later spans like Span::def_site() will allow to opt-in to +“definition-site” hygiene meaning that identifiers created with this +span will be resolved at the location of the macro definition and other +code at the macro call site will not be able to refer to them.

+

Due to the current importance of hygiene this constructor, unlike other +tokens, requires a Span to be specified at construction.

+
§Panics
+

Panics if the input string is neither a keyword nor a legal variable +name. If you are not sure whether the string contains an identifier and +need to handle an error case, use +syn::parse_str::<Ident> +rather than Ident::new.

+
source

pub fn new_raw(string: &str, span: Span) -> Ident

Same as Ident::new, but creates a raw identifier (r#ident). The +string argument must be a valid identifier permitted by the language +(including keywords, e.g. fn). Keywords which are usable in path +segments (e.g. self, super) are not supported, and will cause a +panic.

+
source

pub fn span(&self) -> Span

Returns the span of this Ident.

+
source

pub fn set_span(&mut self, span: Span)

Configures the span of this Ident, possibly changing its hygiene +context.

+

Trait Implementations§

source§

impl Clone for Ident

source§

fn clone(&self) -> Ident

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Ident

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Display for Ident

Prints the identifier as a string that should be losslessly convertible back +into the same identifier.

+
source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl From<Crate> for Ident

source§

fn from(token: Crate) -> Ident

Converts to this type from the input type.
source§

impl From<Extern> for Ident

source§

fn from(token: Extern) -> Ident

Converts to this type from the input type.
source§

impl From<Ident> for Member

source§

fn from(ident: Ident) -> Member

Converts to this type from the input type.
source§

impl From<Ident> for TypeParam

source§

fn from(ident: Ident) -> Self

Converts to this type from the input type.
source§

impl From<SelfType> for Ident

source§

fn from(token: SelfType) -> Ident

Converts to this type from the input type.
source§

impl From<SelfValue> for Ident

source§

fn from(token: SelfValue) -> Ident

Converts to this type from the input type.
source§

impl From<Super> for Ident

source§

fn from(token: Super) -> Ident

Converts to this type from the input type.
source§

impl From<Underscore> for Ident

source§

fn from(token: Underscore) -> Ident

Converts to this type from the input type.
source§

impl Hash for Ident

source§

fn hash<H>(&self, hasher: &mut H)
where + H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl IdentExt for Ident

source§

fn parse_any(input: ParseStream<'_>) -> Result<Self>

Parses any identifier including keywords. Read more
source§

fn unraw(&self) -> Ident

Strips the raw marker r#, if any, from the beginning of an ident. Read more
source§

const peek_any: PeekFn = private::PeekFn

Peeks any identifier including keywords. Usage: +input.peek(Ident::peek_any) Read more
source§

impl IdentFragment for Ident

source§

fn span(&self) -> Option<Span>

Span associated with this IdentFragment. Read more
source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Format this value as an identifier fragment.
source§

impl Ord for Ident

source§

fn cmp(&self, other: &Ident) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where + Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl Parse for Ident

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl<T> PartialEq<T> for Ident
where + T: AsRef<str> + ?Sized,

source§

fn eq(&self, other: &T) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl PartialEq for Ident

source§

fn eq(&self, other: &Ident) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for Ident

source§

fn partial_cmp(&self, other: &Ident) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= +operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= +operator. Read more
source§

impl ToTokens for Ident

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Eq for Ident

source§

impl Token for Ident

Auto Trait Implementations§

§

impl Freeze for Ident

§

impl RefUnwindSafe for Ident

§

impl !Send for Ident

§

impl !Sync for Ident

§

impl Unpin for Ident

§

impl UnwindSafe for Ident

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.ImplGenerics.html b/syn/struct.ImplGenerics.html new file mode 100644 index 0000000..c164f0e --- /dev/null +++ b/syn/struct.ImplGenerics.html @@ -0,0 +1,16 @@ +ImplGenerics in syn - Rust

Struct syn::ImplGenerics

source ·
pub struct ImplGenerics<'a>(/* private fields */);
Expand description

Returned by Generics::split_for_impl.

+

Trait Implementations§

source§

impl<'a> Clone for ImplGenerics<'a>

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'a> ToTokens for ImplGenerics<'a>

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for ImplGenerics<'a>

§

impl<'a> RefUnwindSafe for ImplGenerics<'a>

§

impl<'a> !Send for ImplGenerics<'a>

§

impl<'a> !Sync for ImplGenerics<'a>

§

impl<'a> Unpin for ImplGenerics<'a>

§

impl<'a> UnwindSafe for ImplGenerics<'a>

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.ImplItemConst.html b/syn/struct.ImplItemConst.html new file mode 100644 index 0000000..79c1601 --- /dev/null +++ b/syn/struct.ImplItemConst.html @@ -0,0 +1,28 @@ +ImplItemConst in syn - Rust

Struct syn::ImplItemConst

source ·
pub struct ImplItemConst {
+    pub attrs: Vec<Attribute>,
+    pub vis: Visibility,
+    pub defaultness: Option<Default>,
+    pub const_token: Const,
+    pub ident: Ident,
+    pub generics: Generics,
+    pub colon_token: Colon,
+    pub ty: Type,
+    pub eq_token: Eq,
+    pub expr: Expr,
+    pub semi_token: Semi,
+}
Expand description

An associated constant within an impl block.

+

Fields§

§attrs: Vec<Attribute>§vis: Visibility§defaultness: Option<Default>§const_token: Const§ident: Ident§generics: Generics§colon_token: Colon§ty: Type§eq_token: Eq§expr: Expr§semi_token: Semi

Trait Implementations§

source§

impl Clone for ImplItemConst

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<ImplItemConst> for ImplItem

source§

fn from(e: ImplItemConst) -> ImplItem

Converts to this type from the input type.
source§

impl Parse for ImplItemConst

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for ImplItemConst

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.ImplItemFn.html b/syn/struct.ImplItemFn.html new file mode 100644 index 0000000..b738634 --- /dev/null +++ b/syn/struct.ImplItemFn.html @@ -0,0 +1,22 @@ +ImplItemFn in syn - Rust

Struct syn::ImplItemFn

source ·
pub struct ImplItemFn {
+    pub attrs: Vec<Attribute>,
+    pub vis: Visibility,
+    pub defaultness: Option<Default>,
+    pub sig: Signature,
+    pub block: Block,
+}
Expand description

An associated function within an impl block.

+

Fields§

§attrs: Vec<Attribute>§vis: Visibility§defaultness: Option<Default>§sig: Signature§block: Block

Trait Implementations§

source§

impl Clone for ImplItemFn

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<ImplItemFn> for ImplItem

source§

fn from(e: ImplItemFn) -> ImplItem

Converts to this type from the input type.
source§

impl Parse for ImplItemFn

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for ImplItemFn

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.ImplItemMacro.html b/syn/struct.ImplItemMacro.html new file mode 100644 index 0000000..883b999 --- /dev/null +++ b/syn/struct.ImplItemMacro.html @@ -0,0 +1,20 @@ +ImplItemMacro in syn - Rust

Struct syn::ImplItemMacro

source ·
pub struct ImplItemMacro {
+    pub attrs: Vec<Attribute>,
+    pub mac: Macro,
+    pub semi_token: Option<Semi>,
+}
Expand description

A macro invocation within an impl block.

+

Fields§

§attrs: Vec<Attribute>§mac: Macro§semi_token: Option<Semi>

Trait Implementations§

source§

impl Clone for ImplItemMacro

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<ImplItemMacro> for ImplItem

source§

fn from(e: ImplItemMacro) -> ImplItem

Converts to this type from the input type.
source§

impl Parse for ImplItemMacro

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for ImplItemMacro

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.ImplItemType.html b/syn/struct.ImplItemType.html new file mode 100644 index 0000000..e35489e --- /dev/null +++ b/syn/struct.ImplItemType.html @@ -0,0 +1,26 @@ +ImplItemType in syn - Rust

Struct syn::ImplItemType

source ·
pub struct ImplItemType {
+    pub attrs: Vec<Attribute>,
+    pub vis: Visibility,
+    pub defaultness: Option<Default>,
+    pub type_token: Type,
+    pub ident: Ident,
+    pub generics: Generics,
+    pub eq_token: Eq,
+    pub ty: Type,
+    pub semi_token: Semi,
+}
Expand description

An associated type within an impl block.

+

Fields§

§attrs: Vec<Attribute>§vis: Visibility§defaultness: Option<Default>§type_token: Type§ident: Ident§generics: Generics§eq_token: Eq§ty: Type§semi_token: Semi

Trait Implementations§

source§

impl Clone for ImplItemType

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<ImplItemType> for ImplItem

source§

fn from(e: ImplItemType) -> ImplItem

Converts to this type from the input type.
source§

impl Parse for ImplItemType

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for ImplItemType

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.Index.html b/syn/struct.Index.html new file mode 100644 index 0000000..bca7771 --- /dev/null +++ b/syn/struct.Index.html @@ -0,0 +1,23 @@ +Index in syn - Rust

Struct syn::Index

source ·
pub struct Index {
+    pub index: u32,
+    pub span: Span,
+}
Expand description

The index of an unnamed tuple struct field.

+

Fields§

§index: u32§span: Span

Trait Implementations§

source§

impl Clone for Index

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<Index> for Member

source§

fn from(index: Index) -> Member

Converts to this type from the input type.
source§

impl From<usize> for Index

source§

fn from(index: usize) -> Index

Converts to this type from the input type.
source§

impl Hash for Index

source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl IdentFragment for Index

source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result

Format this value as an identifier fragment.
source§

fn span(&self) -> Option<Span>

Span associated with this IdentFragment. Read more
source§

impl Parse for Index

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl PartialEq for Index

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl ToTokens for Index

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Eq for Index

Auto Trait Implementations§

§

impl Freeze for Index

§

impl RefUnwindSafe for Index

§

impl !Send for Index

§

impl !Sync for Index

§

impl Unpin for Index

§

impl UnwindSafe for Index

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.ItemConst.html b/syn/struct.ItemConst.html new file mode 100644 index 0000000..38d5f83 --- /dev/null +++ b/syn/struct.ItemConst.html @@ -0,0 +1,27 @@ +ItemConst in syn - Rust

Struct syn::ItemConst

source ·
pub struct ItemConst {
+    pub attrs: Vec<Attribute>,
+    pub vis: Visibility,
+    pub const_token: Const,
+    pub ident: Ident,
+    pub generics: Generics,
+    pub colon_token: Colon,
+    pub ty: Box<Type>,
+    pub eq_token: Eq,
+    pub expr: Box<Expr>,
+    pub semi_token: Semi,
+}
Expand description

A constant item: const MAX: u16 = 65535.

+

Fields§

§attrs: Vec<Attribute>§vis: Visibility§const_token: Const§ident: Ident§generics: Generics§colon_token: Colon§ty: Box<Type>§eq_token: Eq§expr: Box<Expr>§semi_token: Semi

Trait Implementations§

source§

impl Clone for ItemConst

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<ItemConst> for Item

source§

fn from(e: ItemConst) -> Item

Converts to this type from the input type.
source§

impl Parse for ItemConst

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for ItemConst

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.ItemEnum.html b/syn/struct.ItemEnum.html new file mode 100644 index 0000000..5f87554 --- /dev/null +++ b/syn/struct.ItemEnum.html @@ -0,0 +1,24 @@ +ItemEnum in syn - Rust

Struct syn::ItemEnum

source ·
pub struct ItemEnum {
+    pub attrs: Vec<Attribute>,
+    pub vis: Visibility,
+    pub enum_token: Enum,
+    pub ident: Ident,
+    pub generics: Generics,
+    pub brace_token: Brace,
+    pub variants: Punctuated<Variant, Comma>,
+}
Expand description

An enum definition: enum Foo<A, B> { A(A), B(B) }.

+

Fields§

§attrs: Vec<Attribute>§vis: Visibility§enum_token: Enum§ident: Ident§generics: Generics§brace_token: Brace§variants: Punctuated<Variant, Comma>

Trait Implementations§

source§

impl Clone for ItemEnum

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<ItemEnum> for DeriveInput

source§

fn from(input: ItemEnum) -> DeriveInput

Converts to this type from the input type.
source§

impl From<ItemEnum> for Item

source§

fn from(e: ItemEnum) -> Item

Converts to this type from the input type.
source§

impl Parse for ItemEnum

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for ItemEnum

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.ItemExternCrate.html b/syn/struct.ItemExternCrate.html new file mode 100644 index 0000000..56f610c --- /dev/null +++ b/syn/struct.ItemExternCrate.html @@ -0,0 +1,24 @@ +ItemExternCrate in syn - Rust

Struct syn::ItemExternCrate

source ·
pub struct ItemExternCrate {
+    pub attrs: Vec<Attribute>,
+    pub vis: Visibility,
+    pub extern_token: Extern,
+    pub crate_token: Crate,
+    pub ident: Ident,
+    pub rename: Option<(As, Ident)>,
+    pub semi_token: Semi,
+}
Expand description

An extern crate item: extern crate serde.

+

Fields§

§attrs: Vec<Attribute>§vis: Visibility§extern_token: Extern§crate_token: Crate§ident: Ident§rename: Option<(As, Ident)>§semi_token: Semi

Trait Implementations§

source§

impl Clone for ItemExternCrate

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<ItemExternCrate> for Item

source§

fn from(e: ItemExternCrate) -> Item

Converts to this type from the input type.
source§

impl Parse for ItemExternCrate

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for ItemExternCrate

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.ItemFn.html b/syn/struct.ItemFn.html new file mode 100644 index 0000000..e51b3ff --- /dev/null +++ b/syn/struct.ItemFn.html @@ -0,0 +1,21 @@ +ItemFn in syn - Rust

Struct syn::ItemFn

source ·
pub struct ItemFn {
+    pub attrs: Vec<Attribute>,
+    pub vis: Visibility,
+    pub sig: Signature,
+    pub block: Box<Block>,
+}
Expand description

A free-standing function: fn process(n: usize) -> Result<()> { ... }.

+

Fields§

§attrs: Vec<Attribute>§vis: Visibility§sig: Signature§block: Box<Block>

Trait Implementations§

source§

impl Clone for ItemFn

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<ItemFn> for Item

source§

fn from(e: ItemFn) -> Item

Converts to this type from the input type.
source§

impl Parse for ItemFn

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for ItemFn

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

§

impl Freeze for ItemFn

§

impl RefUnwindSafe for ItemFn

§

impl !Send for ItemFn

§

impl !Sync for ItemFn

§

impl Unpin for ItemFn

§

impl UnwindSafe for ItemFn

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.ItemForeignMod.html b/syn/struct.ItemForeignMod.html new file mode 100644 index 0000000..6e7aeb1 --- /dev/null +++ b/syn/struct.ItemForeignMod.html @@ -0,0 +1,22 @@ +ItemForeignMod in syn - Rust

Struct syn::ItemForeignMod

source ·
pub struct ItemForeignMod {
+    pub attrs: Vec<Attribute>,
+    pub unsafety: Option<Unsafe>,
+    pub abi: Abi,
+    pub brace_token: Brace,
+    pub items: Vec<ForeignItem>,
+}
Expand description

A block of foreign items: extern "C" { ... }.

+

Fields§

§attrs: Vec<Attribute>§unsafety: Option<Unsafe>§abi: Abi§brace_token: Brace§items: Vec<ForeignItem>

Trait Implementations§

source§

impl Clone for ItemForeignMod

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<ItemForeignMod> for Item

source§

fn from(e: ItemForeignMod) -> Item

Converts to this type from the input type.
source§

impl Parse for ItemForeignMod

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for ItemForeignMod

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.ItemImpl.html b/syn/struct.ItemImpl.html new file mode 100644 index 0000000..6ddcee6 --- /dev/null +++ b/syn/struct.ItemImpl.html @@ -0,0 +1,28 @@ +ItemImpl in syn - Rust

Struct syn::ItemImpl

source ·
pub struct ItemImpl {
+    pub attrs: Vec<Attribute>,
+    pub defaultness: Option<Default>,
+    pub unsafety: Option<Unsafe>,
+    pub impl_token: Impl,
+    pub generics: Generics,
+    pub trait_: Option<(Option<Not>, Path, For)>,
+    pub self_ty: Box<Type>,
+    pub brace_token: Brace,
+    pub items: Vec<ImplItem>,
+}
Expand description

An impl block providing trait or associated items: impl<A> Trait for Data<A> { ... }.

+

Fields§

§attrs: Vec<Attribute>§defaultness: Option<Default>§unsafety: Option<Unsafe>§impl_token: Impl§generics: Generics§trait_: Option<(Option<Not>, Path, For)>

Trait this impl implements.

+
§self_ty: Box<Type>

The Self type of the impl.

+
§brace_token: Brace§items: Vec<ImplItem>

Trait Implementations§

source§

impl Clone for ItemImpl

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<ItemImpl> for Item

source§

fn from(e: ItemImpl) -> Item

Converts to this type from the input type.
source§

impl Parse for ItemImpl

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for ItemImpl

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.ItemMacro.html b/syn/struct.ItemMacro.html new file mode 100644 index 0000000..a3a7b08 --- /dev/null +++ b/syn/struct.ItemMacro.html @@ -0,0 +1,22 @@ +ItemMacro in syn - Rust

Struct syn::ItemMacro

source ·
pub struct ItemMacro {
+    pub attrs: Vec<Attribute>,
+    pub ident: Option<Ident>,
+    pub mac: Macro,
+    pub semi_token: Option<Semi>,
+}
Expand description

A macro invocation, which includes macro_rules! definitions.

+

Fields§

§attrs: Vec<Attribute>§ident: Option<Ident>

The example in macro_rules! example { ... }.

+
§mac: Macro§semi_token: Option<Semi>

Trait Implementations§

source§

impl Clone for ItemMacro

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<ItemMacro> for Item

source§

fn from(e: ItemMacro) -> Item

Converts to this type from the input type.
source§

impl Parse for ItemMacro

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for ItemMacro

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.ItemMod.html b/syn/struct.ItemMod.html new file mode 100644 index 0000000..779fcf6 --- /dev/null +++ b/syn/struct.ItemMod.html @@ -0,0 +1,24 @@ +ItemMod in syn - Rust

Struct syn::ItemMod

source ·
pub struct ItemMod {
+    pub attrs: Vec<Attribute>,
+    pub vis: Visibility,
+    pub unsafety: Option<Unsafe>,
+    pub mod_token: Mod,
+    pub ident: Ident,
+    pub content: Option<(Brace, Vec<Item>)>,
+    pub semi: Option<Semi>,
+}
Expand description

A module or module declaration: mod m or mod m { ... }.

+

Fields§

§attrs: Vec<Attribute>§vis: Visibility§unsafety: Option<Unsafe>§mod_token: Mod§ident: Ident§content: Option<(Brace, Vec<Item>)>§semi: Option<Semi>

Trait Implementations§

source§

impl Clone for ItemMod

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<ItemMod> for Item

source§

fn from(e: ItemMod) -> Item

Converts to this type from the input type.
source§

impl Parse for ItemMod

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for ItemMod

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.ItemStatic.html b/syn/struct.ItemStatic.html new file mode 100644 index 0000000..1d09e68 --- /dev/null +++ b/syn/struct.ItemStatic.html @@ -0,0 +1,27 @@ +ItemStatic in syn - Rust

Struct syn::ItemStatic

source ·
pub struct ItemStatic {
+    pub attrs: Vec<Attribute>,
+    pub vis: Visibility,
+    pub static_token: Static,
+    pub mutability: StaticMutability,
+    pub ident: Ident,
+    pub colon_token: Colon,
+    pub ty: Box<Type>,
+    pub eq_token: Eq,
+    pub expr: Box<Expr>,
+    pub semi_token: Semi,
+}
Expand description

A static item: static BIKE: Shed = Shed(42).

+

Fields§

§attrs: Vec<Attribute>§vis: Visibility§static_token: Static§mutability: StaticMutability§ident: Ident§colon_token: Colon§ty: Box<Type>§eq_token: Eq§expr: Box<Expr>§semi_token: Semi

Trait Implementations§

source§

impl Clone for ItemStatic

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<ItemStatic> for Item

source§

fn from(e: ItemStatic) -> Item

Converts to this type from the input type.
source§

impl Parse for ItemStatic

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for ItemStatic

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.ItemStruct.html b/syn/struct.ItemStruct.html new file mode 100644 index 0000000..cfbe063 --- /dev/null +++ b/syn/struct.ItemStruct.html @@ -0,0 +1,24 @@ +ItemStruct in syn - Rust

Struct syn::ItemStruct

source ·
pub struct ItemStruct {
+    pub attrs: Vec<Attribute>,
+    pub vis: Visibility,
+    pub struct_token: Struct,
+    pub ident: Ident,
+    pub generics: Generics,
+    pub fields: Fields,
+    pub semi_token: Option<Semi>,
+}
Expand description

A struct definition: struct Foo<A> { x: A }.

+

Fields§

§attrs: Vec<Attribute>§vis: Visibility§struct_token: Struct§ident: Ident§generics: Generics§fields: Fields§semi_token: Option<Semi>

Trait Implementations§

source§

impl Clone for ItemStruct

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<ItemStruct> for DeriveInput

source§

fn from(input: ItemStruct) -> DeriveInput

Converts to this type from the input type.
source§

impl From<ItemStruct> for Item

source§

fn from(e: ItemStruct) -> Item

Converts to this type from the input type.
source§

impl Parse for ItemStruct

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for ItemStruct

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.ItemTrait.html b/syn/struct.ItemTrait.html new file mode 100644 index 0000000..8903829 --- /dev/null +++ b/syn/struct.ItemTrait.html @@ -0,0 +1,29 @@ +ItemTrait in syn - Rust

Struct syn::ItemTrait

source ·
pub struct ItemTrait {
+    pub attrs: Vec<Attribute>,
+    pub vis: Visibility,
+    pub unsafety: Option<Unsafe>,
+    pub auto_token: Option<Auto>,
+    pub restriction: Option<ImplRestriction>,
+    pub trait_token: Trait,
+    pub ident: Ident,
+    pub generics: Generics,
+    pub colon_token: Option<Colon>,
+    pub supertraits: Punctuated<TypeParamBound, Plus>,
+    pub brace_token: Brace,
+    pub items: Vec<TraitItem>,
+}
Expand description

A trait definition: pub trait Iterator { ... }.

+

Fields§

§attrs: Vec<Attribute>§vis: Visibility§unsafety: Option<Unsafe>§auto_token: Option<Auto>§restriction: Option<ImplRestriction>§trait_token: Trait§ident: Ident§generics: Generics§colon_token: Option<Colon>§supertraits: Punctuated<TypeParamBound, Plus>§brace_token: Brace§items: Vec<TraitItem>

Trait Implementations§

source§

impl Clone for ItemTrait

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<ItemTrait> for Item

source§

fn from(e: ItemTrait) -> Item

Converts to this type from the input type.
source§

impl Parse for ItemTrait

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for ItemTrait

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.ItemTraitAlias.html b/syn/struct.ItemTraitAlias.html new file mode 100644 index 0000000..18c5c44 --- /dev/null +++ b/syn/struct.ItemTraitAlias.html @@ -0,0 +1,25 @@ +ItemTraitAlias in syn - Rust

Struct syn::ItemTraitAlias

source ·
pub struct ItemTraitAlias {
+    pub attrs: Vec<Attribute>,
+    pub vis: Visibility,
+    pub trait_token: Trait,
+    pub ident: Ident,
+    pub generics: Generics,
+    pub eq_token: Eq,
+    pub bounds: Punctuated<TypeParamBound, Plus>,
+    pub semi_token: Semi,
+}
Expand description

A trait alias: pub trait SharableIterator = Iterator + Sync.

+

Fields§

§attrs: Vec<Attribute>§vis: Visibility§trait_token: Trait§ident: Ident§generics: Generics§eq_token: Eq§bounds: Punctuated<TypeParamBound, Plus>§semi_token: Semi

Trait Implementations§

source§

impl Clone for ItemTraitAlias

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<ItemTraitAlias> for Item

source§

fn from(e: ItemTraitAlias) -> Item

Converts to this type from the input type.
source§

impl Parse for ItemTraitAlias

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for ItemTraitAlias

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.ItemType.html b/syn/struct.ItemType.html new file mode 100644 index 0000000..6351865 --- /dev/null +++ b/syn/struct.ItemType.html @@ -0,0 +1,25 @@ +ItemType in syn - Rust

Struct syn::ItemType

source ·
pub struct ItemType {
+    pub attrs: Vec<Attribute>,
+    pub vis: Visibility,
+    pub type_token: Type,
+    pub ident: Ident,
+    pub generics: Generics,
+    pub eq_token: Eq,
+    pub ty: Box<Type>,
+    pub semi_token: Semi,
+}
Expand description

A type alias: type Result<T> = std::result::Result<T, MyError>.

+

Fields§

§attrs: Vec<Attribute>§vis: Visibility§type_token: Type§ident: Ident§generics: Generics§eq_token: Eq§ty: Box<Type>§semi_token: Semi

Trait Implementations§

source§

impl Clone for ItemType

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<ItemType> for Item

source§

fn from(e: ItemType) -> Item

Converts to this type from the input type.
source§

impl Parse for ItemType

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for ItemType

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.ItemUnion.html b/syn/struct.ItemUnion.html new file mode 100644 index 0000000..28a10fc --- /dev/null +++ b/syn/struct.ItemUnion.html @@ -0,0 +1,23 @@ +ItemUnion in syn - Rust

Struct syn::ItemUnion

source ·
pub struct ItemUnion {
+    pub attrs: Vec<Attribute>,
+    pub vis: Visibility,
+    pub union_token: Union,
+    pub ident: Ident,
+    pub generics: Generics,
+    pub fields: FieldsNamed,
+}
Expand description

A union definition: union Foo<A, B> { x: A, y: B }.

+

Fields§

§attrs: Vec<Attribute>§vis: Visibility§union_token: Union§ident: Ident§generics: Generics§fields: FieldsNamed

Trait Implementations§

source§

impl Clone for ItemUnion

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<ItemUnion> for DeriveInput

source§

fn from(input: ItemUnion) -> DeriveInput

Converts to this type from the input type.
source§

impl From<ItemUnion> for Item

source§

fn from(e: ItemUnion) -> Item

Converts to this type from the input type.
source§

impl Parse for ItemUnion

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for ItemUnion

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.ItemUse.html b/syn/struct.ItemUse.html new file mode 100644 index 0000000..f968672 --- /dev/null +++ b/syn/struct.ItemUse.html @@ -0,0 +1,23 @@ +ItemUse in syn - Rust

Struct syn::ItemUse

source ·
pub struct ItemUse {
+    pub attrs: Vec<Attribute>,
+    pub vis: Visibility,
+    pub use_token: Use,
+    pub leading_colon: Option<PathSep>,
+    pub tree: UseTree,
+    pub semi_token: Semi,
+}
Expand description

A use declaration: use std::collections::HashMap.

+

Fields§

§attrs: Vec<Attribute>§vis: Visibility§use_token: Use§leading_colon: Option<PathSep>§tree: UseTree§semi_token: Semi

Trait Implementations§

source§

impl Clone for ItemUse

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<ItemUse> for Item

source§

fn from(e: ItemUse) -> Item

Converts to this type from the input type.
source§

impl Parse for ItemUse

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for ItemUse

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.Label.html b/syn/struct.Label.html new file mode 100644 index 0000000..028b143 --- /dev/null +++ b/syn/struct.Label.html @@ -0,0 +1,19 @@ +Label in syn - Rust

Struct syn::Label

source ·
pub struct Label {
+    pub name: Lifetime,
+    pub colon_token: Colon,
+}
Expand description

A lifetime labeling a for, while, or loop.

+

Fields§

§name: Lifetime§colon_token: Colon

Trait Implementations§

source§

impl Clone for Label

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Parse for Label

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for Label

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

§

impl Freeze for Label

§

impl RefUnwindSafe for Label

§

impl !Send for Label

§

impl !Sync for Label

§

impl Unpin for Label

§

impl UnwindSafe for Label

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.Lifetime.html b/syn/struct.Lifetime.html new file mode 100644 index 0000000..dcdd02b --- /dev/null +++ b/syn/struct.Lifetime.html @@ -0,0 +1,42 @@ +Lifetime in syn - Rust

Struct syn::Lifetime

source ·
pub struct Lifetime {
+    pub apostrophe: Span,
+    pub ident: Ident,
+}
Expand description

A Rust lifetime: 'a.

+

Lifetime names must conform to the following rules:

+
    +
  • Must start with an apostrophe.
  • +
  • Must not consist of just an apostrophe: '.
  • +
  • Character after the apostrophe must be _ or a Unicode code point with +the XID_Start property.
  • +
  • All following characters must be Unicode code points with the XID_Continue +property.
  • +
+

Fields§

§apostrophe: Span§ident: Ident

Implementations§

source§

impl Lifetime

source

pub fn new(symbol: &str, span: Span) -> Self

§Panics
+

Panics if the lifetime does not conform to the bulleted rules above.

+
§Invocation
+
Lifetime::new("'a", Span::call_site())
+
source

pub fn span(&self) -> Span

source

pub fn set_span(&mut self, span: Span)

Trait Implementations§

source§

impl Clone for Lifetime

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Display for Lifetime

source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<Lifetime> for TypeParamBound

source§

fn from(e: Lifetime) -> TypeParamBound

Converts to this type from the input type.
source§

impl Hash for Lifetime

source§

fn hash<H: Hasher>(&self, h: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where + H: Hasher, + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Ord for Lifetime

source§

fn cmp(&self, other: &Lifetime) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where + Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl Parse for Lifetime

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl PartialEq for Lifetime

source§

fn eq(&self, other: &Lifetime) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for Lifetime

source§

fn partial_cmp(&self, other: &Lifetime) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= +operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= +operator. Read more
source§

impl ToTokens for Lifetime

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Eq for Lifetime

source§

impl Token for Lifetime

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.LifetimeParam.html b/syn/struct.LifetimeParam.html new file mode 100644 index 0000000..8fdbabd --- /dev/null +++ b/syn/struct.LifetimeParam.html @@ -0,0 +1,21 @@ +LifetimeParam in syn - Rust

Struct syn::LifetimeParam

source ·
pub struct LifetimeParam {
+    pub attrs: Vec<Attribute>,
+    pub lifetime: Lifetime,
+    pub colon_token: Option<Colon>,
+    pub bounds: Punctuated<Lifetime, Plus>,
+}
Expand description

A lifetime definition: 'a: 'b + 'c + 'd.

+

Fields§

§attrs: Vec<Attribute>§lifetime: Lifetime§colon_token: Option<Colon>§bounds: Punctuated<Lifetime, Plus>

Implementations§

source§

impl LifetimeParam

source

pub fn new(lifetime: Lifetime) -> Self

Trait Implementations§

source§

impl Clone for LifetimeParam

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<LifetimeParam> for GenericParam

source§

fn from(e: LifetimeParam) -> GenericParam

Converts to this type from the input type.
source§

impl Parse for LifetimeParam

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for LifetimeParam

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.LitBool.html b/syn/struct.LitBool.html new file mode 100644 index 0000000..075fbf5 --- /dev/null +++ b/syn/struct.LitBool.html @@ -0,0 +1,19 @@ +LitBool in syn - Rust

Struct syn::LitBool

source ·
pub struct LitBool {
+    pub value: bool,
+    pub span: Span,
+}
Expand description

A boolean literal: true or false.

+

Fields§

§value: bool§span: Span

Implementations§

source§

impl LitBool

source

pub fn new(value: bool, span: Span) -> Self

source

pub fn value(&self) -> bool

source

pub fn span(&self) -> Span

source

pub fn set_span(&mut self, span: Span)

source

pub fn token(&self) -> Ident

Trait Implementations§

source§

impl Clone for LitBool

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<LitBool> for Lit

source§

fn from(e: LitBool) -> Lit

Converts to this type from the input type.
source§

impl Parse for LitBool

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for LitBool

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Token for LitBool

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.LitByte.html b/syn/struct.LitByte.html new file mode 100644 index 0000000..5237fa0 --- /dev/null +++ b/syn/struct.LitByte.html @@ -0,0 +1,16 @@ +LitByte in syn - Rust

Struct syn::LitByte

source ·
pub struct LitByte { /* private fields */ }
Expand description

A byte literal: b'f'.

+

Implementations§

source§

impl LitByte

source

pub fn new(value: u8, span: Span) -> Self

source

pub fn value(&self) -> u8

source

pub fn span(&self) -> Span

source

pub fn set_span(&mut self, span: Span)

source

pub fn suffix(&self) -> &str

source

pub fn token(&self) -> Literal

Trait Implementations§

source§

impl Clone for LitByte

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<LitByte> for Lit

source§

fn from(e: LitByte) -> Lit

Converts to this type from the input type.
source§

impl Parse for LitByte

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for LitByte

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Token for LitByte

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.LitByteStr.html b/syn/struct.LitByteStr.html new file mode 100644 index 0000000..b18691c --- /dev/null +++ b/syn/struct.LitByteStr.html @@ -0,0 +1,16 @@ +LitByteStr in syn - Rust

Struct syn::LitByteStr

source ·
pub struct LitByteStr { /* private fields */ }
Expand description

A byte string literal: b"foo".

+

Implementations§

source§

impl LitByteStr

source

pub fn new(value: &[u8], span: Span) -> Self

source

pub fn value(&self) -> Vec<u8>

source

pub fn span(&self) -> Span

source

pub fn set_span(&mut self, span: Span)

source

pub fn suffix(&self) -> &str

source

pub fn token(&self) -> Literal

Trait Implementations§

source§

impl Clone for LitByteStr

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<LitByteStr> for Lit

source§

fn from(e: LitByteStr) -> Lit

Converts to this type from the input type.
source§

impl Parse for LitByteStr

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for LitByteStr

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Token for LitByteStr

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.LitCStr.html b/syn/struct.LitCStr.html new file mode 100644 index 0000000..9029466 --- /dev/null +++ b/syn/struct.LitCStr.html @@ -0,0 +1,16 @@ +LitCStr in syn - Rust

Struct syn::LitCStr

source ·
pub struct LitCStr { /* private fields */ }
Expand description

A nul-terminated C-string literal: c"foo".

+

Implementations§

source§

impl LitCStr

source

pub fn new(value: &CStr, span: Span) -> Self

source

pub fn value(&self) -> CString

source

pub fn span(&self) -> Span

source

pub fn set_span(&mut self, span: Span)

source

pub fn suffix(&self) -> &str

source

pub fn token(&self) -> Literal

Trait Implementations§

source§

impl Clone for LitCStr

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<LitCStr> for Lit

source§

fn from(e: LitCStr) -> Lit

Converts to this type from the input type.
source§

impl Parse for LitCStr

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for LitCStr

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.LitChar.html b/syn/struct.LitChar.html new file mode 100644 index 0000000..e9910c2 --- /dev/null +++ b/syn/struct.LitChar.html @@ -0,0 +1,16 @@ +LitChar in syn - Rust

Struct syn::LitChar

source ·
pub struct LitChar { /* private fields */ }
Expand description

A character literal: 'a'.

+

Implementations§

source§

impl LitChar

source

pub fn new(value: char, span: Span) -> Self

source

pub fn value(&self) -> char

source

pub fn span(&self) -> Span

source

pub fn set_span(&mut self, span: Span)

source

pub fn suffix(&self) -> &str

source

pub fn token(&self) -> Literal

Trait Implementations§

source§

impl Clone for LitChar

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<LitChar> for Lit

source§

fn from(e: LitChar) -> Lit

Converts to this type from the input type.
source§

impl Parse for LitChar

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for LitChar

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Token for LitChar

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.LitFloat.html b/syn/struct.LitFloat.html new file mode 100644 index 0000000..c9a12b5 --- /dev/null +++ b/syn/struct.LitFloat.html @@ -0,0 +1,20 @@ +LitFloat in syn - Rust

Struct syn::LitFloat

source ·
pub struct LitFloat { /* private fields */ }
Expand description

A floating point literal: 1f64 or 1.0e10f64.

+

Must be finite. May not be infinite or NaN.

+

Implementations§

source§

impl LitFloat

source

pub fn new(repr: &str, span: Span) -> Self

source

pub fn base10_digits(&self) -> &str

source

pub fn base10_parse<N>(&self) -> Result<N>
where + N: FromStr, + N::Err: Display,

source

pub fn suffix(&self) -> &str

source

pub fn span(&self) -> Span

source

pub fn set_span(&mut self, span: Span)

source

pub fn token(&self) -> Literal

Trait Implementations§

source§

impl Clone for LitFloat

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Display for LitFloat

source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<LitFloat> for Lit

source§

fn from(e: LitFloat) -> Lit

Converts to this type from the input type.
source§

impl From<Literal> for LitFloat

source§

fn from(token: Literal) -> Self

Converts to this type from the input type.
source§

impl Parse for LitFloat

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for LitFloat

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Token for LitFloat

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.LitInt.html b/syn/struct.LitInt.html new file mode 100644 index 0000000..fa0170a --- /dev/null +++ b/syn/struct.LitInt.html @@ -0,0 +1,38 @@ +LitInt in syn - Rust

Struct syn::LitInt

source ·
pub struct LitInt { /* private fields */ }
Expand description

An integer literal: 1 or 1u16.

+

Implementations§

source§

impl LitInt

source

pub fn new(repr: &str, span: Span) -> Self

source

pub fn base10_digits(&self) -> &str

source

pub fn base10_parse<N>(&self) -> Result<N>
where + N: FromStr, + N::Err: Display,

Parses the literal into a selected number type.

+

This is equivalent to lit.base10_digits().parse() except that the +resulting errors will be correctly spanned to point to the literal token +in the macro input.

+ +
use syn::LitInt;
+use syn::parse::{Parse, ParseStream, Result};
+
+struct Port {
+    value: u16,
+}
+
+impl Parse for Port {
+    fn parse(input: ParseStream) -> Result<Self> {
+        let lit: LitInt = input.parse()?;
+        let value = lit.base10_parse::<u16>()?;
+        Ok(Port { value })
+    }
+}
+
source

pub fn suffix(&self) -> &str

source

pub fn span(&self) -> Span

source

pub fn set_span(&mut self, span: Span)

source

pub fn token(&self) -> Literal

Trait Implementations§

source§

impl Clone for LitInt

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Display for LitInt

source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<LitInt> for Lit

source§

fn from(e: LitInt) -> Lit

Converts to this type from the input type.
source§

impl From<Literal> for LitInt

source§

fn from(token: Literal) -> Self

Converts to this type from the input type.
source§

impl Parse for LitInt

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for LitInt

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Token for LitInt

Auto Trait Implementations§

§

impl Freeze for LitInt

§

impl RefUnwindSafe for LitInt

§

impl !Send for LitInt

§

impl !Sync for LitInt

§

impl Unpin for LitInt

§

impl UnwindSafe for LitInt

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.LitStr.html b/syn/struct.LitStr.html new file mode 100644 index 0000000..3536aec --- /dev/null +++ b/syn/struct.LitStr.html @@ -0,0 +1,50 @@ +LitStr in syn - Rust

Struct syn::LitStr

source ·
pub struct LitStr { /* private fields */ }
Expand description

A UTF-8 string literal: "foo".

+

Implementations§

source§

impl LitStr

source

pub fn new(value: &str, span: Span) -> Self

source

pub fn value(&self) -> String

source

pub fn parse<T: Parse>(&self) -> Result<T>

Parse a syntax tree node from the content of this string literal.

+

All spans in the syntax tree will point to the span of this LitStr.

+
§Example
+
use syn::{Attribute, Error, Expr, Lit, Meta, Path, Result};
+
+// Parses the path from an attribute that looks like:
+//
+//     #[path = "a::b::c"]
+//
+// or returns `None` if the input is some other attribute.
+fn get_path(attr: &Attribute) -> Result<Option<Path>> {
+    if !attr.path().is_ident("path") {
+        return Ok(None);
+    }
+
+    if let Meta::NameValue(meta) = &attr.meta {
+        if let Expr::Lit(expr) = &meta.value {
+            if let Lit::Str(lit_str) = &expr.lit {
+                return lit_str.parse().map(Some);
+            }
+        }
+    }
+
+    let message = "expected #[path = \"...\"]";
+    Err(Error::new_spanned(attr, message))
+}
+
source

pub fn parse_with<F: Parser>(&self, parser: F) -> Result<F::Output>

Invoke parser on the content of this string literal.

+

All spans in the syntax tree will point to the span of this LitStr.

+
§Example
+
let lit_str: LitStr = /* ... */;
+
+// Parse a string literal like "a::b::c" into a Path, not allowing
+// generic arguments on any of the path segments.
+let basic_path = lit_str.parse_with(syn::Path::parse_mod_style)?;
+
source

pub fn span(&self) -> Span

source

pub fn set_span(&mut self, span: Span)

source

pub fn suffix(&self) -> &str

source

pub fn token(&self) -> Literal

Trait Implementations§

source§

impl Clone for LitStr

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<LitStr> for Lit

source§

fn from(e: LitStr) -> Lit

Converts to this type from the input type.
source§

impl Parse for LitStr

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for LitStr

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Token for LitStr

Auto Trait Implementations§

§

impl Freeze for LitStr

§

impl RefUnwindSafe for LitStr

§

impl !Send for LitStr

§

impl !Sync for LitStr

§

impl Unpin for LitStr

§

impl UnwindSafe for LitStr

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.Local.html b/syn/struct.Local.html new file mode 100644 index 0000000..bec3281 --- /dev/null +++ b/syn/struct.Local.html @@ -0,0 +1,22 @@ +Local in syn - Rust

Struct syn::Local

source ·
pub struct Local {
+    pub attrs: Vec<Attribute>,
+    pub let_token: Let,
+    pub pat: Pat,
+    pub init: Option<LocalInit>,
+    pub semi_token: Semi,
+}
Expand description

A local let binding: let x: u64 = s.parse()?.

+

Fields§

§attrs: Vec<Attribute>§let_token: Let§pat: Pat§init: Option<LocalInit>§semi_token: Semi

Trait Implementations§

source§

impl Clone for Local

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl ToTokens for Local

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

§

impl Freeze for Local

§

impl RefUnwindSafe for Local

§

impl !Send for Local

§

impl !Sync for Local

§

impl Unpin for Local

§

impl UnwindSafe for Local

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.LocalInit.html b/syn/struct.LocalInit.html new file mode 100644 index 0000000..671e7bf --- /dev/null +++ b/syn/struct.LocalInit.html @@ -0,0 +1,20 @@ +LocalInit in syn - Rust

Struct syn::LocalInit

source ·
pub struct LocalInit {
+    pub eq_token: Eq,
+    pub expr: Box<Expr>,
+    pub diverge: Option<(Else, Box<Expr>)>,
+}
Expand description

The expression assigned in a local let binding, including optional +diverging else block.

+

LocalInit represents = s.parse()? in let x: u64 = s.parse()? and += r else { return } in let Ok(x) = r else { return }.

+

Fields§

§eq_token: Eq§expr: Box<Expr>§diverge: Option<(Else, Box<Expr>)>

Trait Implementations§

source§

impl Clone for LocalInit

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.Macro.html b/syn/struct.Macro.html new file mode 100644 index 0000000..020edc1 --- /dev/null +++ b/syn/struct.Macro.html @@ -0,0 +1,100 @@ +Macro in syn - Rust

Struct syn::Macro

source ·
pub struct Macro {
+    pub path: Path,
+    pub bang_token: Not,
+    pub delimiter: MacroDelimiter,
+    pub tokens: TokenStream,
+}
Expand description

A macro invocation: println!("{}", mac).

+

Fields§

§path: Path§bang_token: Not§delimiter: MacroDelimiter§tokens: TokenStream

Implementations§

source§

impl Macro

source

pub fn parse_body<T: Parse>(&self) -> Result<T>

Parse the tokens within the macro invocation’s delimiters into a syntax +tree.

+

This is equivalent to syn::parse2::<T>(mac.tokens) except that it +produces a more useful span when tokens is empty.

+
§Example
+
use syn::{parse_quote, Expr, ExprLit, Ident, Lit, LitStr, Macro, Token};
+use syn::ext::IdentExt;
+use syn::parse::{Error, Parse, ParseStream, Result};
+use syn::punctuated::Punctuated;
+
+// The arguments expected by libcore's format_args macro, and as a
+// result most other formatting and printing macros like println.
+//
+//     println!("{} is {number:.prec$}", "x", prec=5, number=0.01)
+struct FormatArgs {
+    format_string: Expr,
+    positional_args: Vec<Expr>,
+    named_args: Vec<(Ident, Expr)>,
+}
+
+impl Parse for FormatArgs {
+    fn parse(input: ParseStream) -> Result<Self> {
+        let format_string: Expr;
+        let mut positional_args = Vec::new();
+        let mut named_args = Vec::new();
+
+        format_string = input.parse()?;
+        while !input.is_empty() {
+            input.parse::<Token![,]>()?;
+            if input.is_empty() {
+                break;
+            }
+            if input.peek(Ident::peek_any) && input.peek2(Token![=]) {
+                while !input.is_empty() {
+                    let name: Ident = input.call(Ident::parse_any)?;
+                    input.parse::<Token![=]>()?;
+                    let value: Expr = input.parse()?;
+                    named_args.push((name, value));
+                    if input.is_empty() {
+                        break;
+                    }
+                    input.parse::<Token![,]>()?;
+                }
+                break;
+            }
+            positional_args.push(input.parse()?);
+        }
+
+        Ok(FormatArgs {
+            format_string,
+            positional_args,
+            named_args,
+        })
+    }
+}
+
+// Extract the first argument, the format string literal, from an
+// invocation of a formatting or printing macro.
+fn get_format_string(m: &Macro) -> Result<LitStr> {
+    let args: FormatArgs = m.parse_body()?;
+    match args.format_string {
+        Expr::Lit(ExprLit { lit: Lit::Str(lit), .. }) => Ok(lit),
+        other => {
+            // First argument was not a string literal expression.
+            // Maybe something like: println!(concat!(...), ...)
+            Err(Error::new_spanned(other, "format string must be a string literal"))
+        }
+    }
+}
+
+fn main() {
+    let invocation = parse_quote! {
+        println!("{:?}", Instant::now())
+    };
+    let lit = get_format_string(&invocation).unwrap();
+    assert_eq!(lit.value(), "{:?}");
+}
+
source

pub fn parse_body_with<F: Parser>(&self, parser: F) -> Result<F::Output>

Parse the tokens within the macro invocation’s delimiters using the +given parser.

+

Trait Implementations§

source§

impl Clone for Macro

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Parse for Macro

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for Macro

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

§

impl Freeze for Macro

§

impl RefUnwindSafe for Macro

§

impl !Send for Macro

§

impl !Sync for Macro

§

impl Unpin for Macro

§

impl UnwindSafe for Macro

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.MetaList.html b/syn/struct.MetaList.html new file mode 100644 index 0000000..879e906 --- /dev/null +++ b/syn/struct.MetaList.html @@ -0,0 +1,26 @@ +MetaList in syn - Rust

Struct syn::MetaList

source ·
pub struct MetaList {
+    pub path: Path,
+    pub delimiter: MacroDelimiter,
+    pub tokens: TokenStream,
+}
Expand description

A structured list within an attribute, like derive(Copy, Clone).

+

Fields§

§path: Path§delimiter: MacroDelimiter§tokens: TokenStream

Implementations§

source§

impl MetaList

source

pub fn parse_args<T: Parse>(&self) -> Result<T>

source

pub fn parse_args_with<F: Parser>(&self, parser: F) -> Result<F::Output>

source

pub fn parse_nested_meta( + &self, + logic: impl FnMut(ParseNestedMeta<'_>) -> Result<()> +) -> Result<()>

Trait Implementations§

source§

impl Clone for MetaList

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<MetaList> for Meta

source§

fn from(e: MetaList) -> Meta

Converts to this type from the input type.
source§

impl Parse for MetaList

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for MetaList

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.MetaNameValue.html b/syn/struct.MetaNameValue.html new file mode 100644 index 0000000..8d0288a --- /dev/null +++ b/syn/struct.MetaNameValue.html @@ -0,0 +1,20 @@ +MetaNameValue in syn - Rust

Struct syn::MetaNameValue

source ·
pub struct MetaNameValue {
+    pub path: Path,
+    pub eq_token: Eq,
+    pub value: Expr,
+}
Expand description

A name-value pair within an attribute, like feature = "nightly".

+

Fields§

§path: Path§eq_token: Eq§value: Expr

Trait Implementations§

source§

impl Clone for MetaNameValue

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<MetaNameValue> for Meta

source§

fn from(e: MetaNameValue) -> Meta

Converts to this type from the input type.
source§

impl Parse for MetaNameValue

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for MetaNameValue

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.ParenthesizedGenericArguments.html b/syn/struct.ParenthesizedGenericArguments.html new file mode 100644 index 0000000..1c1775a --- /dev/null +++ b/syn/struct.ParenthesizedGenericArguments.html @@ -0,0 +1,22 @@ +ParenthesizedGenericArguments in syn - Rust

Struct syn::ParenthesizedGenericArguments

source ·
pub struct ParenthesizedGenericArguments {
+    pub paren_token: Paren,
+    pub inputs: Punctuated<Type, Comma>,
+    pub output: ReturnType,
+}
Expand description

Arguments of a function path segment: the (A, B) -> C in Fn(A,B) -> C.

+

Fields§

§paren_token: Paren§inputs: Punctuated<Type, Comma>

(A, B)

+
§output: ReturnType

C

+

Trait Implementations§

source§

impl Clone for ParenthesizedGenericArguments

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Parse for ParenthesizedGenericArguments

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for ParenthesizedGenericArguments

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.PatConst.html b/syn/struct.PatConst.html new file mode 100644 index 0000000..6ae30fe --- /dev/null +++ b/syn/struct.PatConst.html @@ -0,0 +1,20 @@ +PatConst in syn - Rust

Struct syn::PatConst

source ·
pub struct PatConst {
+    pub attrs: Vec<Attribute>,
+    pub const_token: Const,
+    pub block: Block,
+}
Expand description

A const block: const { ... }.

+

Fields§

§attrs: Vec<Attribute>§const_token: Const§block: Block

Trait Implementations§

source§

impl Clone for ExprConst

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<ExprConst> for Expr

source§

fn from(e: ExprConst) -> Expr

Converts to this type from the input type.
source§

impl From<ExprConst> for Pat

source§

fn from(e: PatConst) -> Pat

Converts to this type from the input type.
source§

impl Parse for ExprConst

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for ExprConst

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.PatIdent.html b/syn/struct.PatIdent.html new file mode 100644 index 0000000..f71b897 --- /dev/null +++ b/syn/struct.PatIdent.html @@ -0,0 +1,24 @@ +PatIdent in syn - Rust

Struct syn::PatIdent

source ·
pub struct PatIdent {
+    pub attrs: Vec<Attribute>,
+    pub by_ref: Option<Ref>,
+    pub mutability: Option<Mut>,
+    pub ident: Ident,
+    pub subpat: Option<(At, Box<Pat>)>,
+}
Expand description

A pattern that binds a new variable: ref mut binding @ SUBPATTERN.

+

It may also be a unit struct or struct variant (e.g. None), or a +constant; these cannot be distinguished syntactically.

+

Fields§

§attrs: Vec<Attribute>§by_ref: Option<Ref>§mutability: Option<Mut>§ident: Ident§subpat: Option<(At, Box<Pat>)>

Trait Implementations§

source§

impl Clone for PatIdent

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<PatIdent> for Pat

source§

fn from(e: PatIdent) -> Pat

Converts to this type from the input type.
source§

impl ToTokens for PatIdent

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.PatLit.html b/syn/struct.PatLit.html new file mode 100644 index 0000000..62b1d8e --- /dev/null +++ b/syn/struct.PatLit.html @@ -0,0 +1,19 @@ +PatLit in syn - Rust

Struct syn::PatLit

source ·
pub struct PatLit {
+    pub attrs: Vec<Attribute>,
+    pub lit: Lit,
+}
Expand description

A literal in place of an expression: 1, "foo".

+

Fields§

§attrs: Vec<Attribute>§lit: Lit

Trait Implementations§

source§

impl Clone for ExprLit

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<ExprLit> for Expr

source§

fn from(e: ExprLit) -> Expr

Converts to this type from the input type.
source§

impl From<ExprLit> for Pat

source§

fn from(e: PatLit) -> Pat

Converts to this type from the input type.
source§

impl Parse for ExprLit

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for ExprLit

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.PatMacro.html b/syn/struct.PatMacro.html new file mode 100644 index 0000000..d6beab9 --- /dev/null +++ b/syn/struct.PatMacro.html @@ -0,0 +1,19 @@ +PatMacro in syn - Rust

Struct syn::PatMacro

source ·
pub struct PatMacro {
+    pub attrs: Vec<Attribute>,
+    pub mac: Macro,
+}
Expand description

A macro invocation expression: format!("{}", q).

+

Fields§

§attrs: Vec<Attribute>§mac: Macro

Trait Implementations§

source§

impl Clone for ExprMacro

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<ExprMacro> for Expr

source§

fn from(e: ExprMacro) -> Expr

Converts to this type from the input type.
source§

impl From<ExprMacro> for Pat

source§

fn from(e: PatMacro) -> Pat

Converts to this type from the input type.
source§

impl Parse for ExprMacro

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for ExprMacro

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.PatOr.html b/syn/struct.PatOr.html new file mode 100644 index 0000000..32e8c8a --- /dev/null +++ b/syn/struct.PatOr.html @@ -0,0 +1,20 @@ +PatOr in syn - Rust

Struct syn::PatOr

source ·
pub struct PatOr {
+    pub attrs: Vec<Attribute>,
+    pub leading_vert: Option<Or>,
+    pub cases: Punctuated<Pat, Or>,
+}
Expand description

A pattern that matches any one of a set of cases.

+

Fields§

§attrs: Vec<Attribute>§leading_vert: Option<Or>§cases: Punctuated<Pat, Or>

Trait Implementations§

source§

impl Clone for PatOr

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<PatOr> for Pat

source§

fn from(e: PatOr) -> Pat

Converts to this type from the input type.
source§

impl ToTokens for PatOr

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

§

impl Freeze for PatOr

§

impl RefUnwindSafe for PatOr

§

impl !Send for PatOr

§

impl !Sync for PatOr

§

impl Unpin for PatOr

§

impl UnwindSafe for PatOr

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.PatParen.html b/syn/struct.PatParen.html new file mode 100644 index 0000000..749e5c2 --- /dev/null +++ b/syn/struct.PatParen.html @@ -0,0 +1,20 @@ +PatParen in syn - Rust

Struct syn::PatParen

source ·
pub struct PatParen {
+    pub attrs: Vec<Attribute>,
+    pub paren_token: Paren,
+    pub pat: Box<Pat>,
+}
Expand description

A parenthesized pattern: (A | B).

+

Fields§

§attrs: Vec<Attribute>§paren_token: Paren§pat: Box<Pat>

Trait Implementations§

source§

impl Clone for PatParen

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<PatParen> for Pat

source§

fn from(e: PatParen) -> Pat

Converts to this type from the input type.
source§

impl ToTokens for PatParen

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.PatPath.html b/syn/struct.PatPath.html new file mode 100644 index 0000000..2dea5b2 --- /dev/null +++ b/syn/struct.PatPath.html @@ -0,0 +1,22 @@ +PatPath in syn - Rust

Struct syn::PatPath

source ·
pub struct PatPath {
+    pub attrs: Vec<Attribute>,
+    pub qself: Option<QSelf>,
+    pub path: Path,
+}
Expand description

A path like std::mem::replace possibly containing generic +parameters and a qualified self-type.

+

A plain identifier like x is a path of length 1.

+

Fields§

§attrs: Vec<Attribute>§qself: Option<QSelf>§path: Path

Trait Implementations§

source§

impl Clone for ExprPath

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<ExprPath> for Expr

source§

fn from(e: ExprPath) -> Expr

Converts to this type from the input type.
source§

impl From<ExprPath> for Pat

source§

fn from(e: PatPath) -> Pat

Converts to this type from the input type.
source§

impl Parse for ExprPath

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for ExprPath

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.PatRange.html b/syn/struct.PatRange.html new file mode 100644 index 0000000..d6bf396 --- /dev/null +++ b/syn/struct.PatRange.html @@ -0,0 +1,21 @@ +PatRange in syn - Rust

Struct syn::PatRange

source ·
pub struct PatRange {
+    pub attrs: Vec<Attribute>,
+    pub start: Option<Box<Expr>>,
+    pub limits: RangeLimits,
+    pub end: Option<Box<Expr>>,
+}
Expand description

A range expression: 1..2, 1.., ..2, 1..=2, ..=2.

+

Fields§

§attrs: Vec<Attribute>§start: Option<Box<Expr>>§limits: RangeLimits§end: Option<Box<Expr>>

Trait Implementations§

source§

impl Clone for ExprRange

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<ExprRange> for Expr

source§

fn from(e: ExprRange) -> Expr

Converts to this type from the input type.
source§

impl From<ExprRange> for Pat

source§

fn from(e: PatRange) -> Pat

Converts to this type from the input type.
source§

impl Parse for ExprRange

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for ExprRange

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.PatReference.html b/syn/struct.PatReference.html new file mode 100644 index 0000000..f9c6fa3 --- /dev/null +++ b/syn/struct.PatReference.html @@ -0,0 +1,21 @@ +PatReference in syn - Rust

Struct syn::PatReference

source ·
pub struct PatReference {
+    pub attrs: Vec<Attribute>,
+    pub and_token: And,
+    pub mutability: Option<Mut>,
+    pub pat: Box<Pat>,
+}
Expand description

A reference pattern: &mut var.

+

Fields§

§attrs: Vec<Attribute>§and_token: And§mutability: Option<Mut>§pat: Box<Pat>

Trait Implementations§

source§

impl Clone for PatReference

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<PatReference> for Pat

source§

fn from(e: PatReference) -> Pat

Converts to this type from the input type.
source§

impl ToTokens for PatReference

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.PatRest.html b/syn/struct.PatRest.html new file mode 100644 index 0000000..f9d3cc6 --- /dev/null +++ b/syn/struct.PatRest.html @@ -0,0 +1,19 @@ +PatRest in syn - Rust

Struct syn::PatRest

source ·
pub struct PatRest {
+    pub attrs: Vec<Attribute>,
+    pub dot2_token: DotDot,
+}
Expand description

The dots in a tuple or slice pattern: [0, 1, ..].

+

Fields§

§attrs: Vec<Attribute>§dot2_token: DotDot

Trait Implementations§

source§

impl Clone for PatRest

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<PatRest> for Pat

source§

fn from(e: PatRest) -> Pat

Converts to this type from the input type.
source§

impl ToTokens for PatRest

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.PatSlice.html b/syn/struct.PatSlice.html new file mode 100644 index 0000000..4bb68b0 --- /dev/null +++ b/syn/struct.PatSlice.html @@ -0,0 +1,20 @@ +PatSlice in syn - Rust

Struct syn::PatSlice

source ·
pub struct PatSlice {
+    pub attrs: Vec<Attribute>,
+    pub bracket_token: Bracket,
+    pub elems: Punctuated<Pat, Comma>,
+}
Expand description

A dynamically sized slice pattern: [a, b, ref i @ .., y, z].

+

Fields§

§attrs: Vec<Attribute>§bracket_token: Bracket§elems: Punctuated<Pat, Comma>

Trait Implementations§

source§

impl Clone for PatSlice

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<PatSlice> for Pat

source§

fn from(e: PatSlice) -> Pat

Converts to this type from the input type.
source§

impl ToTokens for PatSlice

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.PatStruct.html b/syn/struct.PatStruct.html new file mode 100644 index 0000000..a22b229 --- /dev/null +++ b/syn/struct.PatStruct.html @@ -0,0 +1,23 @@ +PatStruct in syn - Rust

Struct syn::PatStruct

source ·
pub struct PatStruct {
+    pub attrs: Vec<Attribute>,
+    pub qself: Option<QSelf>,
+    pub path: Path,
+    pub brace_token: Brace,
+    pub fields: Punctuated<FieldPat, Comma>,
+    pub rest: Option<PatRest>,
+}
Expand description

A struct or struct variant pattern: Variant { x, y, .. }.

+

Fields§

§attrs: Vec<Attribute>§qself: Option<QSelf>§path: Path§brace_token: Brace§fields: Punctuated<FieldPat, Comma>§rest: Option<PatRest>

Trait Implementations§

source§

impl Clone for PatStruct

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<PatStruct> for Pat

source§

fn from(e: PatStruct) -> Pat

Converts to this type from the input type.
source§

impl ToTokens for PatStruct

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.PatTuple.html b/syn/struct.PatTuple.html new file mode 100644 index 0000000..12e02da --- /dev/null +++ b/syn/struct.PatTuple.html @@ -0,0 +1,20 @@ +PatTuple in syn - Rust

Struct syn::PatTuple

source ·
pub struct PatTuple {
+    pub attrs: Vec<Attribute>,
+    pub paren_token: Paren,
+    pub elems: Punctuated<Pat, Comma>,
+}
Expand description

A tuple pattern: (a, b).

+

Fields§

§attrs: Vec<Attribute>§paren_token: Paren§elems: Punctuated<Pat, Comma>

Trait Implementations§

source§

impl Clone for PatTuple

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<PatTuple> for Pat

source§

fn from(e: PatTuple) -> Pat

Converts to this type from the input type.
source§

impl ToTokens for PatTuple

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.PatTupleStruct.html b/syn/struct.PatTupleStruct.html new file mode 100644 index 0000000..b958f56 --- /dev/null +++ b/syn/struct.PatTupleStruct.html @@ -0,0 +1,22 @@ +PatTupleStruct in syn - Rust

Struct syn::PatTupleStruct

source ·
pub struct PatTupleStruct {
+    pub attrs: Vec<Attribute>,
+    pub qself: Option<QSelf>,
+    pub path: Path,
+    pub paren_token: Paren,
+    pub elems: Punctuated<Pat, Comma>,
+}
Expand description

A tuple struct or tuple variant pattern: Variant(x, y, .., z).

+

Fields§

§attrs: Vec<Attribute>§qself: Option<QSelf>§path: Path§paren_token: Paren§elems: Punctuated<Pat, Comma>

Trait Implementations§

source§

impl Clone for PatTupleStruct

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<PatTupleStruct> for Pat

source§

fn from(e: PatTupleStruct) -> Pat

Converts to this type from the input type.
source§

impl ToTokens for PatTupleStruct

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.PatType.html b/syn/struct.PatType.html new file mode 100644 index 0000000..fac221f --- /dev/null +++ b/syn/struct.PatType.html @@ -0,0 +1,21 @@ +PatType in syn - Rust

Struct syn::PatType

source ·
pub struct PatType {
+    pub attrs: Vec<Attribute>,
+    pub pat: Box<Pat>,
+    pub colon_token: Colon,
+    pub ty: Box<Type>,
+}
Expand description

A type ascription pattern: foo: f64.

+

Fields§

§attrs: Vec<Attribute>§pat: Box<Pat>§colon_token: Colon§ty: Box<Type>

Trait Implementations§

source§

impl Clone for PatType

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<PatType> for FnArg

source§

fn from(e: PatType) -> FnArg

Converts to this type from the input type.
source§

impl From<PatType> for Pat

source§

fn from(e: PatType) -> Pat

Converts to this type from the input type.
source§

impl Parse for PatType

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for PatType

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.PatWild.html b/syn/struct.PatWild.html new file mode 100644 index 0000000..2ca59fa --- /dev/null +++ b/syn/struct.PatWild.html @@ -0,0 +1,19 @@ +PatWild in syn - Rust

Struct syn::PatWild

source ·
pub struct PatWild {
+    pub attrs: Vec<Attribute>,
+    pub underscore_token: Underscore,
+}
Expand description

A pattern that matches any value: _.

+

Fields§

§attrs: Vec<Attribute>§underscore_token: Underscore

Trait Implementations§

source§

impl Clone for PatWild

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<PatWild> for Pat

source§

fn from(e: PatWild) -> Pat

Converts to this type from the input type.
source§

impl ToTokens for PatWild

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.Path.html b/syn/struct.Path.html new file mode 100644 index 0000000..afcba46 --- /dev/null +++ b/syn/struct.Path.html @@ -0,0 +1,81 @@ +Path in syn - Rust

Struct syn::Path

source ·
pub struct Path {
+    pub leading_colon: Option<PathSep>,
+    pub segments: Punctuated<PathSegment, PathSep>,
+}
Expand description

A path at which a named item is exported (e.g. std::collections::HashMap).

+

Fields§

§leading_colon: Option<PathSep>§segments: Punctuated<PathSegment, PathSep>

Implementations§

source§

impl Path

source

pub fn parse_mod_style(input: ParseStream<'_>) -> Result<Self>

Parse a Path containing no path arguments on any of its segments.

+
§Example
+
use syn::{Path, Result, Token};
+use syn::parse::{Parse, ParseStream};
+
+// A simplified single `use` statement like:
+//
+//     use std::collections::HashMap;
+//
+// Note that generic parameters are not allowed in a `use` statement
+// so the following must not be accepted.
+//
+//     use a::<b>::c;
+struct SingleUse {
+    use_token: Token![use],
+    path: Path,
+}
+
+impl Parse for SingleUse {
+    fn parse(input: ParseStream) -> Result<Self> {
+        Ok(SingleUse {
+            use_token: input.parse()?,
+            path: input.call(Path::parse_mod_style)?,
+        })
+    }
+}
+
source§

impl Path

source

pub fn is_ident<I>(&self, ident: &I) -> bool
where + I: ?Sized, + Ident: PartialEq<I>,

Determines whether this is a path of length 1 equal to the given +ident.

+

For them to compare equal, it must be the case that:

+
    +
  • the path has no leading colon,
  • +
  • the number of path segments is 1,
  • +
  • the first path segment has no angle bracketed or parenthesized +path arguments, and
  • +
  • the ident of the first path segment is equal to the given one.
  • +
+
§Example
+
use proc_macro2::TokenStream;
+use syn::{Attribute, Error, Meta, Result};
+
+fn get_serde_meta_item(attr: &Attribute) -> Result<Option<&TokenStream>> {
+    if attr.path().is_ident("serde") {
+        match &attr.meta {
+            Meta::List(meta) => Ok(Some(&meta.tokens)),
+            bad => Err(Error::new_spanned(bad, "unrecognized attribute")),
+        }
+    } else {
+        Ok(None)
+    }
+}
+
source

pub fn get_ident(&self) -> Option<&Ident>

If this path consists of a single ident, returns the ident.

+

A path is considered an ident if:

+
    +
  • the path has no leading colon,
  • +
  • the number of path segments is 1, and
  • +
  • the first path segment has no angle bracketed or parenthesized +path arguments.
  • +
+
source

pub fn require_ident(&self) -> Result<&Ident>

An error if this path is not a single ident, as defined in get_ident.

+

Trait Implementations§

source§

impl Clone for Path

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<Path> for Meta

source§

fn from(e: Path) -> Meta

Converts to this type from the input type.
source§

impl<T> From<T> for Path
where + T: Into<PathSegment>,

source§

fn from(segment: T) -> Self

Converts to this type from the input type.
source§

impl Parse for Path

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for Path

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

§

impl Freeze for Path

§

impl RefUnwindSafe for Path

§

impl !Send for Path

§

impl !Sync for Path

§

impl Unpin for Path

§

impl UnwindSafe for Path

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.PathSegment.html b/syn/struct.PathSegment.html new file mode 100644 index 0000000..34ccc04 --- /dev/null +++ b/syn/struct.PathSegment.html @@ -0,0 +1,20 @@ +PathSegment in syn - Rust

Struct syn::PathSegment

source ·
pub struct PathSegment {
+    pub ident: Ident,
+    pub arguments: PathArguments,
+}
Expand description

A segment of a path together with any path arguments on that segment.

+

Fields§

§ident: Ident§arguments: PathArguments

Trait Implementations§

source§

impl Clone for PathSegment

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T> From<T> for PathSegment
where + T: Into<Ident>,

source§

fn from(ident: T) -> Self

Converts to this type from the input type.
source§

impl Parse for PathSegment

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for PathSegment

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.PredicateLifetime.html b/syn/struct.PredicateLifetime.html new file mode 100644 index 0000000..e0facc9 --- /dev/null +++ b/syn/struct.PredicateLifetime.html @@ -0,0 +1,20 @@ +PredicateLifetime in syn - Rust

Struct syn::PredicateLifetime

source ·
pub struct PredicateLifetime {
+    pub lifetime: Lifetime,
+    pub colon_token: Colon,
+    pub bounds: Punctuated<Lifetime, Plus>,
+}
Expand description

A lifetime predicate in a where clause: 'a: 'b + 'c.

+

Fields§

§lifetime: Lifetime§colon_token: Colon§bounds: Punctuated<Lifetime, Plus>

Trait Implementations§

source§

impl Clone for PredicateLifetime

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<PredicateLifetime> for WherePredicate

source§

fn from(e: PredicateLifetime) -> WherePredicate

Converts to this type from the input type.
source§

impl ToTokens for PredicateLifetime

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.PredicateType.html b/syn/struct.PredicateType.html new file mode 100644 index 0000000..2d82fff --- /dev/null +++ b/syn/struct.PredicateType.html @@ -0,0 +1,24 @@ +PredicateType in syn - Rust

Struct syn::PredicateType

source ·
pub struct PredicateType {
+    pub lifetimes: Option<BoundLifetimes>,
+    pub bounded_ty: Type,
+    pub colon_token: Colon,
+    pub bounds: Punctuated<TypeParamBound, Plus>,
+}
Expand description

A type predicate in a where clause: for<'c> Foo<'c>: Trait<'c>.

+

Fields§

§lifetimes: Option<BoundLifetimes>

Any lifetimes from a for binding

+
§bounded_ty: Type

The type being bounded

+
§colon_token: Colon§bounds: Punctuated<TypeParamBound, Plus>

Trait and lifetime bounds (Clone+Send+'static)

+

Trait Implementations§

source§

impl Clone for PredicateType

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<PredicateType> for WherePredicate

source§

fn from(e: PredicateType) -> WherePredicate

Converts to this type from the input type.
source§

impl ToTokens for PredicateType

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.QSelf.html b/syn/struct.QSelf.html new file mode 100644 index 0000000..f6c6624 --- /dev/null +++ b/syn/struct.QSelf.html @@ -0,0 +1,30 @@ +QSelf in syn - Rust

Struct syn::QSelf

source ·
pub struct QSelf {
+    pub lt_token: Lt,
+    pub ty: Box<Type>,
+    pub position: usize,
+    pub as_token: Option<As>,
+    pub gt_token: Gt,
+}
Expand description

The explicit Self type in a qualified path: the T in <T as Display>::fmt.

+

The actual path, including the trait and the associated item, is stored +separately. The position field represents the index of the associated +item qualified with this Self type.

+
<Vec<T> as a::b::Trait>::AssociatedItem
+ ^~~~~~    ~~~~~~~~~~~~~~^
+ ty        position = 3
+
+<Vec<T>>::AssociatedItem
+ ^~~~~~   ^
+ ty       position = 0
+

Fields§

§lt_token: Lt§ty: Box<Type>§position: usize§as_token: Option<As>§gt_token: Gt

Trait Implementations§

source§

impl Clone for QSelf

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Spanned for QSelf

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.

Auto Trait Implementations§

§

impl Freeze for QSelf

§

impl RefUnwindSafe for QSelf

§

impl !Send for QSelf

§

impl !Sync for QSelf

§

impl Unpin for QSelf

§

impl UnwindSafe for QSelf

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.Receiver.html b/syn/struct.Receiver.html new file mode 100644 index 0000000..26332bf --- /dev/null +++ b/syn/struct.Receiver.html @@ -0,0 +1,28 @@ +Receiver in syn - Rust

Struct syn::Receiver

source ·
pub struct Receiver {
+    pub attrs: Vec<Attribute>,
+    pub reference: Option<(And, Option<Lifetime>)>,
+    pub mutability: Option<Mut>,
+    pub self_token: SelfValue,
+    pub colon_token: Option<Colon>,
+    pub ty: Box<Type>,
+}
Expand description

The self argument of an associated method.

+

If colon_token is present, the receiver is written with an explicit +type such as self: Box<Self>. If colon_token is absent, the receiver +is written in shorthand such as self or &self or &mut self. In the +shorthand case, the type in ty is reconstructed as one of Self, +&Self, or &mut Self.

+

Fields§

§attrs: Vec<Attribute>§reference: Option<(And, Option<Lifetime>)>§mutability: Option<Mut>§self_token: SelfValue§colon_token: Option<Colon>§ty: Box<Type>

Implementations§

Trait Implementations§

source§

impl Clone for Receiver

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<Receiver> for FnArg

source§

fn from(e: Receiver) -> FnArg

Converts to this type from the input type.
source§

impl Parse for Receiver

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for Receiver

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.Signature.html b/syn/struct.Signature.html new file mode 100644 index 0000000..8ba7d9a --- /dev/null +++ b/syn/struct.Signature.html @@ -0,0 +1,29 @@ +Signature in syn - Rust

Struct syn::Signature

source ·
pub struct Signature {
+    pub constness: Option<Const>,
+    pub asyncness: Option<Async>,
+    pub unsafety: Option<Unsafe>,
+    pub abi: Option<Abi>,
+    pub fn_token: Fn,
+    pub ident: Ident,
+    pub generics: Generics,
+    pub paren_token: Paren,
+    pub inputs: Punctuated<FnArg, Comma>,
+    pub variadic: Option<Variadic>,
+    pub output: ReturnType,
+}
Expand description

A function signature in a trait or implementation: unsafe fn initialize(&self).

+

Fields§

§constness: Option<Const>§asyncness: Option<Async>§unsafety: Option<Unsafe>§abi: Option<Abi>§fn_token: Fn§ident: Ident§generics: Generics§paren_token: Paren§inputs: Punctuated<FnArg, Comma>§variadic: Option<Variadic>§output: ReturnType

Implementations§

source§

impl Signature

source

pub fn receiver(&self) -> Option<&Receiver>

A method’s self receiver, such as &self or self: Box<Self>.

+

Trait Implementations§

source§

impl Clone for Signature

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Parse for Signature

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for Signature

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.StmtMacro.html b/syn/struct.StmtMacro.html new file mode 100644 index 0000000..e689eeb --- /dev/null +++ b/syn/struct.StmtMacro.html @@ -0,0 +1,23 @@ +StmtMacro in syn - Rust

Struct syn::StmtMacro

source ·
pub struct StmtMacro {
+    pub attrs: Vec<Attribute>,
+    pub mac: Macro,
+    pub semi_token: Option<Semi>,
+}
Expand description

A macro invocation in statement position.

+

Syntactically it’s ambiguous which other kind of statement this macro +would expand to. It can be any of local variable (let), item, or +expression.

+

Fields§

§attrs: Vec<Attribute>§mac: Macro§semi_token: Option<Semi>

Trait Implementations§

source§

impl Clone for StmtMacro

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl ToTokens for StmtMacro

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.TraitBound.html b/syn/struct.TraitBound.html new file mode 100644 index 0000000..a69230a --- /dev/null +++ b/syn/struct.TraitBound.html @@ -0,0 +1,23 @@ +TraitBound in syn - Rust

Struct syn::TraitBound

source ·
pub struct TraitBound {
+    pub paren_token: Option<Paren>,
+    pub modifier: TraitBoundModifier,
+    pub lifetimes: Option<BoundLifetimes>,
+    pub path: Path,
+}
Expand description

A trait used as a bound on a type parameter.

+

Fields§

§paren_token: Option<Paren>§modifier: TraitBoundModifier§lifetimes: Option<BoundLifetimes>

The for<'a> in for<'a> Foo<&'a T>

+
§path: Path

The Foo<&'a T> in for<'a> Foo<&'a T>

+

Trait Implementations§

source§

impl Clone for TraitBound

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<TraitBound> for TypeParamBound

source§

fn from(e: TraitBound) -> TypeParamBound

Converts to this type from the input type.
source§

impl Parse for TraitBound

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for TraitBound

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.TraitItemConst.html b/syn/struct.TraitItemConst.html new file mode 100644 index 0000000..8a8bf0d --- /dev/null +++ b/syn/struct.TraitItemConst.html @@ -0,0 +1,25 @@ +TraitItemConst in syn - Rust

Struct syn::TraitItemConst

source ·
pub struct TraitItemConst {
+    pub attrs: Vec<Attribute>,
+    pub const_token: Const,
+    pub ident: Ident,
+    pub generics: Generics,
+    pub colon_token: Colon,
+    pub ty: Type,
+    pub default: Option<(Eq, Expr)>,
+    pub semi_token: Semi,
+}
Expand description

An associated constant within the definition of a trait.

+

Fields§

§attrs: Vec<Attribute>§const_token: Const§ident: Ident§generics: Generics§colon_token: Colon§ty: Type§default: Option<(Eq, Expr)>§semi_token: Semi

Trait Implementations§

source§

impl Clone for TraitItemConst

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<TraitItemConst> for TraitItem

source§

fn from(e: TraitItemConst) -> TraitItem

Converts to this type from the input type.
source§

impl Parse for TraitItemConst

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for TraitItemConst

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.TraitItemFn.html b/syn/struct.TraitItemFn.html new file mode 100644 index 0000000..472a271 --- /dev/null +++ b/syn/struct.TraitItemFn.html @@ -0,0 +1,21 @@ +TraitItemFn in syn - Rust

Struct syn::TraitItemFn

source ·
pub struct TraitItemFn {
+    pub attrs: Vec<Attribute>,
+    pub sig: Signature,
+    pub default: Option<Block>,
+    pub semi_token: Option<Semi>,
+}
Expand description

An associated function within the definition of a trait.

+

Fields§

§attrs: Vec<Attribute>§sig: Signature§default: Option<Block>§semi_token: Option<Semi>

Trait Implementations§

source§

impl Clone for TraitItemFn

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<TraitItemFn> for TraitItem

source§

fn from(e: TraitItemFn) -> TraitItem

Converts to this type from the input type.
source§

impl Parse for TraitItemFn

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for TraitItemFn

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.TraitItemMacro.html b/syn/struct.TraitItemMacro.html new file mode 100644 index 0000000..a7f3531 --- /dev/null +++ b/syn/struct.TraitItemMacro.html @@ -0,0 +1,20 @@ +TraitItemMacro in syn - Rust

Struct syn::TraitItemMacro

source ·
pub struct TraitItemMacro {
+    pub attrs: Vec<Attribute>,
+    pub mac: Macro,
+    pub semi_token: Option<Semi>,
+}
Expand description

A macro invocation within the definition of a trait.

+

Fields§

§attrs: Vec<Attribute>§mac: Macro§semi_token: Option<Semi>

Trait Implementations§

source§

impl Clone for TraitItemMacro

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<TraitItemMacro> for TraitItem

source§

fn from(e: TraitItemMacro) -> TraitItem

Converts to this type from the input type.
source§

impl Parse for TraitItemMacro

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for TraitItemMacro

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.TraitItemType.html b/syn/struct.TraitItemType.html new file mode 100644 index 0000000..343cbdb --- /dev/null +++ b/syn/struct.TraitItemType.html @@ -0,0 +1,25 @@ +TraitItemType in syn - Rust

Struct syn::TraitItemType

source ·
pub struct TraitItemType {
+    pub attrs: Vec<Attribute>,
+    pub type_token: Type,
+    pub ident: Ident,
+    pub generics: Generics,
+    pub colon_token: Option<Colon>,
+    pub bounds: Punctuated<TypeParamBound, Plus>,
+    pub default: Option<(Eq, Type)>,
+    pub semi_token: Semi,
+}
Expand description

An associated type within the definition of a trait.

+

Fields§

§attrs: Vec<Attribute>§type_token: Type§ident: Ident§generics: Generics§colon_token: Option<Colon>§bounds: Punctuated<TypeParamBound, Plus>§default: Option<(Eq, Type)>§semi_token: Semi

Trait Implementations§

source§

impl Clone for TraitItemType

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<TraitItemType> for TraitItem

source§

fn from(e: TraitItemType) -> TraitItem

Converts to this type from the input type.
source§

impl Parse for TraitItemType

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for TraitItemType

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.Turbofish.html b/syn/struct.Turbofish.html new file mode 100644 index 0000000..0d71da8 --- /dev/null +++ b/syn/struct.Turbofish.html @@ -0,0 +1,16 @@ +Turbofish in syn - Rust

Struct syn::Turbofish

source ·
pub struct Turbofish<'a>(/* private fields */);
Expand description

Returned by TypeGenerics::as_turbofish.

+

Trait Implementations§

source§

impl<'a> Clone for Turbofish<'a>

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'a> ToTokens for Turbofish<'a>

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for Turbofish<'a>

§

impl<'a> RefUnwindSafe for Turbofish<'a>

§

impl<'a> !Send for Turbofish<'a>

§

impl<'a> !Sync for Turbofish<'a>

§

impl<'a> Unpin for Turbofish<'a>

§

impl<'a> UnwindSafe for Turbofish<'a>

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.TypeArray.html b/syn/struct.TypeArray.html new file mode 100644 index 0000000..12280fb --- /dev/null +++ b/syn/struct.TypeArray.html @@ -0,0 +1,21 @@ +TypeArray in syn - Rust

Struct syn::TypeArray

source ·
pub struct TypeArray {
+    pub bracket_token: Bracket,
+    pub elem: Box<Type>,
+    pub semi_token: Semi,
+    pub len: Expr,
+}
Expand description

A fixed size array type: [T; n].

+

Fields§

§bracket_token: Bracket§elem: Box<Type>§semi_token: Semi§len: Expr

Trait Implementations§

source§

impl Clone for TypeArray

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<TypeArray> for Type

source§

fn from(e: TypeArray) -> Type

Converts to this type from the input type.
source§

impl Parse for TypeArray

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for TypeArray

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.TypeBareFn.html b/syn/struct.TypeBareFn.html new file mode 100644 index 0000000..48d0371 --- /dev/null +++ b/syn/struct.TypeBareFn.html @@ -0,0 +1,25 @@ +TypeBareFn in syn - Rust

Struct syn::TypeBareFn

source ·
pub struct TypeBareFn {
+    pub lifetimes: Option<BoundLifetimes>,
+    pub unsafety: Option<Unsafe>,
+    pub abi: Option<Abi>,
+    pub fn_token: Fn,
+    pub paren_token: Paren,
+    pub inputs: Punctuated<BareFnArg, Comma>,
+    pub variadic: Option<BareVariadic>,
+    pub output: ReturnType,
+}
Expand description

A bare function type: fn(usize) -> bool.

+

Fields§

§lifetimes: Option<BoundLifetimes>§unsafety: Option<Unsafe>§abi: Option<Abi>§fn_token: Fn§paren_token: Paren§inputs: Punctuated<BareFnArg, Comma>§variadic: Option<BareVariadic>§output: ReturnType

Trait Implementations§

source§

impl Clone for TypeBareFn

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<TypeBareFn> for Type

source§

fn from(e: TypeBareFn) -> Type

Converts to this type from the input type.
source§

impl Parse for TypeBareFn

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for TypeBareFn

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.TypeGenerics.html b/syn/struct.TypeGenerics.html new file mode 100644 index 0000000..a0b7c53 --- /dev/null +++ b/syn/struct.TypeGenerics.html @@ -0,0 +1,17 @@ +TypeGenerics in syn - Rust

Struct syn::TypeGenerics

source ·
pub struct TypeGenerics<'a>(/* private fields */);
Expand description

Returned by Generics::split_for_impl.

+

Implementations§

source§

impl<'a> TypeGenerics<'a>

source

pub fn as_turbofish(&self) -> Turbofish<'_>

Turn a type’s generics like <X, Y> into a turbofish like ::<X, Y>.

+

Trait Implementations§

source§

impl<'a> Clone for TypeGenerics<'a>

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'a> ToTokens for TypeGenerics<'a>

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for TypeGenerics<'a>

§

impl<'a> RefUnwindSafe for TypeGenerics<'a>

§

impl<'a> !Send for TypeGenerics<'a>

§

impl<'a> !Sync for TypeGenerics<'a>

§

impl<'a> Unpin for TypeGenerics<'a>

§

impl<'a> UnwindSafe for TypeGenerics<'a>

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.TypeGroup.html b/syn/struct.TypeGroup.html new file mode 100644 index 0000000..4ab50d6 --- /dev/null +++ b/syn/struct.TypeGroup.html @@ -0,0 +1,19 @@ +TypeGroup in syn - Rust

Struct syn::TypeGroup

source ·
pub struct TypeGroup {
+    pub group_token: Group,
+    pub elem: Box<Type>,
+}
Expand description

A type contained within invisible delimiters.

+

Fields§

§group_token: Group§elem: Box<Type>

Trait Implementations§

source§

impl Clone for TypeGroup

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<TypeGroup> for Type

source§

fn from(e: TypeGroup) -> Type

Converts to this type from the input type.
source§

impl Parse for TypeGroup

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for TypeGroup

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.TypeImplTrait.html b/syn/struct.TypeImplTrait.html new file mode 100644 index 0000000..6c6495a --- /dev/null +++ b/syn/struct.TypeImplTrait.html @@ -0,0 +1,20 @@ +TypeImplTrait in syn - Rust

Struct syn::TypeImplTrait

source ·
pub struct TypeImplTrait {
+    pub impl_token: Impl,
+    pub bounds: Punctuated<TypeParamBound, Plus>,
+}
Expand description

An impl Bound1 + Bound2 + Bound3 type where Bound is a trait or +a lifetime.

+

Fields§

§impl_token: Impl§bounds: Punctuated<TypeParamBound, Plus>

Implementations§

Trait Implementations§

source§

impl Clone for TypeImplTrait

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<TypeImplTrait> for Type

source§

fn from(e: TypeImplTrait) -> Type

Converts to this type from the input type.
source§

impl Parse for TypeImplTrait

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for TypeImplTrait

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.TypeInfer.html b/syn/struct.TypeInfer.html new file mode 100644 index 0000000..89fc85e --- /dev/null +++ b/syn/struct.TypeInfer.html @@ -0,0 +1,18 @@ +TypeInfer in syn - Rust

Struct syn::TypeInfer

source ·
pub struct TypeInfer {
+    pub underscore_token: Underscore,
+}
Expand description

Indication that a type should be inferred by the compiler: _.

+

Fields§

§underscore_token: Underscore

Trait Implementations§

source§

impl Clone for TypeInfer

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<TypeInfer> for Type

source§

fn from(e: TypeInfer) -> Type

Converts to this type from the input type.
source§

impl Parse for TypeInfer

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for TypeInfer

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.TypeMacro.html b/syn/struct.TypeMacro.html new file mode 100644 index 0000000..cbf7fd3 --- /dev/null +++ b/syn/struct.TypeMacro.html @@ -0,0 +1,18 @@ +TypeMacro in syn - Rust

Struct syn::TypeMacro

source ·
pub struct TypeMacro {
+    pub mac: Macro,
+}
Expand description

A macro in the type position.

+

Fields§

§mac: Macro

Trait Implementations§

source§

impl Clone for TypeMacro

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<TypeMacro> for Type

source§

fn from(e: TypeMacro) -> Type

Converts to this type from the input type.
source§

impl Parse for TypeMacro

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for TypeMacro

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.TypeNever.html b/syn/struct.TypeNever.html new file mode 100644 index 0000000..5d67bdc --- /dev/null +++ b/syn/struct.TypeNever.html @@ -0,0 +1,18 @@ +TypeNever in syn - Rust

Struct syn::TypeNever

source ·
pub struct TypeNever {
+    pub bang_token: Not,
+}
Expand description

The never type: !.

+

Fields§

§bang_token: Not

Trait Implementations§

source§

impl Clone for TypeNever

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<TypeNever> for Type

source§

fn from(e: TypeNever) -> Type

Converts to this type from the input type.
source§

impl Parse for TypeNever

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for TypeNever

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.TypeParam.html b/syn/struct.TypeParam.html new file mode 100644 index 0000000..d193dfa --- /dev/null +++ b/syn/struct.TypeParam.html @@ -0,0 +1,23 @@ +TypeParam in syn - Rust

Struct syn::TypeParam

source ·
pub struct TypeParam {
+    pub attrs: Vec<Attribute>,
+    pub ident: Ident,
+    pub colon_token: Option<Colon>,
+    pub bounds: Punctuated<TypeParamBound, Plus>,
+    pub eq_token: Option<Eq>,
+    pub default: Option<Type>,
+}
Expand description

A generic type parameter: T: Into<String>.

+

Fields§

§attrs: Vec<Attribute>§ident: Ident§colon_token: Option<Colon>§bounds: Punctuated<TypeParamBound, Plus>§eq_token: Option<Eq>§default: Option<Type>

Trait Implementations§

source§

impl Clone for TypeParam

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<Ident> for TypeParam

source§

fn from(ident: Ident) -> Self

Converts to this type from the input type.
source§

impl From<TypeParam> for GenericParam

source§

fn from(e: TypeParam) -> GenericParam

Converts to this type from the input type.
source§

impl Parse for TypeParam

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for TypeParam

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.TypeParen.html b/syn/struct.TypeParen.html new file mode 100644 index 0000000..76ff791 --- /dev/null +++ b/syn/struct.TypeParen.html @@ -0,0 +1,19 @@ +TypeParen in syn - Rust

Struct syn::TypeParen

source ·
pub struct TypeParen {
+    pub paren_token: Paren,
+    pub elem: Box<Type>,
+}
Expand description

A parenthesized type equivalent to the inner type.

+

Fields§

§paren_token: Paren§elem: Box<Type>

Trait Implementations§

source§

impl Clone for TypeParen

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<TypeParen> for Type

source§

fn from(e: TypeParen) -> Type

Converts to this type from the input type.
source§

impl Parse for TypeParen

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for TypeParen

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.TypePath.html b/syn/struct.TypePath.html new file mode 100644 index 0000000..93334c1 --- /dev/null +++ b/syn/struct.TypePath.html @@ -0,0 +1,20 @@ +TypePath in syn - Rust

Struct syn::TypePath

source ·
pub struct TypePath {
+    pub qself: Option<QSelf>,
+    pub path: Path,
+}
Expand description

A path like std::slice::Iter, optionally qualified with a +self-type as in <Vec<T> as SomeTrait>::Associated.

+

Fields§

§qself: Option<QSelf>§path: Path

Trait Implementations§

source§

impl Clone for TypePath

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<TypePath> for Type

source§

fn from(e: TypePath) -> Type

Converts to this type from the input type.
source§

impl Parse for TypePath

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for TypePath

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.TypePtr.html b/syn/struct.TypePtr.html new file mode 100644 index 0000000..9eb88a6 --- /dev/null +++ b/syn/struct.TypePtr.html @@ -0,0 +1,21 @@ +TypePtr in syn - Rust

Struct syn::TypePtr

source ·
pub struct TypePtr {
+    pub star_token: Star,
+    pub const_token: Option<Const>,
+    pub mutability: Option<Mut>,
+    pub elem: Box<Type>,
+}
Expand description

A raw pointer type: *const T or *mut T.

+

Fields§

§star_token: Star§const_token: Option<Const>§mutability: Option<Mut>§elem: Box<Type>

Trait Implementations§

source§

impl Clone for TypePtr

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<TypePtr> for Type

source§

fn from(e: TypePtr) -> Type

Converts to this type from the input type.
source§

impl Parse for TypePtr

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for TypePtr

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.TypeReference.html b/syn/struct.TypeReference.html new file mode 100644 index 0000000..17b6125 --- /dev/null +++ b/syn/struct.TypeReference.html @@ -0,0 +1,21 @@ +TypeReference in syn - Rust

Struct syn::TypeReference

source ·
pub struct TypeReference {
+    pub and_token: And,
+    pub lifetime: Option<Lifetime>,
+    pub mutability: Option<Mut>,
+    pub elem: Box<Type>,
+}
Expand description

A reference type: &'a T or &'a mut T.

+

Fields§

§and_token: And§lifetime: Option<Lifetime>§mutability: Option<Mut>§elem: Box<Type>

Trait Implementations§

source§

impl Clone for TypeReference

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<TypeReference> for Type

source§

fn from(e: TypeReference) -> Type

Converts to this type from the input type.
source§

impl Parse for TypeReference

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for TypeReference

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.TypeSlice.html b/syn/struct.TypeSlice.html new file mode 100644 index 0000000..416b26e --- /dev/null +++ b/syn/struct.TypeSlice.html @@ -0,0 +1,19 @@ +TypeSlice in syn - Rust

Struct syn::TypeSlice

source ·
pub struct TypeSlice {
+    pub bracket_token: Bracket,
+    pub elem: Box<Type>,
+}
Expand description

A dynamically sized slice type: [T].

+

Fields§

§bracket_token: Bracket§elem: Box<Type>

Trait Implementations§

source§

impl Clone for TypeSlice

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<TypeSlice> for Type

source§

fn from(e: TypeSlice) -> Type

Converts to this type from the input type.
source§

impl Parse for TypeSlice

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for TypeSlice

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.TypeTraitObject.html b/syn/struct.TypeTraitObject.html new file mode 100644 index 0000000..7131ec0 --- /dev/null +++ b/syn/struct.TypeTraitObject.html @@ -0,0 +1,20 @@ +TypeTraitObject in syn - Rust

Struct syn::TypeTraitObject

source ·
pub struct TypeTraitObject {
+    pub dyn_token: Option<Dyn>,
+    pub bounds: Punctuated<TypeParamBound, Plus>,
+}
Expand description

A trait object type dyn Bound1 + Bound2 + Bound3 where Bound is a +trait or a lifetime.

+

Fields§

§dyn_token: Option<Dyn>§bounds: Punctuated<TypeParamBound, Plus>

Implementations§

Trait Implementations§

source§

impl Clone for TypeTraitObject

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<TypeTraitObject> for Type

source§

fn from(e: TypeTraitObject) -> Type

Converts to this type from the input type.
source§

impl Parse for TypeTraitObject

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for TypeTraitObject

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.TypeTuple.html b/syn/struct.TypeTuple.html new file mode 100644 index 0000000..0aa955e --- /dev/null +++ b/syn/struct.TypeTuple.html @@ -0,0 +1,19 @@ +TypeTuple in syn - Rust

Struct syn::TypeTuple

source ·
pub struct TypeTuple {
+    pub paren_token: Paren,
+    pub elems: Punctuated<Type, Comma>,
+}
Expand description

A tuple type: (A, B, C, String).

+

Fields§

§paren_token: Paren§elems: Punctuated<Type, Comma>

Trait Implementations§

source§

impl Clone for TypeTuple

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<TypeTuple> for Type

source§

fn from(e: TypeTuple) -> Type

Converts to this type from the input type.
source§

impl Parse for TypeTuple

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for TypeTuple

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.UseGlob.html b/syn/struct.UseGlob.html new file mode 100644 index 0000000..e502a95 --- /dev/null +++ b/syn/struct.UseGlob.html @@ -0,0 +1,18 @@ +UseGlob in syn - Rust

Struct syn::UseGlob

source ·
pub struct UseGlob {
+    pub star_token: Star,
+}
Expand description

A glob import in a use item: *.

+

Fields§

§star_token: Star

Trait Implementations§

source§

impl Clone for UseGlob

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<UseGlob> for UseTree

source§

fn from(e: UseGlob) -> UseTree

Converts to this type from the input type.
source§

impl ToTokens for UseGlob

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.UseGroup.html b/syn/struct.UseGroup.html new file mode 100644 index 0000000..ee9f120 --- /dev/null +++ b/syn/struct.UseGroup.html @@ -0,0 +1,19 @@ +UseGroup in syn - Rust

Struct syn::UseGroup

source ·
pub struct UseGroup {
+    pub brace_token: Brace,
+    pub items: Punctuated<UseTree, Comma>,
+}
Expand description

A braced group of imports in a use item: {A, B, C}.

+

Fields§

§brace_token: Brace§items: Punctuated<UseTree, Comma>

Trait Implementations§

source§

impl Clone for UseGroup

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<UseGroup> for UseTree

source§

fn from(e: UseGroup) -> UseTree

Converts to this type from the input type.
source§

impl ToTokens for UseGroup

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.UseName.html b/syn/struct.UseName.html new file mode 100644 index 0000000..ffb1d37 --- /dev/null +++ b/syn/struct.UseName.html @@ -0,0 +1,18 @@ +UseName in syn - Rust

Struct syn::UseName

source ·
pub struct UseName {
+    pub ident: Ident,
+}
Expand description

An identifier imported by a use item: HashMap.

+

Fields§

§ident: Ident

Trait Implementations§

source§

impl Clone for UseName

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<UseName> for UseTree

source§

fn from(e: UseName) -> UseTree

Converts to this type from the input type.
source§

impl ToTokens for UseName

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.UsePath.html b/syn/struct.UsePath.html new file mode 100644 index 0000000..9cd02ab --- /dev/null +++ b/syn/struct.UsePath.html @@ -0,0 +1,20 @@ +UsePath in syn - Rust

Struct syn::UsePath

source ·
pub struct UsePath {
+    pub ident: Ident,
+    pub colon2_token: PathSep,
+    pub tree: Box<UseTree>,
+}
Expand description

A path prefix of imports in a use item: std::....

+

Fields§

§ident: Ident§colon2_token: PathSep§tree: Box<UseTree>

Trait Implementations§

source§

impl Clone for UsePath

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<UsePath> for UseTree

source§

fn from(e: UsePath) -> UseTree

Converts to this type from the input type.
source§

impl ToTokens for UsePath

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.UseRename.html b/syn/struct.UseRename.html new file mode 100644 index 0000000..be0336a --- /dev/null +++ b/syn/struct.UseRename.html @@ -0,0 +1,20 @@ +UseRename in syn - Rust

Struct syn::UseRename

source ·
pub struct UseRename {
+    pub ident: Ident,
+    pub as_token: As,
+    pub rename: Ident,
+}
Expand description

An renamed identifier imported by a use item: HashMap as Map.

+

Fields§

§ident: Ident§as_token: As§rename: Ident

Trait Implementations§

source§

impl Clone for UseRename

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl From<UseRename> for UseTree

source§

fn from(e: UseRename) -> UseTree

Converts to this type from the input type.
source§

impl ToTokens for UseRename

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.Variadic.html b/syn/struct.Variadic.html new file mode 100644 index 0000000..7363b66 --- /dev/null +++ b/syn/struct.Variadic.html @@ -0,0 +1,26 @@ +Variadic in syn - Rust

Struct syn::Variadic

source ·
pub struct Variadic {
+    pub attrs: Vec<Attribute>,
+    pub pat: Option<(Box<Pat>, Colon)>,
+    pub dots: DotDotDot,
+    pub comma: Option<Comma>,
+}
Expand description

The variadic argument of a foreign function.

+ +
extern "C" {
+    fn printf(format: *const c_char, ...) -> c_int;
+    //                               ^^^
+}
+

Fields§

§attrs: Vec<Attribute>§pat: Option<(Box<Pat>, Colon)>§dots: DotDotDot§comma: Option<Comma>

Trait Implementations§

source§

impl Clone for Variadic

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl ToTokens for Variadic

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.Variant.html b/syn/struct.Variant.html new file mode 100644 index 0000000..da62550 --- /dev/null +++ b/syn/struct.Variant.html @@ -0,0 +1,24 @@ +Variant in syn - Rust

Struct syn::Variant

source ·
pub struct Variant {
+    pub attrs: Vec<Attribute>,
+    pub ident: Ident,
+    pub fields: Fields,
+    pub discriminant: Option<(Eq, Expr)>,
+}
Expand description

An enum variant.

+

Fields§

§attrs: Vec<Attribute>§ident: Ident

Name of the variant.

+
§fields: Fields

Content stored in the variant.

+
§discriminant: Option<(Eq, Expr)>

Explicit discriminant: Variant = 1

+

Trait Implementations§

source§

impl Clone for Variant

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Parse for Variant

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for Variant

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.VisRestricted.html b/syn/struct.VisRestricted.html new file mode 100644 index 0000000..bb1d1d3 --- /dev/null +++ b/syn/struct.VisRestricted.html @@ -0,0 +1,22 @@ +VisRestricted in syn - Rust

Struct syn::VisRestricted

source ·
pub struct VisRestricted {
+    pub pub_token: Pub,
+    pub paren_token: Paren,
+    pub in_token: Option<In>,
+    pub path: Box<Path>,
+}
Expand description

A visibility level restricted to some path: pub(self) or +pub(super) or pub(crate) or pub(in some::module).

+

Fields§

§pub_token: Pub§paren_token: Paren§in_token: Option<In>§path: Box<Path>

Trait Implementations§

source§

impl Clone for VisRestricted

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl ToTokens for VisRestricted

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/struct.WhereClause.html b/syn/struct.WhereClause.html new file mode 100644 index 0000000..86bad6b --- /dev/null +++ b/syn/struct.WhereClause.html @@ -0,0 +1,19 @@ +WhereClause in syn - Rust

Struct syn::WhereClause

source ·
pub struct WhereClause {
+    pub where_token: Where,
+    pub predicates: Punctuated<WherePredicate, Comma>,
+}
Expand description

A where clause in a definition: where T: Deserialize<'de>, D: 'static.

+

Fields§

§where_token: Where§predicates: Punctuated<WherePredicate, Comma>

Trait Implementations§

source§

impl Clone for WhereClause

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Parse for WhereClause

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for WhereClause

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/index.html b/syn/token/index.html new file mode 100644 index 0000000..24ef8aa --- /dev/null +++ b/syn/token/index.html @@ -0,0 +1,64 @@ +syn::token - Rust

Module syn::token

source ·
Expand description

Tokens representing Rust punctuation, keywords, and delimiters.

+

The type names in this module can be difficult to keep straight, so we +prefer to use the Token! macro instead. This is a type-macro that +expands to the token type of the given token.

+

§Example

+

The ItemStatic syntax tree node is defined like this.

+ +
pub struct ItemStatic {
+    pub attrs: Vec<Attribute>,
+    pub vis: Visibility,
+    pub static_token: Token![static],
+    pub mutability: Option<Token![mut]>,
+    pub ident: Ident,
+    pub colon_token: Token![:],
+    pub ty: Box<Type>,
+    pub eq_token: Token![=],
+    pub expr: Box<Expr>,
+    pub semi_token: Token![;],
+}
+

§Parsing

+

Keywords and punctuation can be parsed through the ParseStream::parse +method. Delimiter tokens are parsed using the parenthesized!, +bracketed! and braced! macros.

+ +
use syn::{Attribute, Result};
+use syn::parse::{Parse, ParseStream};
+
+// Parse the ItemStatic struct shown above.
+impl Parse for ItemStatic {
+    fn parse(input: ParseStream) -> Result<Self> {
+        Ok(ItemStatic {
+            attrs: input.call(Attribute::parse_outer)?,
+            vis: input.parse()?,
+            static_token: input.parse()?,
+            mutability: input.parse()?,
+            ident: input.parse()?,
+            colon_token: input.parse()?,
+            ty: input.parse()?,
+            eq_token: input.parse()?,
+            expr: input.parse()?,
+            semi_token: input.parse()?,
+        })
+    }
+}
+

§Other operations

+

Every keyword and punctuation token supports the following operations.

+
    +
  • +

    Peekinginput.peek(Token![...])

    +
  • +
  • +

    Parsinginput.parse::<Token![...]>()?

    +
  • +
  • +

    Printingquote!( ... #the_token ... )

    +
  • +
  • +

    Construction from a Spanlet the_token = Token![...](sp)

    +
  • +
  • +

    Field access to its span — let sp = the_token.span

    +
  • +
+

Structs§

Traits§

  • Marker trait for types that represent single tokens.
\ No newline at end of file diff --git a/syn/token/sidebar-items.js b/syn/token/sidebar-items.js new file mode 100644 index 0000000..40ac500 --- /dev/null +++ b/syn/token/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":["Abstract","And","AndAnd","AndEq","As","Async","At","Auto","Await","Become","Box","Brace","Bracket","Break","Caret","CaretEq","Colon","Comma","Const","Continue","Crate","Default","Do","Dollar","Dot","DotDot","DotDotDot","DotDotEq","Dyn","Else","Enum","Eq","EqEq","Extern","FatArrow","Final","Fn","For","Ge","Group","Gt","If","Impl","In","LArrow","Le","Let","Loop","Lt","Macro","Match","Minus","MinusEq","Mod","Move","Mut","Ne","Not","Or","OrEq","OrOr","Override","Paren","PathSep","Percent","PercentEq","Plus","PlusEq","Pound","Priv","Pub","Question","RArrow","Ref","Return","SelfType","SelfValue","Semi","Shl","ShlEq","Shr","ShrEq","Slash","SlashEq","Star","StarEq","Static","Struct","Super","Tilde","Trait","Try","Type","Typeof","Underscore","Union","Unsafe","Unsized","Use","Virtual","Where","While","Yield"],"trait":["Token"]}; \ No newline at end of file diff --git a/syn/token/struct.Abstract.html b/syn/token/struct.Abstract.html new file mode 100644 index 0000000..ef347ff --- /dev/null +++ b/syn/token/struct.Abstract.html @@ -0,0 +1,20 @@ +Abstract in syn::token - Rust

Struct syn::token::Abstract

source ·
pub struct Abstract {
+    pub span: Span,
+}
Expand description

abstract

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§span: Span

Trait Implementations§

source§

impl Clone for Abstract

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for Abstract

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Parse for Abstract

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for Abstract

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for Abstract

source§

impl Token for Abstract

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.And.html b/syn/token/struct.And.html new file mode 100644 index 0000000..55eab22 --- /dev/null +++ b/syn/token/struct.And.html @@ -0,0 +1,22 @@ +And in syn::token - Rust

Struct syn::token::And

source ·
pub struct And {
+    pub spans: [Span; 1],
+}
Expand description

&

+

Usage: +bitwise and logical AND, borrow, references, reference patterns.

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§spans: [Span; 1]

Trait Implementations§

source§

impl Clone for And

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for And

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Deref for And

§

type Target = WithSpan

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl DerefMut for And

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
source§

impl Parse for And

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for And

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for And

source§

impl Token for And

Auto Trait Implementations§

§

impl Freeze for And

§

impl RefUnwindSafe for And

§

impl !Send for And

§

impl !Sync for And

§

impl Unpin for And

§

impl UnwindSafe for And

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.AndAnd.html b/syn/token/struct.AndAnd.html new file mode 100644 index 0000000..bb39cc8 --- /dev/null +++ b/syn/token/struct.AndAnd.html @@ -0,0 +1,22 @@ +AndAnd in syn::token - Rust

Struct syn::token::AndAnd

source ·
pub struct AndAnd {
+    pub spans: [Span; 2],
+}
Expand description

&&

+

Usage: +lazy AND, borrow, references, reference patterns.

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§spans: [Span; 2]

Trait Implementations§

source§

impl Clone for AndAnd

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for AndAnd

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Parse for AndAnd

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for AndAnd

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for AndAnd

source§

impl Token for AndAnd

Auto Trait Implementations§

§

impl Freeze for AndAnd

§

impl RefUnwindSafe for AndAnd

§

impl !Send for AndAnd

§

impl !Sync for AndAnd

§

impl Unpin for AndAnd

§

impl UnwindSafe for AndAnd

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.AndEq.html b/syn/token/struct.AndEq.html new file mode 100644 index 0000000..3d6130c --- /dev/null +++ b/syn/token/struct.AndEq.html @@ -0,0 +1,22 @@ +AndEq in syn::token - Rust

Struct syn::token::AndEq

source ·
pub struct AndEq {
+    pub spans: [Span; 2],
+}
Expand description

&=

+

Usage: +bitwise AND assignment.

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§spans: [Span; 2]

Trait Implementations§

source§

impl Clone for AndEq

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for AndEq

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Parse for AndEq

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for AndEq

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for AndEq

source§

impl Token for AndEq

Auto Trait Implementations§

§

impl Freeze for AndEq

§

impl RefUnwindSafe for AndEq

§

impl !Send for AndEq

§

impl !Sync for AndEq

§

impl Unpin for AndEq

§

impl UnwindSafe for AndEq

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.As.html b/syn/token/struct.As.html new file mode 100644 index 0000000..27ac03f --- /dev/null +++ b/syn/token/struct.As.html @@ -0,0 +1,20 @@ +As in syn::token - Rust

Struct syn::token::As

source ·
pub struct As {
+    pub span: Span,
+}
Expand description

as

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§span: Span

Trait Implementations§

source§

impl Clone for As

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for As

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Parse for As

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for As

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for As

source§

impl Token for As

Auto Trait Implementations§

§

impl Freeze for As

§

impl RefUnwindSafe for As

§

impl !Send for As

§

impl !Sync for As

§

impl Unpin for As

§

impl UnwindSafe for As

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.Async.html b/syn/token/struct.Async.html new file mode 100644 index 0000000..3ec6dbe --- /dev/null +++ b/syn/token/struct.Async.html @@ -0,0 +1,20 @@ +Async in syn::token - Rust

Struct syn::token::Async

source ·
pub struct Async {
+    pub span: Span,
+}
Expand description

async

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§span: Span

Trait Implementations§

source§

impl Clone for Async

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for Async

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Parse for Async

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for Async

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for Async

source§

impl Token for Async

Auto Trait Implementations§

§

impl Freeze for Async

§

impl RefUnwindSafe for Async

§

impl !Send for Async

§

impl !Sync for Async

§

impl Unpin for Async

§

impl UnwindSafe for Async

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.At.html b/syn/token/struct.At.html new file mode 100644 index 0000000..b014e07 --- /dev/null +++ b/syn/token/struct.At.html @@ -0,0 +1,22 @@ +At in syn::token - Rust

Struct syn::token::At

source ·
pub struct At {
+    pub spans: [Span; 1],
+}
Expand description

@

+

Usage: +subpattern binding.

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§spans: [Span; 1]

Trait Implementations§

source§

impl Clone for At

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for At

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Deref for At

§

type Target = WithSpan

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl DerefMut for At

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
source§

impl Parse for At

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for At

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for At

source§

impl Token for At

Auto Trait Implementations§

§

impl Freeze for At

§

impl RefUnwindSafe for At

§

impl !Send for At

§

impl !Sync for At

§

impl Unpin for At

§

impl UnwindSafe for At

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.Auto.html b/syn/token/struct.Auto.html new file mode 100644 index 0000000..509bfb9 --- /dev/null +++ b/syn/token/struct.Auto.html @@ -0,0 +1,20 @@ +Auto in syn::token - Rust

Struct syn::token::Auto

source ·
pub struct Auto {
+    pub span: Span,
+}
Expand description

auto

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§span: Span

Trait Implementations§

source§

impl Clone for Auto

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for Auto

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Parse for Auto

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for Auto

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for Auto

source§

impl Token for Auto

Auto Trait Implementations§

§

impl Freeze for Auto

§

impl RefUnwindSafe for Auto

§

impl !Send for Auto

§

impl !Sync for Auto

§

impl Unpin for Auto

§

impl UnwindSafe for Auto

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.Await.html b/syn/token/struct.Await.html new file mode 100644 index 0000000..2ee1c37 --- /dev/null +++ b/syn/token/struct.Await.html @@ -0,0 +1,20 @@ +Await in syn::token - Rust

Struct syn::token::Await

source ·
pub struct Await {
+    pub span: Span,
+}
Expand description

await

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§span: Span

Trait Implementations§

source§

impl Clone for Await

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for Await

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Parse for Await

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for Await

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for Await

source§

impl Token for Await

Auto Trait Implementations§

§

impl Freeze for Await

§

impl RefUnwindSafe for Await

§

impl !Send for Await

§

impl !Sync for Await

§

impl Unpin for Await

§

impl UnwindSafe for Await

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.Become.html b/syn/token/struct.Become.html new file mode 100644 index 0000000..0af5f69 --- /dev/null +++ b/syn/token/struct.Become.html @@ -0,0 +1,20 @@ +Become in syn::token - Rust

Struct syn::token::Become

source ·
pub struct Become {
+    pub span: Span,
+}
Expand description

become

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§span: Span

Trait Implementations§

source§

impl Clone for Become

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for Become

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Parse for Become

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for Become

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for Become

source§

impl Token for Become

Auto Trait Implementations§

§

impl Freeze for Become

§

impl RefUnwindSafe for Become

§

impl !Send for Become

§

impl !Sync for Become

§

impl Unpin for Become

§

impl UnwindSafe for Become

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.Box.html b/syn/token/struct.Box.html new file mode 100644 index 0000000..d84c7ec --- /dev/null +++ b/syn/token/struct.Box.html @@ -0,0 +1,20 @@ +Box in syn::token - Rust

Struct syn::token::Box

source ·
pub struct Box {
+    pub span: Span,
+}
Expand description

box

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§span: Span

Trait Implementations§

source§

impl Clone for Box

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for Box

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Parse for Box

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for Box

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for Box

source§

impl Token for Box

Auto Trait Implementations§

§

impl Freeze for Box

§

impl RefUnwindSafe for Box

§

impl !Send for Box

§

impl !Sync for Box

§

impl Unpin for Box

§

impl UnwindSafe for Box

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.Brace.html b/syn/token/struct.Brace.html new file mode 100644 index 0000000..1284b4d --- /dev/null +++ b/syn/token/struct.Brace.html @@ -0,0 +1,16 @@ +Brace in syn::token - Rust

Struct syn::token::Brace

source ·
pub struct Brace {
+    pub span: DelimSpan,
+}
Expand description

{}

+

Fields§

§span: DelimSpan

Implementations§

source§

impl Brace

source

pub fn surround<F>(&self, tokens: &mut TokenStream, f: F)
where + F: FnOnce(&mut TokenStream),

Trait Implementations§

source§

impl Clone for Brace

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for Brace

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Copy for Brace

source§

impl Token for Brace

Auto Trait Implementations§

§

impl Freeze for Brace

§

impl RefUnwindSafe for Brace

§

impl !Send for Brace

§

impl !Sync for Brace

§

impl Unpin for Brace

§

impl UnwindSafe for Brace

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.Bracket.html b/syn/token/struct.Bracket.html new file mode 100644 index 0000000..416d257 --- /dev/null +++ b/syn/token/struct.Bracket.html @@ -0,0 +1,16 @@ +Bracket in syn::token - Rust

Struct syn::token::Bracket

source ·
pub struct Bracket {
+    pub span: DelimSpan,
+}
Expand description

[]

+

Fields§

§span: DelimSpan

Implementations§

source§

impl Bracket

source

pub fn surround<F>(&self, tokens: &mut TokenStream, f: F)
where + F: FnOnce(&mut TokenStream),

Trait Implementations§

source§

impl Clone for Bracket

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for Bracket

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Copy for Bracket

source§

impl Token for Bracket

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.Break.html b/syn/token/struct.Break.html new file mode 100644 index 0000000..f4bb0ea --- /dev/null +++ b/syn/token/struct.Break.html @@ -0,0 +1,20 @@ +Break in syn::token - Rust

Struct syn::token::Break

source ·
pub struct Break {
+    pub span: Span,
+}
Expand description

break

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§span: Span

Trait Implementations§

source§

impl Clone for Break

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for Break

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Parse for Break

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for Break

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for Break

source§

impl Token for Break

Auto Trait Implementations§

§

impl Freeze for Break

§

impl RefUnwindSafe for Break

§

impl !Send for Break

§

impl !Sync for Break

§

impl Unpin for Break

§

impl UnwindSafe for Break

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.Caret.html b/syn/token/struct.Caret.html new file mode 100644 index 0000000..f65a465 --- /dev/null +++ b/syn/token/struct.Caret.html @@ -0,0 +1,22 @@ +Caret in syn::token - Rust

Struct syn::token::Caret

source ·
pub struct Caret {
+    pub spans: [Span; 1],
+}
Expand description

^

+

Usage: +bitwise and logical XOR.

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§spans: [Span; 1]

Trait Implementations§

source§

impl Clone for Caret

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for Caret

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Deref for Caret

§

type Target = WithSpan

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl DerefMut for Caret

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
source§

impl Parse for Caret

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for Caret

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for Caret

source§

impl Token for Caret

Auto Trait Implementations§

§

impl Freeze for Caret

§

impl RefUnwindSafe for Caret

§

impl !Send for Caret

§

impl !Sync for Caret

§

impl Unpin for Caret

§

impl UnwindSafe for Caret

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.CaretEq.html b/syn/token/struct.CaretEq.html new file mode 100644 index 0000000..9cc3794 --- /dev/null +++ b/syn/token/struct.CaretEq.html @@ -0,0 +1,22 @@ +CaretEq in syn::token - Rust

Struct syn::token::CaretEq

source ·
pub struct CaretEq {
+    pub spans: [Span; 2],
+}
Expand description

^=

+

Usage: +bitwise XOR assignment.

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§spans: [Span; 2]

Trait Implementations§

source§

impl Clone for CaretEq

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for CaretEq

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Parse for CaretEq

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for CaretEq

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for CaretEq

source§

impl Token for CaretEq

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.Colon.html b/syn/token/struct.Colon.html new file mode 100644 index 0000000..892f68b --- /dev/null +++ b/syn/token/struct.Colon.html @@ -0,0 +1,22 @@ +Colon in syn::token - Rust

Struct syn::token::Colon

source ·
pub struct Colon {
+    pub spans: [Span; 1],
+}
Expand description

:

+

Usage: +various separators.

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§spans: [Span; 1]

Trait Implementations§

source§

impl Clone for Colon

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for Colon

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Deref for Colon

§

type Target = WithSpan

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl DerefMut for Colon

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
source§

impl Parse for Colon

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for Colon

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for Colon

source§

impl Token for Colon

Auto Trait Implementations§

§

impl Freeze for Colon

§

impl RefUnwindSafe for Colon

§

impl !Send for Colon

§

impl !Sync for Colon

§

impl Unpin for Colon

§

impl UnwindSafe for Colon

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.Comma.html b/syn/token/struct.Comma.html new file mode 100644 index 0000000..d3d468a --- /dev/null +++ b/syn/token/struct.Comma.html @@ -0,0 +1,22 @@ +Comma in syn::token - Rust

Struct syn::token::Comma

source ·
pub struct Comma {
+    pub spans: [Span; 1],
+}
Expand description

,

+

Usage: +various separators.

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§spans: [Span; 1]

Trait Implementations§

source§

impl Clone for Comma

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for Comma

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Deref for Comma

§

type Target = WithSpan

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl DerefMut for Comma

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
source§

impl Parse for Comma

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for Comma

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for Comma

source§

impl Token for Comma

Auto Trait Implementations§

§

impl Freeze for Comma

§

impl RefUnwindSafe for Comma

§

impl !Send for Comma

§

impl !Sync for Comma

§

impl Unpin for Comma

§

impl UnwindSafe for Comma

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.Const.html b/syn/token/struct.Const.html new file mode 100644 index 0000000..5a381df --- /dev/null +++ b/syn/token/struct.Const.html @@ -0,0 +1,20 @@ +Const in syn::token - Rust

Struct syn::token::Const

source ·
pub struct Const {
+    pub span: Span,
+}
Expand description

const

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§span: Span

Trait Implementations§

source§

impl Clone for Const

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for Const

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Parse for Const

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for Const

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for Const

source§

impl Token for Const

Auto Trait Implementations§

§

impl Freeze for Const

§

impl RefUnwindSafe for Const

§

impl !Send for Const

§

impl !Sync for Const

§

impl Unpin for Const

§

impl UnwindSafe for Const

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.Continue.html b/syn/token/struct.Continue.html new file mode 100644 index 0000000..ccace7a --- /dev/null +++ b/syn/token/struct.Continue.html @@ -0,0 +1,20 @@ +Continue in syn::token - Rust

Struct syn::token::Continue

source ·
pub struct Continue {
+    pub span: Span,
+}
Expand description

continue

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§span: Span

Trait Implementations§

source§

impl Clone for Continue

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for Continue

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Parse for Continue

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for Continue

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for Continue

source§

impl Token for Continue

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.Crate.html b/syn/token/struct.Crate.html new file mode 100644 index 0000000..f64db65 --- /dev/null +++ b/syn/token/struct.Crate.html @@ -0,0 +1,20 @@ +Crate in syn::token - Rust

Struct syn::token::Crate

source ·
pub struct Crate {
+    pub span: Span,
+}
Expand description

crate

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§span: Span

Trait Implementations§

source§

impl Clone for Crate

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for Crate

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl From<Crate> for Ident

source§

fn from(token: Crate) -> Ident

Converts to this type from the input type.
source§

impl Parse for Crate

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for Crate

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for Crate

source§

impl Token for Crate

Auto Trait Implementations§

§

impl Freeze for Crate

§

impl RefUnwindSafe for Crate

§

impl !Send for Crate

§

impl !Sync for Crate

§

impl Unpin for Crate

§

impl UnwindSafe for Crate

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.Default.html b/syn/token/struct.Default.html new file mode 100644 index 0000000..70bb39e --- /dev/null +++ b/syn/token/struct.Default.html @@ -0,0 +1,20 @@ +Default in syn::token - Rust

Struct syn::token::Default

source ·
pub struct Default {
+    pub span: Span,
+}
Expand description

default

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§span: Span

Trait Implementations§

source§

impl Clone for Default

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for Default

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Parse for Default

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for Default

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for Default

source§

impl Token for Default

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.Do.html b/syn/token/struct.Do.html new file mode 100644 index 0000000..a0d73b0 --- /dev/null +++ b/syn/token/struct.Do.html @@ -0,0 +1,20 @@ +Do in syn::token - Rust

Struct syn::token::Do

source ·
pub struct Do {
+    pub span: Span,
+}
Expand description

do

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§span: Span

Trait Implementations§

source§

impl Clone for Do

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for Do

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Parse for Do

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for Do

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for Do

source§

impl Token for Do

Auto Trait Implementations§

§

impl Freeze for Do

§

impl RefUnwindSafe for Do

§

impl !Send for Do

§

impl !Sync for Do

§

impl Unpin for Do

§

impl UnwindSafe for Do

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.Dollar.html b/syn/token/struct.Dollar.html new file mode 100644 index 0000000..fab2167 --- /dev/null +++ b/syn/token/struct.Dollar.html @@ -0,0 +1,22 @@ +Dollar in syn::token - Rust

Struct syn::token::Dollar

source ·
pub struct Dollar {
+    pub spans: [Span; 1],
+}
Expand description

$

+

Usage: +macros.

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§spans: [Span; 1]

Trait Implementations§

source§

impl Clone for Dollar

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for Dollar

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Deref for Dollar

§

type Target = WithSpan

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl DerefMut for Dollar

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
source§

impl Parse for Dollar

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for Dollar

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for Dollar

source§

impl Token for Dollar

Auto Trait Implementations§

§

impl Freeze for Dollar

§

impl RefUnwindSafe for Dollar

§

impl !Send for Dollar

§

impl !Sync for Dollar

§

impl Unpin for Dollar

§

impl UnwindSafe for Dollar

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.Dot.html b/syn/token/struct.Dot.html new file mode 100644 index 0000000..8e5ce91 --- /dev/null +++ b/syn/token/struct.Dot.html @@ -0,0 +1,22 @@ +Dot in syn::token - Rust

Struct syn::token::Dot

source ·
pub struct Dot {
+    pub spans: [Span; 1],
+}
Expand description

.

+

Usage: +field access, tuple index.

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§spans: [Span; 1]

Trait Implementations§

source§

impl Clone for Dot

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for Dot

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Deref for Dot

§

type Target = WithSpan

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl DerefMut for Dot

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
source§

impl Parse for Dot

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for Dot

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for Dot

source§

impl Token for Dot

Auto Trait Implementations§

§

impl Freeze for Dot

§

impl RefUnwindSafe for Dot

§

impl !Send for Dot

§

impl !Sync for Dot

§

impl Unpin for Dot

§

impl UnwindSafe for Dot

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.DotDot.html b/syn/token/struct.DotDot.html new file mode 100644 index 0000000..41fa8b5 --- /dev/null +++ b/syn/token/struct.DotDot.html @@ -0,0 +1,22 @@ +DotDot in syn::token - Rust

Struct syn::token::DotDot

source ·
pub struct DotDot {
+    pub spans: [Span; 2],
+}
Expand description

..

+

Usage: +range, struct expressions, patterns, range patterns.

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§spans: [Span; 2]

Trait Implementations§

source§

impl Clone for DotDot

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for DotDot

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Parse for DotDot

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for DotDot

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for DotDot

source§

impl Token for DotDot

Auto Trait Implementations§

§

impl Freeze for DotDot

§

impl RefUnwindSafe for DotDot

§

impl !Send for DotDot

§

impl !Sync for DotDot

§

impl Unpin for DotDot

§

impl UnwindSafe for DotDot

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.DotDotDot.html b/syn/token/struct.DotDotDot.html new file mode 100644 index 0000000..13876f8 --- /dev/null +++ b/syn/token/struct.DotDotDot.html @@ -0,0 +1,22 @@ +DotDotDot in syn::token - Rust

Struct syn::token::DotDotDot

source ·
pub struct DotDotDot {
+    pub spans: [Span; 3],
+}
Expand description

...

+

Usage: +variadic functions, range patterns.

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§spans: [Span; 3]

Trait Implementations§

source§

impl Clone for DotDotDot

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for DotDotDot

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Parse for DotDotDot

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for DotDotDot

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for DotDotDot

source§

impl Token for DotDotDot

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.DotDotEq.html b/syn/token/struct.DotDotEq.html new file mode 100644 index 0000000..10274f4 --- /dev/null +++ b/syn/token/struct.DotDotEq.html @@ -0,0 +1,22 @@ +DotDotEq in syn::token - Rust

Struct syn::token::DotDotEq

source ·
pub struct DotDotEq {
+    pub spans: [Span; 3],
+}
Expand description

..=

+

Usage: +inclusive range, range patterns.

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§spans: [Span; 3]

Trait Implementations§

source§

impl Clone for DotDotEq

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for DotDotEq

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Parse for DotDotEq

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for DotDotEq

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for DotDotEq

source§

impl Token for DotDotEq

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.Dyn.html b/syn/token/struct.Dyn.html new file mode 100644 index 0000000..1ec87e6 --- /dev/null +++ b/syn/token/struct.Dyn.html @@ -0,0 +1,20 @@ +Dyn in syn::token - Rust

Struct syn::token::Dyn

source ·
pub struct Dyn {
+    pub span: Span,
+}
Expand description

dyn

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§span: Span

Trait Implementations§

source§

impl Clone for Dyn

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for Dyn

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Parse for Dyn

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for Dyn

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for Dyn

source§

impl Token for Dyn

Auto Trait Implementations§

§

impl Freeze for Dyn

§

impl RefUnwindSafe for Dyn

§

impl !Send for Dyn

§

impl !Sync for Dyn

§

impl Unpin for Dyn

§

impl UnwindSafe for Dyn

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.Else.html b/syn/token/struct.Else.html new file mode 100644 index 0000000..484487f --- /dev/null +++ b/syn/token/struct.Else.html @@ -0,0 +1,20 @@ +Else in syn::token - Rust

Struct syn::token::Else

source ·
pub struct Else {
+    pub span: Span,
+}
Expand description

else

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§span: Span

Trait Implementations§

source§

impl Clone for Else

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for Else

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Parse for Else

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for Else

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for Else

source§

impl Token for Else

Auto Trait Implementations§

§

impl Freeze for Else

§

impl RefUnwindSafe for Else

§

impl !Send for Else

§

impl !Sync for Else

§

impl Unpin for Else

§

impl UnwindSafe for Else

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.Enum.html b/syn/token/struct.Enum.html new file mode 100644 index 0000000..0d9cc58 --- /dev/null +++ b/syn/token/struct.Enum.html @@ -0,0 +1,20 @@ +Enum in syn::token - Rust

Struct syn::token::Enum

source ·
pub struct Enum {
+    pub span: Span,
+}
Expand description

enum

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§span: Span

Trait Implementations§

source§

impl Clone for Enum

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for Enum

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Parse for Enum

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for Enum

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for Enum

source§

impl Token for Enum

Auto Trait Implementations§

§

impl Freeze for Enum

§

impl RefUnwindSafe for Enum

§

impl !Send for Enum

§

impl !Sync for Enum

§

impl Unpin for Enum

§

impl UnwindSafe for Enum

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.Eq.html b/syn/token/struct.Eq.html new file mode 100644 index 0000000..05e5e35 --- /dev/null +++ b/syn/token/struct.Eq.html @@ -0,0 +1,22 @@ +Eq in syn::token - Rust

Struct syn::token::Eq

source ·
pub struct Eq {
+    pub spans: [Span; 1],
+}
Expand description

=

+

Usage: +assignment, attributes, various type definitions.

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§spans: [Span; 1]

Trait Implementations§

source§

impl Clone for Eq

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for Eq

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Deref for Eq

§

type Target = WithSpan

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl DerefMut for Eq

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
source§

impl Parse for Eq

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for Eq

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for Eq

source§

impl Token for Eq

Auto Trait Implementations§

§

impl Freeze for Eq

§

impl RefUnwindSafe for Eq

§

impl !Send for Eq

§

impl !Sync for Eq

§

impl Unpin for Eq

§

impl UnwindSafe for Eq

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.EqEq.html b/syn/token/struct.EqEq.html new file mode 100644 index 0000000..3c49e60 --- /dev/null +++ b/syn/token/struct.EqEq.html @@ -0,0 +1,22 @@ +EqEq in syn::token - Rust

Struct syn::token::EqEq

source ·
pub struct EqEq {
+    pub spans: [Span; 2],
+}
Expand description

==

+

Usage: +equal.

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§spans: [Span; 2]

Trait Implementations§

source§

impl Clone for EqEq

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for EqEq

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Parse for EqEq

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for EqEq

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for EqEq

source§

impl Token for EqEq

Auto Trait Implementations§

§

impl Freeze for EqEq

§

impl RefUnwindSafe for EqEq

§

impl !Send for EqEq

§

impl !Sync for EqEq

§

impl Unpin for EqEq

§

impl UnwindSafe for EqEq

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.Extern.html b/syn/token/struct.Extern.html new file mode 100644 index 0000000..49c5e79 --- /dev/null +++ b/syn/token/struct.Extern.html @@ -0,0 +1,20 @@ +Extern in syn::token - Rust

Struct syn::token::Extern

source ·
pub struct Extern {
+    pub span: Span,
+}
Expand description

extern

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§span: Span

Trait Implementations§

source§

impl Clone for Extern

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for Extern

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl From<Extern> for Ident

source§

fn from(token: Extern) -> Ident

Converts to this type from the input type.
source§

impl Parse for Extern

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for Extern

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for Extern

source§

impl Token for Extern

Auto Trait Implementations§

§

impl Freeze for Extern

§

impl RefUnwindSafe for Extern

§

impl !Send for Extern

§

impl !Sync for Extern

§

impl Unpin for Extern

§

impl UnwindSafe for Extern

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.FatArrow.html b/syn/token/struct.FatArrow.html new file mode 100644 index 0000000..06d337f --- /dev/null +++ b/syn/token/struct.FatArrow.html @@ -0,0 +1,22 @@ +FatArrow in syn::token - Rust

Struct syn::token::FatArrow

source ·
pub struct FatArrow {
+    pub spans: [Span; 2],
+}
Expand description

=>

+

Usage: +match arms, macros.

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§spans: [Span; 2]

Trait Implementations§

source§

impl Clone for FatArrow

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for FatArrow

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Parse for FatArrow

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for FatArrow

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for FatArrow

source§

impl Token for FatArrow

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.Final.html b/syn/token/struct.Final.html new file mode 100644 index 0000000..9e2c8f0 --- /dev/null +++ b/syn/token/struct.Final.html @@ -0,0 +1,20 @@ +Final in syn::token - Rust

Struct syn::token::Final

source ·
pub struct Final {
+    pub span: Span,
+}
Expand description

final

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§span: Span

Trait Implementations§

source§

impl Clone for Final

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for Final

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Parse for Final

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for Final

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for Final

source§

impl Token for Final

Auto Trait Implementations§

§

impl Freeze for Final

§

impl RefUnwindSafe for Final

§

impl !Send for Final

§

impl !Sync for Final

§

impl Unpin for Final

§

impl UnwindSafe for Final

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.Fn.html b/syn/token/struct.Fn.html new file mode 100644 index 0000000..3133afe --- /dev/null +++ b/syn/token/struct.Fn.html @@ -0,0 +1,20 @@ +Fn in syn::token - Rust

Struct syn::token::Fn

source ·
pub struct Fn {
+    pub span: Span,
+}
Expand description

fn

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§span: Span

Trait Implementations§

source§

impl Clone for Fn

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for Fn

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Parse for Fn

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for Fn

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for Fn

source§

impl Token for Fn

Auto Trait Implementations§

§

impl Freeze for Fn

§

impl RefUnwindSafe for Fn

§

impl !Send for Fn

§

impl !Sync for Fn

§

impl Unpin for Fn

§

impl UnwindSafe for Fn

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.For.html b/syn/token/struct.For.html new file mode 100644 index 0000000..70065bb --- /dev/null +++ b/syn/token/struct.For.html @@ -0,0 +1,20 @@ +For in syn::token - Rust

Struct syn::token::For

source ·
pub struct For {
+    pub span: Span,
+}
Expand description

for

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§span: Span

Trait Implementations§

source§

impl Clone for For

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for For

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Parse for For

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for For

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for For

source§

impl Token for For

Auto Trait Implementations§

§

impl Freeze for For

§

impl RefUnwindSafe for For

§

impl !Send for For

§

impl !Sync for For

§

impl Unpin for For

§

impl UnwindSafe for For

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.Ge.html b/syn/token/struct.Ge.html new file mode 100644 index 0000000..c953ced --- /dev/null +++ b/syn/token/struct.Ge.html @@ -0,0 +1,22 @@ +Ge in syn::token - Rust

Struct syn::token::Ge

source ·
pub struct Ge {
+    pub spans: [Span; 2],
+}
Expand description

>=

+

Usage: +greater than or equal to, generics.

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§spans: [Span; 2]

Trait Implementations§

source§

impl Clone for Ge

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for Ge

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Parse for Ge

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for Ge

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for Ge

source§

impl Token for Ge

Auto Trait Implementations§

§

impl Freeze for Ge

§

impl RefUnwindSafe for Ge

§

impl !Send for Ge

§

impl !Sync for Ge

§

impl Unpin for Ge

§

impl UnwindSafe for Ge

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.Group.html b/syn/token/struct.Group.html new file mode 100644 index 0000000..2116dea --- /dev/null +++ b/syn/token/struct.Group.html @@ -0,0 +1,16 @@ +Group in syn::token - Rust

Struct syn::token::Group

source ·
pub struct Group {
+    pub span: Span,
+}
Expand description

None-delimited group

+

Fields§

§span: Span

Implementations§

source§

impl Group

source

pub fn surround<F>(&self, tokens: &mut TokenStream, f: F)
where + F: FnOnce(&mut TokenStream),

Trait Implementations§

source§

impl Clone for Group

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for Group

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Copy for Group

source§

impl Token for Group

Auto Trait Implementations§

§

impl Freeze for Group

§

impl RefUnwindSafe for Group

§

impl !Send for Group

§

impl !Sync for Group

§

impl Unpin for Group

§

impl UnwindSafe for Group

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.Gt.html b/syn/token/struct.Gt.html new file mode 100644 index 0000000..58a0bbd --- /dev/null +++ b/syn/token/struct.Gt.html @@ -0,0 +1,22 @@ +Gt in syn::token - Rust

Struct syn::token::Gt

source ·
pub struct Gt {
+    pub spans: [Span; 1],
+}
Expand description

>

+

Usage: +greater than, generics, paths.

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§spans: [Span; 1]

Trait Implementations§

source§

impl Clone for Gt

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for Gt

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Deref for Gt

§

type Target = WithSpan

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl DerefMut for Gt

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
source§

impl Parse for Gt

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for Gt

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for Gt

source§

impl Token for Gt

Auto Trait Implementations§

§

impl Freeze for Gt

§

impl RefUnwindSafe for Gt

§

impl !Send for Gt

§

impl !Sync for Gt

§

impl Unpin for Gt

§

impl UnwindSafe for Gt

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.If.html b/syn/token/struct.If.html new file mode 100644 index 0000000..0754cea --- /dev/null +++ b/syn/token/struct.If.html @@ -0,0 +1,20 @@ +If in syn::token - Rust

Struct syn::token::If

source ·
pub struct If {
+    pub span: Span,
+}
Expand description

if

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§span: Span

Trait Implementations§

source§

impl Clone for If

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for If

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Parse for If

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for If

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for If

source§

impl Token for If

Auto Trait Implementations§

§

impl Freeze for If

§

impl RefUnwindSafe for If

§

impl !Send for If

§

impl !Sync for If

§

impl Unpin for If

§

impl UnwindSafe for If

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.Impl.html b/syn/token/struct.Impl.html new file mode 100644 index 0000000..99a4e97 --- /dev/null +++ b/syn/token/struct.Impl.html @@ -0,0 +1,20 @@ +Impl in syn::token - Rust

Struct syn::token::Impl

source ·
pub struct Impl {
+    pub span: Span,
+}
Expand description

impl

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§span: Span

Trait Implementations§

source§

impl Clone for Impl

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for Impl

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Parse for Impl

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for Impl

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for Impl

source§

impl Token for Impl

Auto Trait Implementations§

§

impl Freeze for Impl

§

impl RefUnwindSafe for Impl

§

impl !Send for Impl

§

impl !Sync for Impl

§

impl Unpin for Impl

§

impl UnwindSafe for Impl

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.In.html b/syn/token/struct.In.html new file mode 100644 index 0000000..6935edb --- /dev/null +++ b/syn/token/struct.In.html @@ -0,0 +1,20 @@ +In in syn::token - Rust

Struct syn::token::In

source ·
pub struct In {
+    pub span: Span,
+}
Expand description

in

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§span: Span

Trait Implementations§

source§

impl Clone for In

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for In

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Parse for In

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for In

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for In

source§

impl Token for In

Auto Trait Implementations§

§

impl Freeze for In

§

impl RefUnwindSafe for In

§

impl !Send for In

§

impl !Sync for In

§

impl Unpin for In

§

impl UnwindSafe for In

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.LArrow.html b/syn/token/struct.LArrow.html new file mode 100644 index 0000000..6a53f4c --- /dev/null +++ b/syn/token/struct.LArrow.html @@ -0,0 +1,22 @@ +LArrow in syn::token - Rust

Struct syn::token::LArrow

source ·
pub struct LArrow {
+    pub spans: [Span; 2],
+}
Expand description

<-

+

Usage: +unused.

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§spans: [Span; 2]

Trait Implementations§

source§

impl Clone for LArrow

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for LArrow

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Parse for LArrow

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for LArrow

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for LArrow

source§

impl Token for LArrow

Auto Trait Implementations§

§

impl Freeze for LArrow

§

impl RefUnwindSafe for LArrow

§

impl !Send for LArrow

§

impl !Sync for LArrow

§

impl Unpin for LArrow

§

impl UnwindSafe for LArrow

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.Le.html b/syn/token/struct.Le.html new file mode 100644 index 0000000..6fe26ed --- /dev/null +++ b/syn/token/struct.Le.html @@ -0,0 +1,22 @@ +Le in syn::token - Rust

Struct syn::token::Le

source ·
pub struct Le {
+    pub spans: [Span; 2],
+}
Expand description

<=

+

Usage: +less than or equal to.

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§spans: [Span; 2]

Trait Implementations§

source§

impl Clone for Le

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for Le

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Parse for Le

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for Le

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for Le

source§

impl Token for Le

Auto Trait Implementations§

§

impl Freeze for Le

§

impl RefUnwindSafe for Le

§

impl !Send for Le

§

impl !Sync for Le

§

impl Unpin for Le

§

impl UnwindSafe for Le

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.Let.html b/syn/token/struct.Let.html new file mode 100644 index 0000000..fba3323 --- /dev/null +++ b/syn/token/struct.Let.html @@ -0,0 +1,20 @@ +Let in syn::token - Rust

Struct syn::token::Let

source ·
pub struct Let {
+    pub span: Span,
+}
Expand description

let

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§span: Span

Trait Implementations§

source§

impl Clone for Let

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for Let

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Parse for Let

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for Let

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for Let

source§

impl Token for Let

Auto Trait Implementations§

§

impl Freeze for Let

§

impl RefUnwindSafe for Let

§

impl !Send for Let

§

impl !Sync for Let

§

impl Unpin for Let

§

impl UnwindSafe for Let

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.Loop.html b/syn/token/struct.Loop.html new file mode 100644 index 0000000..df56d3e --- /dev/null +++ b/syn/token/struct.Loop.html @@ -0,0 +1,20 @@ +Loop in syn::token - Rust

Struct syn::token::Loop

source ·
pub struct Loop {
+    pub span: Span,
+}
Expand description

loop

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§span: Span

Trait Implementations§

source§

impl Clone for Loop

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for Loop

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Parse for Loop

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for Loop

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for Loop

source§

impl Token for Loop

Auto Trait Implementations§

§

impl Freeze for Loop

§

impl RefUnwindSafe for Loop

§

impl !Send for Loop

§

impl !Sync for Loop

§

impl Unpin for Loop

§

impl UnwindSafe for Loop

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.Lt.html b/syn/token/struct.Lt.html new file mode 100644 index 0000000..33dfed4 --- /dev/null +++ b/syn/token/struct.Lt.html @@ -0,0 +1,22 @@ +Lt in syn::token - Rust

Struct syn::token::Lt

source ·
pub struct Lt {
+    pub spans: [Span; 1],
+}
Expand description

<

+

Usage: +less than, generics, paths.

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§spans: [Span; 1]

Trait Implementations§

source§

impl Clone for Lt

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for Lt

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Deref for Lt

§

type Target = WithSpan

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl DerefMut for Lt

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
source§

impl Parse for Lt

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for Lt

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for Lt

source§

impl Token for Lt

Auto Trait Implementations§

§

impl Freeze for Lt

§

impl RefUnwindSafe for Lt

§

impl !Send for Lt

§

impl !Sync for Lt

§

impl Unpin for Lt

§

impl UnwindSafe for Lt

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.Macro.html b/syn/token/struct.Macro.html new file mode 100644 index 0000000..2909eaf --- /dev/null +++ b/syn/token/struct.Macro.html @@ -0,0 +1,20 @@ +Macro in syn::token - Rust

Struct syn::token::Macro

source ·
pub struct Macro {
+    pub span: Span,
+}
Expand description

macro

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§span: Span

Trait Implementations§

source§

impl Clone for Macro

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for Macro

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Parse for Macro

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for Macro

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for Macro

source§

impl Token for Macro

Auto Trait Implementations§

§

impl Freeze for Macro

§

impl RefUnwindSafe for Macro

§

impl !Send for Macro

§

impl !Sync for Macro

§

impl Unpin for Macro

§

impl UnwindSafe for Macro

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.Match.html b/syn/token/struct.Match.html new file mode 100644 index 0000000..79566c6 --- /dev/null +++ b/syn/token/struct.Match.html @@ -0,0 +1,20 @@ +Match in syn::token - Rust

Struct syn::token::Match

source ·
pub struct Match {
+    pub span: Span,
+}
Expand description

match

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§span: Span

Trait Implementations§

source§

impl Clone for Match

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for Match

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Parse for Match

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for Match

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for Match

source§

impl Token for Match

Auto Trait Implementations§

§

impl Freeze for Match

§

impl RefUnwindSafe for Match

§

impl !Send for Match

§

impl !Sync for Match

§

impl Unpin for Match

§

impl UnwindSafe for Match

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.Minus.html b/syn/token/struct.Minus.html new file mode 100644 index 0000000..c2e2843 --- /dev/null +++ b/syn/token/struct.Minus.html @@ -0,0 +1,22 @@ +Minus in syn::token - Rust

Struct syn::token::Minus

source ·
pub struct Minus {
+    pub spans: [Span; 1],
+}
Expand description

-

+

Usage: +subtraction, negation.

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§spans: [Span; 1]

Trait Implementations§

source§

impl Clone for Minus

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for Minus

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Deref for Minus

§

type Target = WithSpan

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl DerefMut for Minus

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
source§

impl Parse for Minus

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for Minus

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for Minus

source§

impl Token for Minus

Auto Trait Implementations§

§

impl Freeze for Minus

§

impl RefUnwindSafe for Minus

§

impl !Send for Minus

§

impl !Sync for Minus

§

impl Unpin for Minus

§

impl UnwindSafe for Minus

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.MinusEq.html b/syn/token/struct.MinusEq.html new file mode 100644 index 0000000..5f8bcc0 --- /dev/null +++ b/syn/token/struct.MinusEq.html @@ -0,0 +1,22 @@ +MinusEq in syn::token - Rust

Struct syn::token::MinusEq

source ·
pub struct MinusEq {
+    pub spans: [Span; 2],
+}
Expand description

-=

+

Usage: +subtraction assignment.

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§spans: [Span; 2]

Trait Implementations§

source§

impl Clone for MinusEq

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for MinusEq

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Parse for MinusEq

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for MinusEq

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for MinusEq

source§

impl Token for MinusEq

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.Mod.html b/syn/token/struct.Mod.html new file mode 100644 index 0000000..802b8dc --- /dev/null +++ b/syn/token/struct.Mod.html @@ -0,0 +1,20 @@ +Mod in syn::token - Rust

Struct syn::token::Mod

source ·
pub struct Mod {
+    pub span: Span,
+}
Expand description

mod

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§span: Span

Trait Implementations§

source§

impl Clone for Mod

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for Mod

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Parse for Mod

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for Mod

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for Mod

source§

impl Token for Mod

Auto Trait Implementations§

§

impl Freeze for Mod

§

impl RefUnwindSafe for Mod

§

impl !Send for Mod

§

impl !Sync for Mod

§

impl Unpin for Mod

§

impl UnwindSafe for Mod

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.Move.html b/syn/token/struct.Move.html new file mode 100644 index 0000000..722b13d --- /dev/null +++ b/syn/token/struct.Move.html @@ -0,0 +1,20 @@ +Move in syn::token - Rust

Struct syn::token::Move

source ·
pub struct Move {
+    pub span: Span,
+}
Expand description

move

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§span: Span

Trait Implementations§

source§

impl Clone for Move

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for Move

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Parse for Move

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for Move

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for Move

source§

impl Token for Move

Auto Trait Implementations§

§

impl Freeze for Move

§

impl RefUnwindSafe for Move

§

impl !Send for Move

§

impl !Sync for Move

§

impl Unpin for Move

§

impl UnwindSafe for Move

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.Mut.html b/syn/token/struct.Mut.html new file mode 100644 index 0000000..a0e44cf --- /dev/null +++ b/syn/token/struct.Mut.html @@ -0,0 +1,20 @@ +Mut in syn::token - Rust

Struct syn::token::Mut

source ·
pub struct Mut {
+    pub span: Span,
+}
Expand description

mut

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§span: Span

Trait Implementations§

source§

impl Clone for Mut

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for Mut

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Parse for Mut

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for Mut

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for Mut

source§

impl Token for Mut

Auto Trait Implementations§

§

impl Freeze for Mut

§

impl RefUnwindSafe for Mut

§

impl !Send for Mut

§

impl !Sync for Mut

§

impl Unpin for Mut

§

impl UnwindSafe for Mut

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.Ne.html b/syn/token/struct.Ne.html new file mode 100644 index 0000000..b5f579a --- /dev/null +++ b/syn/token/struct.Ne.html @@ -0,0 +1,22 @@ +Ne in syn::token - Rust

Struct syn::token::Ne

source ·
pub struct Ne {
+    pub spans: [Span; 2],
+}
Expand description

!=

+

Usage: +not equal.

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§spans: [Span; 2]

Trait Implementations§

source§

impl Clone for Ne

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for Ne

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Parse for Ne

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for Ne

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for Ne

source§

impl Token for Ne

Auto Trait Implementations§

§

impl Freeze for Ne

§

impl RefUnwindSafe for Ne

§

impl !Send for Ne

§

impl !Sync for Ne

§

impl Unpin for Ne

§

impl UnwindSafe for Ne

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.Not.html b/syn/token/struct.Not.html new file mode 100644 index 0000000..6755acd --- /dev/null +++ b/syn/token/struct.Not.html @@ -0,0 +1,22 @@ +Not in syn::token - Rust

Struct syn::token::Not

source ·
pub struct Not {
+    pub spans: [Span; 1],
+}
Expand description

!

+

Usage: +bitwise and logical NOT, macro calls, inner attributes, never type, negative impls.

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§spans: [Span; 1]

Trait Implementations§

source§

impl Clone for Not

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for Not

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Deref for Not

§

type Target = WithSpan

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl DerefMut for Not

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
source§

impl Parse for Not

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for Not

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for Not

source§

impl Token for Not

Auto Trait Implementations§

§

impl Freeze for Not

§

impl RefUnwindSafe for Not

§

impl !Send for Not

§

impl !Sync for Not

§

impl Unpin for Not

§

impl UnwindSafe for Not

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.Or.html b/syn/token/struct.Or.html new file mode 100644 index 0000000..764ed51 --- /dev/null +++ b/syn/token/struct.Or.html @@ -0,0 +1,22 @@ +Or in syn::token - Rust

Struct syn::token::Or

source ·
pub struct Or {
+    pub spans: [Span; 1],
+}
Expand description

|

+

Usage: +bitwise and logical OR, closures, patterns in match, if let, and while let.

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§spans: [Span; 1]

Trait Implementations§

source§

impl Clone for Or

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for Or

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Deref for Or

§

type Target = WithSpan

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl DerefMut for Or

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
source§

impl Parse for Or

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for Or

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for Or

source§

impl Token for Or

Auto Trait Implementations§

§

impl Freeze for Or

§

impl RefUnwindSafe for Or

§

impl !Send for Or

§

impl !Sync for Or

§

impl Unpin for Or

§

impl UnwindSafe for Or

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.OrEq.html b/syn/token/struct.OrEq.html new file mode 100644 index 0000000..0ea5dc5 --- /dev/null +++ b/syn/token/struct.OrEq.html @@ -0,0 +1,22 @@ +OrEq in syn::token - Rust

Struct syn::token::OrEq

source ·
pub struct OrEq {
+    pub spans: [Span; 2],
+}
Expand description

|=

+

Usage: +bitwise OR assignment.

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§spans: [Span; 2]

Trait Implementations§

source§

impl Clone for OrEq

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for OrEq

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Parse for OrEq

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for OrEq

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for OrEq

source§

impl Token for OrEq

Auto Trait Implementations§

§

impl Freeze for OrEq

§

impl RefUnwindSafe for OrEq

§

impl !Send for OrEq

§

impl !Sync for OrEq

§

impl Unpin for OrEq

§

impl UnwindSafe for OrEq

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.OrOr.html b/syn/token/struct.OrOr.html new file mode 100644 index 0000000..a6c7d84 --- /dev/null +++ b/syn/token/struct.OrOr.html @@ -0,0 +1,22 @@ +OrOr in syn::token - Rust

Struct syn::token::OrOr

source ·
pub struct OrOr {
+    pub spans: [Span; 2],
+}
Expand description

||

+

Usage: +lazy OR, closures.

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§spans: [Span; 2]

Trait Implementations§

source§

impl Clone for OrOr

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for OrOr

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Parse for OrOr

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for OrOr

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for OrOr

source§

impl Token for OrOr

Auto Trait Implementations§

§

impl Freeze for OrOr

§

impl RefUnwindSafe for OrOr

§

impl !Send for OrOr

§

impl !Sync for OrOr

§

impl Unpin for OrOr

§

impl UnwindSafe for OrOr

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.Override.html b/syn/token/struct.Override.html new file mode 100644 index 0000000..c4b3dbe --- /dev/null +++ b/syn/token/struct.Override.html @@ -0,0 +1,20 @@ +Override in syn::token - Rust

Struct syn::token::Override

source ·
pub struct Override {
+    pub span: Span,
+}
Expand description

override

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§span: Span

Trait Implementations§

source§

impl Clone for Override

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for Override

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Parse for Override

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for Override

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for Override

source§

impl Token for Override

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.Paren.html b/syn/token/struct.Paren.html new file mode 100644 index 0000000..bd249dc --- /dev/null +++ b/syn/token/struct.Paren.html @@ -0,0 +1,16 @@ +Paren in syn::token - Rust

Struct syn::token::Paren

source ·
pub struct Paren {
+    pub span: DelimSpan,
+}
Expand description

()

+

Fields§

§span: DelimSpan

Implementations§

source§

impl Paren

source

pub fn surround<F>(&self, tokens: &mut TokenStream, f: F)
where + F: FnOnce(&mut TokenStream),

Trait Implementations§

source§

impl Clone for Paren

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for Paren

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Copy for Paren

source§

impl Token for Paren

Auto Trait Implementations§

§

impl Freeze for Paren

§

impl RefUnwindSafe for Paren

§

impl !Send for Paren

§

impl !Sync for Paren

§

impl Unpin for Paren

§

impl UnwindSafe for Paren

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.PathSep.html b/syn/token/struct.PathSep.html new file mode 100644 index 0000000..2769f50 --- /dev/null +++ b/syn/token/struct.PathSep.html @@ -0,0 +1,22 @@ +PathSep in syn::token - Rust

Struct syn::token::PathSep

source ·
pub struct PathSep {
+    pub spans: [Span; 2],
+}
Expand description

::

+

Usage: +path separator.

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§spans: [Span; 2]

Trait Implementations§

source§

impl Clone for PathSep

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for PathSep

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Parse for PathSep

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for PathSep

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for PathSep

source§

impl Token for PathSep

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.Percent.html b/syn/token/struct.Percent.html new file mode 100644 index 0000000..ede0ff1 --- /dev/null +++ b/syn/token/struct.Percent.html @@ -0,0 +1,22 @@ +Percent in syn::token - Rust

Struct syn::token::Percent

source ·
pub struct Percent {
+    pub spans: [Span; 1],
+}
Expand description

%

+

Usage: +remainder.

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§spans: [Span; 1]

Trait Implementations§

source§

impl Clone for Percent

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for Percent

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Deref for Percent

§

type Target = WithSpan

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl DerefMut for Percent

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
source§

impl Parse for Percent

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for Percent

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for Percent

source§

impl Token for Percent

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.PercentEq.html b/syn/token/struct.PercentEq.html new file mode 100644 index 0000000..66709e5 --- /dev/null +++ b/syn/token/struct.PercentEq.html @@ -0,0 +1,22 @@ +PercentEq in syn::token - Rust

Struct syn::token::PercentEq

source ·
pub struct PercentEq {
+    pub spans: [Span; 2],
+}
Expand description

%=

+

Usage: +remainder assignment.

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§spans: [Span; 2]

Trait Implementations§

source§

impl Clone for PercentEq

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for PercentEq

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Parse for PercentEq

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for PercentEq

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for PercentEq

source§

impl Token for PercentEq

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.Plus.html b/syn/token/struct.Plus.html new file mode 100644 index 0000000..43e2c44 --- /dev/null +++ b/syn/token/struct.Plus.html @@ -0,0 +1,22 @@ +Plus in syn::token - Rust

Struct syn::token::Plus

source ·
pub struct Plus {
+    pub spans: [Span; 1],
+}
Expand description

+

+

Usage: +addition, trait bounds, macro Kleene matcher.

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§spans: [Span; 1]

Trait Implementations§

source§

impl Clone for Plus

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for Plus

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Deref for Plus

§

type Target = WithSpan

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl DerefMut for Plus

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
source§

impl Parse for Plus

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for Plus

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for Plus

source§

impl Token for Plus

Auto Trait Implementations§

§

impl Freeze for Plus

§

impl RefUnwindSafe for Plus

§

impl !Send for Plus

§

impl !Sync for Plus

§

impl Unpin for Plus

§

impl UnwindSafe for Plus

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.PlusEq.html b/syn/token/struct.PlusEq.html new file mode 100644 index 0000000..0894b68 --- /dev/null +++ b/syn/token/struct.PlusEq.html @@ -0,0 +1,22 @@ +PlusEq in syn::token - Rust

Struct syn::token::PlusEq

source ·
pub struct PlusEq {
+    pub spans: [Span; 2],
+}
Expand description

+=

+

Usage: +addition assignment.

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§spans: [Span; 2]

Trait Implementations§

source§

impl Clone for PlusEq

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for PlusEq

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Parse for PlusEq

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for PlusEq

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for PlusEq

source§

impl Token for PlusEq

Auto Trait Implementations§

§

impl Freeze for PlusEq

§

impl RefUnwindSafe for PlusEq

§

impl !Send for PlusEq

§

impl !Sync for PlusEq

§

impl Unpin for PlusEq

§

impl UnwindSafe for PlusEq

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.Pound.html b/syn/token/struct.Pound.html new file mode 100644 index 0000000..5877951 --- /dev/null +++ b/syn/token/struct.Pound.html @@ -0,0 +1,22 @@ +Pound in syn::token - Rust

Struct syn::token::Pound

source ·
pub struct Pound {
+    pub spans: [Span; 1],
+}
Expand description

#

+

Usage: +attributes.

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§spans: [Span; 1]

Trait Implementations§

source§

impl Clone for Pound

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for Pound

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Deref for Pound

§

type Target = WithSpan

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl DerefMut for Pound

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
source§

impl Parse for Pound

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for Pound

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for Pound

source§

impl Token for Pound

Auto Trait Implementations§

§

impl Freeze for Pound

§

impl RefUnwindSafe for Pound

§

impl !Send for Pound

§

impl !Sync for Pound

§

impl Unpin for Pound

§

impl UnwindSafe for Pound

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.Priv.html b/syn/token/struct.Priv.html new file mode 100644 index 0000000..7d9c50c --- /dev/null +++ b/syn/token/struct.Priv.html @@ -0,0 +1,20 @@ +Priv in syn::token - Rust

Struct syn::token::Priv

source ·
pub struct Priv {
+    pub span: Span,
+}
Expand description

priv

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§span: Span

Trait Implementations§

source§

impl Clone for Priv

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for Priv

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Parse for Priv

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for Priv

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for Priv

source§

impl Token for Priv

Auto Trait Implementations§

§

impl Freeze for Priv

§

impl RefUnwindSafe for Priv

§

impl !Send for Priv

§

impl !Sync for Priv

§

impl Unpin for Priv

§

impl UnwindSafe for Priv

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.Pub.html b/syn/token/struct.Pub.html new file mode 100644 index 0000000..cd057bb --- /dev/null +++ b/syn/token/struct.Pub.html @@ -0,0 +1,20 @@ +Pub in syn::token - Rust

Struct syn::token::Pub

source ·
pub struct Pub {
+    pub span: Span,
+}
Expand description

pub

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§span: Span

Trait Implementations§

source§

impl Clone for Pub

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for Pub

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Parse for Pub

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for Pub

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for Pub

source§

impl Token for Pub

Auto Trait Implementations§

§

impl Freeze for Pub

§

impl RefUnwindSafe for Pub

§

impl !Send for Pub

§

impl !Sync for Pub

§

impl Unpin for Pub

§

impl UnwindSafe for Pub

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.Question.html b/syn/token/struct.Question.html new file mode 100644 index 0000000..50d5ea4 --- /dev/null +++ b/syn/token/struct.Question.html @@ -0,0 +1,22 @@ +Question in syn::token - Rust

Struct syn::token::Question

source ·
pub struct Question {
+    pub spans: [Span; 1],
+}
Expand description

?

+

Usage: +question mark operator, questionably sized, macro Kleene matcher.

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§spans: [Span; 1]

Trait Implementations§

source§

impl Clone for Question

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for Question

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Deref for Question

§

type Target = WithSpan

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl DerefMut for Question

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
source§

impl Parse for Question

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for Question

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for Question

source§

impl Token for Question

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.RArrow.html b/syn/token/struct.RArrow.html new file mode 100644 index 0000000..952eb38 --- /dev/null +++ b/syn/token/struct.RArrow.html @@ -0,0 +1,22 @@ +RArrow in syn::token - Rust

Struct syn::token::RArrow

source ·
pub struct RArrow {
+    pub spans: [Span; 2],
+}
Expand description

->

+

Usage: +function return type, closure return type, function pointer type.

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§spans: [Span; 2]

Trait Implementations§

source§

impl Clone for RArrow

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for RArrow

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Parse for RArrow

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for RArrow

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for RArrow

source§

impl Token for RArrow

Auto Trait Implementations§

§

impl Freeze for RArrow

§

impl RefUnwindSafe for RArrow

§

impl !Send for RArrow

§

impl !Sync for RArrow

§

impl Unpin for RArrow

§

impl UnwindSafe for RArrow

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.Ref.html b/syn/token/struct.Ref.html new file mode 100644 index 0000000..f778383 --- /dev/null +++ b/syn/token/struct.Ref.html @@ -0,0 +1,20 @@ +Ref in syn::token - Rust

Struct syn::token::Ref

source ·
pub struct Ref {
+    pub span: Span,
+}
Expand description

ref

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§span: Span

Trait Implementations§

source§

impl Clone for Ref

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for Ref

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Parse for Ref

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for Ref

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for Ref

source§

impl Token for Ref

Auto Trait Implementations§

§

impl Freeze for Ref

§

impl RefUnwindSafe for Ref

§

impl !Send for Ref

§

impl !Sync for Ref

§

impl Unpin for Ref

§

impl UnwindSafe for Ref

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.Return.html b/syn/token/struct.Return.html new file mode 100644 index 0000000..23c21ab --- /dev/null +++ b/syn/token/struct.Return.html @@ -0,0 +1,20 @@ +Return in syn::token - Rust

Struct syn::token::Return

source ·
pub struct Return {
+    pub span: Span,
+}
Expand description

return

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§span: Span

Trait Implementations§

source§

impl Clone for Return

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for Return

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Parse for Return

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for Return

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for Return

source§

impl Token for Return

Auto Trait Implementations§

§

impl Freeze for Return

§

impl RefUnwindSafe for Return

§

impl !Send for Return

§

impl !Sync for Return

§

impl Unpin for Return

§

impl UnwindSafe for Return

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.SelfType.html b/syn/token/struct.SelfType.html new file mode 100644 index 0000000..092383c --- /dev/null +++ b/syn/token/struct.SelfType.html @@ -0,0 +1,20 @@ +SelfType in syn::token - Rust

Struct syn::token::SelfType

source ·
pub struct SelfType {
+    pub span: Span,
+}
Expand description

Self

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§span: Span

Trait Implementations§

source§

impl Clone for SelfType

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for SelfType

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl From<SelfType> for Ident

source§

fn from(token: SelfType) -> Ident

Converts to this type from the input type.
source§

impl Parse for SelfType

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for SelfType

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for SelfType

source§

impl Token for SelfType

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.SelfValue.html b/syn/token/struct.SelfValue.html new file mode 100644 index 0000000..e94d217 --- /dev/null +++ b/syn/token/struct.SelfValue.html @@ -0,0 +1,20 @@ +SelfValue in syn::token - Rust

Struct syn::token::SelfValue

source ·
pub struct SelfValue {
+    pub span: Span,
+}
Expand description

self

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§span: Span

Trait Implementations§

source§

impl Clone for SelfValue

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for SelfValue

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl From<SelfValue> for Ident

source§

fn from(token: SelfValue) -> Ident

Converts to this type from the input type.
source§

impl Parse for SelfValue

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for SelfValue

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for SelfValue

source§

impl Token for SelfValue

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.Semi.html b/syn/token/struct.Semi.html new file mode 100644 index 0000000..947e17d --- /dev/null +++ b/syn/token/struct.Semi.html @@ -0,0 +1,22 @@ +Semi in syn::token - Rust

Struct syn::token::Semi

source ·
pub struct Semi {
+    pub spans: [Span; 1],
+}
Expand description

;

+

Usage: +terminator for various items and statements, array types.

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§spans: [Span; 1]

Trait Implementations§

source§

impl Clone for Semi

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for Semi

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Deref for Semi

§

type Target = WithSpan

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl DerefMut for Semi

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
source§

impl Parse for Semi

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for Semi

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for Semi

source§

impl Token for Semi

Auto Trait Implementations§

§

impl Freeze for Semi

§

impl RefUnwindSafe for Semi

§

impl !Send for Semi

§

impl !Sync for Semi

§

impl Unpin for Semi

§

impl UnwindSafe for Semi

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.Shl.html b/syn/token/struct.Shl.html new file mode 100644 index 0000000..7aa117f --- /dev/null +++ b/syn/token/struct.Shl.html @@ -0,0 +1,22 @@ +Shl in syn::token - Rust

Struct syn::token::Shl

source ·
pub struct Shl {
+    pub spans: [Span; 2],
+}
Expand description

<<

+

Usage: +shift left, nested generics.

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§spans: [Span; 2]

Trait Implementations§

source§

impl Clone for Shl

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for Shl

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Parse for Shl

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for Shl

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for Shl

source§

impl Token for Shl

Auto Trait Implementations§

§

impl Freeze for Shl

§

impl RefUnwindSafe for Shl

§

impl !Send for Shl

§

impl !Sync for Shl

§

impl Unpin for Shl

§

impl UnwindSafe for Shl

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.ShlEq.html b/syn/token/struct.ShlEq.html new file mode 100644 index 0000000..14a0158 --- /dev/null +++ b/syn/token/struct.ShlEq.html @@ -0,0 +1,22 @@ +ShlEq in syn::token - Rust

Struct syn::token::ShlEq

source ·
pub struct ShlEq {
+    pub spans: [Span; 3],
+}
Expand description

<<=

+

Usage: +shift left assignment.

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§spans: [Span; 3]

Trait Implementations§

source§

impl Clone for ShlEq

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for ShlEq

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Parse for ShlEq

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for ShlEq

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for ShlEq

source§

impl Token for ShlEq

Auto Trait Implementations§

§

impl Freeze for ShlEq

§

impl RefUnwindSafe for ShlEq

§

impl !Send for ShlEq

§

impl !Sync for ShlEq

§

impl Unpin for ShlEq

§

impl UnwindSafe for ShlEq

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.Shr.html b/syn/token/struct.Shr.html new file mode 100644 index 0000000..56b223d --- /dev/null +++ b/syn/token/struct.Shr.html @@ -0,0 +1,22 @@ +Shr in syn::token - Rust

Struct syn::token::Shr

source ·
pub struct Shr {
+    pub spans: [Span; 2],
+}
Expand description

>>

+

Usage: +shift right, nested generics.

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§spans: [Span; 2]

Trait Implementations§

source§

impl Clone for Shr

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for Shr

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Parse for Shr

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for Shr

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for Shr

source§

impl Token for Shr

Auto Trait Implementations§

§

impl Freeze for Shr

§

impl RefUnwindSafe for Shr

§

impl !Send for Shr

§

impl !Sync for Shr

§

impl Unpin for Shr

§

impl UnwindSafe for Shr

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.ShrEq.html b/syn/token/struct.ShrEq.html new file mode 100644 index 0000000..b492433 --- /dev/null +++ b/syn/token/struct.ShrEq.html @@ -0,0 +1,22 @@ +ShrEq in syn::token - Rust

Struct syn::token::ShrEq

source ·
pub struct ShrEq {
+    pub spans: [Span; 3],
+}
Expand description

>>=

+

Usage: +shift right assignment, nested generics.

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§spans: [Span; 3]

Trait Implementations§

source§

impl Clone for ShrEq

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for ShrEq

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Parse for ShrEq

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for ShrEq

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for ShrEq

source§

impl Token for ShrEq

Auto Trait Implementations§

§

impl Freeze for ShrEq

§

impl RefUnwindSafe for ShrEq

§

impl !Send for ShrEq

§

impl !Sync for ShrEq

§

impl Unpin for ShrEq

§

impl UnwindSafe for ShrEq

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.Slash.html b/syn/token/struct.Slash.html new file mode 100644 index 0000000..2398843 --- /dev/null +++ b/syn/token/struct.Slash.html @@ -0,0 +1,22 @@ +Slash in syn::token - Rust

Struct syn::token::Slash

source ·
pub struct Slash {
+    pub spans: [Span; 1],
+}
Expand description

/

+

Usage: +division.

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§spans: [Span; 1]

Trait Implementations§

source§

impl Clone for Slash

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for Slash

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Deref for Slash

§

type Target = WithSpan

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl DerefMut for Slash

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
source§

impl Parse for Slash

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for Slash

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for Slash

source§

impl Token for Slash

Auto Trait Implementations§

§

impl Freeze for Slash

§

impl RefUnwindSafe for Slash

§

impl !Send for Slash

§

impl !Sync for Slash

§

impl Unpin for Slash

§

impl UnwindSafe for Slash

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.SlashEq.html b/syn/token/struct.SlashEq.html new file mode 100644 index 0000000..f0f15f8 --- /dev/null +++ b/syn/token/struct.SlashEq.html @@ -0,0 +1,22 @@ +SlashEq in syn::token - Rust

Struct syn::token::SlashEq

source ·
pub struct SlashEq {
+    pub spans: [Span; 2],
+}
Expand description

/=

+

Usage: +division assignment.

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§spans: [Span; 2]

Trait Implementations§

source§

impl Clone for SlashEq

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for SlashEq

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Parse for SlashEq

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for SlashEq

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for SlashEq

source§

impl Token for SlashEq

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.Star.html b/syn/token/struct.Star.html new file mode 100644 index 0000000..f48cac9 --- /dev/null +++ b/syn/token/struct.Star.html @@ -0,0 +1,22 @@ +Star in syn::token - Rust

Struct syn::token::Star

source ·
pub struct Star {
+    pub spans: [Span; 1],
+}
Expand description

*

+

Usage: +multiplication, dereference, raw pointers, macro Kleene matcher, use wildcards.

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§spans: [Span; 1]

Trait Implementations§

source§

impl Clone for Star

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for Star

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Deref for Star

§

type Target = WithSpan

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl DerefMut for Star

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
source§

impl Parse for Star

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for Star

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for Star

source§

impl Token for Star

Auto Trait Implementations§

§

impl Freeze for Star

§

impl RefUnwindSafe for Star

§

impl !Send for Star

§

impl !Sync for Star

§

impl Unpin for Star

§

impl UnwindSafe for Star

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.StarEq.html b/syn/token/struct.StarEq.html new file mode 100644 index 0000000..d73534b --- /dev/null +++ b/syn/token/struct.StarEq.html @@ -0,0 +1,22 @@ +StarEq in syn::token - Rust

Struct syn::token::StarEq

source ·
pub struct StarEq {
+    pub spans: [Span; 2],
+}
Expand description

*=

+

Usage: +multiplication assignment.

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§spans: [Span; 2]

Trait Implementations§

source§

impl Clone for StarEq

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for StarEq

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Parse for StarEq

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for StarEq

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for StarEq

source§

impl Token for StarEq

Auto Trait Implementations§

§

impl Freeze for StarEq

§

impl RefUnwindSafe for StarEq

§

impl !Send for StarEq

§

impl !Sync for StarEq

§

impl Unpin for StarEq

§

impl UnwindSafe for StarEq

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.Static.html b/syn/token/struct.Static.html new file mode 100644 index 0000000..96e76f8 --- /dev/null +++ b/syn/token/struct.Static.html @@ -0,0 +1,20 @@ +Static in syn::token - Rust

Struct syn::token::Static

source ·
pub struct Static {
+    pub span: Span,
+}
Expand description

static

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§span: Span

Trait Implementations§

source§

impl Clone for Static

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for Static

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Parse for Static

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for Static

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for Static

source§

impl Token for Static

Auto Trait Implementations§

§

impl Freeze for Static

§

impl RefUnwindSafe for Static

§

impl !Send for Static

§

impl !Sync for Static

§

impl Unpin for Static

§

impl UnwindSafe for Static

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.Struct.html b/syn/token/struct.Struct.html new file mode 100644 index 0000000..a46bf65 --- /dev/null +++ b/syn/token/struct.Struct.html @@ -0,0 +1,20 @@ +Struct in syn::token - Rust

Struct syn::token::Struct

source ·
pub struct Struct {
+    pub span: Span,
+}
Expand description

struct

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§span: Span

Trait Implementations§

source§

impl Clone for Struct

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for Struct

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Parse for Struct

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for Struct

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for Struct

source§

impl Token for Struct

Auto Trait Implementations§

§

impl Freeze for Struct

§

impl RefUnwindSafe for Struct

§

impl !Send for Struct

§

impl !Sync for Struct

§

impl Unpin for Struct

§

impl UnwindSafe for Struct

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.Super.html b/syn/token/struct.Super.html new file mode 100644 index 0000000..ebed514 --- /dev/null +++ b/syn/token/struct.Super.html @@ -0,0 +1,20 @@ +Super in syn::token - Rust

Struct syn::token::Super

source ·
pub struct Super {
+    pub span: Span,
+}
Expand description

super

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§span: Span

Trait Implementations§

source§

impl Clone for Super

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for Super

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl From<Super> for Ident

source§

fn from(token: Super) -> Ident

Converts to this type from the input type.
source§

impl Parse for Super

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for Super

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for Super

source§

impl Token for Super

Auto Trait Implementations§

§

impl Freeze for Super

§

impl RefUnwindSafe for Super

§

impl !Send for Super

§

impl !Sync for Super

§

impl Unpin for Super

§

impl UnwindSafe for Super

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.Tilde.html b/syn/token/struct.Tilde.html new file mode 100644 index 0000000..91aa8b2 --- /dev/null +++ b/syn/token/struct.Tilde.html @@ -0,0 +1,22 @@ +Tilde in syn::token - Rust

Struct syn::token::Tilde

source ·
pub struct Tilde {
+    pub spans: [Span; 1],
+}
Expand description

~

+

Usage: +unused since before Rust 1.0.

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§spans: [Span; 1]

Trait Implementations§

source§

impl Clone for Tilde

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for Tilde

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Deref for Tilde

§

type Target = WithSpan

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl DerefMut for Tilde

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
source§

impl Parse for Tilde

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for Tilde

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for Tilde

source§

impl Token for Tilde

Auto Trait Implementations§

§

impl Freeze for Tilde

§

impl RefUnwindSafe for Tilde

§

impl !Send for Tilde

§

impl !Sync for Tilde

§

impl Unpin for Tilde

§

impl UnwindSafe for Tilde

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.Trait.html b/syn/token/struct.Trait.html new file mode 100644 index 0000000..89a57d4 --- /dev/null +++ b/syn/token/struct.Trait.html @@ -0,0 +1,20 @@ +Trait in syn::token - Rust

Struct syn::token::Trait

source ·
pub struct Trait {
+    pub span: Span,
+}
Expand description

trait

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§span: Span

Trait Implementations§

source§

impl Clone for Trait

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for Trait

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Parse for Trait

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for Trait

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for Trait

source§

impl Token for Trait

Auto Trait Implementations§

§

impl Freeze for Trait

§

impl RefUnwindSafe for Trait

§

impl !Send for Trait

§

impl !Sync for Trait

§

impl Unpin for Trait

§

impl UnwindSafe for Trait

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.Try.html b/syn/token/struct.Try.html new file mode 100644 index 0000000..bc12232 --- /dev/null +++ b/syn/token/struct.Try.html @@ -0,0 +1,20 @@ +Try in syn::token - Rust

Struct syn::token::Try

source ·
pub struct Try {
+    pub span: Span,
+}
Expand description

try

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§span: Span

Trait Implementations§

source§

impl Clone for Try

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for Try

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Parse for Try

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for Try

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for Try

source§

impl Token for Try

Auto Trait Implementations§

§

impl Freeze for Try

§

impl RefUnwindSafe for Try

§

impl !Send for Try

§

impl !Sync for Try

§

impl Unpin for Try

§

impl UnwindSafe for Try

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.Type.html b/syn/token/struct.Type.html new file mode 100644 index 0000000..d661284 --- /dev/null +++ b/syn/token/struct.Type.html @@ -0,0 +1,20 @@ +Type in syn::token - Rust

Struct syn::token::Type

source ·
pub struct Type {
+    pub span: Span,
+}
Expand description

type

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§span: Span

Trait Implementations§

source§

impl Clone for Type

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for Type

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Parse for Type

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for Type

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for Type

source§

impl Token for Type

Auto Trait Implementations§

§

impl Freeze for Type

§

impl RefUnwindSafe for Type

§

impl !Send for Type

§

impl !Sync for Type

§

impl Unpin for Type

§

impl UnwindSafe for Type

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.Typeof.html b/syn/token/struct.Typeof.html new file mode 100644 index 0000000..0868fbc --- /dev/null +++ b/syn/token/struct.Typeof.html @@ -0,0 +1,20 @@ +Typeof in syn::token - Rust

Struct syn::token::Typeof

source ·
pub struct Typeof {
+    pub span: Span,
+}
Expand description

typeof

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§span: Span

Trait Implementations§

source§

impl Clone for Typeof

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for Typeof

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Parse for Typeof

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for Typeof

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for Typeof

source§

impl Token for Typeof

Auto Trait Implementations§

§

impl Freeze for Typeof

§

impl RefUnwindSafe for Typeof

§

impl !Send for Typeof

§

impl !Sync for Typeof

§

impl Unpin for Typeof

§

impl UnwindSafe for Typeof

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.Underscore.html b/syn/token/struct.Underscore.html new file mode 100644 index 0000000..ea98c2a --- /dev/null +++ b/syn/token/struct.Underscore.html @@ -0,0 +1,22 @@ +Underscore in syn::token - Rust

Struct syn::token::Underscore

source ·
pub struct Underscore {
+    pub spans: [Span; 1],
+}
Expand description

_

+

Usage: +wildcard patterns, inferred types, unnamed items in constants, extern crates, use declarations, and destructuring assignment.

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§spans: [Span; 1]

Trait Implementations§

source§

impl Clone for Underscore

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for Underscore

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Deref for Underscore

§

type Target = WithSpan

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl DerefMut for Underscore

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
source§

impl From<Underscore> for Ident

source§

fn from(token: Underscore) -> Ident

Converts to this type from the input type.
source§

impl Parse for Underscore

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for Underscore

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for Underscore

source§

impl Token for Underscore

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.Union.html b/syn/token/struct.Union.html new file mode 100644 index 0000000..a6e49ea --- /dev/null +++ b/syn/token/struct.Union.html @@ -0,0 +1,20 @@ +Union in syn::token - Rust

Struct syn::token::Union

source ·
pub struct Union {
+    pub span: Span,
+}
Expand description

union

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§span: Span

Trait Implementations§

source§

impl Clone for Union

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for Union

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Parse for Union

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for Union

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for Union

source§

impl Token for Union

Auto Trait Implementations§

§

impl Freeze for Union

§

impl RefUnwindSafe for Union

§

impl !Send for Union

§

impl !Sync for Union

§

impl Unpin for Union

§

impl UnwindSafe for Union

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.Unsafe.html b/syn/token/struct.Unsafe.html new file mode 100644 index 0000000..a14b620 --- /dev/null +++ b/syn/token/struct.Unsafe.html @@ -0,0 +1,20 @@ +Unsafe in syn::token - Rust

Struct syn::token::Unsafe

source ·
pub struct Unsafe {
+    pub span: Span,
+}
Expand description

unsafe

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§span: Span

Trait Implementations§

source§

impl Clone for Unsafe

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for Unsafe

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Parse for Unsafe

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for Unsafe

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for Unsafe

source§

impl Token for Unsafe

Auto Trait Implementations§

§

impl Freeze for Unsafe

§

impl RefUnwindSafe for Unsafe

§

impl !Send for Unsafe

§

impl !Sync for Unsafe

§

impl Unpin for Unsafe

§

impl UnwindSafe for Unsafe

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.Unsized.html b/syn/token/struct.Unsized.html new file mode 100644 index 0000000..619824f --- /dev/null +++ b/syn/token/struct.Unsized.html @@ -0,0 +1,20 @@ +Unsized in syn::token - Rust

Struct syn::token::Unsized

source ·
pub struct Unsized {
+    pub span: Span,
+}
Expand description

unsized

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§span: Span

Trait Implementations§

source§

impl Clone for Unsized

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for Unsized

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Parse for Unsized

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for Unsized

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for Unsized

source§

impl Token for Unsized

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.Use.html b/syn/token/struct.Use.html new file mode 100644 index 0000000..9bdef66 --- /dev/null +++ b/syn/token/struct.Use.html @@ -0,0 +1,20 @@ +Use in syn::token - Rust

Struct syn::token::Use

source ·
pub struct Use {
+    pub span: Span,
+}
Expand description

use

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§span: Span

Trait Implementations§

source§

impl Clone for Use

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for Use

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Parse for Use

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for Use

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for Use

source§

impl Token for Use

Auto Trait Implementations§

§

impl Freeze for Use

§

impl RefUnwindSafe for Use

§

impl !Send for Use

§

impl !Sync for Use

§

impl Unpin for Use

§

impl UnwindSafe for Use

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.Virtual.html b/syn/token/struct.Virtual.html new file mode 100644 index 0000000..c092ee5 --- /dev/null +++ b/syn/token/struct.Virtual.html @@ -0,0 +1,20 @@ +Virtual in syn::token - Rust

Struct syn::token::Virtual

source ·
pub struct Virtual {
+    pub span: Span,
+}
Expand description

virtual

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§span: Span

Trait Implementations§

source§

impl Clone for Virtual

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for Virtual

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Parse for Virtual

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for Virtual

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for Virtual

source§

impl Token for Virtual

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.Where.html b/syn/token/struct.Where.html new file mode 100644 index 0000000..3c45def --- /dev/null +++ b/syn/token/struct.Where.html @@ -0,0 +1,20 @@ +Where in syn::token - Rust

Struct syn::token::Where

source ·
pub struct Where {
+    pub span: Span,
+}
Expand description

where

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§span: Span

Trait Implementations§

source§

impl Clone for Where

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for Where

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Parse for Where

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for Where

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for Where

source§

impl Token for Where

Auto Trait Implementations§

§

impl Freeze for Where

§

impl RefUnwindSafe for Where

§

impl !Send for Where

§

impl !Sync for Where

§

impl Unpin for Where

§

impl UnwindSafe for Where

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.While.html b/syn/token/struct.While.html new file mode 100644 index 0000000..e235eb6 --- /dev/null +++ b/syn/token/struct.While.html @@ -0,0 +1,20 @@ +While in syn::token - Rust

Struct syn::token::While

source ·
pub struct While {
+    pub span: Span,
+}
Expand description

while

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§span: Span

Trait Implementations§

source§

impl Clone for While

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for While

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Parse for While

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for While

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for While

source§

impl Token for While

Auto Trait Implementations§

§

impl Freeze for While

§

impl RefUnwindSafe for While

§

impl !Send for While

§

impl !Sync for While

§

impl Unpin for While

§

impl UnwindSafe for While

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/struct.Yield.html b/syn/token/struct.Yield.html new file mode 100644 index 0000000..576852e --- /dev/null +++ b/syn/token/struct.Yield.html @@ -0,0 +1,20 @@ +Yield in syn::token - Rust

Struct syn::token::Yield

source ·
pub struct Yield {
+    pub span: Span,
+}
Expand description

yield

+

Don’t try to remember the name of this type — use the +Token! macro instead.

+

Fields§

§span: Span

Trait Implementations§

source§

impl Clone for Yield

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for Yield

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Parse for Yield

source§

fn parse(input: ParseStream<'_>) -> Result<Self>

source§

impl ToTokens for Yield

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream
where + Self: Sized,

Convert self directly into a TokenStream object. Read more
source§

impl Copy for Yield

source§

impl Token for Yield

Auto Trait Implementations§

§

impl Freeze for Yield

§

impl RefUnwindSafe for Yield

§

impl !Send for Yield

§

impl !Sync for Yield

§

impl Unpin for Yield

§

impl UnwindSafe for Yield

Blanket Implementations§

source§

impl<T> Any for T
where + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+

That is, this conversion is whatever the implementation of +From<T> for U chooses to do.

+
source§

impl<T> Spanned for T
where + T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree +node, or Span::call_site() if this node is empty.
source§

impl<T> ToOwned for T
where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/syn/token/trait.Token.html b/syn/token/trait.Token.html new file mode 100644 index 0000000..263c0ad --- /dev/null +++ b/syn/token/trait.Token.html @@ -0,0 +1,3 @@ +Token in syn::token - Rust

Trait syn::token::Token

source ·
pub trait Token: Sealed { }
Expand description

Marker trait for types that represent single tokens.

+

This trait is sealed and cannot be implemented for types outside of Syn.

+

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl Token for TokenTree

source§

impl Token for Group

source§

impl Token for Literal

source§

impl Token for Punct

Implementors§

source§

impl Token for Lit

source§

impl Token for Ident

source§

impl Token for Lifetime

source§

impl Token for LitBool

source§

impl Token for LitByte

source§

impl Token for LitByteStr

source§

impl Token for LitChar

source§

impl Token for LitFloat

source§

impl Token for LitInt

source§

impl Token for LitStr

source§

impl Token for Abstract

source§

impl Token for And

source§

impl Token for AndAnd

source§

impl Token for AndEq

source§

impl Token for As

source§

impl Token for Async

source§

impl Token for At

source§

impl Token for Auto

source§

impl Token for Await

source§

impl Token for Become

source§

impl Token for Box

source§

impl Token for Brace

source§

impl Token for Bracket

source§

impl Token for Break

source§

impl Token for Caret

source§

impl Token for CaretEq

source§

impl Token for Colon

source§

impl Token for Comma

source§

impl Token for Const

source§

impl Token for Continue

source§

impl Token for Crate

source§

impl Token for Default

source§

impl Token for Do

source§

impl Token for Dollar

source§

impl Token for Dot

source§

impl Token for DotDot

source§

impl Token for DotDotDot

source§

impl Token for DotDotEq

source§

impl Token for Dyn

source§

impl Token for Else

source§

impl Token for Enum

source§

impl Token for Eq

source§

impl Token for EqEq

source§

impl Token for Extern

source§

impl Token for FatArrow

source§

impl Token for Final

source§

impl Token for Fn

source§

impl Token for For

source§

impl Token for Ge

source§

impl Token for syn::token::Group

source§

impl Token for Gt

source§

impl Token for If

source§

impl Token for Impl

source§

impl Token for In

source§

impl Token for LArrow

source§

impl Token for Le

source§

impl Token for Let

source§

impl Token for Loop

source§

impl Token for Lt

source§

impl Token for Macro

source§

impl Token for Match

source§

impl Token for Minus

source§

impl Token for MinusEq

source§

impl Token for Mod

source§

impl Token for Move

source§

impl Token for Mut

source§

impl Token for Ne

source§

impl Token for Not

source§

impl Token for Or

source§

impl Token for OrEq

source§

impl Token for OrOr

source§

impl Token for Override

source§

impl Token for Paren

source§

impl Token for PathSep

source§

impl Token for Percent

source§

impl Token for PercentEq

source§

impl Token for Plus

source§

impl Token for PlusEq

source§

impl Token for Pound

source§

impl Token for Priv

source§

impl Token for Pub

source§

impl Token for Question

source§

impl Token for RArrow

source§

impl Token for Ref

source§

impl Token for Return

source§

impl Token for SelfType

source§

impl Token for SelfValue

source§

impl Token for Semi

source§

impl Token for Shl

source§

impl Token for ShlEq

source§

impl Token for Shr

source§

impl Token for ShrEq

source§

impl Token for Slash

source§

impl Token for SlashEq

source§

impl Token for Star

source§

impl Token for StarEq

source§

impl Token for Static

source§

impl Token for Struct

source§

impl Token for Super

source§

impl Token for Tilde

source§

impl Token for Trait

source§

impl Token for Try

source§

impl Token for Type

source§

impl Token for Typeof

source§

impl Token for Underscore

source§

impl Token for Union

source§

impl Token for Unsafe

source§

impl Token for Unsized

source§

impl Token for Use

source§

impl Token for Virtual

source§

impl Token for Where

source§

impl Token for While

source§

impl Token for Yield

source§

impl<T: CustomToken> Token for T

\ No newline at end of file diff --git a/syn/ty/enum.ReturnType.html b/syn/ty/enum.ReturnType.html new file mode 100644 index 0000000..6b4dc77 --- /dev/null +++ b/syn/ty/enum.ReturnType.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/enum.ReturnType.html...

+ + + \ No newline at end of file diff --git a/syn/ty/enum.Type.html b/syn/ty/enum.Type.html new file mode 100644 index 0000000..71a8e41 --- /dev/null +++ b/syn/ty/enum.Type.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/enum.Type.html...

+ + + \ No newline at end of file diff --git a/syn/ty/struct.Abi.html b/syn/ty/struct.Abi.html new file mode 100644 index 0000000..a263048 --- /dev/null +++ b/syn/ty/struct.Abi.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.Abi.html...

+ + + \ No newline at end of file diff --git a/syn/ty/struct.BareFnArg.html b/syn/ty/struct.BareFnArg.html new file mode 100644 index 0000000..1c7cb5d --- /dev/null +++ b/syn/ty/struct.BareFnArg.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.BareFnArg.html...

+ + + \ No newline at end of file diff --git a/syn/ty/struct.BareVariadic.html b/syn/ty/struct.BareVariadic.html new file mode 100644 index 0000000..6ae0055 --- /dev/null +++ b/syn/ty/struct.BareVariadic.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.BareVariadic.html...

+ + + \ No newline at end of file diff --git a/syn/ty/struct.TypeArray.html b/syn/ty/struct.TypeArray.html new file mode 100644 index 0000000..d251689 --- /dev/null +++ b/syn/ty/struct.TypeArray.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.TypeArray.html...

+ + + \ No newline at end of file diff --git a/syn/ty/struct.TypeBareFn.html b/syn/ty/struct.TypeBareFn.html new file mode 100644 index 0000000..9488ca0 --- /dev/null +++ b/syn/ty/struct.TypeBareFn.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.TypeBareFn.html...

+ + + \ No newline at end of file diff --git a/syn/ty/struct.TypeGroup.html b/syn/ty/struct.TypeGroup.html new file mode 100644 index 0000000..23f694c --- /dev/null +++ b/syn/ty/struct.TypeGroup.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.TypeGroup.html...

+ + + \ No newline at end of file diff --git a/syn/ty/struct.TypeImplTrait.html b/syn/ty/struct.TypeImplTrait.html new file mode 100644 index 0000000..c0efd76 --- /dev/null +++ b/syn/ty/struct.TypeImplTrait.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.TypeImplTrait.html...

+ + + \ No newline at end of file diff --git a/syn/ty/struct.TypeInfer.html b/syn/ty/struct.TypeInfer.html new file mode 100644 index 0000000..f092eb0 --- /dev/null +++ b/syn/ty/struct.TypeInfer.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.TypeInfer.html...

+ + + \ No newline at end of file diff --git a/syn/ty/struct.TypeMacro.html b/syn/ty/struct.TypeMacro.html new file mode 100644 index 0000000..7be1ab8 --- /dev/null +++ b/syn/ty/struct.TypeMacro.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.TypeMacro.html...

+ + + \ No newline at end of file diff --git a/syn/ty/struct.TypeNever.html b/syn/ty/struct.TypeNever.html new file mode 100644 index 0000000..268bacc --- /dev/null +++ b/syn/ty/struct.TypeNever.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.TypeNever.html...

+ + + \ No newline at end of file diff --git a/syn/ty/struct.TypeParen.html b/syn/ty/struct.TypeParen.html new file mode 100644 index 0000000..50c3fa1 --- /dev/null +++ b/syn/ty/struct.TypeParen.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.TypeParen.html...

+ + + \ No newline at end of file diff --git a/syn/ty/struct.TypePath.html b/syn/ty/struct.TypePath.html new file mode 100644 index 0000000..1db5db7 --- /dev/null +++ b/syn/ty/struct.TypePath.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.TypePath.html...

+ + + \ No newline at end of file diff --git a/syn/ty/struct.TypePtr.html b/syn/ty/struct.TypePtr.html new file mode 100644 index 0000000..985e920 --- /dev/null +++ b/syn/ty/struct.TypePtr.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.TypePtr.html...

+ + + \ No newline at end of file diff --git a/syn/ty/struct.TypeReference.html b/syn/ty/struct.TypeReference.html new file mode 100644 index 0000000..8261a4e --- /dev/null +++ b/syn/ty/struct.TypeReference.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.TypeReference.html...

+ + + \ No newline at end of file diff --git a/syn/ty/struct.TypeSlice.html b/syn/ty/struct.TypeSlice.html new file mode 100644 index 0000000..e61d4d4 --- /dev/null +++ b/syn/ty/struct.TypeSlice.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.TypeSlice.html...

+ + + \ No newline at end of file diff --git a/syn/ty/struct.TypeTraitObject.html b/syn/ty/struct.TypeTraitObject.html new file mode 100644 index 0000000..a73919c --- /dev/null +++ b/syn/ty/struct.TypeTraitObject.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.TypeTraitObject.html...

+ + + \ No newline at end of file diff --git a/syn/ty/struct.TypeTuple.html b/syn/ty/struct.TypeTuple.html new file mode 100644 index 0000000..99efe6d --- /dev/null +++ b/syn/ty/struct.TypeTuple.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../syn/struct.TypeTuple.html...

+ + + \ No newline at end of file diff --git a/syn/type.Result.html b/syn/type.Result.html new file mode 100644 index 0000000..7351dfb --- /dev/null +++ b/syn/type.Result.html @@ -0,0 +1,4 @@ +Result in syn - Rust

Type Alias syn::Result

source ·
pub type Result<T> = Result<T, Error>;
Expand description

The result of a Syn parser.

+

Aliased Type§

enum Result<T> {
+    // some variants omitted
+}

Variants§

\ No newline at end of file diff --git a/trait.impl/core/clone/trait.Clone.js b/trait.impl/core/clone/trait.Clone.js new file mode 100644 index 0000000..40876f1 --- /dev/null +++ b/trait.impl/core/clone/trait.Clone.js @@ -0,0 +1,4 @@ +(function() {var implementors = { +"proc_macro2":[["impl Clone for Delimiter"],["impl Clone for Spacing"],["impl Clone for TokenTree"],["impl Clone for DelimSpan"],["impl Clone for Group"],["impl Clone for Ident"],["impl Clone for Literal"],["impl Clone for Punct"],["impl Clone for Span"],["impl Clone for TokenStream"],["impl Clone for IntoIter"]], +"syn":[["impl Clone for AttrStyle"],["impl Clone for BinOp"],["impl Clone for Data"],["impl Clone for Expr"],["impl Clone for FieldMutability"],["impl Clone for Fields"],["impl Clone for FnArg"],["impl Clone for ForeignItem"],["impl Clone for GenericArgument"],["impl Clone for GenericParam"],["impl Clone for ImplItem"],["impl Clone for ImplRestriction"],["impl Clone for Item"],["impl Clone for Lit"],["impl Clone for MacroDelimiter"],["impl Clone for Member"],["impl Clone for Meta"],["impl Clone for Pat"],["impl Clone for PathArguments"],["impl Clone for RangeLimits"],["impl Clone for ReturnType"],["impl Clone for StaticMutability"],["impl Clone for Stmt"],["impl Clone for TraitBoundModifier"],["impl Clone for TraitItem"],["impl Clone for Type"],["impl Clone for TypeParamBound"],["impl Clone for UnOp"],["impl Clone for UseTree"],["impl Clone for Visibility"],["impl Clone for WherePredicate"],["impl Clone for Error"],["impl Clone for Nothing"],["impl Clone for Abi"],["impl Clone for AngleBracketedGenericArguments"],["impl Clone for Arm"],["impl Clone for AssocConst"],["impl Clone for AssocType"],["impl Clone for Attribute"],["impl Clone for BareFnArg"],["impl Clone for BareVariadic"],["impl Clone for Block"],["impl Clone for BoundLifetimes"],["impl Clone for ConstParam"],["impl Clone for Constraint"],["impl Clone for DataEnum"],["impl Clone for DataStruct"],["impl Clone for DataUnion"],["impl Clone for DeriveInput"],["impl Clone for ExprArray"],["impl Clone for ExprAssign"],["impl Clone for ExprAsync"],["impl Clone for ExprAwait"],["impl Clone for ExprBinary"],["impl Clone for ExprBlock"],["impl Clone for ExprBreak"],["impl Clone for ExprCall"],["impl Clone for ExprCast"],["impl Clone for ExprClosure"],["impl Clone for ExprConst"],["impl Clone for ExprContinue"],["impl Clone for ExprField"],["impl Clone for ExprForLoop"],["impl Clone for ExprGroup"],["impl Clone for ExprIf"],["impl Clone for ExprIndex"],["impl Clone for ExprInfer"],["impl Clone for ExprLet"],["impl Clone for ExprLit"],["impl Clone for ExprLoop"],["impl Clone for ExprMacro"],["impl Clone for ExprMatch"],["impl Clone for ExprMethodCall"],["impl Clone for ExprParen"],["impl Clone for ExprPath"],["impl Clone for ExprRange"],["impl Clone for ExprReference"],["impl Clone for ExprRepeat"],["impl Clone for ExprReturn"],["impl Clone for ExprStruct"],["impl Clone for ExprTry"],["impl Clone for ExprTryBlock"],["impl Clone for ExprTuple"],["impl Clone for ExprUnary"],["impl Clone for ExprUnsafe"],["impl Clone for ExprWhile"],["impl Clone for ExprYield"],["impl Clone for Field"],["impl Clone for FieldPat"],["impl Clone for FieldValue"],["impl Clone for FieldsNamed"],["impl Clone for FieldsUnnamed"],["impl Clone for File"],["impl Clone for ForeignItemFn"],["impl Clone for ForeignItemMacro"],["impl Clone for ForeignItemStatic"],["impl Clone for ForeignItemType"],["impl Clone for Generics"],["impl Clone for ImplItemConst"],["impl Clone for ImplItemFn"],["impl Clone for ImplItemMacro"],["impl Clone for ImplItemType"],["impl Clone for Index"],["impl Clone for ItemConst"],["impl Clone for ItemEnum"],["impl Clone for ItemExternCrate"],["impl Clone for ItemFn"],["impl Clone for ItemForeignMod"],["impl Clone for ItemImpl"],["impl Clone for ItemMacro"],["impl Clone for ItemMod"],["impl Clone for ItemStatic"],["impl Clone for ItemStruct"],["impl Clone for ItemTrait"],["impl Clone for ItemTraitAlias"],["impl Clone for ItemType"],["impl Clone for ItemUnion"],["impl Clone for ItemUse"],["impl Clone for Label"],["impl Clone for Lifetime"],["impl Clone for LifetimeParam"],["impl Clone for LitBool"],["impl Clone for LitByte"],["impl Clone for LitByteStr"],["impl Clone for LitCStr"],["impl Clone for LitChar"],["impl Clone for LitFloat"],["impl Clone for LitInt"],["impl Clone for LitStr"],["impl Clone for Local"],["impl Clone for LocalInit"],["impl Clone for Macro"],["impl Clone for MetaList"],["impl Clone for MetaNameValue"],["impl Clone for ParenthesizedGenericArguments"],["impl Clone for PatIdent"],["impl Clone for PatOr"],["impl Clone for PatParen"],["impl Clone for PatReference"],["impl Clone for PatRest"],["impl Clone for PatSlice"],["impl Clone for PatStruct"],["impl Clone for PatTuple"],["impl Clone for PatTupleStruct"],["impl Clone for PatType"],["impl Clone for PatWild"],["impl Clone for Path"],["impl Clone for PathSegment"],["impl Clone for PredicateLifetime"],["impl Clone for PredicateType"],["impl Clone for QSelf"],["impl Clone for Receiver"],["impl Clone for Signature"],["impl Clone for StmtMacro"],["impl Clone for TraitBound"],["impl Clone for TraitItemConst"],["impl Clone for TraitItemFn"],["impl Clone for TraitItemMacro"],["impl Clone for TraitItemType"],["impl Clone for TypeArray"],["impl Clone for TypeBareFn"],["impl Clone for TypeGroup"],["impl Clone for TypeImplTrait"],["impl Clone for TypeInfer"],["impl Clone for TypeMacro"],["impl Clone for TypeNever"],["impl Clone for TypeParam"],["impl Clone for TypeParen"],["impl Clone for TypePath"],["impl Clone for TypePtr"],["impl Clone for TypeReference"],["impl Clone for TypeSlice"],["impl Clone for TypeTraitObject"],["impl Clone for TypeTuple"],["impl Clone for UseGlob"],["impl Clone for UseGroup"],["impl Clone for UseName"],["impl Clone for UsePath"],["impl Clone for UseRename"],["impl Clone for Variadic"],["impl Clone for Variant"],["impl Clone for VisRestricted"],["impl Clone for WhereClause"],["impl Clone for Abstract"],["impl Clone for And"],["impl Clone for AndAnd"],["impl Clone for AndEq"],["impl Clone for As"],["impl Clone for Async"],["impl Clone for At"],["impl Clone for Auto"],["impl Clone for Await"],["impl Clone for Become"],["impl Clone for Box"],["impl Clone for Brace"],["impl Clone for Bracket"],["impl Clone for Break"],["impl Clone for Caret"],["impl Clone for CaretEq"],["impl Clone for Colon"],["impl Clone for Comma"],["impl Clone for Const"],["impl Clone for Continue"],["impl Clone for Crate"],["impl Clone for Default"],["impl Clone for Do"],["impl Clone for Dollar"],["impl Clone for Dot"],["impl Clone for DotDot"],["impl Clone for DotDotDot"],["impl Clone for DotDotEq"],["impl Clone for Dyn"],["impl Clone for Else"],["impl Clone for Enum"],["impl Clone for Eq"],["impl Clone for EqEq"],["impl Clone for Extern"],["impl Clone for FatArrow"],["impl Clone for Final"],["impl Clone for Fn"],["impl Clone for For"],["impl Clone for Ge"],["impl Clone for Group"],["impl Clone for Gt"],["impl Clone for If"],["impl Clone for Impl"],["impl Clone for In"],["impl Clone for LArrow"],["impl Clone for Le"],["impl Clone for Let"],["impl Clone for Loop"],["impl Clone for Lt"],["impl Clone for Macro"],["impl Clone for Match"],["impl Clone for Minus"],["impl Clone for MinusEq"],["impl Clone for Mod"],["impl Clone for Move"],["impl Clone for Mut"],["impl Clone for Ne"],["impl Clone for Not"],["impl Clone for Or"],["impl Clone for OrEq"],["impl Clone for OrOr"],["impl Clone for Override"],["impl Clone for Paren"],["impl Clone for PathSep"],["impl Clone for Percent"],["impl Clone for PercentEq"],["impl Clone for Plus"],["impl Clone for PlusEq"],["impl Clone for Pound"],["impl Clone for Priv"],["impl Clone for Pub"],["impl Clone for Question"],["impl Clone for RArrow"],["impl Clone for Ref"],["impl Clone for Return"],["impl Clone for SelfType"],["impl Clone for SelfValue"],["impl Clone for Semi"],["impl Clone for Shl"],["impl Clone for ShlEq"],["impl Clone for Shr"],["impl Clone for ShrEq"],["impl Clone for Slash"],["impl Clone for SlashEq"],["impl Clone for Star"],["impl Clone for StarEq"],["impl Clone for Static"],["impl Clone for Struct"],["impl Clone for Super"],["impl Clone for Tilde"],["impl Clone for Trait"],["impl Clone for Try"],["impl Clone for Type"],["impl Clone for Typeof"],["impl Clone for Underscore"],["impl Clone for Union"],["impl Clone for Unsafe"],["impl Clone for Unsized"],["impl Clone for Use"],["impl Clone for Virtual"],["impl Clone for Where"],["impl Clone for While"],["impl Clone for Yield"],["impl<'a> Clone for Cursor<'a>"],["impl<'a> Clone for ImplGenerics<'a>"],["impl<'a> Clone for Turbofish<'a>"],["impl<'a> Clone for TypeGenerics<'a>"],["impl<'a, T> Clone for Iter<'a, T>"],["impl<'a, T, P> Clone for Pairs<'a, T, P>"],["impl<'c, 'a> Clone for StepCursor<'c, 'a>"],["impl<T> Clone for IntoIter<T>
where\n T: Clone,
"],["impl<T, P> Clone for Pair<T, P>
where\n T: Clone,\n P: Clone,
"],["impl<T, P> Clone for IntoPairs<T, P>
where\n T: Clone,\n P: Clone,
"],["impl<T, P> Clone for Punctuated<T, P>
where\n T: Clone,\n P: Clone,
"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/cmp/trait.Eq.js b/trait.impl/core/cmp/trait.Eq.js new file mode 100644 index 0000000..61e831d --- /dev/null +++ b/trait.impl/core/cmp/trait.Eq.js @@ -0,0 +1,4 @@ +(function() {var implementors = { +"proc_macro2":[["impl Eq for Delimiter"],["impl Eq for Spacing"],["impl Eq for Ident"]], +"syn":[["impl Eq for Member"],["impl Eq for Index"],["impl Eq for Lifetime"],["impl<'a> Eq for Cursor<'a>"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/cmp/trait.Ord.js b/trait.impl/core/cmp/trait.Ord.js new file mode 100644 index 0000000..ab8d4fe --- /dev/null +++ b/trait.impl/core/cmp/trait.Ord.js @@ -0,0 +1,4 @@ +(function() {var implementors = { +"proc_macro2":[["impl Ord for Ident"]], +"syn":[["impl Ord for Lifetime"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/cmp/trait.PartialEq.js b/trait.impl/core/cmp/trait.PartialEq.js new file mode 100644 index 0000000..12d105c --- /dev/null +++ b/trait.impl/core/cmp/trait.PartialEq.js @@ -0,0 +1,4 @@ +(function() {var implementors = { +"proc_macro2":[["impl PartialEq for Delimiter"],["impl PartialEq for Spacing"],["impl PartialEq for Ident"],["impl<T> PartialEq<T> for Ident
where\n T: ?Sized + AsRef<str>,
"]], +"syn":[["impl PartialEq for Member"],["impl PartialEq for Index"],["impl PartialEq for Lifetime"],["impl<'a> PartialEq for Cursor<'a>"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/cmp/trait.PartialOrd.js b/trait.impl/core/cmp/trait.PartialOrd.js new file mode 100644 index 0000000..33f5070 --- /dev/null +++ b/trait.impl/core/cmp/trait.PartialOrd.js @@ -0,0 +1,4 @@ +(function() {var implementors = { +"proc_macro2":[["impl PartialOrd for Ident"]], +"syn":[["impl PartialOrd for Lifetime"],["impl<'a> PartialOrd for Cursor<'a>"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/convert/trait.From.js b/trait.impl/core/convert/trait.From.js new file mode 100644 index 0000000..c8cdb99 --- /dev/null +++ b/trait.impl/core/convert/trait.From.js @@ -0,0 +1,4 @@ +(function() {var implementors = { +"proc_macro2":[["impl From<TokenTree> for TokenStream"],["impl From<Span> for Span"],["impl From<TokenStream> for TokenStream"],["impl From<Group> for TokenTree"],["impl From<Ident> for TokenTree"],["impl From<Literal> for TokenTree"],["impl From<Punct> for TokenTree"],["impl From<TokenStream> for TokenStream"]], +"syn":[["impl From<usize> for Member"],["impl From<usize> for Index"],["impl From<LexError> for Error"],["impl From<Literal> for LitFloat"],["impl From<Literal> for LitInt"],["impl From<ConstParam> for GenericParam"],["impl From<DeriveInput> for Item"],["impl From<ExprArray> for Expr"],["impl From<ExprAssign> for Expr"],["impl From<ExprAsync> for Expr"],["impl From<ExprAwait> for Expr"],["impl From<ExprBinary> for Expr"],["impl From<ExprBlock> for Expr"],["impl From<ExprBreak> for Expr"],["impl From<ExprCall> for Expr"],["impl From<ExprCast> for Expr"],["impl From<ExprClosure> for Expr"],["impl From<ExprConst> for Expr"],["impl From<ExprConst> for Pat"],["impl From<ExprContinue> for Expr"],["impl From<ExprField> for Expr"],["impl From<ExprForLoop> for Expr"],["impl From<ExprGroup> for Expr"],["impl From<ExprIf> for Expr"],["impl From<ExprIndex> for Expr"],["impl From<ExprInfer> for Expr"],["impl From<ExprLet> for Expr"],["impl From<ExprLit> for Expr"],["impl From<ExprLit> for Pat"],["impl From<ExprLoop> for Expr"],["impl From<ExprMacro> for Expr"],["impl From<ExprMacro> for Pat"],["impl From<ExprMatch> for Expr"],["impl From<ExprMethodCall> for Expr"],["impl From<ExprParen> for Expr"],["impl From<ExprPath> for Expr"],["impl From<ExprPath> for Pat"],["impl From<ExprRange> for Expr"],["impl From<ExprRange> for Pat"],["impl From<ExprReference> for Expr"],["impl From<ExprRepeat> for Expr"],["impl From<ExprReturn> for Expr"],["impl From<ExprStruct> for Expr"],["impl From<ExprTry> for Expr"],["impl From<ExprTryBlock> for Expr"],["impl From<ExprTuple> for Expr"],["impl From<ExprUnary> for Expr"],["impl From<ExprUnsafe> for Expr"],["impl From<ExprWhile> for Expr"],["impl From<ExprYield> for Expr"],["impl From<FieldsNamed> for Fields"],["impl From<FieldsUnnamed> for Fields"],["impl From<ForeignItemFn> for ForeignItem"],["impl From<ForeignItemMacro> for ForeignItem"],["impl From<ForeignItemStatic> for ForeignItem"],["impl From<ForeignItemType> for ForeignItem"],["impl From<Ident> for Member"],["impl From<Ident> for TypeParam"],["impl From<ImplItemConst> for ImplItem"],["impl From<ImplItemFn> for ImplItem"],["impl From<ImplItemMacro> for ImplItem"],["impl From<ImplItemType> for ImplItem"],["impl From<Index> for Member"],["impl From<ItemConst> for Item"],["impl From<ItemEnum> for Item"],["impl From<ItemEnum> for DeriveInput"],["impl From<ItemExternCrate> for Item"],["impl From<ItemFn> for Item"],["impl From<ItemForeignMod> for Item"],["impl From<ItemImpl> for Item"],["impl From<ItemMacro> for Item"],["impl From<ItemMod> for Item"],["impl From<ItemStatic> for Item"],["impl From<ItemStruct> for Item"],["impl From<ItemStruct> for DeriveInput"],["impl From<ItemTrait> for Item"],["impl From<ItemTraitAlias> for Item"],["impl From<ItemType> for Item"],["impl From<ItemUnion> for Item"],["impl From<ItemUnion> for DeriveInput"],["impl From<ItemUse> for Item"],["impl From<Lifetime> for TypeParamBound"],["impl From<LifetimeParam> for GenericParam"],["impl From<LitBool> for Lit"],["impl From<LitByte> for Lit"],["impl From<LitByteStr> for Lit"],["impl From<LitCStr> for Lit"],["impl From<LitChar> for Lit"],["impl From<LitFloat> for Lit"],["impl From<LitInt> for Lit"],["impl From<LitStr> for Lit"],["impl From<MetaList> for Meta"],["impl From<MetaNameValue> for Meta"],["impl From<PatIdent> for Pat"],["impl From<PatOr> for Pat"],["impl From<PatParen> for Pat"],["impl From<PatReference> for Pat"],["impl From<PatRest> for Pat"],["impl From<PatSlice> for Pat"],["impl From<PatStruct> for Pat"],["impl From<PatTuple> for Pat"],["impl From<PatTupleStruct> for Pat"],["impl From<PatType> for FnArg"],["impl From<PatType> for Pat"],["impl From<PatWild> for Pat"],["impl From<Path> for Meta"],["impl From<PredicateLifetime> for WherePredicate"],["impl From<PredicateType> for WherePredicate"],["impl From<Receiver> for FnArg"],["impl From<TraitBound> for TypeParamBound"],["impl From<TraitItemConst> for TraitItem"],["impl From<TraitItemFn> for TraitItem"],["impl From<TraitItemMacro> for TraitItem"],["impl From<TraitItemType> for TraitItem"],["impl From<TypeArray> for Type"],["impl From<TypeBareFn> for Type"],["impl From<TypeGroup> for Type"],["impl From<TypeImplTrait> for Type"],["impl From<TypeInfer> for Type"],["impl From<TypeMacro> for Type"],["impl From<TypeNever> for Type"],["impl From<TypeParam> for GenericParam"],["impl From<TypeParen> for Type"],["impl From<TypePath> for Type"],["impl From<TypePtr> for Type"],["impl From<TypeReference> for Type"],["impl From<TypeSlice> for Type"],["impl From<TypeTraitObject> for Type"],["impl From<TypeTuple> for Type"],["impl From<UseGlob> for UseTree"],["impl From<UseGroup> for UseTree"],["impl From<UseName> for UseTree"],["impl From<UsePath> for UseTree"],["impl From<UseRename> for UseTree"],["impl From<Crate> for Ident"],["impl From<Extern> for Ident"],["impl From<SelfType> for Ident"],["impl From<SelfValue> for Ident"],["impl From<Super> for Ident"],["impl From<Underscore> for Ident"],["impl<T> From<T> for Path
where\n T: Into<PathSegment>,
"],["impl<T> From<T> for PathSegment
where\n T: Into<Ident>,
"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/default/trait.Default.js b/trait.impl/core/default/trait.Default.js new file mode 100644 index 0000000..dff9586 --- /dev/null +++ b/trait.impl/core/default/trait.Default.js @@ -0,0 +1,4 @@ +(function() {var implementors = { +"proc_macro2":[["impl Default for TokenStream"]], +"syn":[["impl Default for PathArguments"],["impl Default for BoundLifetimes"],["impl Default for Generics"],["impl Default for Abstract"],["impl Default for And"],["impl Default for AndAnd"],["impl Default for AndEq"],["impl Default for As"],["impl Default for Async"],["impl Default for At"],["impl Default for Auto"],["impl Default for Await"],["impl Default for Become"],["impl Default for Box"],["impl Default for Brace"],["impl Default for Bracket"],["impl Default for Break"],["impl Default for Caret"],["impl Default for CaretEq"],["impl Default for Colon"],["impl Default for Comma"],["impl Default for Const"],["impl Default for Continue"],["impl Default for Crate"],["impl Default for Default"],["impl Default for Do"],["impl Default for Dollar"],["impl Default for Dot"],["impl Default for DotDot"],["impl Default for DotDotDot"],["impl Default for DotDotEq"],["impl Default for Dyn"],["impl Default for Else"],["impl Default for Enum"],["impl Default for Eq"],["impl Default for EqEq"],["impl Default for Extern"],["impl Default for FatArrow"],["impl Default for Final"],["impl Default for Fn"],["impl Default for For"],["impl Default for Ge"],["impl Default for Group"],["impl Default for Gt"],["impl Default for If"],["impl Default for Impl"],["impl Default for In"],["impl Default for LArrow"],["impl Default for Le"],["impl Default for Let"],["impl Default for Loop"],["impl Default for Lt"],["impl Default for Macro"],["impl Default for Match"],["impl Default for Minus"],["impl Default for MinusEq"],["impl Default for Mod"],["impl Default for Move"],["impl Default for Mut"],["impl Default for Ne"],["impl Default for Not"],["impl Default for Or"],["impl Default for OrEq"],["impl Default for OrOr"],["impl Default for Override"],["impl Default for Paren"],["impl Default for PathSep"],["impl Default for Percent"],["impl Default for PercentEq"],["impl Default for Plus"],["impl Default for PlusEq"],["impl Default for Pound"],["impl Default for Priv"],["impl Default for Pub"],["impl Default for Question"],["impl Default for RArrow"],["impl Default for Ref"],["impl Default for Return"],["impl Default for SelfType"],["impl Default for SelfValue"],["impl Default for Semi"],["impl Default for Shl"],["impl Default for ShlEq"],["impl Default for Shr"],["impl Default for ShrEq"],["impl Default for Slash"],["impl Default for SlashEq"],["impl Default for Star"],["impl Default for StarEq"],["impl Default for Static"],["impl Default for Struct"],["impl Default for Super"],["impl Default for Tilde"],["impl Default for Trait"],["impl Default for Try"],["impl Default for Type"],["impl Default for Typeof"],["impl Default for Underscore"],["impl Default for Union"],["impl Default for Unsafe"],["impl Default for Unsized"],["impl Default for Use"],["impl Default for Virtual"],["impl Default for Where"],["impl Default for While"],["impl Default for Yield"],["impl<T, P> Default for Punctuated<T, P>"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/error/trait.Error.js b/trait.impl/core/error/trait.Error.js new file mode 100644 index 0000000..b233589 --- /dev/null +++ b/trait.impl/core/error/trait.Error.js @@ -0,0 +1,4 @@ +(function() {var implementors = { +"proc_macro2":[["impl Error for LexError"]], +"syn":[["impl Error for Error"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/fmt/trait.Debug.js b/trait.impl/core/fmt/trait.Debug.js new file mode 100644 index 0000000..7cdf086 --- /dev/null +++ b/trait.impl/core/fmt/trait.Debug.js @@ -0,0 +1,4 @@ +(function() {var implementors = { +"proc_macro2":[["impl Debug for Delimiter"],["impl Debug for Spacing"],["impl Debug for TokenTree"],["impl Debug for DelimSpan"],["impl Debug for Group"],["impl Debug for Ident"],["impl Debug for LexError"],["impl Debug for Literal"],["impl Debug for Punct"],["impl Debug for Span"],["impl Debug for TokenStream"],["impl Debug for IntoIter"]], +"syn":[["impl Debug for Error"],["impl<'a> Debug for ParseBuffer<'a>"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/fmt/trait.Display.js b/trait.impl/core/fmt/trait.Display.js new file mode 100644 index 0000000..0cc9c8a --- /dev/null +++ b/trait.impl/core/fmt/trait.Display.js @@ -0,0 +1,4 @@ +(function() {var implementors = { +"proc_macro2":[["impl Display for TokenTree"],["impl Display for Group"],["impl Display for Ident"],["impl Display for LexError"],["impl Display for Literal"],["impl Display for Punct"],["impl Display for TokenStream"]], +"syn":[["impl Display for Error"],["impl Display for Lifetime"],["impl Display for LitFloat"],["impl Display for LitInt"],["impl<'a> Display for ParseBuffer<'a>"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/hash/trait.Hash.js b/trait.impl/core/hash/trait.Hash.js new file mode 100644 index 0000000..e690bee --- /dev/null +++ b/trait.impl/core/hash/trait.Hash.js @@ -0,0 +1,4 @@ +(function() {var implementors = { +"proc_macro2":[["impl Hash for Ident"]], +"syn":[["impl Hash for Member"],["impl Hash for Index"],["impl Hash for Lifetime"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/iter/traits/collect/trait.Extend.js b/trait.impl/core/iter/traits/collect/trait.Extend.js new file mode 100644 index 0000000..4b533dc --- /dev/null +++ b/trait.impl/core/iter/traits/collect/trait.Extend.js @@ -0,0 +1,4 @@ +(function() {var implementors = { +"proc_macro2":[["impl Extend<TokenTree> for TokenStream"],["impl Extend<TokenStream> for TokenStream"]], +"syn":[["impl Extend<Error> for Error"],["impl<T, P> Extend<Pair<T, P>> for Punctuated<T, P>
where\n P: Default,
"],["impl<T, P> Extend<T> for Punctuated<T, P>
where\n P: Default,
"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/iter/traits/collect/trait.FromIterator.js b/trait.impl/core/iter/traits/collect/trait.FromIterator.js new file mode 100644 index 0000000..d16a8c6 --- /dev/null +++ b/trait.impl/core/iter/traits/collect/trait.FromIterator.js @@ -0,0 +1,4 @@ +(function() {var implementors = { +"proc_macro2":[["impl FromIterator<TokenTree> for TokenStream"],["impl FromIterator<TokenStream> for TokenStream"]], +"syn":[["impl<T, P> FromIterator<Pair<T, P>> for Punctuated<T, P>"],["impl<T, P> FromIterator<T> for Punctuated<T, P>
where\n P: Default,
"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/iter/traits/collect/trait.IntoIterator.js b/trait.impl/core/iter/traits/collect/trait.IntoIterator.js new file mode 100644 index 0000000..f481f06 --- /dev/null +++ b/trait.impl/core/iter/traits/collect/trait.IntoIterator.js @@ -0,0 +1,4 @@ +(function() {var implementors = { +"proc_macro2":[["impl IntoIterator for TokenStream"]], +"syn":[["impl IntoIterator for Fields"],["impl IntoIterator for Error"],["impl<'a> IntoIterator for &'a Fields"],["impl<'a> IntoIterator for &'a Error"],["impl<'a> IntoIterator for &'a mut Fields"],["impl<'a, T, P> IntoIterator for &'a Punctuated<T, P>"],["impl<'a, T, P> IntoIterator for &'a mut Punctuated<T, P>"],["impl<T, P> IntoIterator for Punctuated<T, P>"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/iter/traits/double_ended/trait.DoubleEndedIterator.js b/trait.impl/core/iter/traits/double_ended/trait.DoubleEndedIterator.js new file mode 100644 index 0000000..90eb8fe --- /dev/null +++ b/trait.impl/core/iter/traits/double_ended/trait.DoubleEndedIterator.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"syn":[["impl<'a, T> DoubleEndedIterator for Iter<'a, T>"],["impl<'a, T> DoubleEndedIterator for IterMut<'a, T>"],["impl<'a, T, P> DoubleEndedIterator for Pairs<'a, T, P>"],["impl<'a, T, P> DoubleEndedIterator for PairsMut<'a, T, P>"],["impl<T> DoubleEndedIterator for IntoIter<T>"],["impl<T, P> DoubleEndedIterator for IntoPairs<T, P>"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/iter/traits/exact_size/trait.ExactSizeIterator.js b/trait.impl/core/iter/traits/exact_size/trait.ExactSizeIterator.js new file mode 100644 index 0000000..b9d842b --- /dev/null +++ b/trait.impl/core/iter/traits/exact_size/trait.ExactSizeIterator.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"syn":[["impl<'a, T> ExactSizeIterator for Iter<'a, T>"],["impl<'a, T> ExactSizeIterator for IterMut<'a, T>"],["impl<'a, T, P> ExactSizeIterator for Pairs<'a, T, P>"],["impl<'a, T, P> ExactSizeIterator for PairsMut<'a, T, P>"],["impl<T> ExactSizeIterator for IntoIter<T>"],["impl<T, P> ExactSizeIterator for IntoPairs<T, P>"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/iter/traits/iterator/trait.Iterator.js b/trait.impl/core/iter/traits/iterator/trait.Iterator.js new file mode 100644 index 0000000..ef10a43 --- /dev/null +++ b/trait.impl/core/iter/traits/iterator/trait.Iterator.js @@ -0,0 +1,4 @@ +(function() {var implementors = { +"proc_macro2":[["impl Iterator for IntoIter"]], +"syn":[["impl<'a, T> Iterator for Iter<'a, T>"],["impl<'a, T> Iterator for IterMut<'a, T>"],["impl<'a, T, P> Iterator for Pairs<'a, T, P>"],["impl<'a, T, P> Iterator for PairsMut<'a, T, P>"],["impl<T> Iterator for IntoIter<T>"],["impl<T, P> Iterator for IntoPairs<T, P>"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/marker/trait.Copy.js b/trait.impl/core/marker/trait.Copy.js new file mode 100644 index 0000000..cdf0fb1 --- /dev/null +++ b/trait.impl/core/marker/trait.Copy.js @@ -0,0 +1,4 @@ +(function() {var implementors = { +"proc_macro2":[["impl Copy for Delimiter"],["impl Copy for Spacing"],["impl Copy for DelimSpan"],["impl Copy for Span"]], +"syn":[["impl Copy for AttrStyle"],["impl Copy for BinOp"],["impl Copy for RangeLimits"],["impl Copy for TraitBoundModifier"],["impl Copy for UnOp"],["impl Copy for Nothing"],["impl Copy for Abstract"],["impl Copy for And"],["impl Copy for AndAnd"],["impl Copy for AndEq"],["impl Copy for As"],["impl Copy for Async"],["impl Copy for At"],["impl Copy for Auto"],["impl Copy for Await"],["impl Copy for Become"],["impl Copy for Box"],["impl Copy for Brace"],["impl Copy for Bracket"],["impl Copy for Break"],["impl Copy for Caret"],["impl Copy for CaretEq"],["impl Copy for Colon"],["impl Copy for Comma"],["impl Copy for Const"],["impl Copy for Continue"],["impl Copy for Crate"],["impl Copy for Default"],["impl Copy for Do"],["impl Copy for Dollar"],["impl Copy for Dot"],["impl Copy for DotDot"],["impl Copy for DotDotDot"],["impl Copy for DotDotEq"],["impl Copy for Dyn"],["impl Copy for Else"],["impl Copy for Enum"],["impl Copy for Eq"],["impl Copy for EqEq"],["impl Copy for Extern"],["impl Copy for FatArrow"],["impl Copy for Final"],["impl Copy for Fn"],["impl Copy for For"],["impl Copy for Ge"],["impl Copy for Group"],["impl Copy for Gt"],["impl Copy for If"],["impl Copy for Impl"],["impl Copy for In"],["impl Copy for LArrow"],["impl Copy for Le"],["impl Copy for Let"],["impl Copy for Loop"],["impl Copy for Lt"],["impl Copy for Macro"],["impl Copy for Match"],["impl Copy for Minus"],["impl Copy for MinusEq"],["impl Copy for Mod"],["impl Copy for Move"],["impl Copy for Mut"],["impl Copy for Ne"],["impl Copy for Not"],["impl Copy for Or"],["impl Copy for OrEq"],["impl Copy for OrOr"],["impl Copy for Override"],["impl Copy for Paren"],["impl Copy for PathSep"],["impl Copy for Percent"],["impl Copy for PercentEq"],["impl Copy for Plus"],["impl Copy for PlusEq"],["impl Copy for Pound"],["impl Copy for Priv"],["impl Copy for Pub"],["impl Copy for Question"],["impl Copy for RArrow"],["impl Copy for Ref"],["impl Copy for Return"],["impl Copy for SelfType"],["impl Copy for SelfValue"],["impl Copy for Semi"],["impl Copy for Shl"],["impl Copy for ShlEq"],["impl Copy for Shr"],["impl Copy for ShrEq"],["impl Copy for Slash"],["impl Copy for SlashEq"],["impl Copy for Star"],["impl Copy for StarEq"],["impl Copy for Static"],["impl Copy for Struct"],["impl Copy for Super"],["impl Copy for Tilde"],["impl Copy for Trait"],["impl Copy for Try"],["impl Copy for Type"],["impl Copy for Typeof"],["impl Copy for Underscore"],["impl Copy for Union"],["impl Copy for Unsafe"],["impl Copy for Unsized"],["impl Copy for Use"],["impl Copy for Virtual"],["impl Copy for Where"],["impl Copy for While"],["impl Copy for Yield"],["impl<'a> Copy for Cursor<'a>"],["impl<'c, 'a> Copy for StepCursor<'c, 'a>"],["impl<T, P> Copy for Pair<T, P>
where\n T: Copy,\n P: Copy,
"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/marker/trait.Freeze.js b/trait.impl/core/marker/trait.Freeze.js new file mode 100644 index 0000000..0de6de2 --- /dev/null +++ b/trait.impl/core/marker/trait.Freeze.js @@ -0,0 +1,4 @@ +(function() {var implementors = { +"proc_macro2":[["impl Freeze for Delimiter",1,["proc_macro2::Delimiter"]],["impl Freeze for Spacing",1,["proc_macro2::Spacing"]],["impl Freeze for TokenTree",1,["proc_macro2::TokenTree"]],["impl Freeze for DelimSpan",1,["proc_macro2::extra::DelimSpan"]],["impl Freeze for Group",1,["proc_macro2::Group"]],["impl Freeze for Ident",1,["proc_macro2::Ident"]],["impl Freeze for LexError",1,["proc_macro2::LexError"]],["impl Freeze for Literal",1,["proc_macro2::Literal"]],["impl Freeze for Punct",1,["proc_macro2::Punct"]],["impl Freeze for Span",1,["proc_macro2::Span"]],["impl Freeze for TokenStream",1,["proc_macro2::TokenStream"]],["impl Freeze for IntoIter",1,["proc_macro2::token_stream::IntoIter"]]], +"syn":[["impl Freeze for AttrStyle",1,["syn::attr::AttrStyle"]],["impl Freeze for BinOp",1,["syn::op::BinOp"]],["impl Freeze for Data",1,["syn::derive::Data"]],["impl Freeze for Expr",1,["syn::expr::Expr"]],["impl Freeze for FieldMutability",1,["syn::restriction::FieldMutability"]],["impl Freeze for Fields",1,["syn::data::Fields"]],["impl Freeze for FnArg",1,["syn::item::FnArg"]],["impl Freeze for ForeignItem",1,["syn::item::ForeignItem"]],["impl Freeze for GenericArgument",1,["syn::path::GenericArgument"]],["impl Freeze for GenericParam",1,["syn::generics::GenericParam"]],["impl Freeze for ImplItem",1,["syn::item::ImplItem"]],["impl Freeze for ImplRestriction",1,["syn::item::ImplRestriction"]],["impl Freeze for Item",1,["syn::item::Item"]],["impl Freeze for Lit",1,["syn::lit::Lit"]],["impl Freeze for MacroDelimiter",1,["syn::mac::MacroDelimiter"]],["impl Freeze for Member",1,["syn::expr::Member"]],["impl Freeze for Meta",1,["syn::attr::Meta"]],["impl Freeze for Pat",1,["syn::pat::Pat"]],["impl Freeze for PathArguments",1,["syn::path::PathArguments"]],["impl Freeze for RangeLimits",1,["syn::expr::RangeLimits"]],["impl Freeze for ReturnType",1,["syn::ty::ReturnType"]],["impl Freeze for StaticMutability",1,["syn::item::StaticMutability"]],["impl Freeze for Stmt",1,["syn::stmt::Stmt"]],["impl Freeze for TraitBoundModifier",1,["syn::generics::TraitBoundModifier"]],["impl Freeze for TraitItem",1,["syn::item::TraitItem"]],["impl Freeze for Type",1,["syn::ty::Type"]],["impl Freeze for TypeParamBound",1,["syn::generics::TypeParamBound"]],["impl Freeze for UnOp",1,["syn::op::UnOp"]],["impl Freeze for UseTree",1,["syn::item::UseTree"]],["impl Freeze for Visibility",1,["syn::restriction::Visibility"]],["impl Freeze for WherePredicate",1,["syn::generics::WherePredicate"]],["impl Freeze for TokenBuffer",1,["syn::buffer::TokenBuffer"]],["impl Freeze for Error",1,["syn::error::Error"]],["impl Freeze for Nothing",1,["syn::parse::Nothing"]],["impl Freeze for Abi",1,["syn::ty::Abi"]],["impl Freeze for AngleBracketedGenericArguments",1,["syn::path::AngleBracketedGenericArguments"]],["impl Freeze for Arm",1,["syn::expr::Arm"]],["impl Freeze for AssocConst",1,["syn::path::AssocConst"]],["impl Freeze for AssocType",1,["syn::path::AssocType"]],["impl Freeze for Attribute",1,["syn::attr::Attribute"]],["impl Freeze for BareFnArg",1,["syn::ty::BareFnArg"]],["impl Freeze for BareVariadic",1,["syn::ty::BareVariadic"]],["impl Freeze for Block",1,["syn::stmt::Block"]],["impl Freeze for BoundLifetimes",1,["syn::generics::BoundLifetimes"]],["impl Freeze for ConstParam",1,["syn::generics::ConstParam"]],["impl Freeze for Constraint",1,["syn::path::Constraint"]],["impl Freeze for DataEnum",1,["syn::derive::DataEnum"]],["impl Freeze for DataStruct",1,["syn::derive::DataStruct"]],["impl Freeze for DataUnion",1,["syn::derive::DataUnion"]],["impl Freeze for DeriveInput",1,["syn::derive::DeriveInput"]],["impl Freeze for ExprArray",1,["syn::expr::ExprArray"]],["impl Freeze for ExprAssign",1,["syn::expr::ExprAssign"]],["impl Freeze for ExprAsync",1,["syn::expr::ExprAsync"]],["impl Freeze for ExprAwait",1,["syn::expr::ExprAwait"]],["impl Freeze for ExprBinary",1,["syn::expr::ExprBinary"]],["impl Freeze for ExprBlock",1,["syn::expr::ExprBlock"]],["impl Freeze for ExprBreak",1,["syn::expr::ExprBreak"]],["impl Freeze for ExprCall",1,["syn::expr::ExprCall"]],["impl Freeze for ExprCast",1,["syn::expr::ExprCast"]],["impl Freeze for ExprClosure",1,["syn::expr::ExprClosure"]],["impl Freeze for ExprConst",1,["syn::expr::ExprConst"]],["impl Freeze for ExprContinue",1,["syn::expr::ExprContinue"]],["impl Freeze for ExprField",1,["syn::expr::ExprField"]],["impl Freeze for ExprForLoop",1,["syn::expr::ExprForLoop"]],["impl Freeze for ExprGroup",1,["syn::expr::ExprGroup"]],["impl Freeze for ExprIf",1,["syn::expr::ExprIf"]],["impl Freeze for ExprIndex",1,["syn::expr::ExprIndex"]],["impl Freeze for ExprInfer",1,["syn::expr::ExprInfer"]],["impl Freeze for ExprLet",1,["syn::expr::ExprLet"]],["impl Freeze for ExprLit",1,["syn::expr::ExprLit"]],["impl Freeze for ExprLoop",1,["syn::expr::ExprLoop"]],["impl Freeze for ExprMacro",1,["syn::expr::ExprMacro"]],["impl Freeze for ExprMatch",1,["syn::expr::ExprMatch"]],["impl Freeze for ExprMethodCall",1,["syn::expr::ExprMethodCall"]],["impl Freeze for ExprParen",1,["syn::expr::ExprParen"]],["impl Freeze for ExprPath",1,["syn::expr::ExprPath"]],["impl Freeze for ExprRange",1,["syn::expr::ExprRange"]],["impl Freeze for ExprReference",1,["syn::expr::ExprReference"]],["impl Freeze for ExprRepeat",1,["syn::expr::ExprRepeat"]],["impl Freeze for ExprReturn",1,["syn::expr::ExprReturn"]],["impl Freeze for ExprStruct",1,["syn::expr::ExprStruct"]],["impl Freeze for ExprTry",1,["syn::expr::ExprTry"]],["impl Freeze for ExprTryBlock",1,["syn::expr::ExprTryBlock"]],["impl Freeze for ExprTuple",1,["syn::expr::ExprTuple"]],["impl Freeze for ExprUnary",1,["syn::expr::ExprUnary"]],["impl Freeze for ExprUnsafe",1,["syn::expr::ExprUnsafe"]],["impl Freeze for ExprWhile",1,["syn::expr::ExprWhile"]],["impl Freeze for ExprYield",1,["syn::expr::ExprYield"]],["impl Freeze for Field",1,["syn::data::Field"]],["impl Freeze for FieldPat",1,["syn::pat::FieldPat"]],["impl Freeze for FieldValue",1,["syn::expr::FieldValue"]],["impl Freeze for FieldsNamed",1,["syn::data::FieldsNamed"]],["impl Freeze for FieldsUnnamed",1,["syn::data::FieldsUnnamed"]],["impl Freeze for File",1,["syn::file::File"]],["impl Freeze for ForeignItemFn",1,["syn::item::ForeignItemFn"]],["impl Freeze for ForeignItemMacro",1,["syn::item::ForeignItemMacro"]],["impl Freeze for ForeignItemStatic",1,["syn::item::ForeignItemStatic"]],["impl Freeze for ForeignItemType",1,["syn::item::ForeignItemType"]],["impl Freeze for Generics",1,["syn::generics::Generics"]],["impl Freeze for ImplItemConst",1,["syn::item::ImplItemConst"]],["impl Freeze for ImplItemFn",1,["syn::item::ImplItemFn"]],["impl Freeze for ImplItemMacro",1,["syn::item::ImplItemMacro"]],["impl Freeze for ImplItemType",1,["syn::item::ImplItemType"]],["impl Freeze for Index",1,["syn::expr::Index"]],["impl Freeze for ItemConst",1,["syn::item::ItemConst"]],["impl Freeze for ItemEnum",1,["syn::item::ItemEnum"]],["impl Freeze for ItemExternCrate",1,["syn::item::ItemExternCrate"]],["impl Freeze for ItemFn",1,["syn::item::ItemFn"]],["impl Freeze for ItemForeignMod",1,["syn::item::ItemForeignMod"]],["impl Freeze for ItemImpl",1,["syn::item::ItemImpl"]],["impl Freeze for ItemMacro",1,["syn::item::ItemMacro"]],["impl Freeze for ItemMod",1,["syn::item::ItemMod"]],["impl Freeze for ItemStatic",1,["syn::item::ItemStatic"]],["impl Freeze for ItemStruct",1,["syn::item::ItemStruct"]],["impl Freeze for ItemTrait",1,["syn::item::ItemTrait"]],["impl Freeze for ItemTraitAlias",1,["syn::item::ItemTraitAlias"]],["impl Freeze for ItemType",1,["syn::item::ItemType"]],["impl Freeze for ItemUnion",1,["syn::item::ItemUnion"]],["impl Freeze for ItemUse",1,["syn::item::ItemUse"]],["impl Freeze for Label",1,["syn::expr::Label"]],["impl Freeze for Lifetime",1,["syn::lifetime::Lifetime"]],["impl Freeze for LifetimeParam",1,["syn::generics::LifetimeParam"]],["impl Freeze for LitBool",1,["syn::lit::LitBool"]],["impl Freeze for LitByte",1,["syn::lit::LitByte"]],["impl Freeze for LitByteStr",1,["syn::lit::LitByteStr"]],["impl Freeze for LitCStr",1,["syn::lit::LitCStr"]],["impl Freeze for LitChar",1,["syn::lit::LitChar"]],["impl Freeze for LitFloat",1,["syn::lit::LitFloat"]],["impl Freeze for LitInt",1,["syn::lit::LitInt"]],["impl Freeze for LitStr",1,["syn::lit::LitStr"]],["impl Freeze for Local",1,["syn::stmt::Local"]],["impl Freeze for LocalInit",1,["syn::stmt::LocalInit"]],["impl Freeze for Macro",1,["syn::mac::Macro"]],["impl Freeze for MetaList",1,["syn::attr::MetaList"]],["impl Freeze for MetaNameValue",1,["syn::attr::MetaNameValue"]],["impl Freeze for ParenthesizedGenericArguments",1,["syn::path::ParenthesizedGenericArguments"]],["impl Freeze for PatIdent",1,["syn::pat::PatIdent"]],["impl Freeze for PatOr",1,["syn::pat::PatOr"]],["impl Freeze for PatParen",1,["syn::pat::PatParen"]],["impl Freeze for PatReference",1,["syn::pat::PatReference"]],["impl Freeze for PatRest",1,["syn::pat::PatRest"]],["impl Freeze for PatSlice",1,["syn::pat::PatSlice"]],["impl Freeze for PatStruct",1,["syn::pat::PatStruct"]],["impl Freeze for PatTuple",1,["syn::pat::PatTuple"]],["impl Freeze for PatTupleStruct",1,["syn::pat::PatTupleStruct"]],["impl Freeze for PatType",1,["syn::pat::PatType"]],["impl Freeze for PatWild",1,["syn::pat::PatWild"]],["impl Freeze for Path",1,["syn::path::Path"]],["impl Freeze for PathSegment",1,["syn::path::PathSegment"]],["impl Freeze for PredicateLifetime",1,["syn::generics::PredicateLifetime"]],["impl Freeze for PredicateType",1,["syn::generics::PredicateType"]],["impl Freeze for QSelf",1,["syn::path::QSelf"]],["impl Freeze for Receiver",1,["syn::item::Receiver"]],["impl Freeze for Signature",1,["syn::item::Signature"]],["impl Freeze for StmtMacro",1,["syn::stmt::StmtMacro"]],["impl Freeze for TraitBound",1,["syn::generics::TraitBound"]],["impl Freeze for TraitItemConst",1,["syn::item::TraitItemConst"]],["impl Freeze for TraitItemFn",1,["syn::item::TraitItemFn"]],["impl Freeze for TraitItemMacro",1,["syn::item::TraitItemMacro"]],["impl Freeze for TraitItemType",1,["syn::item::TraitItemType"]],["impl Freeze for TypeArray",1,["syn::ty::TypeArray"]],["impl Freeze for TypeBareFn",1,["syn::ty::TypeBareFn"]],["impl Freeze for TypeGroup",1,["syn::ty::TypeGroup"]],["impl Freeze for TypeImplTrait",1,["syn::ty::TypeImplTrait"]],["impl Freeze for TypeInfer",1,["syn::ty::TypeInfer"]],["impl Freeze for TypeMacro",1,["syn::ty::TypeMacro"]],["impl Freeze for TypeNever",1,["syn::ty::TypeNever"]],["impl Freeze for TypeParam",1,["syn::generics::TypeParam"]],["impl Freeze for TypeParen",1,["syn::ty::TypeParen"]],["impl Freeze for TypePath",1,["syn::ty::TypePath"]],["impl Freeze for TypePtr",1,["syn::ty::TypePtr"]],["impl Freeze for TypeReference",1,["syn::ty::TypeReference"]],["impl Freeze for TypeSlice",1,["syn::ty::TypeSlice"]],["impl Freeze for TypeTraitObject",1,["syn::ty::TypeTraitObject"]],["impl Freeze for TypeTuple",1,["syn::ty::TypeTuple"]],["impl Freeze for UseGlob",1,["syn::item::UseGlob"]],["impl Freeze for UseGroup",1,["syn::item::UseGroup"]],["impl Freeze for UseName",1,["syn::item::UseName"]],["impl Freeze for UsePath",1,["syn::item::UsePath"]],["impl Freeze for UseRename",1,["syn::item::UseRename"]],["impl Freeze for Variadic",1,["syn::item::Variadic"]],["impl Freeze for Variant",1,["syn::data::Variant"]],["impl Freeze for VisRestricted",1,["syn::restriction::VisRestricted"]],["impl Freeze for WhereClause",1,["syn::generics::WhereClause"]],["impl Freeze for Abstract",1,["syn::token::Abstract"]],["impl Freeze for And",1,["syn::token::And"]],["impl Freeze for AndAnd",1,["syn::token::AndAnd"]],["impl Freeze for AndEq",1,["syn::token::AndEq"]],["impl Freeze for As",1,["syn::token::As"]],["impl Freeze for Async",1,["syn::token::Async"]],["impl Freeze for At",1,["syn::token::At"]],["impl Freeze for Auto",1,["syn::token::Auto"]],["impl Freeze for Await",1,["syn::token::Await"]],["impl Freeze for Become",1,["syn::token::Become"]],["impl Freeze for Box",1,["syn::token::Box"]],["impl Freeze for Brace",1,["syn::token::Brace"]],["impl Freeze for Bracket",1,["syn::token::Bracket"]],["impl Freeze for Break",1,["syn::token::Break"]],["impl Freeze for Caret",1,["syn::token::Caret"]],["impl Freeze for CaretEq",1,["syn::token::CaretEq"]],["impl Freeze for Colon",1,["syn::token::Colon"]],["impl Freeze for Comma",1,["syn::token::Comma"]],["impl Freeze for Const",1,["syn::token::Const"]],["impl Freeze for Continue",1,["syn::token::Continue"]],["impl Freeze for Crate",1,["syn::token::Crate"]],["impl Freeze for Default",1,["syn::token::Default"]],["impl Freeze for Do",1,["syn::token::Do"]],["impl Freeze for Dollar",1,["syn::token::Dollar"]],["impl Freeze for Dot",1,["syn::token::Dot"]],["impl Freeze for DotDot",1,["syn::token::DotDot"]],["impl Freeze for DotDotDot",1,["syn::token::DotDotDot"]],["impl Freeze for DotDotEq",1,["syn::token::DotDotEq"]],["impl Freeze for Dyn",1,["syn::token::Dyn"]],["impl Freeze for Else",1,["syn::token::Else"]],["impl Freeze for Enum",1,["syn::token::Enum"]],["impl Freeze for Eq",1,["syn::token::Eq"]],["impl Freeze for EqEq",1,["syn::token::EqEq"]],["impl Freeze for Extern",1,["syn::token::Extern"]],["impl Freeze for FatArrow",1,["syn::token::FatArrow"]],["impl Freeze for Final",1,["syn::token::Final"]],["impl Freeze for Fn",1,["syn::token::Fn"]],["impl Freeze for For",1,["syn::token::For"]],["impl Freeze for Ge",1,["syn::token::Ge"]],["impl Freeze for Group",1,["syn::token::Group"]],["impl Freeze for Gt",1,["syn::token::Gt"]],["impl Freeze for If",1,["syn::token::If"]],["impl Freeze for Impl",1,["syn::token::Impl"]],["impl Freeze for In",1,["syn::token::In"]],["impl Freeze for LArrow",1,["syn::token::LArrow"]],["impl Freeze for Le",1,["syn::token::Le"]],["impl Freeze for Let",1,["syn::token::Let"]],["impl Freeze for Loop",1,["syn::token::Loop"]],["impl Freeze for Lt",1,["syn::token::Lt"]],["impl Freeze for Macro",1,["syn::token::Macro"]],["impl Freeze for Match",1,["syn::token::Match"]],["impl Freeze for Minus",1,["syn::token::Minus"]],["impl Freeze for MinusEq",1,["syn::token::MinusEq"]],["impl Freeze for Mod",1,["syn::token::Mod"]],["impl Freeze for Move",1,["syn::token::Move"]],["impl Freeze for Mut",1,["syn::token::Mut"]],["impl Freeze for Ne",1,["syn::token::Ne"]],["impl Freeze for Not",1,["syn::token::Not"]],["impl Freeze for Or",1,["syn::token::Or"]],["impl Freeze for OrEq",1,["syn::token::OrEq"]],["impl Freeze for OrOr",1,["syn::token::OrOr"]],["impl Freeze for Override",1,["syn::token::Override"]],["impl Freeze for Paren",1,["syn::token::Paren"]],["impl Freeze for PathSep",1,["syn::token::PathSep"]],["impl Freeze for Percent",1,["syn::token::Percent"]],["impl Freeze for PercentEq",1,["syn::token::PercentEq"]],["impl Freeze for Plus",1,["syn::token::Plus"]],["impl Freeze for PlusEq",1,["syn::token::PlusEq"]],["impl Freeze for Pound",1,["syn::token::Pound"]],["impl Freeze for Priv",1,["syn::token::Priv"]],["impl Freeze for Pub",1,["syn::token::Pub"]],["impl Freeze for Question",1,["syn::token::Question"]],["impl Freeze for RArrow",1,["syn::token::RArrow"]],["impl Freeze for Ref",1,["syn::token::Ref"]],["impl Freeze for Return",1,["syn::token::Return"]],["impl Freeze for SelfType",1,["syn::token::SelfType"]],["impl Freeze for SelfValue",1,["syn::token::SelfValue"]],["impl Freeze for Semi",1,["syn::token::Semi"]],["impl Freeze for Shl",1,["syn::token::Shl"]],["impl Freeze for ShlEq",1,["syn::token::ShlEq"]],["impl Freeze for Shr",1,["syn::token::Shr"]],["impl Freeze for ShrEq",1,["syn::token::ShrEq"]],["impl Freeze for Slash",1,["syn::token::Slash"]],["impl Freeze for SlashEq",1,["syn::token::SlashEq"]],["impl Freeze for Star",1,["syn::token::Star"]],["impl Freeze for StarEq",1,["syn::token::StarEq"]],["impl Freeze for Static",1,["syn::token::Static"]],["impl Freeze for Struct",1,["syn::token::Struct"]],["impl Freeze for Super",1,["syn::token::Super"]],["impl Freeze for Tilde",1,["syn::token::Tilde"]],["impl Freeze for Trait",1,["syn::token::Trait"]],["impl Freeze for Try",1,["syn::token::Try"]],["impl Freeze for Type",1,["syn::token::Type"]],["impl Freeze for Typeof",1,["syn::token::Typeof"]],["impl Freeze for Underscore",1,["syn::token::Underscore"]],["impl Freeze for Union",1,["syn::token::Union"]],["impl Freeze for Unsafe",1,["syn::token::Unsafe"]],["impl Freeze for Unsized",1,["syn::token::Unsized"]],["impl Freeze for Use",1,["syn::token::Use"]],["impl Freeze for Virtual",1,["syn::token::Virtual"]],["impl Freeze for Where",1,["syn::token::Where"]],["impl Freeze for While",1,["syn::token::While"]],["impl Freeze for Yield",1,["syn::token::Yield"]],["impl<'a> !Freeze for Lookahead1<'a>",1,["syn::lookahead::Lookahead1"]],["impl<'a> !Freeze for ParseBuffer<'a>",1,["syn::parse::ParseBuffer"]],["impl<'a> Freeze for Cursor<'a>",1,["syn::buffer::Cursor"]],["impl<'a> Freeze for ParseNestedMeta<'a>",1,["syn::meta::ParseNestedMeta"]],["impl<'a> Freeze for ImplGenerics<'a>",1,["syn::generics::ImplGenerics"]],["impl<'a> Freeze for Turbofish<'a>",1,["syn::generics::Turbofish"]],["impl<'a> Freeze for TypeGenerics<'a>",1,["syn::generics::TypeGenerics"]],["impl<'a, T> Freeze for Iter<'a, T>",1,["syn::punctuated::Iter"]],["impl<'a, T> Freeze for IterMut<'a, T>",1,["syn::punctuated::IterMut"]],["impl<'a, T, P> Freeze for Pairs<'a, T, P>",1,["syn::punctuated::Pairs"]],["impl<'a, T, P> Freeze for PairsMut<'a, T, P>",1,["syn::punctuated::PairsMut"]],["impl<'c, 'a> Freeze for StepCursor<'c, 'a>",1,["syn::parse::StepCursor"]],["impl<T> Freeze for IntoIter<T>",1,["syn::punctuated::IntoIter"]],["impl<T, P> Freeze for Pair<T, P>
where\n T: Freeze,\n P: Freeze,
",1,["syn::punctuated::Pair"]],["impl<T, P> Freeze for IntoPairs<T, P>
where\n T: Freeze,
",1,["syn::punctuated::IntoPairs"]],["impl<T, P> Freeze for Punctuated<T, P>",1,["syn::punctuated::Punctuated"]]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/marker/trait.Send.js b/trait.impl/core/marker/trait.Send.js new file mode 100644 index 0000000..0403062 --- /dev/null +++ b/trait.impl/core/marker/trait.Send.js @@ -0,0 +1,4 @@ +(function() {var implementors = { +"proc_macro2":[["impl !Send for TokenTree",1,["proc_macro2::TokenTree"]],["impl !Send for DelimSpan",1,["proc_macro2::extra::DelimSpan"]],["impl !Send for Group",1,["proc_macro2::Group"]],["impl !Send for Ident",1,["proc_macro2::Ident"]],["impl !Send for LexError",1,["proc_macro2::LexError"]],["impl !Send for Literal",1,["proc_macro2::Literal"]],["impl !Send for Punct",1,["proc_macro2::Punct"]],["impl !Send for Span",1,["proc_macro2::Span"]],["impl !Send for TokenStream",1,["proc_macro2::TokenStream"]],["impl !Send for IntoIter",1,["proc_macro2::token_stream::IntoIter"]],["impl Send for Delimiter",1,["proc_macro2::Delimiter"]],["impl Send for Spacing",1,["proc_macro2::Spacing"]]], +"syn":[["impl !Send for AttrStyle",1,["syn::attr::AttrStyle"]],["impl !Send for BinOp",1,["syn::op::BinOp"]],["impl !Send for Data",1,["syn::derive::Data"]],["impl !Send for Expr",1,["syn::expr::Expr"]],["impl !Send for Fields",1,["syn::data::Fields"]],["impl !Send for FnArg",1,["syn::item::FnArg"]],["impl !Send for ForeignItem",1,["syn::item::ForeignItem"]],["impl !Send for GenericArgument",1,["syn::path::GenericArgument"]],["impl !Send for GenericParam",1,["syn::generics::GenericParam"]],["impl !Send for ImplItem",1,["syn::item::ImplItem"]],["impl !Send for Item",1,["syn::item::Item"]],["impl !Send for Lit",1,["syn::lit::Lit"]],["impl !Send for MacroDelimiter",1,["syn::mac::MacroDelimiter"]],["impl !Send for Member",1,["syn::expr::Member"]],["impl !Send for Meta",1,["syn::attr::Meta"]],["impl !Send for Pat",1,["syn::pat::Pat"]],["impl !Send for PathArguments",1,["syn::path::PathArguments"]],["impl !Send for RangeLimits",1,["syn::expr::RangeLimits"]],["impl !Send for ReturnType",1,["syn::ty::ReturnType"]],["impl !Send for StaticMutability",1,["syn::item::StaticMutability"]],["impl !Send for Stmt",1,["syn::stmt::Stmt"]],["impl !Send for TraitBoundModifier",1,["syn::generics::TraitBoundModifier"]],["impl !Send for TraitItem",1,["syn::item::TraitItem"]],["impl !Send for Type",1,["syn::ty::Type"]],["impl !Send for TypeParamBound",1,["syn::generics::TypeParamBound"]],["impl !Send for UnOp",1,["syn::op::UnOp"]],["impl !Send for UseTree",1,["syn::item::UseTree"]],["impl !Send for Visibility",1,["syn::restriction::Visibility"]],["impl !Send for WherePredicate",1,["syn::generics::WherePredicate"]],["impl !Send for TokenBuffer",1,["syn::buffer::TokenBuffer"]],["impl !Send for Abi",1,["syn::ty::Abi"]],["impl !Send for AngleBracketedGenericArguments",1,["syn::path::AngleBracketedGenericArguments"]],["impl !Send for Arm",1,["syn::expr::Arm"]],["impl !Send for AssocConst",1,["syn::path::AssocConst"]],["impl !Send for AssocType",1,["syn::path::AssocType"]],["impl !Send for Attribute",1,["syn::attr::Attribute"]],["impl !Send for BareFnArg",1,["syn::ty::BareFnArg"]],["impl !Send for BareVariadic",1,["syn::ty::BareVariadic"]],["impl !Send for Block",1,["syn::stmt::Block"]],["impl !Send for BoundLifetimes",1,["syn::generics::BoundLifetimes"]],["impl !Send for ConstParam",1,["syn::generics::ConstParam"]],["impl !Send for Constraint",1,["syn::path::Constraint"]],["impl !Send for DataEnum",1,["syn::derive::DataEnum"]],["impl !Send for DataStruct",1,["syn::derive::DataStruct"]],["impl !Send for DataUnion",1,["syn::derive::DataUnion"]],["impl !Send for DeriveInput",1,["syn::derive::DeriveInput"]],["impl !Send for ExprArray",1,["syn::expr::ExprArray"]],["impl !Send for ExprAssign",1,["syn::expr::ExprAssign"]],["impl !Send for ExprAsync",1,["syn::expr::ExprAsync"]],["impl !Send for ExprAwait",1,["syn::expr::ExprAwait"]],["impl !Send for ExprBinary",1,["syn::expr::ExprBinary"]],["impl !Send for ExprBlock",1,["syn::expr::ExprBlock"]],["impl !Send for ExprBreak",1,["syn::expr::ExprBreak"]],["impl !Send for ExprCall",1,["syn::expr::ExprCall"]],["impl !Send for ExprCast",1,["syn::expr::ExprCast"]],["impl !Send for ExprClosure",1,["syn::expr::ExprClosure"]],["impl !Send for ExprConst",1,["syn::expr::ExprConst"]],["impl !Send for ExprContinue",1,["syn::expr::ExprContinue"]],["impl !Send for ExprField",1,["syn::expr::ExprField"]],["impl !Send for ExprForLoop",1,["syn::expr::ExprForLoop"]],["impl !Send for ExprGroup",1,["syn::expr::ExprGroup"]],["impl !Send for ExprIf",1,["syn::expr::ExprIf"]],["impl !Send for ExprIndex",1,["syn::expr::ExprIndex"]],["impl !Send for ExprInfer",1,["syn::expr::ExprInfer"]],["impl !Send for ExprLet",1,["syn::expr::ExprLet"]],["impl !Send for ExprLit",1,["syn::expr::ExprLit"]],["impl !Send for ExprLoop",1,["syn::expr::ExprLoop"]],["impl !Send for ExprMacro",1,["syn::expr::ExprMacro"]],["impl !Send for ExprMatch",1,["syn::expr::ExprMatch"]],["impl !Send for ExprMethodCall",1,["syn::expr::ExprMethodCall"]],["impl !Send for ExprParen",1,["syn::expr::ExprParen"]],["impl !Send for ExprPath",1,["syn::expr::ExprPath"]],["impl !Send for ExprRange",1,["syn::expr::ExprRange"]],["impl !Send for ExprReference",1,["syn::expr::ExprReference"]],["impl !Send for ExprRepeat",1,["syn::expr::ExprRepeat"]],["impl !Send for ExprReturn",1,["syn::expr::ExprReturn"]],["impl !Send for ExprStruct",1,["syn::expr::ExprStruct"]],["impl !Send for ExprTry",1,["syn::expr::ExprTry"]],["impl !Send for ExprTryBlock",1,["syn::expr::ExprTryBlock"]],["impl !Send for ExprTuple",1,["syn::expr::ExprTuple"]],["impl !Send for ExprUnary",1,["syn::expr::ExprUnary"]],["impl !Send for ExprUnsafe",1,["syn::expr::ExprUnsafe"]],["impl !Send for ExprWhile",1,["syn::expr::ExprWhile"]],["impl !Send for ExprYield",1,["syn::expr::ExprYield"]],["impl !Send for Field",1,["syn::data::Field"]],["impl !Send for FieldPat",1,["syn::pat::FieldPat"]],["impl !Send for FieldValue",1,["syn::expr::FieldValue"]],["impl !Send for FieldsNamed",1,["syn::data::FieldsNamed"]],["impl !Send for FieldsUnnamed",1,["syn::data::FieldsUnnamed"]],["impl !Send for File",1,["syn::file::File"]],["impl !Send for ForeignItemFn",1,["syn::item::ForeignItemFn"]],["impl !Send for ForeignItemMacro",1,["syn::item::ForeignItemMacro"]],["impl !Send for ForeignItemStatic",1,["syn::item::ForeignItemStatic"]],["impl !Send for ForeignItemType",1,["syn::item::ForeignItemType"]],["impl !Send for Generics",1,["syn::generics::Generics"]],["impl !Send for ImplItemConst",1,["syn::item::ImplItemConst"]],["impl !Send for ImplItemFn",1,["syn::item::ImplItemFn"]],["impl !Send for ImplItemMacro",1,["syn::item::ImplItemMacro"]],["impl !Send for ImplItemType",1,["syn::item::ImplItemType"]],["impl !Send for Index",1,["syn::expr::Index"]],["impl !Send for ItemConst",1,["syn::item::ItemConst"]],["impl !Send for ItemEnum",1,["syn::item::ItemEnum"]],["impl !Send for ItemExternCrate",1,["syn::item::ItemExternCrate"]],["impl !Send for ItemFn",1,["syn::item::ItemFn"]],["impl !Send for ItemForeignMod",1,["syn::item::ItemForeignMod"]],["impl !Send for ItemImpl",1,["syn::item::ItemImpl"]],["impl !Send for ItemMacro",1,["syn::item::ItemMacro"]],["impl !Send for ItemMod",1,["syn::item::ItemMod"]],["impl !Send for ItemStatic",1,["syn::item::ItemStatic"]],["impl !Send for ItemStruct",1,["syn::item::ItemStruct"]],["impl !Send for ItemTrait",1,["syn::item::ItemTrait"]],["impl !Send for ItemTraitAlias",1,["syn::item::ItemTraitAlias"]],["impl !Send for ItemType",1,["syn::item::ItemType"]],["impl !Send for ItemUnion",1,["syn::item::ItemUnion"]],["impl !Send for ItemUse",1,["syn::item::ItemUse"]],["impl !Send for Label",1,["syn::expr::Label"]],["impl !Send for Lifetime",1,["syn::lifetime::Lifetime"]],["impl !Send for LifetimeParam",1,["syn::generics::LifetimeParam"]],["impl !Send for LitBool",1,["syn::lit::LitBool"]],["impl !Send for LitByte",1,["syn::lit::LitByte"]],["impl !Send for LitByteStr",1,["syn::lit::LitByteStr"]],["impl !Send for LitCStr",1,["syn::lit::LitCStr"]],["impl !Send for LitChar",1,["syn::lit::LitChar"]],["impl !Send for LitFloat",1,["syn::lit::LitFloat"]],["impl !Send for LitInt",1,["syn::lit::LitInt"]],["impl !Send for LitStr",1,["syn::lit::LitStr"]],["impl !Send for Local",1,["syn::stmt::Local"]],["impl !Send for LocalInit",1,["syn::stmt::LocalInit"]],["impl !Send for Macro",1,["syn::mac::Macro"]],["impl !Send for MetaList",1,["syn::attr::MetaList"]],["impl !Send for MetaNameValue",1,["syn::attr::MetaNameValue"]],["impl !Send for ParenthesizedGenericArguments",1,["syn::path::ParenthesizedGenericArguments"]],["impl !Send for PatIdent",1,["syn::pat::PatIdent"]],["impl !Send for PatOr",1,["syn::pat::PatOr"]],["impl !Send for PatParen",1,["syn::pat::PatParen"]],["impl !Send for PatReference",1,["syn::pat::PatReference"]],["impl !Send for PatRest",1,["syn::pat::PatRest"]],["impl !Send for PatSlice",1,["syn::pat::PatSlice"]],["impl !Send for PatStruct",1,["syn::pat::PatStruct"]],["impl !Send for PatTuple",1,["syn::pat::PatTuple"]],["impl !Send for PatTupleStruct",1,["syn::pat::PatTupleStruct"]],["impl !Send for PatType",1,["syn::pat::PatType"]],["impl !Send for PatWild",1,["syn::pat::PatWild"]],["impl !Send for Path",1,["syn::path::Path"]],["impl !Send for PathSegment",1,["syn::path::PathSegment"]],["impl !Send for PredicateLifetime",1,["syn::generics::PredicateLifetime"]],["impl !Send for PredicateType",1,["syn::generics::PredicateType"]],["impl !Send for QSelf",1,["syn::path::QSelf"]],["impl !Send for Receiver",1,["syn::item::Receiver"]],["impl !Send for Signature",1,["syn::item::Signature"]],["impl !Send for StmtMacro",1,["syn::stmt::StmtMacro"]],["impl !Send for TraitBound",1,["syn::generics::TraitBound"]],["impl !Send for TraitItemConst",1,["syn::item::TraitItemConst"]],["impl !Send for TraitItemFn",1,["syn::item::TraitItemFn"]],["impl !Send for TraitItemMacro",1,["syn::item::TraitItemMacro"]],["impl !Send for TraitItemType",1,["syn::item::TraitItemType"]],["impl !Send for TypeArray",1,["syn::ty::TypeArray"]],["impl !Send for TypeBareFn",1,["syn::ty::TypeBareFn"]],["impl !Send for TypeGroup",1,["syn::ty::TypeGroup"]],["impl !Send for TypeImplTrait",1,["syn::ty::TypeImplTrait"]],["impl !Send for TypeInfer",1,["syn::ty::TypeInfer"]],["impl !Send for TypeMacro",1,["syn::ty::TypeMacro"]],["impl !Send for TypeNever",1,["syn::ty::TypeNever"]],["impl !Send for TypeParam",1,["syn::generics::TypeParam"]],["impl !Send for TypeParen",1,["syn::ty::TypeParen"]],["impl !Send for TypePath",1,["syn::ty::TypePath"]],["impl !Send for TypePtr",1,["syn::ty::TypePtr"]],["impl !Send for TypeReference",1,["syn::ty::TypeReference"]],["impl !Send for TypeSlice",1,["syn::ty::TypeSlice"]],["impl !Send for TypeTraitObject",1,["syn::ty::TypeTraitObject"]],["impl !Send for TypeTuple",1,["syn::ty::TypeTuple"]],["impl !Send for UseGlob",1,["syn::item::UseGlob"]],["impl !Send for UseGroup",1,["syn::item::UseGroup"]],["impl !Send for UseName",1,["syn::item::UseName"]],["impl !Send for UsePath",1,["syn::item::UsePath"]],["impl !Send for UseRename",1,["syn::item::UseRename"]],["impl !Send for Variadic",1,["syn::item::Variadic"]],["impl !Send for Variant",1,["syn::data::Variant"]],["impl !Send for VisRestricted",1,["syn::restriction::VisRestricted"]],["impl !Send for WhereClause",1,["syn::generics::WhereClause"]],["impl !Send for Abstract",1,["syn::token::Abstract"]],["impl !Send for And",1,["syn::token::And"]],["impl !Send for AndAnd",1,["syn::token::AndAnd"]],["impl !Send for AndEq",1,["syn::token::AndEq"]],["impl !Send for As",1,["syn::token::As"]],["impl !Send for Async",1,["syn::token::Async"]],["impl !Send for At",1,["syn::token::At"]],["impl !Send for Auto",1,["syn::token::Auto"]],["impl !Send for Await",1,["syn::token::Await"]],["impl !Send for Become",1,["syn::token::Become"]],["impl !Send for Box",1,["syn::token::Box"]],["impl !Send for Brace",1,["syn::token::Brace"]],["impl !Send for Bracket",1,["syn::token::Bracket"]],["impl !Send for Break",1,["syn::token::Break"]],["impl !Send for Caret",1,["syn::token::Caret"]],["impl !Send for CaretEq",1,["syn::token::CaretEq"]],["impl !Send for Colon",1,["syn::token::Colon"]],["impl !Send for Comma",1,["syn::token::Comma"]],["impl !Send for Const",1,["syn::token::Const"]],["impl !Send for Continue",1,["syn::token::Continue"]],["impl !Send for Crate",1,["syn::token::Crate"]],["impl !Send for Default",1,["syn::token::Default"]],["impl !Send for Do",1,["syn::token::Do"]],["impl !Send for Dollar",1,["syn::token::Dollar"]],["impl !Send for Dot",1,["syn::token::Dot"]],["impl !Send for DotDot",1,["syn::token::DotDot"]],["impl !Send for DotDotDot",1,["syn::token::DotDotDot"]],["impl !Send for DotDotEq",1,["syn::token::DotDotEq"]],["impl !Send for Dyn",1,["syn::token::Dyn"]],["impl !Send for Else",1,["syn::token::Else"]],["impl !Send for Enum",1,["syn::token::Enum"]],["impl !Send for Eq",1,["syn::token::Eq"]],["impl !Send for EqEq",1,["syn::token::EqEq"]],["impl !Send for Extern",1,["syn::token::Extern"]],["impl !Send for FatArrow",1,["syn::token::FatArrow"]],["impl !Send for Final",1,["syn::token::Final"]],["impl !Send for Fn",1,["syn::token::Fn"]],["impl !Send for For",1,["syn::token::For"]],["impl !Send for Ge",1,["syn::token::Ge"]],["impl !Send for Group",1,["syn::token::Group"]],["impl !Send for Gt",1,["syn::token::Gt"]],["impl !Send for If",1,["syn::token::If"]],["impl !Send for Impl",1,["syn::token::Impl"]],["impl !Send for In",1,["syn::token::In"]],["impl !Send for LArrow",1,["syn::token::LArrow"]],["impl !Send for Le",1,["syn::token::Le"]],["impl !Send for Let",1,["syn::token::Let"]],["impl !Send for Loop",1,["syn::token::Loop"]],["impl !Send for Lt",1,["syn::token::Lt"]],["impl !Send for Macro",1,["syn::token::Macro"]],["impl !Send for Match",1,["syn::token::Match"]],["impl !Send for Minus",1,["syn::token::Minus"]],["impl !Send for MinusEq",1,["syn::token::MinusEq"]],["impl !Send for Mod",1,["syn::token::Mod"]],["impl !Send for Move",1,["syn::token::Move"]],["impl !Send for Mut",1,["syn::token::Mut"]],["impl !Send for Ne",1,["syn::token::Ne"]],["impl !Send for Not",1,["syn::token::Not"]],["impl !Send for Or",1,["syn::token::Or"]],["impl !Send for OrEq",1,["syn::token::OrEq"]],["impl !Send for OrOr",1,["syn::token::OrOr"]],["impl !Send for Override",1,["syn::token::Override"]],["impl !Send for Paren",1,["syn::token::Paren"]],["impl !Send for PathSep",1,["syn::token::PathSep"]],["impl !Send for Percent",1,["syn::token::Percent"]],["impl !Send for PercentEq",1,["syn::token::PercentEq"]],["impl !Send for Plus",1,["syn::token::Plus"]],["impl !Send for PlusEq",1,["syn::token::PlusEq"]],["impl !Send for Pound",1,["syn::token::Pound"]],["impl !Send for Priv",1,["syn::token::Priv"]],["impl !Send for Pub",1,["syn::token::Pub"]],["impl !Send for Question",1,["syn::token::Question"]],["impl !Send for RArrow",1,["syn::token::RArrow"]],["impl !Send for Ref",1,["syn::token::Ref"]],["impl !Send for Return",1,["syn::token::Return"]],["impl !Send for SelfType",1,["syn::token::SelfType"]],["impl !Send for SelfValue",1,["syn::token::SelfValue"]],["impl !Send for Semi",1,["syn::token::Semi"]],["impl !Send for Shl",1,["syn::token::Shl"]],["impl !Send for ShlEq",1,["syn::token::ShlEq"]],["impl !Send for Shr",1,["syn::token::Shr"]],["impl !Send for ShrEq",1,["syn::token::ShrEq"]],["impl !Send for Slash",1,["syn::token::Slash"]],["impl !Send for SlashEq",1,["syn::token::SlashEq"]],["impl !Send for Star",1,["syn::token::Star"]],["impl !Send for StarEq",1,["syn::token::StarEq"]],["impl !Send for Static",1,["syn::token::Static"]],["impl !Send for Struct",1,["syn::token::Struct"]],["impl !Send for Super",1,["syn::token::Super"]],["impl !Send for Tilde",1,["syn::token::Tilde"]],["impl !Send for Trait",1,["syn::token::Trait"]],["impl !Send for Try",1,["syn::token::Try"]],["impl !Send for Type",1,["syn::token::Type"]],["impl !Send for Typeof",1,["syn::token::Typeof"]],["impl !Send for Underscore",1,["syn::token::Underscore"]],["impl !Send for Union",1,["syn::token::Union"]],["impl !Send for Unsafe",1,["syn::token::Unsafe"]],["impl !Send for Unsized",1,["syn::token::Unsized"]],["impl !Send for Use",1,["syn::token::Use"]],["impl !Send for Virtual",1,["syn::token::Virtual"]],["impl !Send for Where",1,["syn::token::Where"]],["impl !Send for While",1,["syn::token::While"]],["impl !Send for Yield",1,["syn::token::Yield"]],["impl Send for FieldMutability",1,["syn::restriction::FieldMutability"]],["impl Send for ImplRestriction",1,["syn::item::ImplRestriction"]],["impl Send for Error",1,["syn::error::Error"]],["impl Send for Nothing",1,["syn::parse::Nothing"]],["impl<'a> !Send for Cursor<'a>",1,["syn::buffer::Cursor"]],["impl<'a> !Send for ParseNestedMeta<'a>",1,["syn::meta::ParseNestedMeta"]],["impl<'a> !Send for Lookahead1<'a>",1,["syn::lookahead::Lookahead1"]],["impl<'a> !Send for ParseBuffer<'a>",1,["syn::parse::ParseBuffer"]],["impl<'a> !Send for ImplGenerics<'a>",1,["syn::generics::ImplGenerics"]],["impl<'a> !Send for Turbofish<'a>",1,["syn::generics::Turbofish"]],["impl<'a> !Send for TypeGenerics<'a>",1,["syn::generics::TypeGenerics"]],["impl<'a, T> !Send for Iter<'a, T>",1,["syn::punctuated::Iter"]],["impl<'a, T> !Send for IterMut<'a, T>",1,["syn::punctuated::IterMut"]],["impl<'a, T, P> Send for Pairs<'a, T, P>
where\n T: Sync,\n P: Sync,
",1,["syn::punctuated::Pairs"]],["impl<'a, T, P> Send for PairsMut<'a, T, P>
where\n T: Send,\n P: Send,
",1,["syn::punctuated::PairsMut"]],["impl<'c, 'a> !Send for StepCursor<'c, 'a>",1,["syn::parse::StepCursor"]],["impl<T> Send for IntoIter<T>
where\n T: Send,
",1,["syn::punctuated::IntoIter"]],["impl<T, P> Send for Pair<T, P>
where\n T: Send,\n P: Send,
",1,["syn::punctuated::Pair"]],["impl<T, P> Send for IntoPairs<T, P>
where\n T: Send,\n P: Send,
",1,["syn::punctuated::IntoPairs"]],["impl<T, P> Send for Punctuated<T, P>
where\n T: Send,\n P: Send,
",1,["syn::punctuated::Punctuated"]]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/marker/trait.StructuralPartialEq.js b/trait.impl/core/marker/trait.StructuralPartialEq.js new file mode 100644 index 0000000..c0be1a8 --- /dev/null +++ b/trait.impl/core/marker/trait.StructuralPartialEq.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"proc_macro2":[["impl StructuralPartialEq for Delimiter"],["impl StructuralPartialEq for Spacing"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/marker/trait.Sync.js b/trait.impl/core/marker/trait.Sync.js new file mode 100644 index 0000000..f624f5b --- /dev/null +++ b/trait.impl/core/marker/trait.Sync.js @@ -0,0 +1,4 @@ +(function() {var implementors = { +"proc_macro2":[["impl !Sync for TokenTree",1,["proc_macro2::TokenTree"]],["impl !Sync for DelimSpan",1,["proc_macro2::extra::DelimSpan"]],["impl !Sync for Group",1,["proc_macro2::Group"]],["impl !Sync for Ident",1,["proc_macro2::Ident"]],["impl !Sync for LexError",1,["proc_macro2::LexError"]],["impl !Sync for Literal",1,["proc_macro2::Literal"]],["impl !Sync for Punct",1,["proc_macro2::Punct"]],["impl !Sync for Span",1,["proc_macro2::Span"]],["impl !Sync for TokenStream",1,["proc_macro2::TokenStream"]],["impl !Sync for IntoIter",1,["proc_macro2::token_stream::IntoIter"]],["impl Sync for Delimiter",1,["proc_macro2::Delimiter"]],["impl Sync for Spacing",1,["proc_macro2::Spacing"]]], +"syn":[["impl !Sync for AttrStyle",1,["syn::attr::AttrStyle"]],["impl !Sync for BinOp",1,["syn::op::BinOp"]],["impl !Sync for Data",1,["syn::derive::Data"]],["impl !Sync for Expr",1,["syn::expr::Expr"]],["impl !Sync for Fields",1,["syn::data::Fields"]],["impl !Sync for FnArg",1,["syn::item::FnArg"]],["impl !Sync for ForeignItem",1,["syn::item::ForeignItem"]],["impl !Sync for GenericArgument",1,["syn::path::GenericArgument"]],["impl !Sync for GenericParam",1,["syn::generics::GenericParam"]],["impl !Sync for ImplItem",1,["syn::item::ImplItem"]],["impl !Sync for Item",1,["syn::item::Item"]],["impl !Sync for Lit",1,["syn::lit::Lit"]],["impl !Sync for MacroDelimiter",1,["syn::mac::MacroDelimiter"]],["impl !Sync for Member",1,["syn::expr::Member"]],["impl !Sync for Meta",1,["syn::attr::Meta"]],["impl !Sync for Pat",1,["syn::pat::Pat"]],["impl !Sync for PathArguments",1,["syn::path::PathArguments"]],["impl !Sync for RangeLimits",1,["syn::expr::RangeLimits"]],["impl !Sync for ReturnType",1,["syn::ty::ReturnType"]],["impl !Sync for StaticMutability",1,["syn::item::StaticMutability"]],["impl !Sync for Stmt",1,["syn::stmt::Stmt"]],["impl !Sync for TraitBoundModifier",1,["syn::generics::TraitBoundModifier"]],["impl !Sync for TraitItem",1,["syn::item::TraitItem"]],["impl !Sync for Type",1,["syn::ty::Type"]],["impl !Sync for TypeParamBound",1,["syn::generics::TypeParamBound"]],["impl !Sync for UnOp",1,["syn::op::UnOp"]],["impl !Sync for UseTree",1,["syn::item::UseTree"]],["impl !Sync for Visibility",1,["syn::restriction::Visibility"]],["impl !Sync for WherePredicate",1,["syn::generics::WherePredicate"]],["impl !Sync for TokenBuffer",1,["syn::buffer::TokenBuffer"]],["impl !Sync for Abi",1,["syn::ty::Abi"]],["impl !Sync for AngleBracketedGenericArguments",1,["syn::path::AngleBracketedGenericArguments"]],["impl !Sync for Arm",1,["syn::expr::Arm"]],["impl !Sync for AssocConst",1,["syn::path::AssocConst"]],["impl !Sync for AssocType",1,["syn::path::AssocType"]],["impl !Sync for Attribute",1,["syn::attr::Attribute"]],["impl !Sync for BareFnArg",1,["syn::ty::BareFnArg"]],["impl !Sync for BareVariadic",1,["syn::ty::BareVariadic"]],["impl !Sync for Block",1,["syn::stmt::Block"]],["impl !Sync for BoundLifetimes",1,["syn::generics::BoundLifetimes"]],["impl !Sync for ConstParam",1,["syn::generics::ConstParam"]],["impl !Sync for Constraint",1,["syn::path::Constraint"]],["impl !Sync for DataEnum",1,["syn::derive::DataEnum"]],["impl !Sync for DataStruct",1,["syn::derive::DataStruct"]],["impl !Sync for DataUnion",1,["syn::derive::DataUnion"]],["impl !Sync for DeriveInput",1,["syn::derive::DeriveInput"]],["impl !Sync for ExprArray",1,["syn::expr::ExprArray"]],["impl !Sync for ExprAssign",1,["syn::expr::ExprAssign"]],["impl !Sync for ExprAsync",1,["syn::expr::ExprAsync"]],["impl !Sync for ExprAwait",1,["syn::expr::ExprAwait"]],["impl !Sync for ExprBinary",1,["syn::expr::ExprBinary"]],["impl !Sync for ExprBlock",1,["syn::expr::ExprBlock"]],["impl !Sync for ExprBreak",1,["syn::expr::ExprBreak"]],["impl !Sync for ExprCall",1,["syn::expr::ExprCall"]],["impl !Sync for ExprCast",1,["syn::expr::ExprCast"]],["impl !Sync for ExprClosure",1,["syn::expr::ExprClosure"]],["impl !Sync for ExprConst",1,["syn::expr::ExprConst"]],["impl !Sync for ExprContinue",1,["syn::expr::ExprContinue"]],["impl !Sync for ExprField",1,["syn::expr::ExprField"]],["impl !Sync for ExprForLoop",1,["syn::expr::ExprForLoop"]],["impl !Sync for ExprGroup",1,["syn::expr::ExprGroup"]],["impl !Sync for ExprIf",1,["syn::expr::ExprIf"]],["impl !Sync for ExprIndex",1,["syn::expr::ExprIndex"]],["impl !Sync for ExprInfer",1,["syn::expr::ExprInfer"]],["impl !Sync for ExprLet",1,["syn::expr::ExprLet"]],["impl !Sync for ExprLit",1,["syn::expr::ExprLit"]],["impl !Sync for ExprLoop",1,["syn::expr::ExprLoop"]],["impl !Sync for ExprMacro",1,["syn::expr::ExprMacro"]],["impl !Sync for ExprMatch",1,["syn::expr::ExprMatch"]],["impl !Sync for ExprMethodCall",1,["syn::expr::ExprMethodCall"]],["impl !Sync for ExprParen",1,["syn::expr::ExprParen"]],["impl !Sync for ExprPath",1,["syn::expr::ExprPath"]],["impl !Sync for ExprRange",1,["syn::expr::ExprRange"]],["impl !Sync for ExprReference",1,["syn::expr::ExprReference"]],["impl !Sync for ExprRepeat",1,["syn::expr::ExprRepeat"]],["impl !Sync for ExprReturn",1,["syn::expr::ExprReturn"]],["impl !Sync for ExprStruct",1,["syn::expr::ExprStruct"]],["impl !Sync for ExprTry",1,["syn::expr::ExprTry"]],["impl !Sync for ExprTryBlock",1,["syn::expr::ExprTryBlock"]],["impl !Sync for ExprTuple",1,["syn::expr::ExprTuple"]],["impl !Sync for ExprUnary",1,["syn::expr::ExprUnary"]],["impl !Sync for ExprUnsafe",1,["syn::expr::ExprUnsafe"]],["impl !Sync for ExprWhile",1,["syn::expr::ExprWhile"]],["impl !Sync for ExprYield",1,["syn::expr::ExprYield"]],["impl !Sync for Field",1,["syn::data::Field"]],["impl !Sync for FieldPat",1,["syn::pat::FieldPat"]],["impl !Sync for FieldValue",1,["syn::expr::FieldValue"]],["impl !Sync for FieldsNamed",1,["syn::data::FieldsNamed"]],["impl !Sync for FieldsUnnamed",1,["syn::data::FieldsUnnamed"]],["impl !Sync for File",1,["syn::file::File"]],["impl !Sync for ForeignItemFn",1,["syn::item::ForeignItemFn"]],["impl !Sync for ForeignItemMacro",1,["syn::item::ForeignItemMacro"]],["impl !Sync for ForeignItemStatic",1,["syn::item::ForeignItemStatic"]],["impl !Sync for ForeignItemType",1,["syn::item::ForeignItemType"]],["impl !Sync for Generics",1,["syn::generics::Generics"]],["impl !Sync for ImplItemConst",1,["syn::item::ImplItemConst"]],["impl !Sync for ImplItemFn",1,["syn::item::ImplItemFn"]],["impl !Sync for ImplItemMacro",1,["syn::item::ImplItemMacro"]],["impl !Sync for ImplItemType",1,["syn::item::ImplItemType"]],["impl !Sync for Index",1,["syn::expr::Index"]],["impl !Sync for ItemConst",1,["syn::item::ItemConst"]],["impl !Sync for ItemEnum",1,["syn::item::ItemEnum"]],["impl !Sync for ItemExternCrate",1,["syn::item::ItemExternCrate"]],["impl !Sync for ItemFn",1,["syn::item::ItemFn"]],["impl !Sync for ItemForeignMod",1,["syn::item::ItemForeignMod"]],["impl !Sync for ItemImpl",1,["syn::item::ItemImpl"]],["impl !Sync for ItemMacro",1,["syn::item::ItemMacro"]],["impl !Sync for ItemMod",1,["syn::item::ItemMod"]],["impl !Sync for ItemStatic",1,["syn::item::ItemStatic"]],["impl !Sync for ItemStruct",1,["syn::item::ItemStruct"]],["impl !Sync for ItemTrait",1,["syn::item::ItemTrait"]],["impl !Sync for ItemTraitAlias",1,["syn::item::ItemTraitAlias"]],["impl !Sync for ItemType",1,["syn::item::ItemType"]],["impl !Sync for ItemUnion",1,["syn::item::ItemUnion"]],["impl !Sync for ItemUse",1,["syn::item::ItemUse"]],["impl !Sync for Label",1,["syn::expr::Label"]],["impl !Sync for Lifetime",1,["syn::lifetime::Lifetime"]],["impl !Sync for LifetimeParam",1,["syn::generics::LifetimeParam"]],["impl !Sync for LitBool",1,["syn::lit::LitBool"]],["impl !Sync for LitByte",1,["syn::lit::LitByte"]],["impl !Sync for LitByteStr",1,["syn::lit::LitByteStr"]],["impl !Sync for LitCStr",1,["syn::lit::LitCStr"]],["impl !Sync for LitChar",1,["syn::lit::LitChar"]],["impl !Sync for LitFloat",1,["syn::lit::LitFloat"]],["impl !Sync for LitInt",1,["syn::lit::LitInt"]],["impl !Sync for LitStr",1,["syn::lit::LitStr"]],["impl !Sync for Local",1,["syn::stmt::Local"]],["impl !Sync for LocalInit",1,["syn::stmt::LocalInit"]],["impl !Sync for Macro",1,["syn::mac::Macro"]],["impl !Sync for MetaList",1,["syn::attr::MetaList"]],["impl !Sync for MetaNameValue",1,["syn::attr::MetaNameValue"]],["impl !Sync for ParenthesizedGenericArguments",1,["syn::path::ParenthesizedGenericArguments"]],["impl !Sync for PatIdent",1,["syn::pat::PatIdent"]],["impl !Sync for PatOr",1,["syn::pat::PatOr"]],["impl !Sync for PatParen",1,["syn::pat::PatParen"]],["impl !Sync for PatReference",1,["syn::pat::PatReference"]],["impl !Sync for PatRest",1,["syn::pat::PatRest"]],["impl !Sync for PatSlice",1,["syn::pat::PatSlice"]],["impl !Sync for PatStruct",1,["syn::pat::PatStruct"]],["impl !Sync for PatTuple",1,["syn::pat::PatTuple"]],["impl !Sync for PatTupleStruct",1,["syn::pat::PatTupleStruct"]],["impl !Sync for PatType",1,["syn::pat::PatType"]],["impl !Sync for PatWild",1,["syn::pat::PatWild"]],["impl !Sync for Path",1,["syn::path::Path"]],["impl !Sync for PathSegment",1,["syn::path::PathSegment"]],["impl !Sync for PredicateLifetime",1,["syn::generics::PredicateLifetime"]],["impl !Sync for PredicateType",1,["syn::generics::PredicateType"]],["impl !Sync for QSelf",1,["syn::path::QSelf"]],["impl !Sync for Receiver",1,["syn::item::Receiver"]],["impl !Sync for Signature",1,["syn::item::Signature"]],["impl !Sync for StmtMacro",1,["syn::stmt::StmtMacro"]],["impl !Sync for TraitBound",1,["syn::generics::TraitBound"]],["impl !Sync for TraitItemConst",1,["syn::item::TraitItemConst"]],["impl !Sync for TraitItemFn",1,["syn::item::TraitItemFn"]],["impl !Sync for TraitItemMacro",1,["syn::item::TraitItemMacro"]],["impl !Sync for TraitItemType",1,["syn::item::TraitItemType"]],["impl !Sync for TypeArray",1,["syn::ty::TypeArray"]],["impl !Sync for TypeBareFn",1,["syn::ty::TypeBareFn"]],["impl !Sync for TypeGroup",1,["syn::ty::TypeGroup"]],["impl !Sync for TypeImplTrait",1,["syn::ty::TypeImplTrait"]],["impl !Sync for TypeInfer",1,["syn::ty::TypeInfer"]],["impl !Sync for TypeMacro",1,["syn::ty::TypeMacro"]],["impl !Sync for TypeNever",1,["syn::ty::TypeNever"]],["impl !Sync for TypeParam",1,["syn::generics::TypeParam"]],["impl !Sync for TypeParen",1,["syn::ty::TypeParen"]],["impl !Sync for TypePath",1,["syn::ty::TypePath"]],["impl !Sync for TypePtr",1,["syn::ty::TypePtr"]],["impl !Sync for TypeReference",1,["syn::ty::TypeReference"]],["impl !Sync for TypeSlice",1,["syn::ty::TypeSlice"]],["impl !Sync for TypeTraitObject",1,["syn::ty::TypeTraitObject"]],["impl !Sync for TypeTuple",1,["syn::ty::TypeTuple"]],["impl !Sync for UseGlob",1,["syn::item::UseGlob"]],["impl !Sync for UseGroup",1,["syn::item::UseGroup"]],["impl !Sync for UseName",1,["syn::item::UseName"]],["impl !Sync for UsePath",1,["syn::item::UsePath"]],["impl !Sync for UseRename",1,["syn::item::UseRename"]],["impl !Sync for Variadic",1,["syn::item::Variadic"]],["impl !Sync for Variant",1,["syn::data::Variant"]],["impl !Sync for VisRestricted",1,["syn::restriction::VisRestricted"]],["impl !Sync for WhereClause",1,["syn::generics::WhereClause"]],["impl !Sync for Abstract",1,["syn::token::Abstract"]],["impl !Sync for And",1,["syn::token::And"]],["impl !Sync for AndAnd",1,["syn::token::AndAnd"]],["impl !Sync for AndEq",1,["syn::token::AndEq"]],["impl !Sync for As",1,["syn::token::As"]],["impl !Sync for Async",1,["syn::token::Async"]],["impl !Sync for At",1,["syn::token::At"]],["impl !Sync for Auto",1,["syn::token::Auto"]],["impl !Sync for Await",1,["syn::token::Await"]],["impl !Sync for Become",1,["syn::token::Become"]],["impl !Sync for Box",1,["syn::token::Box"]],["impl !Sync for Brace",1,["syn::token::Brace"]],["impl !Sync for Bracket",1,["syn::token::Bracket"]],["impl !Sync for Break",1,["syn::token::Break"]],["impl !Sync for Caret",1,["syn::token::Caret"]],["impl !Sync for CaretEq",1,["syn::token::CaretEq"]],["impl !Sync for Colon",1,["syn::token::Colon"]],["impl !Sync for Comma",1,["syn::token::Comma"]],["impl !Sync for Const",1,["syn::token::Const"]],["impl !Sync for Continue",1,["syn::token::Continue"]],["impl !Sync for Crate",1,["syn::token::Crate"]],["impl !Sync for Default",1,["syn::token::Default"]],["impl !Sync for Do",1,["syn::token::Do"]],["impl !Sync for Dollar",1,["syn::token::Dollar"]],["impl !Sync for Dot",1,["syn::token::Dot"]],["impl !Sync for DotDot",1,["syn::token::DotDot"]],["impl !Sync for DotDotDot",1,["syn::token::DotDotDot"]],["impl !Sync for DotDotEq",1,["syn::token::DotDotEq"]],["impl !Sync for Dyn",1,["syn::token::Dyn"]],["impl !Sync for Else",1,["syn::token::Else"]],["impl !Sync for Enum",1,["syn::token::Enum"]],["impl !Sync for Eq",1,["syn::token::Eq"]],["impl !Sync for EqEq",1,["syn::token::EqEq"]],["impl !Sync for Extern",1,["syn::token::Extern"]],["impl !Sync for FatArrow",1,["syn::token::FatArrow"]],["impl !Sync for Final",1,["syn::token::Final"]],["impl !Sync for Fn",1,["syn::token::Fn"]],["impl !Sync for For",1,["syn::token::For"]],["impl !Sync for Ge",1,["syn::token::Ge"]],["impl !Sync for Group",1,["syn::token::Group"]],["impl !Sync for Gt",1,["syn::token::Gt"]],["impl !Sync for If",1,["syn::token::If"]],["impl !Sync for Impl",1,["syn::token::Impl"]],["impl !Sync for In",1,["syn::token::In"]],["impl !Sync for LArrow",1,["syn::token::LArrow"]],["impl !Sync for Le",1,["syn::token::Le"]],["impl !Sync for Let",1,["syn::token::Let"]],["impl !Sync for Loop",1,["syn::token::Loop"]],["impl !Sync for Lt",1,["syn::token::Lt"]],["impl !Sync for Macro",1,["syn::token::Macro"]],["impl !Sync for Match",1,["syn::token::Match"]],["impl !Sync for Minus",1,["syn::token::Minus"]],["impl !Sync for MinusEq",1,["syn::token::MinusEq"]],["impl !Sync for Mod",1,["syn::token::Mod"]],["impl !Sync for Move",1,["syn::token::Move"]],["impl !Sync for Mut",1,["syn::token::Mut"]],["impl !Sync for Ne",1,["syn::token::Ne"]],["impl !Sync for Not",1,["syn::token::Not"]],["impl !Sync for Or",1,["syn::token::Or"]],["impl !Sync for OrEq",1,["syn::token::OrEq"]],["impl !Sync for OrOr",1,["syn::token::OrOr"]],["impl !Sync for Override",1,["syn::token::Override"]],["impl !Sync for Paren",1,["syn::token::Paren"]],["impl !Sync for PathSep",1,["syn::token::PathSep"]],["impl !Sync for Percent",1,["syn::token::Percent"]],["impl !Sync for PercentEq",1,["syn::token::PercentEq"]],["impl !Sync for Plus",1,["syn::token::Plus"]],["impl !Sync for PlusEq",1,["syn::token::PlusEq"]],["impl !Sync for Pound",1,["syn::token::Pound"]],["impl !Sync for Priv",1,["syn::token::Priv"]],["impl !Sync for Pub",1,["syn::token::Pub"]],["impl !Sync for Question",1,["syn::token::Question"]],["impl !Sync for RArrow",1,["syn::token::RArrow"]],["impl !Sync for Ref",1,["syn::token::Ref"]],["impl !Sync for Return",1,["syn::token::Return"]],["impl !Sync for SelfType",1,["syn::token::SelfType"]],["impl !Sync for SelfValue",1,["syn::token::SelfValue"]],["impl !Sync for Semi",1,["syn::token::Semi"]],["impl !Sync for Shl",1,["syn::token::Shl"]],["impl !Sync for ShlEq",1,["syn::token::ShlEq"]],["impl !Sync for Shr",1,["syn::token::Shr"]],["impl !Sync for ShrEq",1,["syn::token::ShrEq"]],["impl !Sync for Slash",1,["syn::token::Slash"]],["impl !Sync for SlashEq",1,["syn::token::SlashEq"]],["impl !Sync for Star",1,["syn::token::Star"]],["impl !Sync for StarEq",1,["syn::token::StarEq"]],["impl !Sync for Static",1,["syn::token::Static"]],["impl !Sync for Struct",1,["syn::token::Struct"]],["impl !Sync for Super",1,["syn::token::Super"]],["impl !Sync for Tilde",1,["syn::token::Tilde"]],["impl !Sync for Trait",1,["syn::token::Trait"]],["impl !Sync for Try",1,["syn::token::Try"]],["impl !Sync for Type",1,["syn::token::Type"]],["impl !Sync for Typeof",1,["syn::token::Typeof"]],["impl !Sync for Underscore",1,["syn::token::Underscore"]],["impl !Sync for Union",1,["syn::token::Union"]],["impl !Sync for Unsafe",1,["syn::token::Unsafe"]],["impl !Sync for Unsized",1,["syn::token::Unsized"]],["impl !Sync for Use",1,["syn::token::Use"]],["impl !Sync for Virtual",1,["syn::token::Virtual"]],["impl !Sync for Where",1,["syn::token::Where"]],["impl !Sync for While",1,["syn::token::While"]],["impl !Sync for Yield",1,["syn::token::Yield"]],["impl Sync for FieldMutability",1,["syn::restriction::FieldMutability"]],["impl Sync for ImplRestriction",1,["syn::item::ImplRestriction"]],["impl Sync for Error",1,["syn::error::Error"]],["impl Sync for Nothing",1,["syn::parse::Nothing"]],["impl<'a> !Sync for Cursor<'a>",1,["syn::buffer::Cursor"]],["impl<'a> !Sync for ParseNestedMeta<'a>",1,["syn::meta::ParseNestedMeta"]],["impl<'a> !Sync for Lookahead1<'a>",1,["syn::lookahead::Lookahead1"]],["impl<'a> !Sync for ParseBuffer<'a>",1,["syn::parse::ParseBuffer"]],["impl<'a> !Sync for ImplGenerics<'a>",1,["syn::generics::ImplGenerics"]],["impl<'a> !Sync for Turbofish<'a>",1,["syn::generics::Turbofish"]],["impl<'a> !Sync for TypeGenerics<'a>",1,["syn::generics::TypeGenerics"]],["impl<'a, T> !Sync for Iter<'a, T>",1,["syn::punctuated::Iter"]],["impl<'a, T> !Sync for IterMut<'a, T>",1,["syn::punctuated::IterMut"]],["impl<'a, T, P> Sync for Pairs<'a, T, P>
where\n T: Sync,\n P: Sync,
",1,["syn::punctuated::Pairs"]],["impl<'a, T, P> Sync for PairsMut<'a, T, P>
where\n T: Sync,\n P: Sync,
",1,["syn::punctuated::PairsMut"]],["impl<'c, 'a> !Sync for StepCursor<'c, 'a>",1,["syn::parse::StepCursor"]],["impl<T> Sync for IntoIter<T>
where\n T: Sync,
",1,["syn::punctuated::IntoIter"]],["impl<T, P> Sync for Pair<T, P>
where\n T: Sync,\n P: Sync,
",1,["syn::punctuated::Pair"]],["impl<T, P> Sync for IntoPairs<T, P>
where\n T: Sync,\n P: Sync,
",1,["syn::punctuated::IntoPairs"]],["impl<T, P> Sync for Punctuated<T, P>
where\n T: Sync,\n P: Sync,
",1,["syn::punctuated::Punctuated"]]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/marker/trait.Unpin.js b/trait.impl/core/marker/trait.Unpin.js new file mode 100644 index 0000000..406c071 --- /dev/null +++ b/trait.impl/core/marker/trait.Unpin.js @@ -0,0 +1,4 @@ +(function() {var implementors = { +"proc_macro2":[["impl Unpin for Delimiter",1,["proc_macro2::Delimiter"]],["impl Unpin for Spacing",1,["proc_macro2::Spacing"]],["impl Unpin for TokenTree",1,["proc_macro2::TokenTree"]],["impl Unpin for DelimSpan",1,["proc_macro2::extra::DelimSpan"]],["impl Unpin for Group",1,["proc_macro2::Group"]],["impl Unpin for Ident",1,["proc_macro2::Ident"]],["impl Unpin for LexError",1,["proc_macro2::LexError"]],["impl Unpin for Literal",1,["proc_macro2::Literal"]],["impl Unpin for Punct",1,["proc_macro2::Punct"]],["impl Unpin for Span",1,["proc_macro2::Span"]],["impl Unpin for TokenStream",1,["proc_macro2::TokenStream"]],["impl Unpin for IntoIter",1,["proc_macro2::token_stream::IntoIter"]]], +"syn":[["impl Unpin for AttrStyle",1,["syn::attr::AttrStyle"]],["impl Unpin for BinOp",1,["syn::op::BinOp"]],["impl Unpin for Data",1,["syn::derive::Data"]],["impl Unpin for Expr",1,["syn::expr::Expr"]],["impl Unpin for FieldMutability",1,["syn::restriction::FieldMutability"]],["impl Unpin for Fields",1,["syn::data::Fields"]],["impl Unpin for FnArg",1,["syn::item::FnArg"]],["impl Unpin for ForeignItem",1,["syn::item::ForeignItem"]],["impl Unpin for GenericArgument",1,["syn::path::GenericArgument"]],["impl Unpin for GenericParam",1,["syn::generics::GenericParam"]],["impl Unpin for ImplItem",1,["syn::item::ImplItem"]],["impl Unpin for ImplRestriction",1,["syn::item::ImplRestriction"]],["impl Unpin for Item",1,["syn::item::Item"]],["impl Unpin for Lit",1,["syn::lit::Lit"]],["impl Unpin for MacroDelimiter",1,["syn::mac::MacroDelimiter"]],["impl Unpin for Member",1,["syn::expr::Member"]],["impl Unpin for Meta",1,["syn::attr::Meta"]],["impl Unpin for Pat",1,["syn::pat::Pat"]],["impl Unpin for PathArguments",1,["syn::path::PathArguments"]],["impl Unpin for RangeLimits",1,["syn::expr::RangeLimits"]],["impl Unpin for ReturnType",1,["syn::ty::ReturnType"]],["impl Unpin for StaticMutability",1,["syn::item::StaticMutability"]],["impl Unpin for Stmt",1,["syn::stmt::Stmt"]],["impl Unpin for TraitBoundModifier",1,["syn::generics::TraitBoundModifier"]],["impl Unpin for TraitItem",1,["syn::item::TraitItem"]],["impl Unpin for Type",1,["syn::ty::Type"]],["impl Unpin for TypeParamBound",1,["syn::generics::TypeParamBound"]],["impl Unpin for UnOp",1,["syn::op::UnOp"]],["impl Unpin for UseTree",1,["syn::item::UseTree"]],["impl Unpin for Visibility",1,["syn::restriction::Visibility"]],["impl Unpin for WherePredicate",1,["syn::generics::WherePredicate"]],["impl Unpin for TokenBuffer",1,["syn::buffer::TokenBuffer"]],["impl Unpin for Error",1,["syn::error::Error"]],["impl Unpin for Nothing",1,["syn::parse::Nothing"]],["impl Unpin for Abi",1,["syn::ty::Abi"]],["impl Unpin for AngleBracketedGenericArguments",1,["syn::path::AngleBracketedGenericArguments"]],["impl Unpin for Arm",1,["syn::expr::Arm"]],["impl Unpin for AssocConst",1,["syn::path::AssocConst"]],["impl Unpin for AssocType",1,["syn::path::AssocType"]],["impl Unpin for Attribute",1,["syn::attr::Attribute"]],["impl Unpin for BareFnArg",1,["syn::ty::BareFnArg"]],["impl Unpin for BareVariadic",1,["syn::ty::BareVariadic"]],["impl Unpin for Block",1,["syn::stmt::Block"]],["impl Unpin for BoundLifetimes",1,["syn::generics::BoundLifetimes"]],["impl Unpin for ConstParam",1,["syn::generics::ConstParam"]],["impl Unpin for Constraint",1,["syn::path::Constraint"]],["impl Unpin for DataEnum",1,["syn::derive::DataEnum"]],["impl Unpin for DataStruct",1,["syn::derive::DataStruct"]],["impl Unpin for DataUnion",1,["syn::derive::DataUnion"]],["impl Unpin for DeriveInput",1,["syn::derive::DeriveInput"]],["impl Unpin for ExprArray",1,["syn::expr::ExprArray"]],["impl Unpin for ExprAssign",1,["syn::expr::ExprAssign"]],["impl Unpin for ExprAsync",1,["syn::expr::ExprAsync"]],["impl Unpin for ExprAwait",1,["syn::expr::ExprAwait"]],["impl Unpin for ExprBinary",1,["syn::expr::ExprBinary"]],["impl Unpin for ExprBlock",1,["syn::expr::ExprBlock"]],["impl Unpin for ExprBreak",1,["syn::expr::ExprBreak"]],["impl Unpin for ExprCall",1,["syn::expr::ExprCall"]],["impl Unpin for ExprCast",1,["syn::expr::ExprCast"]],["impl Unpin for ExprClosure",1,["syn::expr::ExprClosure"]],["impl Unpin for ExprConst",1,["syn::expr::ExprConst"]],["impl Unpin for ExprContinue",1,["syn::expr::ExprContinue"]],["impl Unpin for ExprField",1,["syn::expr::ExprField"]],["impl Unpin for ExprForLoop",1,["syn::expr::ExprForLoop"]],["impl Unpin for ExprGroup",1,["syn::expr::ExprGroup"]],["impl Unpin for ExprIf",1,["syn::expr::ExprIf"]],["impl Unpin for ExprIndex",1,["syn::expr::ExprIndex"]],["impl Unpin for ExprInfer",1,["syn::expr::ExprInfer"]],["impl Unpin for ExprLet",1,["syn::expr::ExprLet"]],["impl Unpin for ExprLit",1,["syn::expr::ExprLit"]],["impl Unpin for ExprLoop",1,["syn::expr::ExprLoop"]],["impl Unpin for ExprMacro",1,["syn::expr::ExprMacro"]],["impl Unpin for ExprMatch",1,["syn::expr::ExprMatch"]],["impl Unpin for ExprMethodCall",1,["syn::expr::ExprMethodCall"]],["impl Unpin for ExprParen",1,["syn::expr::ExprParen"]],["impl Unpin for ExprPath",1,["syn::expr::ExprPath"]],["impl Unpin for ExprRange",1,["syn::expr::ExprRange"]],["impl Unpin for ExprReference",1,["syn::expr::ExprReference"]],["impl Unpin for ExprRepeat",1,["syn::expr::ExprRepeat"]],["impl Unpin for ExprReturn",1,["syn::expr::ExprReturn"]],["impl Unpin for ExprStruct",1,["syn::expr::ExprStruct"]],["impl Unpin for ExprTry",1,["syn::expr::ExprTry"]],["impl Unpin for ExprTryBlock",1,["syn::expr::ExprTryBlock"]],["impl Unpin for ExprTuple",1,["syn::expr::ExprTuple"]],["impl Unpin for ExprUnary",1,["syn::expr::ExprUnary"]],["impl Unpin for ExprUnsafe",1,["syn::expr::ExprUnsafe"]],["impl Unpin for ExprWhile",1,["syn::expr::ExprWhile"]],["impl Unpin for ExprYield",1,["syn::expr::ExprYield"]],["impl Unpin for Field",1,["syn::data::Field"]],["impl Unpin for FieldPat",1,["syn::pat::FieldPat"]],["impl Unpin for FieldValue",1,["syn::expr::FieldValue"]],["impl Unpin for FieldsNamed",1,["syn::data::FieldsNamed"]],["impl Unpin for FieldsUnnamed",1,["syn::data::FieldsUnnamed"]],["impl Unpin for File",1,["syn::file::File"]],["impl Unpin for ForeignItemFn",1,["syn::item::ForeignItemFn"]],["impl Unpin for ForeignItemMacro",1,["syn::item::ForeignItemMacro"]],["impl Unpin for ForeignItemStatic",1,["syn::item::ForeignItemStatic"]],["impl Unpin for ForeignItemType",1,["syn::item::ForeignItemType"]],["impl Unpin for Generics",1,["syn::generics::Generics"]],["impl Unpin for ImplItemConst",1,["syn::item::ImplItemConst"]],["impl Unpin for ImplItemFn",1,["syn::item::ImplItemFn"]],["impl Unpin for ImplItemMacro",1,["syn::item::ImplItemMacro"]],["impl Unpin for ImplItemType",1,["syn::item::ImplItemType"]],["impl Unpin for Index",1,["syn::expr::Index"]],["impl Unpin for ItemConst",1,["syn::item::ItemConst"]],["impl Unpin for ItemEnum",1,["syn::item::ItemEnum"]],["impl Unpin for ItemExternCrate",1,["syn::item::ItemExternCrate"]],["impl Unpin for ItemFn",1,["syn::item::ItemFn"]],["impl Unpin for ItemForeignMod",1,["syn::item::ItemForeignMod"]],["impl Unpin for ItemImpl",1,["syn::item::ItemImpl"]],["impl Unpin for ItemMacro",1,["syn::item::ItemMacro"]],["impl Unpin for ItemMod",1,["syn::item::ItemMod"]],["impl Unpin for ItemStatic",1,["syn::item::ItemStatic"]],["impl Unpin for ItemStruct",1,["syn::item::ItemStruct"]],["impl Unpin for ItemTrait",1,["syn::item::ItemTrait"]],["impl Unpin for ItemTraitAlias",1,["syn::item::ItemTraitAlias"]],["impl Unpin for ItemType",1,["syn::item::ItemType"]],["impl Unpin for ItemUnion",1,["syn::item::ItemUnion"]],["impl Unpin for ItemUse",1,["syn::item::ItemUse"]],["impl Unpin for Label",1,["syn::expr::Label"]],["impl Unpin for Lifetime",1,["syn::lifetime::Lifetime"]],["impl Unpin for LifetimeParam",1,["syn::generics::LifetimeParam"]],["impl Unpin for LitBool",1,["syn::lit::LitBool"]],["impl Unpin for LitByte",1,["syn::lit::LitByte"]],["impl Unpin for LitByteStr",1,["syn::lit::LitByteStr"]],["impl Unpin for LitCStr",1,["syn::lit::LitCStr"]],["impl Unpin for LitChar",1,["syn::lit::LitChar"]],["impl Unpin for LitFloat",1,["syn::lit::LitFloat"]],["impl Unpin for LitInt",1,["syn::lit::LitInt"]],["impl Unpin for LitStr",1,["syn::lit::LitStr"]],["impl Unpin for Local",1,["syn::stmt::Local"]],["impl Unpin for LocalInit",1,["syn::stmt::LocalInit"]],["impl Unpin for Macro",1,["syn::mac::Macro"]],["impl Unpin for MetaList",1,["syn::attr::MetaList"]],["impl Unpin for MetaNameValue",1,["syn::attr::MetaNameValue"]],["impl Unpin for ParenthesizedGenericArguments",1,["syn::path::ParenthesizedGenericArguments"]],["impl Unpin for PatIdent",1,["syn::pat::PatIdent"]],["impl Unpin for PatOr",1,["syn::pat::PatOr"]],["impl Unpin for PatParen",1,["syn::pat::PatParen"]],["impl Unpin for PatReference",1,["syn::pat::PatReference"]],["impl Unpin for PatRest",1,["syn::pat::PatRest"]],["impl Unpin for PatSlice",1,["syn::pat::PatSlice"]],["impl Unpin for PatStruct",1,["syn::pat::PatStruct"]],["impl Unpin for PatTuple",1,["syn::pat::PatTuple"]],["impl Unpin for PatTupleStruct",1,["syn::pat::PatTupleStruct"]],["impl Unpin for PatType",1,["syn::pat::PatType"]],["impl Unpin for PatWild",1,["syn::pat::PatWild"]],["impl Unpin for Path",1,["syn::path::Path"]],["impl Unpin for PathSegment",1,["syn::path::PathSegment"]],["impl Unpin for PredicateLifetime",1,["syn::generics::PredicateLifetime"]],["impl Unpin for PredicateType",1,["syn::generics::PredicateType"]],["impl Unpin for QSelf",1,["syn::path::QSelf"]],["impl Unpin for Receiver",1,["syn::item::Receiver"]],["impl Unpin for Signature",1,["syn::item::Signature"]],["impl Unpin for StmtMacro",1,["syn::stmt::StmtMacro"]],["impl Unpin for TraitBound",1,["syn::generics::TraitBound"]],["impl Unpin for TraitItemConst",1,["syn::item::TraitItemConst"]],["impl Unpin for TraitItemFn",1,["syn::item::TraitItemFn"]],["impl Unpin for TraitItemMacro",1,["syn::item::TraitItemMacro"]],["impl Unpin for TraitItemType",1,["syn::item::TraitItemType"]],["impl Unpin for TypeArray",1,["syn::ty::TypeArray"]],["impl Unpin for TypeBareFn",1,["syn::ty::TypeBareFn"]],["impl Unpin for TypeGroup",1,["syn::ty::TypeGroup"]],["impl Unpin for TypeImplTrait",1,["syn::ty::TypeImplTrait"]],["impl Unpin for TypeInfer",1,["syn::ty::TypeInfer"]],["impl Unpin for TypeMacro",1,["syn::ty::TypeMacro"]],["impl Unpin for TypeNever",1,["syn::ty::TypeNever"]],["impl Unpin for TypeParam",1,["syn::generics::TypeParam"]],["impl Unpin for TypeParen",1,["syn::ty::TypeParen"]],["impl Unpin for TypePath",1,["syn::ty::TypePath"]],["impl Unpin for TypePtr",1,["syn::ty::TypePtr"]],["impl Unpin for TypeReference",1,["syn::ty::TypeReference"]],["impl Unpin for TypeSlice",1,["syn::ty::TypeSlice"]],["impl Unpin for TypeTraitObject",1,["syn::ty::TypeTraitObject"]],["impl Unpin for TypeTuple",1,["syn::ty::TypeTuple"]],["impl Unpin for UseGlob",1,["syn::item::UseGlob"]],["impl Unpin for UseGroup",1,["syn::item::UseGroup"]],["impl Unpin for UseName",1,["syn::item::UseName"]],["impl Unpin for UsePath",1,["syn::item::UsePath"]],["impl Unpin for UseRename",1,["syn::item::UseRename"]],["impl Unpin for Variadic",1,["syn::item::Variadic"]],["impl Unpin for Variant",1,["syn::data::Variant"]],["impl Unpin for VisRestricted",1,["syn::restriction::VisRestricted"]],["impl Unpin for WhereClause",1,["syn::generics::WhereClause"]],["impl Unpin for Abstract",1,["syn::token::Abstract"]],["impl Unpin for And",1,["syn::token::And"]],["impl Unpin for AndAnd",1,["syn::token::AndAnd"]],["impl Unpin for AndEq",1,["syn::token::AndEq"]],["impl Unpin for As",1,["syn::token::As"]],["impl Unpin for Async",1,["syn::token::Async"]],["impl Unpin for At",1,["syn::token::At"]],["impl Unpin for Auto",1,["syn::token::Auto"]],["impl Unpin for Await",1,["syn::token::Await"]],["impl Unpin for Become",1,["syn::token::Become"]],["impl Unpin for Box",1,["syn::token::Box"]],["impl Unpin for Brace",1,["syn::token::Brace"]],["impl Unpin for Bracket",1,["syn::token::Bracket"]],["impl Unpin for Break",1,["syn::token::Break"]],["impl Unpin for Caret",1,["syn::token::Caret"]],["impl Unpin for CaretEq",1,["syn::token::CaretEq"]],["impl Unpin for Colon",1,["syn::token::Colon"]],["impl Unpin for Comma",1,["syn::token::Comma"]],["impl Unpin for Const",1,["syn::token::Const"]],["impl Unpin for Continue",1,["syn::token::Continue"]],["impl Unpin for Crate",1,["syn::token::Crate"]],["impl Unpin for Default",1,["syn::token::Default"]],["impl Unpin for Do",1,["syn::token::Do"]],["impl Unpin for Dollar",1,["syn::token::Dollar"]],["impl Unpin for Dot",1,["syn::token::Dot"]],["impl Unpin for DotDot",1,["syn::token::DotDot"]],["impl Unpin for DotDotDot",1,["syn::token::DotDotDot"]],["impl Unpin for DotDotEq",1,["syn::token::DotDotEq"]],["impl Unpin for Dyn",1,["syn::token::Dyn"]],["impl Unpin for Else",1,["syn::token::Else"]],["impl Unpin for Enum",1,["syn::token::Enum"]],["impl Unpin for Eq",1,["syn::token::Eq"]],["impl Unpin for EqEq",1,["syn::token::EqEq"]],["impl Unpin for Extern",1,["syn::token::Extern"]],["impl Unpin for FatArrow",1,["syn::token::FatArrow"]],["impl Unpin for Final",1,["syn::token::Final"]],["impl Unpin for Fn",1,["syn::token::Fn"]],["impl Unpin for For",1,["syn::token::For"]],["impl Unpin for Ge",1,["syn::token::Ge"]],["impl Unpin for Group",1,["syn::token::Group"]],["impl Unpin for Gt",1,["syn::token::Gt"]],["impl Unpin for If",1,["syn::token::If"]],["impl Unpin for Impl",1,["syn::token::Impl"]],["impl Unpin for In",1,["syn::token::In"]],["impl Unpin for LArrow",1,["syn::token::LArrow"]],["impl Unpin for Le",1,["syn::token::Le"]],["impl Unpin for Let",1,["syn::token::Let"]],["impl Unpin for Loop",1,["syn::token::Loop"]],["impl Unpin for Lt",1,["syn::token::Lt"]],["impl Unpin for Macro",1,["syn::token::Macro"]],["impl Unpin for Match",1,["syn::token::Match"]],["impl Unpin for Minus",1,["syn::token::Minus"]],["impl Unpin for MinusEq",1,["syn::token::MinusEq"]],["impl Unpin for Mod",1,["syn::token::Mod"]],["impl Unpin for Move",1,["syn::token::Move"]],["impl Unpin for Mut",1,["syn::token::Mut"]],["impl Unpin for Ne",1,["syn::token::Ne"]],["impl Unpin for Not",1,["syn::token::Not"]],["impl Unpin for Or",1,["syn::token::Or"]],["impl Unpin for OrEq",1,["syn::token::OrEq"]],["impl Unpin for OrOr",1,["syn::token::OrOr"]],["impl Unpin for Override",1,["syn::token::Override"]],["impl Unpin for Paren",1,["syn::token::Paren"]],["impl Unpin for PathSep",1,["syn::token::PathSep"]],["impl Unpin for Percent",1,["syn::token::Percent"]],["impl Unpin for PercentEq",1,["syn::token::PercentEq"]],["impl Unpin for Plus",1,["syn::token::Plus"]],["impl Unpin for PlusEq",1,["syn::token::PlusEq"]],["impl Unpin for Pound",1,["syn::token::Pound"]],["impl Unpin for Priv",1,["syn::token::Priv"]],["impl Unpin for Pub",1,["syn::token::Pub"]],["impl Unpin for Question",1,["syn::token::Question"]],["impl Unpin for RArrow",1,["syn::token::RArrow"]],["impl Unpin for Ref",1,["syn::token::Ref"]],["impl Unpin for Return",1,["syn::token::Return"]],["impl Unpin for SelfType",1,["syn::token::SelfType"]],["impl Unpin for SelfValue",1,["syn::token::SelfValue"]],["impl Unpin for Semi",1,["syn::token::Semi"]],["impl Unpin for Shl",1,["syn::token::Shl"]],["impl Unpin for ShlEq",1,["syn::token::ShlEq"]],["impl Unpin for Shr",1,["syn::token::Shr"]],["impl Unpin for ShrEq",1,["syn::token::ShrEq"]],["impl Unpin for Slash",1,["syn::token::Slash"]],["impl Unpin for SlashEq",1,["syn::token::SlashEq"]],["impl Unpin for Star",1,["syn::token::Star"]],["impl Unpin for StarEq",1,["syn::token::StarEq"]],["impl Unpin for Static",1,["syn::token::Static"]],["impl Unpin for Struct",1,["syn::token::Struct"]],["impl Unpin for Super",1,["syn::token::Super"]],["impl Unpin for Tilde",1,["syn::token::Tilde"]],["impl Unpin for Trait",1,["syn::token::Trait"]],["impl Unpin for Try",1,["syn::token::Try"]],["impl Unpin for Type",1,["syn::token::Type"]],["impl Unpin for Typeof",1,["syn::token::Typeof"]],["impl Unpin for Underscore",1,["syn::token::Underscore"]],["impl Unpin for Union",1,["syn::token::Union"]],["impl Unpin for Unsafe",1,["syn::token::Unsafe"]],["impl Unpin for Unsized",1,["syn::token::Unsized"]],["impl Unpin for Use",1,["syn::token::Use"]],["impl Unpin for Virtual",1,["syn::token::Virtual"]],["impl Unpin for Where",1,["syn::token::Where"]],["impl Unpin for While",1,["syn::token::While"]],["impl Unpin for Yield",1,["syn::token::Yield"]],["impl<'a> Unpin for Cursor<'a>",1,["syn::buffer::Cursor"]],["impl<'a> Unpin for ParseNestedMeta<'a>",1,["syn::meta::ParseNestedMeta"]],["impl<'a> Unpin for Lookahead1<'a>",1,["syn::lookahead::Lookahead1"]],["impl<'a> Unpin for ParseBuffer<'a>",1,["syn::parse::ParseBuffer"]],["impl<'a> Unpin for ImplGenerics<'a>",1,["syn::generics::ImplGenerics"]],["impl<'a> Unpin for Turbofish<'a>",1,["syn::generics::Turbofish"]],["impl<'a> Unpin for TypeGenerics<'a>",1,["syn::generics::TypeGenerics"]],["impl<'a, T> Unpin for Iter<'a, T>",1,["syn::punctuated::Iter"]],["impl<'a, T> Unpin for IterMut<'a, T>",1,["syn::punctuated::IterMut"]],["impl<'a, T, P> Unpin for Pairs<'a, T, P>",1,["syn::punctuated::Pairs"]],["impl<'a, T, P> Unpin for PairsMut<'a, T, P>",1,["syn::punctuated::PairsMut"]],["impl<'c, 'a> Unpin for StepCursor<'c, 'a>",1,["syn::parse::StepCursor"]],["impl<T> Unpin for IntoIter<T>
where\n T: Unpin,
",1,["syn::punctuated::IntoIter"]],["impl<T, P> Unpin for Pair<T, P>
where\n T: Unpin,\n P: Unpin,
",1,["syn::punctuated::Pair"]],["impl<T, P> Unpin for IntoPairs<T, P>
where\n T: Unpin,\n P: Unpin,
",1,["syn::punctuated::IntoPairs"]],["impl<T, P> Unpin for Punctuated<T, P>
where\n T: Unpin,\n P: Unpin,
",1,["syn::punctuated::Punctuated"]]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/ops/deref/trait.Deref.js b/trait.impl/core/ops/deref/trait.Deref.js new file mode 100644 index 0000000..7fc1b9b --- /dev/null +++ b/trait.impl/core/ops/deref/trait.Deref.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"syn":[["impl Deref for And"],["impl Deref for At"],["impl Deref for Caret"],["impl Deref for Colon"],["impl Deref for Comma"],["impl Deref for Dollar"],["impl Deref for Dot"],["impl Deref for Eq"],["impl Deref for Gt"],["impl Deref for Lt"],["impl Deref for Minus"],["impl Deref for Not"],["impl Deref for Or"],["impl Deref for Percent"],["impl Deref for Plus"],["impl Deref for Pound"],["impl Deref for Question"],["impl Deref for Semi"],["impl Deref for Slash"],["impl Deref for Star"],["impl Deref for Tilde"],["impl Deref for Underscore"],["impl<'c, 'a> Deref for StepCursor<'c, 'a>"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/ops/deref/trait.DerefMut.js b/trait.impl/core/ops/deref/trait.DerefMut.js new file mode 100644 index 0000000..2f2b706 --- /dev/null +++ b/trait.impl/core/ops/deref/trait.DerefMut.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"syn":[["impl DerefMut for And"],["impl DerefMut for At"],["impl DerefMut for Caret"],["impl DerefMut for Colon"],["impl DerefMut for Comma"],["impl DerefMut for Dollar"],["impl DerefMut for Dot"],["impl DerefMut for Eq"],["impl DerefMut for Gt"],["impl DerefMut for Lt"],["impl DerefMut for Minus"],["impl DerefMut for Not"],["impl DerefMut for Or"],["impl DerefMut for Percent"],["impl DerefMut for Plus"],["impl DerefMut for Pound"],["impl DerefMut for Question"],["impl DerefMut for Semi"],["impl DerefMut for Slash"],["impl DerefMut for Star"],["impl DerefMut for Tilde"],["impl DerefMut for Underscore"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/ops/drop/trait.Drop.js b/trait.impl/core/ops/drop/trait.Drop.js new file mode 100644 index 0000000..7edad7a --- /dev/null +++ b/trait.impl/core/ops/drop/trait.Drop.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"syn":[["impl<'a> Drop for ParseBuffer<'a>"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/ops/index/trait.Index.js b/trait.impl/core/ops/index/trait.Index.js new file mode 100644 index 0000000..4228dd5 --- /dev/null +++ b/trait.impl/core/ops/index/trait.Index.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"syn":[["impl<T, P> Index<usize> for Punctuated<T, P>"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/ops/index/trait.IndexMut.js b/trait.impl/core/ops/index/trait.IndexMut.js new file mode 100644 index 0000000..6dea115 --- /dev/null +++ b/trait.impl/core/ops/index/trait.IndexMut.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"syn":[["impl<T, P> IndexMut<usize> for Punctuated<T, P>"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/panic/unwind_safe/trait.RefUnwindSafe.js b/trait.impl/core/panic/unwind_safe/trait.RefUnwindSafe.js new file mode 100644 index 0000000..e61fb60 --- /dev/null +++ b/trait.impl/core/panic/unwind_safe/trait.RefUnwindSafe.js @@ -0,0 +1,4 @@ +(function() {var implementors = { +"proc_macro2":[["impl RefUnwindSafe for Delimiter",1,["proc_macro2::Delimiter"]],["impl RefUnwindSafe for Spacing",1,["proc_macro2::Spacing"]],["impl RefUnwindSafe for TokenTree",1,["proc_macro2::TokenTree"]],["impl RefUnwindSafe for DelimSpan",1,["proc_macro2::extra::DelimSpan"]],["impl RefUnwindSafe for Group",1,["proc_macro2::Group"]],["impl RefUnwindSafe for Ident",1,["proc_macro2::Ident"]],["impl RefUnwindSafe for LexError",1,["proc_macro2::LexError"]],["impl RefUnwindSafe for Literal",1,["proc_macro2::Literal"]],["impl RefUnwindSafe for Punct",1,["proc_macro2::Punct"]],["impl RefUnwindSafe for Span",1,["proc_macro2::Span"]],["impl RefUnwindSafe for TokenStream",1,["proc_macro2::TokenStream"]],["impl RefUnwindSafe for IntoIter",1,["proc_macro2::token_stream::IntoIter"]]], +"syn":[["impl RefUnwindSafe for AttrStyle",1,["syn::attr::AttrStyle"]],["impl RefUnwindSafe for BinOp",1,["syn::op::BinOp"]],["impl RefUnwindSafe for Data",1,["syn::derive::Data"]],["impl RefUnwindSafe for Expr",1,["syn::expr::Expr"]],["impl RefUnwindSafe for FieldMutability",1,["syn::restriction::FieldMutability"]],["impl RefUnwindSafe for Fields",1,["syn::data::Fields"]],["impl RefUnwindSafe for FnArg",1,["syn::item::FnArg"]],["impl RefUnwindSafe for ForeignItem",1,["syn::item::ForeignItem"]],["impl RefUnwindSafe for GenericArgument",1,["syn::path::GenericArgument"]],["impl RefUnwindSafe for GenericParam",1,["syn::generics::GenericParam"]],["impl RefUnwindSafe for ImplItem",1,["syn::item::ImplItem"]],["impl RefUnwindSafe for ImplRestriction",1,["syn::item::ImplRestriction"]],["impl RefUnwindSafe for Item",1,["syn::item::Item"]],["impl RefUnwindSafe for Lit",1,["syn::lit::Lit"]],["impl RefUnwindSafe for MacroDelimiter",1,["syn::mac::MacroDelimiter"]],["impl RefUnwindSafe for Member",1,["syn::expr::Member"]],["impl RefUnwindSafe for Meta",1,["syn::attr::Meta"]],["impl RefUnwindSafe for Pat",1,["syn::pat::Pat"]],["impl RefUnwindSafe for PathArguments",1,["syn::path::PathArguments"]],["impl RefUnwindSafe for RangeLimits",1,["syn::expr::RangeLimits"]],["impl RefUnwindSafe for ReturnType",1,["syn::ty::ReturnType"]],["impl RefUnwindSafe for StaticMutability",1,["syn::item::StaticMutability"]],["impl RefUnwindSafe for Stmt",1,["syn::stmt::Stmt"]],["impl RefUnwindSafe for TraitBoundModifier",1,["syn::generics::TraitBoundModifier"]],["impl RefUnwindSafe for TraitItem",1,["syn::item::TraitItem"]],["impl RefUnwindSafe for Type",1,["syn::ty::Type"]],["impl RefUnwindSafe for TypeParamBound",1,["syn::generics::TypeParamBound"]],["impl RefUnwindSafe for UnOp",1,["syn::op::UnOp"]],["impl RefUnwindSafe for UseTree",1,["syn::item::UseTree"]],["impl RefUnwindSafe for Visibility",1,["syn::restriction::Visibility"]],["impl RefUnwindSafe for WherePredicate",1,["syn::generics::WherePredicate"]],["impl RefUnwindSafe for TokenBuffer",1,["syn::buffer::TokenBuffer"]],["impl RefUnwindSafe for Error",1,["syn::error::Error"]],["impl RefUnwindSafe for Nothing",1,["syn::parse::Nothing"]],["impl RefUnwindSafe for Abi",1,["syn::ty::Abi"]],["impl RefUnwindSafe for AngleBracketedGenericArguments",1,["syn::path::AngleBracketedGenericArguments"]],["impl RefUnwindSafe for Arm",1,["syn::expr::Arm"]],["impl RefUnwindSafe for AssocConst",1,["syn::path::AssocConst"]],["impl RefUnwindSafe for AssocType",1,["syn::path::AssocType"]],["impl RefUnwindSafe for Attribute",1,["syn::attr::Attribute"]],["impl RefUnwindSafe for BareFnArg",1,["syn::ty::BareFnArg"]],["impl RefUnwindSafe for BareVariadic",1,["syn::ty::BareVariadic"]],["impl RefUnwindSafe for Block",1,["syn::stmt::Block"]],["impl RefUnwindSafe for BoundLifetimes",1,["syn::generics::BoundLifetimes"]],["impl RefUnwindSafe for ConstParam",1,["syn::generics::ConstParam"]],["impl RefUnwindSafe for Constraint",1,["syn::path::Constraint"]],["impl RefUnwindSafe for DataEnum",1,["syn::derive::DataEnum"]],["impl RefUnwindSafe for DataStruct",1,["syn::derive::DataStruct"]],["impl RefUnwindSafe for DataUnion",1,["syn::derive::DataUnion"]],["impl RefUnwindSafe for DeriveInput",1,["syn::derive::DeriveInput"]],["impl RefUnwindSafe for ExprArray",1,["syn::expr::ExprArray"]],["impl RefUnwindSafe for ExprAssign",1,["syn::expr::ExprAssign"]],["impl RefUnwindSafe for ExprAsync",1,["syn::expr::ExprAsync"]],["impl RefUnwindSafe for ExprAwait",1,["syn::expr::ExprAwait"]],["impl RefUnwindSafe for ExprBinary",1,["syn::expr::ExprBinary"]],["impl RefUnwindSafe for ExprBlock",1,["syn::expr::ExprBlock"]],["impl RefUnwindSafe for ExprBreak",1,["syn::expr::ExprBreak"]],["impl RefUnwindSafe for ExprCall",1,["syn::expr::ExprCall"]],["impl RefUnwindSafe for ExprCast",1,["syn::expr::ExprCast"]],["impl RefUnwindSafe for ExprClosure",1,["syn::expr::ExprClosure"]],["impl RefUnwindSafe for ExprConst",1,["syn::expr::ExprConst"]],["impl RefUnwindSafe for ExprContinue",1,["syn::expr::ExprContinue"]],["impl RefUnwindSafe for ExprField",1,["syn::expr::ExprField"]],["impl RefUnwindSafe for ExprForLoop",1,["syn::expr::ExprForLoop"]],["impl RefUnwindSafe for ExprGroup",1,["syn::expr::ExprGroup"]],["impl RefUnwindSafe for ExprIf",1,["syn::expr::ExprIf"]],["impl RefUnwindSafe for ExprIndex",1,["syn::expr::ExprIndex"]],["impl RefUnwindSafe for ExprInfer",1,["syn::expr::ExprInfer"]],["impl RefUnwindSafe for ExprLet",1,["syn::expr::ExprLet"]],["impl RefUnwindSafe for ExprLit",1,["syn::expr::ExprLit"]],["impl RefUnwindSafe for ExprLoop",1,["syn::expr::ExprLoop"]],["impl RefUnwindSafe for ExprMacro",1,["syn::expr::ExprMacro"]],["impl RefUnwindSafe for ExprMatch",1,["syn::expr::ExprMatch"]],["impl RefUnwindSafe for ExprMethodCall",1,["syn::expr::ExprMethodCall"]],["impl RefUnwindSafe for ExprParen",1,["syn::expr::ExprParen"]],["impl RefUnwindSafe for ExprPath",1,["syn::expr::ExprPath"]],["impl RefUnwindSafe for ExprRange",1,["syn::expr::ExprRange"]],["impl RefUnwindSafe for ExprReference",1,["syn::expr::ExprReference"]],["impl RefUnwindSafe for ExprRepeat",1,["syn::expr::ExprRepeat"]],["impl RefUnwindSafe for ExprReturn",1,["syn::expr::ExprReturn"]],["impl RefUnwindSafe for ExprStruct",1,["syn::expr::ExprStruct"]],["impl RefUnwindSafe for ExprTry",1,["syn::expr::ExprTry"]],["impl RefUnwindSafe for ExprTryBlock",1,["syn::expr::ExprTryBlock"]],["impl RefUnwindSafe for ExprTuple",1,["syn::expr::ExprTuple"]],["impl RefUnwindSafe for ExprUnary",1,["syn::expr::ExprUnary"]],["impl RefUnwindSafe for ExprUnsafe",1,["syn::expr::ExprUnsafe"]],["impl RefUnwindSafe for ExprWhile",1,["syn::expr::ExprWhile"]],["impl RefUnwindSafe for ExprYield",1,["syn::expr::ExprYield"]],["impl RefUnwindSafe for Field",1,["syn::data::Field"]],["impl RefUnwindSafe for FieldPat",1,["syn::pat::FieldPat"]],["impl RefUnwindSafe for FieldValue",1,["syn::expr::FieldValue"]],["impl RefUnwindSafe for FieldsNamed",1,["syn::data::FieldsNamed"]],["impl RefUnwindSafe for FieldsUnnamed",1,["syn::data::FieldsUnnamed"]],["impl RefUnwindSafe for File",1,["syn::file::File"]],["impl RefUnwindSafe for ForeignItemFn",1,["syn::item::ForeignItemFn"]],["impl RefUnwindSafe for ForeignItemMacro",1,["syn::item::ForeignItemMacro"]],["impl RefUnwindSafe for ForeignItemStatic",1,["syn::item::ForeignItemStatic"]],["impl RefUnwindSafe for ForeignItemType",1,["syn::item::ForeignItemType"]],["impl RefUnwindSafe for Generics",1,["syn::generics::Generics"]],["impl RefUnwindSafe for ImplItemConst",1,["syn::item::ImplItemConst"]],["impl RefUnwindSafe for ImplItemFn",1,["syn::item::ImplItemFn"]],["impl RefUnwindSafe for ImplItemMacro",1,["syn::item::ImplItemMacro"]],["impl RefUnwindSafe for ImplItemType",1,["syn::item::ImplItemType"]],["impl RefUnwindSafe for Index",1,["syn::expr::Index"]],["impl RefUnwindSafe for ItemConst",1,["syn::item::ItemConst"]],["impl RefUnwindSafe for ItemEnum",1,["syn::item::ItemEnum"]],["impl RefUnwindSafe for ItemExternCrate",1,["syn::item::ItemExternCrate"]],["impl RefUnwindSafe for ItemFn",1,["syn::item::ItemFn"]],["impl RefUnwindSafe for ItemForeignMod",1,["syn::item::ItemForeignMod"]],["impl RefUnwindSafe for ItemImpl",1,["syn::item::ItemImpl"]],["impl RefUnwindSafe for ItemMacro",1,["syn::item::ItemMacro"]],["impl RefUnwindSafe for ItemMod",1,["syn::item::ItemMod"]],["impl RefUnwindSafe for ItemStatic",1,["syn::item::ItemStatic"]],["impl RefUnwindSafe for ItemStruct",1,["syn::item::ItemStruct"]],["impl RefUnwindSafe for ItemTrait",1,["syn::item::ItemTrait"]],["impl RefUnwindSafe for ItemTraitAlias",1,["syn::item::ItemTraitAlias"]],["impl RefUnwindSafe for ItemType",1,["syn::item::ItemType"]],["impl RefUnwindSafe for ItemUnion",1,["syn::item::ItemUnion"]],["impl RefUnwindSafe for ItemUse",1,["syn::item::ItemUse"]],["impl RefUnwindSafe for Label",1,["syn::expr::Label"]],["impl RefUnwindSafe for Lifetime",1,["syn::lifetime::Lifetime"]],["impl RefUnwindSafe for LifetimeParam",1,["syn::generics::LifetimeParam"]],["impl RefUnwindSafe for LitBool",1,["syn::lit::LitBool"]],["impl RefUnwindSafe for LitByte",1,["syn::lit::LitByte"]],["impl RefUnwindSafe for LitByteStr",1,["syn::lit::LitByteStr"]],["impl RefUnwindSafe for LitCStr",1,["syn::lit::LitCStr"]],["impl RefUnwindSafe for LitChar",1,["syn::lit::LitChar"]],["impl RefUnwindSafe for LitFloat",1,["syn::lit::LitFloat"]],["impl RefUnwindSafe for LitInt",1,["syn::lit::LitInt"]],["impl RefUnwindSafe for LitStr",1,["syn::lit::LitStr"]],["impl RefUnwindSafe for Local",1,["syn::stmt::Local"]],["impl RefUnwindSafe for LocalInit",1,["syn::stmt::LocalInit"]],["impl RefUnwindSafe for Macro",1,["syn::mac::Macro"]],["impl RefUnwindSafe for MetaList",1,["syn::attr::MetaList"]],["impl RefUnwindSafe for MetaNameValue",1,["syn::attr::MetaNameValue"]],["impl RefUnwindSafe for ParenthesizedGenericArguments",1,["syn::path::ParenthesizedGenericArguments"]],["impl RefUnwindSafe for PatIdent",1,["syn::pat::PatIdent"]],["impl RefUnwindSafe for PatOr",1,["syn::pat::PatOr"]],["impl RefUnwindSafe for PatParen",1,["syn::pat::PatParen"]],["impl RefUnwindSafe for PatReference",1,["syn::pat::PatReference"]],["impl RefUnwindSafe for PatRest",1,["syn::pat::PatRest"]],["impl RefUnwindSafe for PatSlice",1,["syn::pat::PatSlice"]],["impl RefUnwindSafe for PatStruct",1,["syn::pat::PatStruct"]],["impl RefUnwindSafe for PatTuple",1,["syn::pat::PatTuple"]],["impl RefUnwindSafe for PatTupleStruct",1,["syn::pat::PatTupleStruct"]],["impl RefUnwindSafe for PatType",1,["syn::pat::PatType"]],["impl RefUnwindSafe for PatWild",1,["syn::pat::PatWild"]],["impl RefUnwindSafe for Path",1,["syn::path::Path"]],["impl RefUnwindSafe for PathSegment",1,["syn::path::PathSegment"]],["impl RefUnwindSafe for PredicateLifetime",1,["syn::generics::PredicateLifetime"]],["impl RefUnwindSafe for PredicateType",1,["syn::generics::PredicateType"]],["impl RefUnwindSafe for QSelf",1,["syn::path::QSelf"]],["impl RefUnwindSafe for Receiver",1,["syn::item::Receiver"]],["impl RefUnwindSafe for Signature",1,["syn::item::Signature"]],["impl RefUnwindSafe for StmtMacro",1,["syn::stmt::StmtMacro"]],["impl RefUnwindSafe for TraitBound",1,["syn::generics::TraitBound"]],["impl RefUnwindSafe for TraitItemConst",1,["syn::item::TraitItemConst"]],["impl RefUnwindSafe for TraitItemFn",1,["syn::item::TraitItemFn"]],["impl RefUnwindSafe for TraitItemMacro",1,["syn::item::TraitItemMacro"]],["impl RefUnwindSafe for TraitItemType",1,["syn::item::TraitItemType"]],["impl RefUnwindSafe for TypeArray",1,["syn::ty::TypeArray"]],["impl RefUnwindSafe for TypeBareFn",1,["syn::ty::TypeBareFn"]],["impl RefUnwindSafe for TypeGroup",1,["syn::ty::TypeGroup"]],["impl RefUnwindSafe for TypeImplTrait",1,["syn::ty::TypeImplTrait"]],["impl RefUnwindSafe for TypeInfer",1,["syn::ty::TypeInfer"]],["impl RefUnwindSafe for TypeMacro",1,["syn::ty::TypeMacro"]],["impl RefUnwindSafe for TypeNever",1,["syn::ty::TypeNever"]],["impl RefUnwindSafe for TypeParam",1,["syn::generics::TypeParam"]],["impl RefUnwindSafe for TypeParen",1,["syn::ty::TypeParen"]],["impl RefUnwindSafe for TypePath",1,["syn::ty::TypePath"]],["impl RefUnwindSafe for TypePtr",1,["syn::ty::TypePtr"]],["impl RefUnwindSafe for TypeReference",1,["syn::ty::TypeReference"]],["impl RefUnwindSafe for TypeSlice",1,["syn::ty::TypeSlice"]],["impl RefUnwindSafe for TypeTraitObject",1,["syn::ty::TypeTraitObject"]],["impl RefUnwindSafe for TypeTuple",1,["syn::ty::TypeTuple"]],["impl RefUnwindSafe for UseGlob",1,["syn::item::UseGlob"]],["impl RefUnwindSafe for UseGroup",1,["syn::item::UseGroup"]],["impl RefUnwindSafe for UseName",1,["syn::item::UseName"]],["impl RefUnwindSafe for UsePath",1,["syn::item::UsePath"]],["impl RefUnwindSafe for UseRename",1,["syn::item::UseRename"]],["impl RefUnwindSafe for Variadic",1,["syn::item::Variadic"]],["impl RefUnwindSafe for Variant",1,["syn::data::Variant"]],["impl RefUnwindSafe for VisRestricted",1,["syn::restriction::VisRestricted"]],["impl RefUnwindSafe for WhereClause",1,["syn::generics::WhereClause"]],["impl RefUnwindSafe for Abstract",1,["syn::token::Abstract"]],["impl RefUnwindSafe for And",1,["syn::token::And"]],["impl RefUnwindSafe for AndAnd",1,["syn::token::AndAnd"]],["impl RefUnwindSafe for AndEq",1,["syn::token::AndEq"]],["impl RefUnwindSafe for As",1,["syn::token::As"]],["impl RefUnwindSafe for Async",1,["syn::token::Async"]],["impl RefUnwindSafe for At",1,["syn::token::At"]],["impl RefUnwindSafe for Auto",1,["syn::token::Auto"]],["impl RefUnwindSafe for Await",1,["syn::token::Await"]],["impl RefUnwindSafe for Become",1,["syn::token::Become"]],["impl RefUnwindSafe for Box",1,["syn::token::Box"]],["impl RefUnwindSafe for Brace",1,["syn::token::Brace"]],["impl RefUnwindSafe for Bracket",1,["syn::token::Bracket"]],["impl RefUnwindSafe for Break",1,["syn::token::Break"]],["impl RefUnwindSafe for Caret",1,["syn::token::Caret"]],["impl RefUnwindSafe for CaretEq",1,["syn::token::CaretEq"]],["impl RefUnwindSafe for Colon",1,["syn::token::Colon"]],["impl RefUnwindSafe for Comma",1,["syn::token::Comma"]],["impl RefUnwindSafe for Const",1,["syn::token::Const"]],["impl RefUnwindSafe for Continue",1,["syn::token::Continue"]],["impl RefUnwindSafe for Crate",1,["syn::token::Crate"]],["impl RefUnwindSafe for Default",1,["syn::token::Default"]],["impl RefUnwindSafe for Do",1,["syn::token::Do"]],["impl RefUnwindSafe for Dollar",1,["syn::token::Dollar"]],["impl RefUnwindSafe for Dot",1,["syn::token::Dot"]],["impl RefUnwindSafe for DotDot",1,["syn::token::DotDot"]],["impl RefUnwindSafe for DotDotDot",1,["syn::token::DotDotDot"]],["impl RefUnwindSafe for DotDotEq",1,["syn::token::DotDotEq"]],["impl RefUnwindSafe for Dyn",1,["syn::token::Dyn"]],["impl RefUnwindSafe for Else",1,["syn::token::Else"]],["impl RefUnwindSafe for Enum",1,["syn::token::Enum"]],["impl RefUnwindSafe for Eq",1,["syn::token::Eq"]],["impl RefUnwindSafe for EqEq",1,["syn::token::EqEq"]],["impl RefUnwindSafe for Extern",1,["syn::token::Extern"]],["impl RefUnwindSafe for FatArrow",1,["syn::token::FatArrow"]],["impl RefUnwindSafe for Final",1,["syn::token::Final"]],["impl RefUnwindSafe for Fn",1,["syn::token::Fn"]],["impl RefUnwindSafe for For",1,["syn::token::For"]],["impl RefUnwindSafe for Ge",1,["syn::token::Ge"]],["impl RefUnwindSafe for Group",1,["syn::token::Group"]],["impl RefUnwindSafe for Gt",1,["syn::token::Gt"]],["impl RefUnwindSafe for If",1,["syn::token::If"]],["impl RefUnwindSafe for Impl",1,["syn::token::Impl"]],["impl RefUnwindSafe for In",1,["syn::token::In"]],["impl RefUnwindSafe for LArrow",1,["syn::token::LArrow"]],["impl RefUnwindSafe for Le",1,["syn::token::Le"]],["impl RefUnwindSafe for Let",1,["syn::token::Let"]],["impl RefUnwindSafe for Loop",1,["syn::token::Loop"]],["impl RefUnwindSafe for Lt",1,["syn::token::Lt"]],["impl RefUnwindSafe for Macro",1,["syn::token::Macro"]],["impl RefUnwindSafe for Match",1,["syn::token::Match"]],["impl RefUnwindSafe for Minus",1,["syn::token::Minus"]],["impl RefUnwindSafe for MinusEq",1,["syn::token::MinusEq"]],["impl RefUnwindSafe for Mod",1,["syn::token::Mod"]],["impl RefUnwindSafe for Move",1,["syn::token::Move"]],["impl RefUnwindSafe for Mut",1,["syn::token::Mut"]],["impl RefUnwindSafe for Ne",1,["syn::token::Ne"]],["impl RefUnwindSafe for Not",1,["syn::token::Not"]],["impl RefUnwindSafe for Or",1,["syn::token::Or"]],["impl RefUnwindSafe for OrEq",1,["syn::token::OrEq"]],["impl RefUnwindSafe for OrOr",1,["syn::token::OrOr"]],["impl RefUnwindSafe for Override",1,["syn::token::Override"]],["impl RefUnwindSafe for Paren",1,["syn::token::Paren"]],["impl RefUnwindSafe for PathSep",1,["syn::token::PathSep"]],["impl RefUnwindSafe for Percent",1,["syn::token::Percent"]],["impl RefUnwindSafe for PercentEq",1,["syn::token::PercentEq"]],["impl RefUnwindSafe for Plus",1,["syn::token::Plus"]],["impl RefUnwindSafe for PlusEq",1,["syn::token::PlusEq"]],["impl RefUnwindSafe for Pound",1,["syn::token::Pound"]],["impl RefUnwindSafe for Priv",1,["syn::token::Priv"]],["impl RefUnwindSafe for Pub",1,["syn::token::Pub"]],["impl RefUnwindSafe for Question",1,["syn::token::Question"]],["impl RefUnwindSafe for RArrow",1,["syn::token::RArrow"]],["impl RefUnwindSafe for Ref",1,["syn::token::Ref"]],["impl RefUnwindSafe for Return",1,["syn::token::Return"]],["impl RefUnwindSafe for SelfType",1,["syn::token::SelfType"]],["impl RefUnwindSafe for SelfValue",1,["syn::token::SelfValue"]],["impl RefUnwindSafe for Semi",1,["syn::token::Semi"]],["impl RefUnwindSafe for Shl",1,["syn::token::Shl"]],["impl RefUnwindSafe for ShlEq",1,["syn::token::ShlEq"]],["impl RefUnwindSafe for Shr",1,["syn::token::Shr"]],["impl RefUnwindSafe for ShrEq",1,["syn::token::ShrEq"]],["impl RefUnwindSafe for Slash",1,["syn::token::Slash"]],["impl RefUnwindSafe for SlashEq",1,["syn::token::SlashEq"]],["impl RefUnwindSafe for Star",1,["syn::token::Star"]],["impl RefUnwindSafe for StarEq",1,["syn::token::StarEq"]],["impl RefUnwindSafe for Static",1,["syn::token::Static"]],["impl RefUnwindSafe for Struct",1,["syn::token::Struct"]],["impl RefUnwindSafe for Super",1,["syn::token::Super"]],["impl RefUnwindSafe for Tilde",1,["syn::token::Tilde"]],["impl RefUnwindSafe for Trait",1,["syn::token::Trait"]],["impl RefUnwindSafe for Try",1,["syn::token::Try"]],["impl RefUnwindSafe for Type",1,["syn::token::Type"]],["impl RefUnwindSafe for Typeof",1,["syn::token::Typeof"]],["impl RefUnwindSafe for Underscore",1,["syn::token::Underscore"]],["impl RefUnwindSafe for Union",1,["syn::token::Union"]],["impl RefUnwindSafe for Unsafe",1,["syn::token::Unsafe"]],["impl RefUnwindSafe for Unsized",1,["syn::token::Unsized"]],["impl RefUnwindSafe for Use",1,["syn::token::Use"]],["impl RefUnwindSafe for Virtual",1,["syn::token::Virtual"]],["impl RefUnwindSafe for Where",1,["syn::token::Where"]],["impl RefUnwindSafe for While",1,["syn::token::While"]],["impl RefUnwindSafe for Yield",1,["syn::token::Yield"]],["impl<'a> !RefUnwindSafe for ParseNestedMeta<'a>",1,["syn::meta::ParseNestedMeta"]],["impl<'a> !RefUnwindSafe for Lookahead1<'a>",1,["syn::lookahead::Lookahead1"]],["impl<'a> !RefUnwindSafe for ParseBuffer<'a>",1,["syn::parse::ParseBuffer"]],["impl<'a> RefUnwindSafe for Cursor<'a>",1,["syn::buffer::Cursor"]],["impl<'a> RefUnwindSafe for ImplGenerics<'a>",1,["syn::generics::ImplGenerics"]],["impl<'a> RefUnwindSafe for Turbofish<'a>",1,["syn::generics::Turbofish"]],["impl<'a> RefUnwindSafe for TypeGenerics<'a>",1,["syn::generics::TypeGenerics"]],["impl<'a, T> !RefUnwindSafe for Iter<'a, T>",1,["syn::punctuated::Iter"]],["impl<'a, T> !RefUnwindSafe for IterMut<'a, T>",1,["syn::punctuated::IterMut"]],["impl<'a, T, P> RefUnwindSafe for Pairs<'a, T, P>
where\n T: RefUnwindSafe,\n P: RefUnwindSafe,
",1,["syn::punctuated::Pairs"]],["impl<'a, T, P> RefUnwindSafe for PairsMut<'a, T, P>
where\n T: RefUnwindSafe,\n P: RefUnwindSafe,
",1,["syn::punctuated::PairsMut"]],["impl<'c, 'a> RefUnwindSafe for StepCursor<'c, 'a>",1,["syn::parse::StepCursor"]],["impl<T> RefUnwindSafe for IntoIter<T>
where\n T: RefUnwindSafe,
",1,["syn::punctuated::IntoIter"]],["impl<T, P> RefUnwindSafe for Pair<T, P>
where\n T: RefUnwindSafe,\n P: RefUnwindSafe,
",1,["syn::punctuated::Pair"]],["impl<T, P> RefUnwindSafe for IntoPairs<T, P>
where\n T: RefUnwindSafe,\n P: RefUnwindSafe,
",1,["syn::punctuated::IntoPairs"]],["impl<T, P> RefUnwindSafe for Punctuated<T, P>
where\n T: RefUnwindSafe,\n P: RefUnwindSafe,
",1,["syn::punctuated::Punctuated"]]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/panic/unwind_safe/trait.UnwindSafe.js b/trait.impl/core/panic/unwind_safe/trait.UnwindSafe.js new file mode 100644 index 0000000..0df2d82 --- /dev/null +++ b/trait.impl/core/panic/unwind_safe/trait.UnwindSafe.js @@ -0,0 +1,4 @@ +(function() {var implementors = { +"proc_macro2":[["impl UnwindSafe for Delimiter",1,["proc_macro2::Delimiter"]],["impl UnwindSafe for Spacing",1,["proc_macro2::Spacing"]],["impl UnwindSafe for TokenTree",1,["proc_macro2::TokenTree"]],["impl UnwindSafe for DelimSpan",1,["proc_macro2::extra::DelimSpan"]],["impl UnwindSafe for Group",1,["proc_macro2::Group"]],["impl UnwindSafe for Ident",1,["proc_macro2::Ident"]],["impl UnwindSafe for LexError",1,["proc_macro2::LexError"]],["impl UnwindSafe for Literal",1,["proc_macro2::Literal"]],["impl UnwindSafe for Punct",1,["proc_macro2::Punct"]],["impl UnwindSafe for Span",1,["proc_macro2::Span"]],["impl UnwindSafe for TokenStream",1,["proc_macro2::TokenStream"]],["impl UnwindSafe for IntoIter",1,["proc_macro2::token_stream::IntoIter"]]], +"syn":[["impl UnwindSafe for AttrStyle",1,["syn::attr::AttrStyle"]],["impl UnwindSafe for BinOp",1,["syn::op::BinOp"]],["impl UnwindSafe for Data",1,["syn::derive::Data"]],["impl UnwindSafe for Expr",1,["syn::expr::Expr"]],["impl UnwindSafe for FieldMutability",1,["syn::restriction::FieldMutability"]],["impl UnwindSafe for Fields",1,["syn::data::Fields"]],["impl UnwindSafe for FnArg",1,["syn::item::FnArg"]],["impl UnwindSafe for ForeignItem",1,["syn::item::ForeignItem"]],["impl UnwindSafe for GenericArgument",1,["syn::path::GenericArgument"]],["impl UnwindSafe for GenericParam",1,["syn::generics::GenericParam"]],["impl UnwindSafe for ImplItem",1,["syn::item::ImplItem"]],["impl UnwindSafe for ImplRestriction",1,["syn::item::ImplRestriction"]],["impl UnwindSafe for Item",1,["syn::item::Item"]],["impl UnwindSafe for Lit",1,["syn::lit::Lit"]],["impl UnwindSafe for MacroDelimiter",1,["syn::mac::MacroDelimiter"]],["impl UnwindSafe for Member",1,["syn::expr::Member"]],["impl UnwindSafe for Meta",1,["syn::attr::Meta"]],["impl UnwindSafe for Pat",1,["syn::pat::Pat"]],["impl UnwindSafe for PathArguments",1,["syn::path::PathArguments"]],["impl UnwindSafe for RangeLimits",1,["syn::expr::RangeLimits"]],["impl UnwindSafe for ReturnType",1,["syn::ty::ReturnType"]],["impl UnwindSafe for StaticMutability",1,["syn::item::StaticMutability"]],["impl UnwindSafe for Stmt",1,["syn::stmt::Stmt"]],["impl UnwindSafe for TraitBoundModifier",1,["syn::generics::TraitBoundModifier"]],["impl UnwindSafe for TraitItem",1,["syn::item::TraitItem"]],["impl UnwindSafe for Type",1,["syn::ty::Type"]],["impl UnwindSafe for TypeParamBound",1,["syn::generics::TypeParamBound"]],["impl UnwindSafe for UnOp",1,["syn::op::UnOp"]],["impl UnwindSafe for UseTree",1,["syn::item::UseTree"]],["impl UnwindSafe for Visibility",1,["syn::restriction::Visibility"]],["impl UnwindSafe for WherePredicate",1,["syn::generics::WherePredicate"]],["impl UnwindSafe for TokenBuffer",1,["syn::buffer::TokenBuffer"]],["impl UnwindSafe for Error",1,["syn::error::Error"]],["impl UnwindSafe for Nothing",1,["syn::parse::Nothing"]],["impl UnwindSafe for Abi",1,["syn::ty::Abi"]],["impl UnwindSafe for AngleBracketedGenericArguments",1,["syn::path::AngleBracketedGenericArguments"]],["impl UnwindSafe for Arm",1,["syn::expr::Arm"]],["impl UnwindSafe for AssocConst",1,["syn::path::AssocConst"]],["impl UnwindSafe for AssocType",1,["syn::path::AssocType"]],["impl UnwindSafe for Attribute",1,["syn::attr::Attribute"]],["impl UnwindSafe for BareFnArg",1,["syn::ty::BareFnArg"]],["impl UnwindSafe for BareVariadic",1,["syn::ty::BareVariadic"]],["impl UnwindSafe for Block",1,["syn::stmt::Block"]],["impl UnwindSafe for BoundLifetimes",1,["syn::generics::BoundLifetimes"]],["impl UnwindSafe for ConstParam",1,["syn::generics::ConstParam"]],["impl UnwindSafe for Constraint",1,["syn::path::Constraint"]],["impl UnwindSafe for DataEnum",1,["syn::derive::DataEnum"]],["impl UnwindSafe for DataStruct",1,["syn::derive::DataStruct"]],["impl UnwindSafe for DataUnion",1,["syn::derive::DataUnion"]],["impl UnwindSafe for DeriveInput",1,["syn::derive::DeriveInput"]],["impl UnwindSafe for ExprArray",1,["syn::expr::ExprArray"]],["impl UnwindSafe for ExprAssign",1,["syn::expr::ExprAssign"]],["impl UnwindSafe for ExprAsync",1,["syn::expr::ExprAsync"]],["impl UnwindSafe for ExprAwait",1,["syn::expr::ExprAwait"]],["impl UnwindSafe for ExprBinary",1,["syn::expr::ExprBinary"]],["impl UnwindSafe for ExprBlock",1,["syn::expr::ExprBlock"]],["impl UnwindSafe for ExprBreak",1,["syn::expr::ExprBreak"]],["impl UnwindSafe for ExprCall",1,["syn::expr::ExprCall"]],["impl UnwindSafe for ExprCast",1,["syn::expr::ExprCast"]],["impl UnwindSafe for ExprClosure",1,["syn::expr::ExprClosure"]],["impl UnwindSafe for ExprConst",1,["syn::expr::ExprConst"]],["impl UnwindSafe for ExprContinue",1,["syn::expr::ExprContinue"]],["impl UnwindSafe for ExprField",1,["syn::expr::ExprField"]],["impl UnwindSafe for ExprForLoop",1,["syn::expr::ExprForLoop"]],["impl UnwindSafe for ExprGroup",1,["syn::expr::ExprGroup"]],["impl UnwindSafe for ExprIf",1,["syn::expr::ExprIf"]],["impl UnwindSafe for ExprIndex",1,["syn::expr::ExprIndex"]],["impl UnwindSafe for ExprInfer",1,["syn::expr::ExprInfer"]],["impl UnwindSafe for ExprLet",1,["syn::expr::ExprLet"]],["impl UnwindSafe for ExprLit",1,["syn::expr::ExprLit"]],["impl UnwindSafe for ExprLoop",1,["syn::expr::ExprLoop"]],["impl UnwindSafe for ExprMacro",1,["syn::expr::ExprMacro"]],["impl UnwindSafe for ExprMatch",1,["syn::expr::ExprMatch"]],["impl UnwindSafe for ExprMethodCall",1,["syn::expr::ExprMethodCall"]],["impl UnwindSafe for ExprParen",1,["syn::expr::ExprParen"]],["impl UnwindSafe for ExprPath",1,["syn::expr::ExprPath"]],["impl UnwindSafe for ExprRange",1,["syn::expr::ExprRange"]],["impl UnwindSafe for ExprReference",1,["syn::expr::ExprReference"]],["impl UnwindSafe for ExprRepeat",1,["syn::expr::ExprRepeat"]],["impl UnwindSafe for ExprReturn",1,["syn::expr::ExprReturn"]],["impl UnwindSafe for ExprStruct",1,["syn::expr::ExprStruct"]],["impl UnwindSafe for ExprTry",1,["syn::expr::ExprTry"]],["impl UnwindSafe for ExprTryBlock",1,["syn::expr::ExprTryBlock"]],["impl UnwindSafe for ExprTuple",1,["syn::expr::ExprTuple"]],["impl UnwindSafe for ExprUnary",1,["syn::expr::ExprUnary"]],["impl UnwindSafe for ExprUnsafe",1,["syn::expr::ExprUnsafe"]],["impl UnwindSafe for ExprWhile",1,["syn::expr::ExprWhile"]],["impl UnwindSafe for ExprYield",1,["syn::expr::ExprYield"]],["impl UnwindSafe for Field",1,["syn::data::Field"]],["impl UnwindSafe for FieldPat",1,["syn::pat::FieldPat"]],["impl UnwindSafe for FieldValue",1,["syn::expr::FieldValue"]],["impl UnwindSafe for FieldsNamed",1,["syn::data::FieldsNamed"]],["impl UnwindSafe for FieldsUnnamed",1,["syn::data::FieldsUnnamed"]],["impl UnwindSafe for File",1,["syn::file::File"]],["impl UnwindSafe for ForeignItemFn",1,["syn::item::ForeignItemFn"]],["impl UnwindSafe for ForeignItemMacro",1,["syn::item::ForeignItemMacro"]],["impl UnwindSafe for ForeignItemStatic",1,["syn::item::ForeignItemStatic"]],["impl UnwindSafe for ForeignItemType",1,["syn::item::ForeignItemType"]],["impl UnwindSafe for Generics",1,["syn::generics::Generics"]],["impl UnwindSafe for ImplItemConst",1,["syn::item::ImplItemConst"]],["impl UnwindSafe for ImplItemFn",1,["syn::item::ImplItemFn"]],["impl UnwindSafe for ImplItemMacro",1,["syn::item::ImplItemMacro"]],["impl UnwindSafe for ImplItemType",1,["syn::item::ImplItemType"]],["impl UnwindSafe for Index",1,["syn::expr::Index"]],["impl UnwindSafe for ItemConst",1,["syn::item::ItemConst"]],["impl UnwindSafe for ItemEnum",1,["syn::item::ItemEnum"]],["impl UnwindSafe for ItemExternCrate",1,["syn::item::ItemExternCrate"]],["impl UnwindSafe for ItemFn",1,["syn::item::ItemFn"]],["impl UnwindSafe for ItemForeignMod",1,["syn::item::ItemForeignMod"]],["impl UnwindSafe for ItemImpl",1,["syn::item::ItemImpl"]],["impl UnwindSafe for ItemMacro",1,["syn::item::ItemMacro"]],["impl UnwindSafe for ItemMod",1,["syn::item::ItemMod"]],["impl UnwindSafe for ItemStatic",1,["syn::item::ItemStatic"]],["impl UnwindSafe for ItemStruct",1,["syn::item::ItemStruct"]],["impl UnwindSafe for ItemTrait",1,["syn::item::ItemTrait"]],["impl UnwindSafe for ItemTraitAlias",1,["syn::item::ItemTraitAlias"]],["impl UnwindSafe for ItemType",1,["syn::item::ItemType"]],["impl UnwindSafe for ItemUnion",1,["syn::item::ItemUnion"]],["impl UnwindSafe for ItemUse",1,["syn::item::ItemUse"]],["impl UnwindSafe for Label",1,["syn::expr::Label"]],["impl UnwindSafe for Lifetime",1,["syn::lifetime::Lifetime"]],["impl UnwindSafe for LifetimeParam",1,["syn::generics::LifetimeParam"]],["impl UnwindSafe for LitBool",1,["syn::lit::LitBool"]],["impl UnwindSafe for LitByte",1,["syn::lit::LitByte"]],["impl UnwindSafe for LitByteStr",1,["syn::lit::LitByteStr"]],["impl UnwindSafe for LitCStr",1,["syn::lit::LitCStr"]],["impl UnwindSafe for LitChar",1,["syn::lit::LitChar"]],["impl UnwindSafe for LitFloat",1,["syn::lit::LitFloat"]],["impl UnwindSafe for LitInt",1,["syn::lit::LitInt"]],["impl UnwindSafe for LitStr",1,["syn::lit::LitStr"]],["impl UnwindSafe for Local",1,["syn::stmt::Local"]],["impl UnwindSafe for LocalInit",1,["syn::stmt::LocalInit"]],["impl UnwindSafe for Macro",1,["syn::mac::Macro"]],["impl UnwindSafe for MetaList",1,["syn::attr::MetaList"]],["impl UnwindSafe for MetaNameValue",1,["syn::attr::MetaNameValue"]],["impl UnwindSafe for ParenthesizedGenericArguments",1,["syn::path::ParenthesizedGenericArguments"]],["impl UnwindSafe for PatIdent",1,["syn::pat::PatIdent"]],["impl UnwindSafe for PatOr",1,["syn::pat::PatOr"]],["impl UnwindSafe for PatParen",1,["syn::pat::PatParen"]],["impl UnwindSafe for PatReference",1,["syn::pat::PatReference"]],["impl UnwindSafe for PatRest",1,["syn::pat::PatRest"]],["impl UnwindSafe for PatSlice",1,["syn::pat::PatSlice"]],["impl UnwindSafe for PatStruct",1,["syn::pat::PatStruct"]],["impl UnwindSafe for PatTuple",1,["syn::pat::PatTuple"]],["impl UnwindSafe for PatTupleStruct",1,["syn::pat::PatTupleStruct"]],["impl UnwindSafe for PatType",1,["syn::pat::PatType"]],["impl UnwindSafe for PatWild",1,["syn::pat::PatWild"]],["impl UnwindSafe for Path",1,["syn::path::Path"]],["impl UnwindSafe for PathSegment",1,["syn::path::PathSegment"]],["impl UnwindSafe for PredicateLifetime",1,["syn::generics::PredicateLifetime"]],["impl UnwindSafe for PredicateType",1,["syn::generics::PredicateType"]],["impl UnwindSafe for QSelf",1,["syn::path::QSelf"]],["impl UnwindSafe for Receiver",1,["syn::item::Receiver"]],["impl UnwindSafe for Signature",1,["syn::item::Signature"]],["impl UnwindSafe for StmtMacro",1,["syn::stmt::StmtMacro"]],["impl UnwindSafe for TraitBound",1,["syn::generics::TraitBound"]],["impl UnwindSafe for TraitItemConst",1,["syn::item::TraitItemConst"]],["impl UnwindSafe for TraitItemFn",1,["syn::item::TraitItemFn"]],["impl UnwindSafe for TraitItemMacro",1,["syn::item::TraitItemMacro"]],["impl UnwindSafe for TraitItemType",1,["syn::item::TraitItemType"]],["impl UnwindSafe for TypeArray",1,["syn::ty::TypeArray"]],["impl UnwindSafe for TypeBareFn",1,["syn::ty::TypeBareFn"]],["impl UnwindSafe for TypeGroup",1,["syn::ty::TypeGroup"]],["impl UnwindSafe for TypeImplTrait",1,["syn::ty::TypeImplTrait"]],["impl UnwindSafe for TypeInfer",1,["syn::ty::TypeInfer"]],["impl UnwindSafe for TypeMacro",1,["syn::ty::TypeMacro"]],["impl UnwindSafe for TypeNever",1,["syn::ty::TypeNever"]],["impl UnwindSafe for TypeParam",1,["syn::generics::TypeParam"]],["impl UnwindSafe for TypeParen",1,["syn::ty::TypeParen"]],["impl UnwindSafe for TypePath",1,["syn::ty::TypePath"]],["impl UnwindSafe for TypePtr",1,["syn::ty::TypePtr"]],["impl UnwindSafe for TypeReference",1,["syn::ty::TypeReference"]],["impl UnwindSafe for TypeSlice",1,["syn::ty::TypeSlice"]],["impl UnwindSafe for TypeTraitObject",1,["syn::ty::TypeTraitObject"]],["impl UnwindSafe for TypeTuple",1,["syn::ty::TypeTuple"]],["impl UnwindSafe for UseGlob",1,["syn::item::UseGlob"]],["impl UnwindSafe for UseGroup",1,["syn::item::UseGroup"]],["impl UnwindSafe for UseName",1,["syn::item::UseName"]],["impl UnwindSafe for UsePath",1,["syn::item::UsePath"]],["impl UnwindSafe for UseRename",1,["syn::item::UseRename"]],["impl UnwindSafe for Variadic",1,["syn::item::Variadic"]],["impl UnwindSafe for Variant",1,["syn::data::Variant"]],["impl UnwindSafe for VisRestricted",1,["syn::restriction::VisRestricted"]],["impl UnwindSafe for WhereClause",1,["syn::generics::WhereClause"]],["impl UnwindSafe for Abstract",1,["syn::token::Abstract"]],["impl UnwindSafe for And",1,["syn::token::And"]],["impl UnwindSafe for AndAnd",1,["syn::token::AndAnd"]],["impl UnwindSafe for AndEq",1,["syn::token::AndEq"]],["impl UnwindSafe for As",1,["syn::token::As"]],["impl UnwindSafe for Async",1,["syn::token::Async"]],["impl UnwindSafe for At",1,["syn::token::At"]],["impl UnwindSafe for Auto",1,["syn::token::Auto"]],["impl UnwindSafe for Await",1,["syn::token::Await"]],["impl UnwindSafe for Become",1,["syn::token::Become"]],["impl UnwindSafe for Box",1,["syn::token::Box"]],["impl UnwindSafe for Brace",1,["syn::token::Brace"]],["impl UnwindSafe for Bracket",1,["syn::token::Bracket"]],["impl UnwindSafe for Break",1,["syn::token::Break"]],["impl UnwindSafe for Caret",1,["syn::token::Caret"]],["impl UnwindSafe for CaretEq",1,["syn::token::CaretEq"]],["impl UnwindSafe for Colon",1,["syn::token::Colon"]],["impl UnwindSafe for Comma",1,["syn::token::Comma"]],["impl UnwindSafe for Const",1,["syn::token::Const"]],["impl UnwindSafe for Continue",1,["syn::token::Continue"]],["impl UnwindSafe for Crate",1,["syn::token::Crate"]],["impl UnwindSafe for Default",1,["syn::token::Default"]],["impl UnwindSafe for Do",1,["syn::token::Do"]],["impl UnwindSafe for Dollar",1,["syn::token::Dollar"]],["impl UnwindSafe for Dot",1,["syn::token::Dot"]],["impl UnwindSafe for DotDot",1,["syn::token::DotDot"]],["impl UnwindSafe for DotDotDot",1,["syn::token::DotDotDot"]],["impl UnwindSafe for DotDotEq",1,["syn::token::DotDotEq"]],["impl UnwindSafe for Dyn",1,["syn::token::Dyn"]],["impl UnwindSafe for Else",1,["syn::token::Else"]],["impl UnwindSafe for Enum",1,["syn::token::Enum"]],["impl UnwindSafe for Eq",1,["syn::token::Eq"]],["impl UnwindSafe for EqEq",1,["syn::token::EqEq"]],["impl UnwindSafe for Extern",1,["syn::token::Extern"]],["impl UnwindSafe for FatArrow",1,["syn::token::FatArrow"]],["impl UnwindSafe for Final",1,["syn::token::Final"]],["impl UnwindSafe for Fn",1,["syn::token::Fn"]],["impl UnwindSafe for For",1,["syn::token::For"]],["impl UnwindSafe for Ge",1,["syn::token::Ge"]],["impl UnwindSafe for Group",1,["syn::token::Group"]],["impl UnwindSafe for Gt",1,["syn::token::Gt"]],["impl UnwindSafe for If",1,["syn::token::If"]],["impl UnwindSafe for Impl",1,["syn::token::Impl"]],["impl UnwindSafe for In",1,["syn::token::In"]],["impl UnwindSafe for LArrow",1,["syn::token::LArrow"]],["impl UnwindSafe for Le",1,["syn::token::Le"]],["impl UnwindSafe for Let",1,["syn::token::Let"]],["impl UnwindSafe for Loop",1,["syn::token::Loop"]],["impl UnwindSafe for Lt",1,["syn::token::Lt"]],["impl UnwindSafe for Macro",1,["syn::token::Macro"]],["impl UnwindSafe for Match",1,["syn::token::Match"]],["impl UnwindSafe for Minus",1,["syn::token::Minus"]],["impl UnwindSafe for MinusEq",1,["syn::token::MinusEq"]],["impl UnwindSafe for Mod",1,["syn::token::Mod"]],["impl UnwindSafe for Move",1,["syn::token::Move"]],["impl UnwindSafe for Mut",1,["syn::token::Mut"]],["impl UnwindSafe for Ne",1,["syn::token::Ne"]],["impl UnwindSafe for Not",1,["syn::token::Not"]],["impl UnwindSafe for Or",1,["syn::token::Or"]],["impl UnwindSafe for OrEq",1,["syn::token::OrEq"]],["impl UnwindSafe for OrOr",1,["syn::token::OrOr"]],["impl UnwindSafe for Override",1,["syn::token::Override"]],["impl UnwindSafe for Paren",1,["syn::token::Paren"]],["impl UnwindSafe for PathSep",1,["syn::token::PathSep"]],["impl UnwindSafe for Percent",1,["syn::token::Percent"]],["impl UnwindSafe for PercentEq",1,["syn::token::PercentEq"]],["impl UnwindSafe for Plus",1,["syn::token::Plus"]],["impl UnwindSafe for PlusEq",1,["syn::token::PlusEq"]],["impl UnwindSafe for Pound",1,["syn::token::Pound"]],["impl UnwindSafe for Priv",1,["syn::token::Priv"]],["impl UnwindSafe for Pub",1,["syn::token::Pub"]],["impl UnwindSafe for Question",1,["syn::token::Question"]],["impl UnwindSafe for RArrow",1,["syn::token::RArrow"]],["impl UnwindSafe for Ref",1,["syn::token::Ref"]],["impl UnwindSafe for Return",1,["syn::token::Return"]],["impl UnwindSafe for SelfType",1,["syn::token::SelfType"]],["impl UnwindSafe for SelfValue",1,["syn::token::SelfValue"]],["impl UnwindSafe for Semi",1,["syn::token::Semi"]],["impl UnwindSafe for Shl",1,["syn::token::Shl"]],["impl UnwindSafe for ShlEq",1,["syn::token::ShlEq"]],["impl UnwindSafe for Shr",1,["syn::token::Shr"]],["impl UnwindSafe for ShrEq",1,["syn::token::ShrEq"]],["impl UnwindSafe for Slash",1,["syn::token::Slash"]],["impl UnwindSafe for SlashEq",1,["syn::token::SlashEq"]],["impl UnwindSafe for Star",1,["syn::token::Star"]],["impl UnwindSafe for StarEq",1,["syn::token::StarEq"]],["impl UnwindSafe for Static",1,["syn::token::Static"]],["impl UnwindSafe for Struct",1,["syn::token::Struct"]],["impl UnwindSafe for Super",1,["syn::token::Super"]],["impl UnwindSafe for Tilde",1,["syn::token::Tilde"]],["impl UnwindSafe for Trait",1,["syn::token::Trait"]],["impl UnwindSafe for Try",1,["syn::token::Try"]],["impl UnwindSafe for Type",1,["syn::token::Type"]],["impl UnwindSafe for Typeof",1,["syn::token::Typeof"]],["impl UnwindSafe for Underscore",1,["syn::token::Underscore"]],["impl UnwindSafe for Union",1,["syn::token::Union"]],["impl UnwindSafe for Unsafe",1,["syn::token::Unsafe"]],["impl UnwindSafe for Unsized",1,["syn::token::Unsized"]],["impl UnwindSafe for Use",1,["syn::token::Use"]],["impl UnwindSafe for Virtual",1,["syn::token::Virtual"]],["impl UnwindSafe for Where",1,["syn::token::Where"]],["impl UnwindSafe for While",1,["syn::token::While"]],["impl UnwindSafe for Yield",1,["syn::token::Yield"]],["impl<'a> !UnwindSafe for ParseNestedMeta<'a>",1,["syn::meta::ParseNestedMeta"]],["impl<'a> !UnwindSafe for ParseBuffer<'a>",1,["syn::parse::ParseBuffer"]],["impl<'a> UnwindSafe for Cursor<'a>",1,["syn::buffer::Cursor"]],["impl<'a> UnwindSafe for Lookahead1<'a>",1,["syn::lookahead::Lookahead1"]],["impl<'a> UnwindSafe for ImplGenerics<'a>",1,["syn::generics::ImplGenerics"]],["impl<'a> UnwindSafe for Turbofish<'a>",1,["syn::generics::Turbofish"]],["impl<'a> UnwindSafe for TypeGenerics<'a>",1,["syn::generics::TypeGenerics"]],["impl<'a, T> !UnwindSafe for Iter<'a, T>",1,["syn::punctuated::Iter"]],["impl<'a, T> !UnwindSafe for IterMut<'a, T>",1,["syn::punctuated::IterMut"]],["impl<'a, T, P> !UnwindSafe for PairsMut<'a, T, P>",1,["syn::punctuated::PairsMut"]],["impl<'a, T, P> UnwindSafe for Pairs<'a, T, P>
where\n T: RefUnwindSafe,\n P: RefUnwindSafe,
",1,["syn::punctuated::Pairs"]],["impl<'c, 'a> UnwindSafe for StepCursor<'c, 'a>",1,["syn::parse::StepCursor"]],["impl<T> UnwindSafe for IntoIter<T>",1,["syn::punctuated::IntoIter"]],["impl<T, P> UnwindSafe for Pair<T, P>
where\n T: UnwindSafe,\n P: UnwindSafe,
",1,["syn::punctuated::Pair"]],["impl<T, P> UnwindSafe for IntoPairs<T, P>",1,["syn::punctuated::IntoPairs"]],["impl<T, P> UnwindSafe for Punctuated<T, P>
where\n T: UnwindSafe,\n P: UnwindSafe,
",1,["syn::punctuated::Punctuated"]]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/str/traits/trait.FromStr.js b/trait.impl/core/str/traits/trait.FromStr.js new file mode 100644 index 0000000..8ad98ac --- /dev/null +++ b/trait.impl/core/str/traits/trait.FromStr.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"proc_macro2":[["impl FromStr for Literal"],["impl FromStr for TokenStream"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/quote/ext/trait.TokenStreamExt.js b/trait.impl/quote/ext/trait.TokenStreamExt.js new file mode 100644 index 0000000..05ee4dc --- /dev/null +++ b/trait.impl/quote/ext/trait.TokenStreamExt.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"quote":[] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/quote/ident_fragment/trait.IdentFragment.js b/trait.impl/quote/ident_fragment/trait.IdentFragment.js new file mode 100644 index 0000000..27db79d --- /dev/null +++ b/trait.impl/quote/ident_fragment/trait.IdentFragment.js @@ -0,0 +1,4 @@ +(function() {var implementors = { +"quote":[], +"syn":[["impl IdentFragment for Member"],["impl IdentFragment for Index"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/quote/to_tokens/trait.ToTokens.js b/trait.impl/quote/to_tokens/trait.ToTokens.js new file mode 100644 index 0000000..9f864a2 --- /dev/null +++ b/trait.impl/quote/to_tokens/trait.ToTokens.js @@ -0,0 +1,4 @@ +(function() {var implementors = { +"quote":[], +"syn":[["impl ToTokens for BinOp"],["impl ToTokens for Expr"],["impl ToTokens for Fields"],["impl ToTokens for FnArg"],["impl ToTokens for ForeignItem"],["impl ToTokens for GenericArgument"],["impl ToTokens for GenericParam"],["impl ToTokens for ImplItem"],["impl ToTokens for Item"],["impl ToTokens for Lit"],["impl ToTokens for Member"],["impl ToTokens for Meta"],["impl ToTokens for Pat"],["impl ToTokens for PathArguments"],["impl ToTokens for RangeLimits"],["impl ToTokens for ReturnType"],["impl ToTokens for StaticMutability"],["impl ToTokens for Stmt"],["impl ToTokens for TraitBoundModifier"],["impl ToTokens for TraitItem"],["impl ToTokens for Type"],["impl ToTokens for TypeParamBound"],["impl ToTokens for UnOp"],["impl ToTokens for UseTree"],["impl ToTokens for Visibility"],["impl ToTokens for WherePredicate"],["impl ToTokens for Nothing"],["impl ToTokens for Abi"],["impl ToTokens for AngleBracketedGenericArguments"],["impl ToTokens for Arm"],["impl ToTokens for AssocConst"],["impl ToTokens for AssocType"],["impl ToTokens for Attribute"],["impl ToTokens for BareFnArg"],["impl ToTokens for BareVariadic"],["impl ToTokens for Block"],["impl ToTokens for BoundLifetimes"],["impl ToTokens for ConstParam"],["impl ToTokens for Constraint"],["impl ToTokens for DeriveInput"],["impl ToTokens for ExprArray"],["impl ToTokens for ExprAssign"],["impl ToTokens for ExprAsync"],["impl ToTokens for ExprAwait"],["impl ToTokens for ExprBinary"],["impl ToTokens for ExprBlock"],["impl ToTokens for ExprBreak"],["impl ToTokens for ExprCall"],["impl ToTokens for ExprCast"],["impl ToTokens for ExprClosure"],["impl ToTokens for ExprConst"],["impl ToTokens for ExprContinue"],["impl ToTokens for ExprField"],["impl ToTokens for ExprForLoop"],["impl ToTokens for ExprGroup"],["impl ToTokens for ExprIf"],["impl ToTokens for ExprIndex"],["impl ToTokens for ExprInfer"],["impl ToTokens for ExprLet"],["impl ToTokens for ExprLit"],["impl ToTokens for ExprLoop"],["impl ToTokens for ExprMacro"],["impl ToTokens for ExprMatch"],["impl ToTokens for ExprMethodCall"],["impl ToTokens for ExprParen"],["impl ToTokens for ExprPath"],["impl ToTokens for ExprRange"],["impl ToTokens for ExprReference"],["impl ToTokens for ExprRepeat"],["impl ToTokens for ExprReturn"],["impl ToTokens for ExprStruct"],["impl ToTokens for ExprTry"],["impl ToTokens for ExprTryBlock"],["impl ToTokens for ExprTuple"],["impl ToTokens for ExprUnary"],["impl ToTokens for ExprUnsafe"],["impl ToTokens for ExprWhile"],["impl ToTokens for ExprYield"],["impl ToTokens for Field"],["impl ToTokens for FieldPat"],["impl ToTokens for FieldValue"],["impl ToTokens for FieldsNamed"],["impl ToTokens for FieldsUnnamed"],["impl ToTokens for File"],["impl ToTokens for ForeignItemFn"],["impl ToTokens for ForeignItemMacro"],["impl ToTokens for ForeignItemStatic"],["impl ToTokens for ForeignItemType"],["impl ToTokens for Generics"],["impl ToTokens for ImplItemConst"],["impl ToTokens for ImplItemFn"],["impl ToTokens for ImplItemMacro"],["impl ToTokens for ImplItemType"],["impl ToTokens for Index"],["impl ToTokens for ItemConst"],["impl ToTokens for ItemEnum"],["impl ToTokens for ItemExternCrate"],["impl ToTokens for ItemFn"],["impl ToTokens for ItemForeignMod"],["impl ToTokens for ItemImpl"],["impl ToTokens for ItemMacro"],["impl ToTokens for ItemMod"],["impl ToTokens for ItemStatic"],["impl ToTokens for ItemStruct"],["impl ToTokens for ItemTrait"],["impl ToTokens for ItemTraitAlias"],["impl ToTokens for ItemType"],["impl ToTokens for ItemUnion"],["impl ToTokens for ItemUse"],["impl ToTokens for Label"],["impl ToTokens for Lifetime"],["impl ToTokens for LifetimeParam"],["impl ToTokens for LitBool"],["impl ToTokens for LitByte"],["impl ToTokens for LitByteStr"],["impl ToTokens for LitCStr"],["impl ToTokens for LitChar"],["impl ToTokens for LitFloat"],["impl ToTokens for LitInt"],["impl ToTokens for LitStr"],["impl ToTokens for Local"],["impl ToTokens for Macro"],["impl ToTokens for MetaList"],["impl ToTokens for MetaNameValue"],["impl ToTokens for ParenthesizedGenericArguments"],["impl ToTokens for PatIdent"],["impl ToTokens for PatOr"],["impl ToTokens for PatParen"],["impl ToTokens for PatReference"],["impl ToTokens for PatRest"],["impl ToTokens for PatSlice"],["impl ToTokens for PatStruct"],["impl ToTokens for PatTuple"],["impl ToTokens for PatTupleStruct"],["impl ToTokens for PatType"],["impl ToTokens for PatWild"],["impl ToTokens for Path"],["impl ToTokens for PathSegment"],["impl ToTokens for PredicateLifetime"],["impl ToTokens for PredicateType"],["impl ToTokens for Receiver"],["impl ToTokens for Signature"],["impl ToTokens for StmtMacro"],["impl ToTokens for TraitBound"],["impl ToTokens for TraitItemConst"],["impl ToTokens for TraitItemFn"],["impl ToTokens for TraitItemMacro"],["impl ToTokens for TraitItemType"],["impl ToTokens for TypeArray"],["impl ToTokens for TypeBareFn"],["impl ToTokens for TypeGroup"],["impl ToTokens for TypeImplTrait"],["impl ToTokens for TypeInfer"],["impl ToTokens for TypeMacro"],["impl ToTokens for TypeNever"],["impl ToTokens for TypeParam"],["impl ToTokens for TypeParen"],["impl ToTokens for TypePath"],["impl ToTokens for TypePtr"],["impl ToTokens for TypeReference"],["impl ToTokens for TypeSlice"],["impl ToTokens for TypeTraitObject"],["impl ToTokens for TypeTuple"],["impl ToTokens for UseGlob"],["impl ToTokens for UseGroup"],["impl ToTokens for UseName"],["impl ToTokens for UsePath"],["impl ToTokens for UseRename"],["impl ToTokens for Variadic"],["impl ToTokens for Variant"],["impl ToTokens for VisRestricted"],["impl ToTokens for WhereClause"],["impl ToTokens for Abstract"],["impl ToTokens for And"],["impl ToTokens for AndAnd"],["impl ToTokens for AndEq"],["impl ToTokens for As"],["impl ToTokens for Async"],["impl ToTokens for At"],["impl ToTokens for Auto"],["impl ToTokens for Await"],["impl ToTokens for Become"],["impl ToTokens for Box"],["impl ToTokens for Break"],["impl ToTokens for Caret"],["impl ToTokens for CaretEq"],["impl ToTokens for Colon"],["impl ToTokens for Comma"],["impl ToTokens for Const"],["impl ToTokens for Continue"],["impl ToTokens for Crate"],["impl ToTokens for Default"],["impl ToTokens for Do"],["impl ToTokens for Dollar"],["impl ToTokens for Dot"],["impl ToTokens for DotDot"],["impl ToTokens for DotDotDot"],["impl ToTokens for DotDotEq"],["impl ToTokens for Dyn"],["impl ToTokens for Else"],["impl ToTokens for Enum"],["impl ToTokens for Eq"],["impl ToTokens for EqEq"],["impl ToTokens for Extern"],["impl ToTokens for FatArrow"],["impl ToTokens for Final"],["impl ToTokens for Fn"],["impl ToTokens for For"],["impl ToTokens for Ge"],["impl ToTokens for Gt"],["impl ToTokens for If"],["impl ToTokens for Impl"],["impl ToTokens for In"],["impl ToTokens for LArrow"],["impl ToTokens for Le"],["impl ToTokens for Let"],["impl ToTokens for Loop"],["impl ToTokens for Lt"],["impl ToTokens for Macro"],["impl ToTokens for Match"],["impl ToTokens for Minus"],["impl ToTokens for MinusEq"],["impl ToTokens for Mod"],["impl ToTokens for Move"],["impl ToTokens for Mut"],["impl ToTokens for Ne"],["impl ToTokens for Not"],["impl ToTokens for Or"],["impl ToTokens for OrEq"],["impl ToTokens for OrOr"],["impl ToTokens for Override"],["impl ToTokens for PathSep"],["impl ToTokens for Percent"],["impl ToTokens for PercentEq"],["impl ToTokens for Plus"],["impl ToTokens for PlusEq"],["impl ToTokens for Pound"],["impl ToTokens for Priv"],["impl ToTokens for Pub"],["impl ToTokens for Question"],["impl ToTokens for RArrow"],["impl ToTokens for Ref"],["impl ToTokens for Return"],["impl ToTokens for SelfType"],["impl ToTokens for SelfValue"],["impl ToTokens for Semi"],["impl ToTokens for Shl"],["impl ToTokens for ShlEq"],["impl ToTokens for Shr"],["impl ToTokens for ShrEq"],["impl ToTokens for Slash"],["impl ToTokens for SlashEq"],["impl ToTokens for Star"],["impl ToTokens for StarEq"],["impl ToTokens for Static"],["impl ToTokens for Struct"],["impl ToTokens for Super"],["impl ToTokens for Tilde"],["impl ToTokens for Trait"],["impl ToTokens for Try"],["impl ToTokens for Type"],["impl ToTokens for Typeof"],["impl ToTokens for Underscore"],["impl ToTokens for Union"],["impl ToTokens for Unsafe"],["impl ToTokens for Unsized"],["impl ToTokens for Use"],["impl ToTokens for Virtual"],["impl ToTokens for Where"],["impl ToTokens for While"],["impl ToTokens for Yield"],["impl<'a> ToTokens for ImplGenerics<'a>"],["impl<'a> ToTokens for Turbofish<'a>"],["impl<'a> ToTokens for TypeGenerics<'a>"],["impl<T, P> ToTokens for Pair<T, P>
where\n T: ToTokens,\n P: ToTokens,
"],["impl<T, P> ToTokens for Punctuated<T, P>
where\n T: ToTokens,\n P: ToTokens,
"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/syn/ext/trait.IdentExt.js b/trait.impl/syn/ext/trait.IdentExt.js new file mode 100644 index 0000000..a0219ef --- /dev/null +++ b/trait.impl/syn/ext/trait.IdentExt.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"syn":[] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/syn/lookahead/trait.Peek.js b/trait.impl/syn/lookahead/trait.Peek.js new file mode 100644 index 0000000..a0219ef --- /dev/null +++ b/trait.impl/syn/lookahead/trait.Peek.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"syn":[] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/syn/parse/discouraged/trait.AnyDelimiter.js b/trait.impl/syn/parse/discouraged/trait.AnyDelimiter.js new file mode 100644 index 0000000..a0219ef --- /dev/null +++ b/trait.impl/syn/parse/discouraged/trait.AnyDelimiter.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"syn":[] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/syn/parse/discouraged/trait.Speculative.js b/trait.impl/syn/parse/discouraged/trait.Speculative.js new file mode 100644 index 0000000..a0219ef --- /dev/null +++ b/trait.impl/syn/parse/discouraged/trait.Speculative.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"syn":[] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/syn/parse/trait.Parse.js b/trait.impl/syn/parse/trait.Parse.js new file mode 100644 index 0000000..a0219ef --- /dev/null +++ b/trait.impl/syn/parse/trait.Parse.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"syn":[] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/syn/parse/trait.Parser.js b/trait.impl/syn/parse/trait.Parser.js new file mode 100644 index 0000000..a0219ef --- /dev/null +++ b/trait.impl/syn/parse/trait.Parser.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"syn":[] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/syn/spanned/trait.Spanned.js b/trait.impl/syn/spanned/trait.Spanned.js new file mode 100644 index 0000000..a0219ef --- /dev/null +++ b/trait.impl/syn/spanned/trait.Spanned.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"syn":[] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/syn/token/trait.Token.js b/trait.impl/syn/token/trait.Token.js new file mode 100644 index 0000000..a0219ef --- /dev/null +++ b/trait.impl/syn/token/trait.Token.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"syn":[] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/type.impl/core/result/enum.Result.js b/type.impl/core/result/enum.Result.js new file mode 100644 index 0000000..bd7bb46 --- /dev/null +++ b/type.impl/core/result/enum.Result.js @@ -0,0 +1,3 @@ +(function() {var type_impls = { +"syn":[["
1.0.0 · source§

impl<T, E> Clone for Result<T, E>
where\n T: Clone,\n E: Clone,

source§

fn clone(&self) -> Result<T, E>

Returns a copy of the value. Read more
source§

fn clone_from(&mut self, source: &Result<T, E>)

Performs copy-assignment from source. Read more
","Clone","syn::error::Result"],["
1.0.0 · source§

impl<T, E> Debug for Result<T, E>
where\n T: Debug,\n E: Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
","Debug","syn::error::Result"],["
1.0.0 · source§

impl<A, E, V> FromIterator<Result<A, E>> for Result<V, E>
where\n V: FromIterator<A>,

source§

fn from_iter<I>(iter: I) -> Result<V, E>
where\n I: IntoIterator<Item = Result<A, E>>,

Takes each element in the Iterator: if it is an Err, no further\nelements are taken, and the Err is returned. Should no Err occur, a\ncontainer with the values of each Result is returned.

\n

Here is an example which increments every integer in a vector,\nchecking for overflow:

\n\n
let v = vec![1, 2];\nlet res: Result<Vec<u32>, &'static str> = v.iter().map(|x: &u32|\n    x.checked_add(1).ok_or(\"Overflow!\")\n).collect();\nassert_eq!(res, Ok(vec![2, 3]));
\n

Here is another example that tries to subtract one from another list\nof integers, this time checking for underflow:

\n\n
let v = vec![1, 2, 0];\nlet res: Result<Vec<u32>, &'static str> = v.iter().map(|x: &u32|\n    x.checked_sub(1).ok_or(\"Underflow!\")\n).collect();\nassert_eq!(res, Err(\"Underflow!\"));
\n

Here is a variation on the previous example, showing that no\nfurther elements are taken from iter after the first Err.

\n\n
let v = vec![3, 2, 1, 10];\nlet mut shared = 0;\nlet res: Result<Vec<u32>, &'static str> = v.iter().map(|x: &u32| {\n    shared += x;\n    x.checked_sub(2).ok_or(\"Underflow!\")\n}).collect();\nassert_eq!(res, Err(\"Underflow!\"));\nassert_eq!(shared, 6);
\n

Since the third element caused an underflow, no further elements were taken,\nso the final value of shared is 6 (= 3 + 2 + 1), not 16.

\n
","FromIterator>","syn::error::Result"],["
source§

impl<T, E, F> FromResidual<Result<Infallible, E>> for Result<T, F>
where\n F: From<E>,

source§

fn from_residual(residual: Result<Infallible, E>) -> Result<T, F>

🔬This is a nightly-only experimental API. (try_trait_v2)
Constructs the type from a compatible Residual type. Read more
","FromResidual>","syn::error::Result"],["
source§

impl<T, E, F> FromResidual<Yeet<E>> for Result<T, F>
where\n F: From<E>,

source§

fn from_residual(_: Yeet<E>) -> Result<T, F>

🔬This is a nightly-only experimental API. (try_trait_v2)
Constructs the type from a compatible Residual type. Read more
","FromResidual>","syn::error::Result"],["
1.0.0 · source§

impl<T, E> Hash for Result<T, E>
where\n T: Hash,\n E: Hash,

source§

fn hash<__H>(&self, state: &mut __H)
where\n __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where\n H: Hasher,\n Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
","Hash","syn::error::Result"],["
1.0.0 · source§

impl<T, E> IntoIterator for Result<T, E>

source§

fn into_iter(self) -> IntoIter<T>

Returns a consuming iterator over the possibly contained value.

\n

The iterator yields one value if the result is Result::Ok, otherwise none.

\n
§Examples
\n
let x: Result<u32, &str> = Ok(5);\nlet v: Vec<u32> = x.into_iter().collect();\nassert_eq!(v, [5]);\n\nlet x: Result<u32, &str> = Err(\"nothing!\");\nlet v: Vec<u32> = x.into_iter().collect();\nassert_eq!(v, []);
\n
§

type Item = T

The type of the elements being iterated over.
§

type IntoIter = IntoIter<T>

Which kind of iterator are we turning this into?
","IntoIterator","syn::error::Result"],["
1.0.0 · source§

impl<T, E> Ord for Result<T, E>
where\n T: Ord,\n E: Ord,

source§

fn cmp(&self, other: &Result<T, E>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where\n Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where\n Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where\n Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
","Ord","syn::error::Result"],["
1.0.0 · source§

impl<T, E> PartialEq for Result<T, E>
where\n T: PartialEq,\n E: PartialEq,

source§

fn eq(&self, other: &Result<T, E>) -> bool

This method tests for self and other values to be equal, and is used\nby ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
","PartialEq","syn::error::Result"],["
1.0.0 · source§

impl<T, E> PartialOrd for Result<T, E>
where\n T: PartialOrd,\n E: PartialOrd,

source§

fn partial_cmp(&self, other: &Result<T, E>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <=\noperator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >=\noperator. Read more
","PartialOrd","syn::error::Result"],["
1.16.0 · source§

impl<T, U, E> Product<Result<U, E>> for Result<T, E>
where\n T: Product<U>,

source§

fn product<I>(iter: I) -> Result<T, E>
where\n I: Iterator<Item = Result<U, E>>,

Takes each element in the Iterator: if it is an Err, no further\nelements are taken, and the Err is returned. Should no Err\noccur, the product of all elements is returned.

\n
§Examples
\n

This multiplies each number in a vector of strings,\nif a string could not be parsed the operation returns Err:

\n\n
let nums = vec![\"5\", \"10\", \"1\", \"2\"];\nlet total: Result<usize, _> = nums.iter().map(|w| w.parse::<usize>()).product();\nassert_eq!(total, Ok(100));\nlet nums = vec![\"5\", \"10\", \"one\", \"2\"];\nlet total: Result<usize, _> = nums.iter().map(|w| w.parse::<usize>()).product();\nassert!(total.is_err());
\n
","Product>","syn::error::Result"],["
source§

impl<T, E> Residual<T> for Result<Infallible, E>

§

type TryType = Result<T, E>

🔬This is a nightly-only experimental API. (try_trait_v2_residual)
The “return” type of this meta-function.
","Residual","syn::error::Result"],["
source§

impl<T, E> Result<&T, E>

1.59.0 · source

pub fn copied(self) -> Result<T, E>
where\n T: Copy,

Maps a Result<&T, E> to a Result<T, E> by copying the contents of the\nOk part.

\n
§Examples
\n
let val = 12;\nlet x: Result<&i32, i32> = Ok(&val);\nassert_eq!(x, Ok(&12));\nlet copied = x.copied();\nassert_eq!(copied, Ok(12));
\n
1.59.0 · source

pub fn cloned(self) -> Result<T, E>
where\n T: Clone,

Maps a Result<&T, E> to a Result<T, E> by cloning the contents of the\nOk part.

\n
§Examples
\n
let val = 12;\nlet x: Result<&i32, i32> = Ok(&val);\nassert_eq!(x, Ok(&12));\nlet cloned = x.cloned();\nassert_eq!(cloned, Ok(12));
\n
",0,"syn::error::Result"],["
source§

impl<T, E> Result<&mut T, E>

1.59.0 · source

pub fn copied(self) -> Result<T, E>
where\n T: Copy,

Maps a Result<&mut T, E> to a Result<T, E> by copying the contents of the\nOk part.

\n
§Examples
\n
let mut val = 12;\nlet x: Result<&mut i32, i32> = Ok(&mut val);\nassert_eq!(x, Ok(&mut 12));\nlet copied = x.copied();\nassert_eq!(copied, Ok(12));
\n
1.59.0 · source

pub fn cloned(self) -> Result<T, E>
where\n T: Clone,

Maps a Result<&mut T, E> to a Result<T, E> by cloning the contents of the\nOk part.

\n
§Examples
\n
let mut val = 12;\nlet x: Result<&mut i32, i32> = Ok(&mut val);\nassert_eq!(x, Ok(&mut 12));\nlet cloned = x.cloned();\nassert_eq!(cloned, Ok(12));
\n
",0,"syn::error::Result"],["
source§

impl<T, E> Result<Option<T>, E>

1.33.0 (const: unstable) · source

pub fn transpose(self) -> Option<Result<T, E>>

Transposes a Result of an Option into an Option of a Result.

\n

Ok(None) will be mapped to None.\nOk(Some(_)) and Err(_) will be mapped to Some(Ok(_)) and Some(Err(_)).

\n
§Examples
\n
#[derive(Debug, Eq, PartialEq)]\nstruct SomeErr;\n\nlet x: Result<Option<i32>, SomeErr> = Ok(Some(5));\nlet y: Option<Result<i32, SomeErr>> = Some(Ok(5));\nassert_eq!(x.transpose(), y);
\n
",0,"syn::error::Result"],["
source§

impl<T, E> Result<Result<T, E>, E>

source

pub fn flatten(self) -> Result<T, E>

🔬This is a nightly-only experimental API. (result_flattening)

Converts from Result<Result<T, E>, E> to Result<T, E>

\n
§Examples
\n
#![feature(result_flattening)]\nlet x: Result<Result<&'static str, u32>, u32> = Ok(Ok(\"hello\"));\nassert_eq!(Ok(\"hello\"), x.flatten());\n\nlet x: Result<Result<&'static str, u32>, u32> = Ok(Err(6));\nassert_eq!(Err(6), x.flatten());\n\nlet x: Result<Result<&'static str, u32>, u32> = Err(6);\nassert_eq!(Err(6), x.flatten());
\n

Flattening only removes one level of nesting at a time:

\n\n
#![feature(result_flattening)]\nlet x: Result<Result<Result<&'static str, u32>, u32>, u32> = Ok(Ok(Ok(\"hello\")));\nassert_eq!(Ok(Ok(\"hello\")), x.flatten());\nassert_eq!(Ok(\"hello\"), x.flatten().flatten());
\n
",0,"syn::error::Result"],["
source§

impl<T, E> Result<T, E>

1.0.0 (const: 1.48.0) · source

pub const fn is_ok(&self) -> bool

Returns true if the result is Ok.

\n
§Examples
\n
let x: Result<i32, &str> = Ok(-3);\nassert_eq!(x.is_ok(), true);\n\nlet x: Result<i32, &str> = Err(\"Some error message\");\nassert_eq!(x.is_ok(), false);
\n
1.70.0 · source

pub fn is_ok_and(self, f: impl FnOnce(T) -> bool) -> bool

Returns true if the result is Ok and the value inside of it matches a predicate.

\n
§Examples
\n
let x: Result<u32, &str> = Ok(2);\nassert_eq!(x.is_ok_and(|x| x > 1), true);\n\nlet x: Result<u32, &str> = Ok(0);\nassert_eq!(x.is_ok_and(|x| x > 1), false);\n\nlet x: Result<u32, &str> = Err(\"hey\");\nassert_eq!(x.is_ok_and(|x| x > 1), false);
\n
1.0.0 (const: 1.48.0) · source

pub const fn is_err(&self) -> bool

Returns true if the result is Err.

\n
§Examples
\n
let x: Result<i32, &str> = Ok(-3);\nassert_eq!(x.is_err(), false);\n\nlet x: Result<i32, &str> = Err(\"Some error message\");\nassert_eq!(x.is_err(), true);
\n
1.70.0 · source

pub fn is_err_and(self, f: impl FnOnce(E) -> bool) -> bool

Returns true if the result is Err and the value inside of it matches a predicate.

\n
§Examples
\n
use std::io::{Error, ErrorKind};\n\nlet x: Result<u32, Error> = Err(Error::new(ErrorKind::NotFound, \"!\"));\nassert_eq!(x.is_err_and(|x| x.kind() == ErrorKind::NotFound), true);\n\nlet x: Result<u32, Error> = Err(Error::new(ErrorKind::PermissionDenied, \"!\"));\nassert_eq!(x.is_err_and(|x| x.kind() == ErrorKind::NotFound), false);\n\nlet x: Result<u32, Error> = Ok(123);\nassert_eq!(x.is_err_and(|x| x.kind() == ErrorKind::NotFound), false);
\n
1.0.0 · source

pub fn ok(self) -> Option<T>

Converts from Result<T, E> to Option<T>.

\n

Converts self into an Option<T>, consuming self,\nand discarding the error, if any.

\n
§Examples
\n
let x: Result<u32, &str> = Ok(2);\nassert_eq!(x.ok(), Some(2));\n\nlet x: Result<u32, &str> = Err(\"Nothing here\");\nassert_eq!(x.ok(), None);
\n
1.0.0 · source

pub fn err(self) -> Option<E>

Converts from Result<T, E> to Option<E>.

\n

Converts self into an Option<E>, consuming self,\nand discarding the success value, if any.

\n
§Examples
\n
let x: Result<u32, &str> = Ok(2);\nassert_eq!(x.err(), None);\n\nlet x: Result<u32, &str> = Err(\"Nothing here\");\nassert_eq!(x.err(), Some(\"Nothing here\"));
\n
1.0.0 (const: 1.48.0) · source

pub const fn as_ref(&self) -> Result<&T, &E>

Converts from &Result<T, E> to Result<&T, &E>.

\n

Produces a new Result, containing a reference\ninto the original, leaving the original in place.

\n
§Examples
\n
let x: Result<u32, &str> = Ok(2);\nassert_eq!(x.as_ref(), Ok(&2));\n\nlet x: Result<u32, &str> = Err(\"Error\");\nassert_eq!(x.as_ref(), Err(&\"Error\"));
\n
1.0.0 (const: unstable) · source

pub fn as_mut(&mut self) -> Result<&mut T, &mut E>

Converts from &mut Result<T, E> to Result<&mut T, &mut E>.

\n
§Examples
\n
fn mutate(r: &mut Result<i32, i32>) {\n    match r.as_mut() {\n        Ok(v) => *v = 42,\n        Err(e) => *e = 0,\n    }\n}\n\nlet mut x: Result<i32, i32> = Ok(2);\nmutate(&mut x);\nassert_eq!(x.unwrap(), 42);\n\nlet mut x: Result<i32, i32> = Err(13);\nmutate(&mut x);\nassert_eq!(x.unwrap_err(), 0);
\n
1.0.0 · source

pub fn map<U, F>(self, op: F) -> Result<U, E>
where\n F: FnOnce(T) -> U,

Maps a Result<T, E> to Result<U, E> by applying a function to a\ncontained Ok value, leaving an Err value untouched.

\n

This function can be used to compose the results of two functions.

\n
§Examples
\n

Print the numbers on each line of a string multiplied by two.

\n\n
let line = \"1\\n2\\n3\\n4\\n\";\n\nfor num in line.lines() {\n    match num.parse::<i32>().map(|i| i * 2) {\n        Ok(n) => println!(\"{n}\"),\n        Err(..) => {}\n    }\n}
\n
1.41.0 · source

pub fn map_or<U, F>(self, default: U, f: F) -> U
where\n F: FnOnce(T) -> U,

Returns the provided default (if Err), or\napplies a function to the contained value (if Ok).

\n

Arguments passed to map_or are eagerly evaluated; if you are passing\nthe result of a function call, it is recommended to use map_or_else,\nwhich is lazily evaluated.

\n
§Examples
\n
let x: Result<_, &str> = Ok(\"foo\");\nassert_eq!(x.map_or(42, |v| v.len()), 3);\n\nlet x: Result<&str, _> = Err(\"bar\");\nassert_eq!(x.map_or(42, |v| v.len()), 42);
\n
1.41.0 · source

pub fn map_or_else<U, D, F>(self, default: D, f: F) -> U
where\n D: FnOnce(E) -> U,\n F: FnOnce(T) -> U,

Maps a Result<T, E> to U by applying fallback function default to\na contained Err value, or function f to a contained Ok value.

\n

This function can be used to unpack a successful result\nwhile handling an error.

\n
§Examples
\n
let k = 21;\n\nlet x : Result<_, &str> = Ok(\"foo\");\nassert_eq!(x.map_or_else(|e| k * 2, |v| v.len()), 3);\n\nlet x : Result<&str, _> = Err(\"bar\");\nassert_eq!(x.map_or_else(|e| k * 2, |v| v.len()), 42);
\n
1.0.0 · source

pub fn map_err<F, O>(self, op: O) -> Result<T, F>
where\n O: FnOnce(E) -> F,

Maps a Result<T, E> to Result<T, F> by applying a function to a\ncontained Err value, leaving an Ok value untouched.

\n

This function can be used to pass through a successful result while handling\nan error.

\n
§Examples
\n
fn stringify(x: u32) -> String { format!(\"error code: {x}\") }\n\nlet x: Result<u32, u32> = Ok(2);\nassert_eq!(x.map_err(stringify), Ok(2));\n\nlet x: Result<u32, u32> = Err(13);\nassert_eq!(x.map_err(stringify), Err(\"error code: 13\".to_string()));
\n
1.76.0 · source

pub fn inspect<F>(self, f: F) -> Result<T, E>
where\n F: FnOnce(&T),

Calls a function with a reference to the contained value if Ok.

\n

Returns the original result.

\n
§Examples
\n
let x: u8 = \"4\"\n    .parse::<u8>()\n    .inspect(|x| println!(\"original: {x}\"))\n    .map(|x| x.pow(3))\n    .expect(\"failed to parse number\");
\n
1.76.0 · source

pub fn inspect_err<F>(self, f: F) -> Result<T, E>
where\n F: FnOnce(&E),

Calls a function with a reference to the contained value if Err.

\n

Returns the original result.

\n
§Examples
\n
use std::{fs, io};\n\nfn read() -> io::Result<String> {\n    fs::read_to_string(\"address.txt\")\n        .inspect_err(|e| eprintln!(\"failed to read file: {e}\"))\n}
\n
1.47.0 · source

pub fn as_deref(&self) -> Result<&<T as Deref>::Target, &E>
where\n T: Deref,

Converts from Result<T, E> (or &Result<T, E>) to Result<&<T as Deref>::Target, &E>.

\n

Coerces the Ok variant of the original Result via Deref\nand returns the new Result.

\n
§Examples
\n
let x: Result<String, u32> = Ok(\"hello\".to_string());\nlet y: Result<&str, &u32> = Ok(\"hello\");\nassert_eq!(x.as_deref(), y);\n\nlet x: Result<String, u32> = Err(42);\nlet y: Result<&str, &u32> = Err(&42);\nassert_eq!(x.as_deref(), y);
\n
1.47.0 · source

pub fn as_deref_mut(&mut self) -> Result<&mut <T as Deref>::Target, &mut E>
where\n T: DerefMut,

Converts from Result<T, E> (or &mut Result<T, E>) to Result<&mut <T as DerefMut>::Target, &mut E>.

\n

Coerces the Ok variant of the original Result via DerefMut\nand returns the new Result.

\n
§Examples
\n
let mut s = \"HELLO\".to_string();\nlet mut x: Result<String, u32> = Ok(\"hello\".to_string());\nlet y: Result<&mut str, &mut u32> = Ok(&mut s);\nassert_eq!(x.as_deref_mut().map(|x| { x.make_ascii_uppercase(); x }), y);\n\nlet mut i = 42;\nlet mut x: Result<String, u32> = Err(42);\nlet y: Result<&mut str, &mut u32> = Err(&mut i);\nassert_eq!(x.as_deref_mut().map(|x| { x.make_ascii_uppercase(); x }), y);
\n
1.0.0 · source

pub fn iter(&self) -> Iter<'_, T>

Returns an iterator over the possibly contained value.

\n

The iterator yields one value if the result is Result::Ok, otherwise none.

\n
§Examples
\n
let x: Result<u32, &str> = Ok(7);\nassert_eq!(x.iter().next(), Some(&7));\n\nlet x: Result<u32, &str> = Err(\"nothing!\");\nassert_eq!(x.iter().next(), None);
\n
1.0.0 · source

pub fn iter_mut(&mut self) -> IterMut<'_, T>

Returns a mutable iterator over the possibly contained value.

\n

The iterator yields one value if the result is Result::Ok, otherwise none.

\n
§Examples
\n
let mut x: Result<u32, &str> = Ok(7);\nmatch x.iter_mut().next() {\n    Some(v) => *v = 40,\n    None => {},\n}\nassert_eq!(x, Ok(40));\n\nlet mut x: Result<u32, &str> = Err(\"nothing!\");\nassert_eq!(x.iter_mut().next(), None);
\n
1.4.0 · source

pub fn expect(self, msg: &str) -> T
where\n E: Debug,

Returns the contained Ok value, consuming the self value.

\n

Because this function may panic, its use is generally discouraged.\nInstead, prefer to use pattern matching and handle the Err\ncase explicitly, or call unwrap_or, unwrap_or_else, or\nunwrap_or_default.

\n
§Panics
\n

Panics if the value is an Err, with a panic message including the\npassed message, and the content of the Err.

\n
§Examples
\n
let x: Result<u32, &str> = Err(\"emergency failure\");\nx.expect(\"Testing expect\"); // panics with `Testing expect: emergency failure`
\n
§Recommended Message Style
\n

We recommend that expect messages are used to describe the reason you\nexpect the Result should be Ok.

\n\n
let path = std::env::var(\"IMPORTANT_PATH\")\n    .expect(\"env variable `IMPORTANT_PATH` should be set by `wrapper_script.sh`\");
\n

Hint: If you’re having trouble remembering how to phrase expect\nerror messages remember to focus on the word “should” as in “env\nvariable should be set by blah” or “the given binary should be available\nand executable by the current user”.

\n

For more detail on expect message styles and the reasoning behind our recommendation please\nrefer to the section on “Common Message\nStyles” in the\nstd::error module docs.

\n
1.0.0 · source

pub fn unwrap(self) -> T
where\n E: Debug,

Returns the contained Ok value, consuming the self value.

\n

Because this function may panic, its use is generally discouraged.\nInstead, prefer to use pattern matching and handle the Err\ncase explicitly, or call unwrap_or, unwrap_or_else, or\nunwrap_or_default.

\n
§Panics
\n

Panics if the value is an Err, with a panic message provided by the\nErr’s value.

\n
§Examples
\n

Basic usage:

\n\n
let x: Result<u32, &str> = Ok(2);\nassert_eq!(x.unwrap(), 2);
\n\n
let x: Result<u32, &str> = Err(\"emergency failure\");\nx.unwrap(); // panics with `emergency failure`
\n
1.16.0 · source

pub fn unwrap_or_default(self) -> T
where\n T: Default,

Returns the contained Ok value or a default

\n

Consumes the self argument then, if Ok, returns the contained\nvalue, otherwise if Err, returns the default value for that\ntype.

\n
§Examples
\n

Converts a string to an integer, turning poorly-formed strings\ninto 0 (the default value for integers). parse converts\na string to any other type that implements FromStr, returning an\nErr on error.

\n\n
let good_year_from_input = \"1909\";\nlet bad_year_from_input = \"190blarg\";\nlet good_year = good_year_from_input.parse().unwrap_or_default();\nlet bad_year = bad_year_from_input.parse().unwrap_or_default();\n\nassert_eq!(1909, good_year);\nassert_eq!(0, bad_year);
\n
1.17.0 · source

pub fn expect_err(self, msg: &str) -> E
where\n T: Debug,

Returns the contained Err value, consuming the self value.

\n
§Panics
\n

Panics if the value is an Ok, with a panic message including the\npassed message, and the content of the Ok.

\n
§Examples
\n
let x: Result<u32, &str> = Ok(10);\nx.expect_err(\"Testing expect_err\"); // panics with `Testing expect_err: 10`
\n
1.0.0 · source

pub fn unwrap_err(self) -> E
where\n T: Debug,

Returns the contained Err value, consuming the self value.

\n
§Panics
\n

Panics if the value is an Ok, with a custom panic message provided\nby the Ok’s value.

\n
§Examples
\n
let x: Result<u32, &str> = Ok(2);\nx.unwrap_err(); // panics with `2`
\n\n
let x: Result<u32, &str> = Err(\"emergency failure\");\nassert_eq!(x.unwrap_err(), \"emergency failure\");
\n
source

pub fn into_ok(self) -> T
where\n E: Into<!>,

🔬This is a nightly-only experimental API. (unwrap_infallible)

Returns the contained Ok value, but never panics.

\n

Unlike unwrap, this method is known to never panic on the\nresult types it is implemented for. Therefore, it can be used\ninstead of unwrap as a maintainability safeguard that will fail\nto compile if the error type of the Result is later changed\nto an error that can actually occur.

\n
§Examples
\n
\nfn only_good_news() -> Result<String, !> {\n    Ok(\"this is fine\".into())\n}\n\nlet s: String = only_good_news().into_ok();\nprintln!(\"{s}\");
\n
source

pub fn into_err(self) -> E
where\n T: Into<!>,

🔬This is a nightly-only experimental API. (unwrap_infallible)

Returns the contained Err value, but never panics.

\n

Unlike unwrap_err, this method is known to never panic on the\nresult types it is implemented for. Therefore, it can be used\ninstead of unwrap_err as a maintainability safeguard that will fail\nto compile if the ok type of the Result is later changed\nto a type that can actually occur.

\n
§Examples
\n
\nfn only_bad_news() -> Result<!, String> {\n    Err(\"Oops, it failed\".into())\n}\n\nlet error: String = only_bad_news().into_err();\nprintln!(\"{error}\");
\n
1.0.0 · source

pub fn and<U>(self, res: Result<U, E>) -> Result<U, E>

Returns res if the result is Ok, otherwise returns the Err value of self.

\n

Arguments passed to and are eagerly evaluated; if you are passing the\nresult of a function call, it is recommended to use and_then, which is\nlazily evaluated.

\n
§Examples
\n
let x: Result<u32, &str> = Ok(2);\nlet y: Result<&str, &str> = Err(\"late error\");\nassert_eq!(x.and(y), Err(\"late error\"));\n\nlet x: Result<u32, &str> = Err(\"early error\");\nlet y: Result<&str, &str> = Ok(\"foo\");\nassert_eq!(x.and(y), Err(\"early error\"));\n\nlet x: Result<u32, &str> = Err(\"not a 2\");\nlet y: Result<&str, &str> = Err(\"late error\");\nassert_eq!(x.and(y), Err(\"not a 2\"));\n\nlet x: Result<u32, &str> = Ok(2);\nlet y: Result<&str, &str> = Ok(\"different result type\");\nassert_eq!(x.and(y), Ok(\"different result type\"));
\n
1.0.0 · source

pub fn and_then<U, F>(self, op: F) -> Result<U, E>
where\n F: FnOnce(T) -> Result<U, E>,

Calls op if the result is Ok, otherwise returns the Err value of self.

\n

This function can be used for control flow based on Result values.

\n
§Examples
\n
fn sq_then_to_string(x: u32) -> Result<String, &'static str> {\n    x.checked_mul(x).map(|sq| sq.to_string()).ok_or(\"overflowed\")\n}\n\nassert_eq!(Ok(2).and_then(sq_then_to_string), Ok(4.to_string()));\nassert_eq!(Ok(1_000_000).and_then(sq_then_to_string), Err(\"overflowed\"));\nassert_eq!(Err(\"not a number\").and_then(sq_then_to_string), Err(\"not a number\"));
\n

Often used to chain fallible operations that may return Err.

\n\n
use std::{io::ErrorKind, path::Path};\n\n// Note: on Windows \"/\" maps to \"C:\\\"\nlet root_modified_time = Path::new(\"/\").metadata().and_then(|md| md.modified());\nassert!(root_modified_time.is_ok());\n\nlet should_fail = Path::new(\"/bad/path\").metadata().and_then(|md| md.modified());\nassert!(should_fail.is_err());\nassert_eq!(should_fail.unwrap_err().kind(), ErrorKind::NotFound);
\n
1.0.0 · source

pub fn or<F>(self, res: Result<T, F>) -> Result<T, F>

Returns res if the result is Err, otherwise returns the Ok value of self.

\n

Arguments passed to or are eagerly evaluated; if you are passing the\nresult of a function call, it is recommended to use or_else, which is\nlazily evaluated.

\n
§Examples
\n
let x: Result<u32, &str> = Ok(2);\nlet y: Result<u32, &str> = Err(\"late error\");\nassert_eq!(x.or(y), Ok(2));\n\nlet x: Result<u32, &str> = Err(\"early error\");\nlet y: Result<u32, &str> = Ok(2);\nassert_eq!(x.or(y), Ok(2));\n\nlet x: Result<u32, &str> = Err(\"not a 2\");\nlet y: Result<u32, &str> = Err(\"late error\");\nassert_eq!(x.or(y), Err(\"late error\"));\n\nlet x: Result<u32, &str> = Ok(2);\nlet y: Result<u32, &str> = Ok(100);\nassert_eq!(x.or(y), Ok(2));
\n
1.0.0 · source

pub fn or_else<F, O>(self, op: O) -> Result<T, F>
where\n O: FnOnce(E) -> Result<T, F>,

Calls op if the result is Err, otherwise returns the Ok value of self.

\n

This function can be used for control flow based on result values.

\n
§Examples
\n
fn sq(x: u32) -> Result<u32, u32> { Ok(x * x) }\nfn err(x: u32) -> Result<u32, u32> { Err(x) }\n\nassert_eq!(Ok(2).or_else(sq).or_else(sq), Ok(2));\nassert_eq!(Ok(2).or_else(err).or_else(sq), Ok(2));\nassert_eq!(Err(3).or_else(sq).or_else(err), Ok(9));\nassert_eq!(Err(3).or_else(err).or_else(err), Err(3));
\n
1.0.0 · source

pub fn unwrap_or(self, default: T) -> T

Returns the contained Ok value or a provided default.

\n

Arguments passed to unwrap_or are eagerly evaluated; if you are passing\nthe result of a function call, it is recommended to use unwrap_or_else,\nwhich is lazily evaluated.

\n
§Examples
\n
let default = 2;\nlet x: Result<u32, &str> = Ok(9);\nassert_eq!(x.unwrap_or(default), 9);\n\nlet x: Result<u32, &str> = Err(\"error\");\nassert_eq!(x.unwrap_or(default), default);
\n
1.0.0 · source

pub fn unwrap_or_else<F>(self, op: F) -> T
where\n F: FnOnce(E) -> T,

Returns the contained Ok value or computes it from a closure.

\n
§Examples
\n
fn count(x: &str) -> usize { x.len() }\n\nassert_eq!(Ok(2).unwrap_or_else(count), 2);\nassert_eq!(Err(\"foo\").unwrap_or_else(count), 3);
\n
1.58.0 · source

pub unsafe fn unwrap_unchecked(self) -> T

Returns the contained Ok value, consuming the self value,\nwithout checking that the value is not an Err.

\n
§Safety
\n

Calling this method on an Err is undefined behavior.

\n
§Examples
\n
let x: Result<u32, &str> = Ok(2);\nassert_eq!(unsafe { x.unwrap_unchecked() }, 2);
\n\n
let x: Result<u32, &str> = Err(\"emergency failure\");\nunsafe { x.unwrap_unchecked(); } // Undefined behavior!
\n
1.58.0 · source

pub unsafe fn unwrap_err_unchecked(self) -> E

Returns the contained Err value, consuming the self value,\nwithout checking that the value is not an Ok.

\n
§Safety
\n

Calling this method on an Ok is undefined behavior.

\n
§Examples
\n
let x: Result<u32, &str> = Ok(2);\nunsafe { x.unwrap_err_unchecked() }; // Undefined behavior!
\n\n
let x: Result<u32, &str> = Err(\"emergency failure\");\nassert_eq!(unsafe { x.unwrap_err_unchecked() }, \"emergency failure\");
\n
",0,"syn::error::Result"],["
1.16.0 · source§

impl<T, U, E> Sum<Result<U, E>> for Result<T, E>
where\n T: Sum<U>,

source§

fn sum<I>(iter: I) -> Result<T, E>
where\n I: Iterator<Item = Result<U, E>>,

Takes each element in the Iterator: if it is an Err, no further\nelements are taken, and the Err is returned. Should no Err\noccur, the sum of all elements is returned.

\n
§Examples
\n

This sums up every integer in a vector, rejecting the sum if a negative\nelement is encountered:

\n\n
let f = |&x: &i32| if x < 0 { Err(\"Negative element found\") } else { Ok(x) };\nlet v = vec![1, 2];\nlet res: Result<i32, _> = v.iter().map(f).sum();\nassert_eq!(res, Ok(3));\nlet v = vec![1, -2];\nlet res: Result<i32, _> = v.iter().map(f).sum();\nassert_eq!(res, Err(\"Negative element found\"));
\n
","Sum>","syn::error::Result"],["
1.61.0 · source§

impl<T, E> Termination for Result<T, E>
where\n T: Termination,\n E: Debug,

source§

fn report(self) -> ExitCode

Is called to get the representation of the value as status code.\nThis status code is returned to the operating system.
","Termination","syn::error::Result"],["
source§

impl<T, E> Try for Result<T, E>

§

type Output = T

🔬This is a nightly-only experimental API. (try_trait_v2)
The type of the value produced by ? when not short-circuiting.
§

type Residual = Result<Infallible, E>

🔬This is a nightly-only experimental API. (try_trait_v2)
The type of the value passed to FromResidual::from_residual\nas part of ? when short-circuiting. Read more
source§

fn from_output(output: <Result<T, E> as Try>::Output) -> Result<T, E>

🔬This is a nightly-only experimental API. (try_trait_v2)
Constructs the type from its Output type. Read more
source§

fn branch(\n self\n) -> ControlFlow<<Result<T, E> as Try>::Residual, <Result<T, E> as Try>::Output>

🔬This is a nightly-only experimental API. (try_trait_v2)
Used in ? to decide whether the operator should produce a value\n(because this returned ControlFlow::Continue)\nor propagate a value back to the caller\n(because this returned ControlFlow::Break). Read more
","Try","syn::error::Result"],["
1.0.0 · source§

impl<T, E> Copy for Result<T, E>
where\n T: Copy,\n E: Copy,

","Copy","syn::error::Result"],["
1.0.0 · source§

impl<T, E> Eq for Result<T, E>
where\n T: Eq,\n E: Eq,

","Eq","syn::error::Result"],["
1.0.0 · source§

impl<T, E> StructuralPartialEq for Result<T, E>

","StructuralPartialEq","syn::error::Result"]] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/type.impl/syn/parse/struct.ParseBuffer.js b/type.impl/syn/parse/struct.ParseBuffer.js new file mode 100644 index 0000000..5c242d8 --- /dev/null +++ b/type.impl/syn/parse/struct.ParseBuffer.js @@ -0,0 +1,3 @@ +(function() {var type_impls = { +"syn":[] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/unicode_ident/all.html b/unicode_ident/all.html new file mode 100644 index 0000000..c0e5019 --- /dev/null +++ b/unicode_ident/all.html @@ -0,0 +1 @@ +List of all items in this crate

List of all items

Functions

\ No newline at end of file diff --git a/unicode_ident/fn.is_xid_continue.html b/unicode_ident/fn.is_xid_continue.html new file mode 100644 index 0000000..1259dc4 --- /dev/null +++ b/unicode_ident/fn.is_xid_continue.html @@ -0,0 +1 @@ +is_xid_continue in unicode_ident - Rust

Function unicode_ident::is_xid_continue

source ·
pub fn is_xid_continue(ch: char) -> bool
\ No newline at end of file diff --git a/unicode_ident/fn.is_xid_start.html b/unicode_ident/fn.is_xid_start.html new file mode 100644 index 0000000..e6a0061 --- /dev/null +++ b/unicode_ident/fn.is_xid_start.html @@ -0,0 +1 @@ +is_xid_start in unicode_ident - Rust

Function unicode_ident::is_xid_start

source ·
pub fn is_xid_start(ch: char) -> bool
\ No newline at end of file diff --git a/unicode_ident/index.html b/unicode_ident/index.html new file mode 100644 index 0000000..0d8868b --- /dev/null +++ b/unicode_ident/index.html @@ -0,0 +1,175 @@ +unicode_ident - Rust

Crate unicode_ident

source ·
Expand description

githubcrates-iodocs-rs

+
+

Implementation of Unicode Standard Annex #31 for determining which +char values are valid in programming language identifiers.

+

This crate is a better optimized implementation of the older unicode-xid +crate. This crate uses less static storage, and is able to classify both +ASCII and non-ASCII codepoints with better performance, 2–10× +faster than unicode-xid.

+
+

§Comparison of performance

+

The following table shows a comparison between five Unicode identifier +implementations.

+
    +
  • unicode-ident is this crate;
  • +
  • unicode-xid is a widely used crate run by the “unicode-rs” org;
  • +
  • ucd-trie and fst are two data structures supported by the +ucd-generate tool;
  • +
  • roaring is a Rust implementation of Roaring bitmap.
  • +
+

The static storage column shows the total size of static tables that the +crate bakes into your binary, measured in 1000s of bytes.

+

The remaining columns show the cost per call to evaluate whether a +single char has the XID_Start or XID_Continue Unicode property, +comparing across different ratios of ASCII to non-ASCII codepoints in the +input data.

+
+ + + + + +
static storage0% nonascii1%10%100% nonascii
unicode-ident10.1 K0.96 ns0.95 ns1.09 ns1.55 ns
unicode-xid11.5 K1.88 ns2.14 ns3.48 ns15.63 ns
ucd-trie10.2 K1.29 ns1.28 ns1.36 ns2.15 ns
fst139 K55.1 ns54.9 ns53.2 ns28.5 ns
roaring66.1 K2.78 ns3.09 ns3.37 ns4.70 ns
+
+

Source code for the benchmark is provided in the bench directory of this +repo and may be repeated by running cargo criterion.

+
+

§Comparison of data structures

§unicode-xid
+

They use a sorted array of character ranges, and do a binary search to look +up whether a given character lands inside one of those ranges.

+ +
static XID_Continue_table: [(char, char); 763] = [
+    ('\u{30}', '\u{39}'),  // 0-9
+    ('\u{41}', '\u{5a}'),  // A-Z
+    …
+    ('\u{e0100}', '\u{e01ef}'),
+];
+

The static storage used by this data structure scales with the number of +contiguous ranges of identifier codepoints in Unicode. Every table entry +consumes 8 bytes, because it consists of a pair of 32-bit char values.

+

In some ranges of the Unicode codepoint space, this is quite a sparse +representation – there are some ranges where tens of thousands of +adjacent codepoints are all valid identifier characters. In other places, +the representation is quite inefficient. A characater like µ (U+00B5) +which is surrounded by non-identifier codepoints consumes 64 bits in the +table, while it would be just 1 bit in a dense bitmap.

+

On a system with 64-byte cache lines, binary searching the table touches 7 +cache lines on average. Each cache line fits only 8 table entries. +Additionally, the branching performed during the binary search is probably +mostly unpredictable to the branch predictor.

+

Overall, the crate ends up being about 10× slower on non-ASCII input +compared to the fastest crate.

+

A potential improvement would be to pack the table entries more compactly. +Rust’s char type is a 21-bit integer padded to 32 bits, which means every +table entry is holding 22 bits of wasted space, adding up to 3.9 K. They +could instead fit every table entry into 6 bytes, leaving out some of the +padding, for a 25% improvement in space used. With some cleverness it may be +possible to fit in 5 bytes or even 4 bytes by storing a low char and an +extent, instead of low char and high char. I don’t expect that performance +would improve much but this could be the most efficient for space across all +the libraries, needing only about 7 K to store.

+
§ucd-trie
+

Their data structure is a compressed trie set specifically tailored for +Unicode codepoints. The design is credited to Raph Levien in +rust-lang/rust#33098.

+ +
pub struct TrieSet {
+    tree1_level1: &'static [u64; 32],
+    tree2_level1: &'static [u8; 992],
+    tree2_level2: &'static [u64],
+    tree3_level1: &'static [u8; 256],
+    tree3_level2: &'static [u8],
+    tree3_level3: &'static [u64],
+}
+

It represents codepoint sets using a trie to achieve prefix compression. The +final states of the trie are embedded in leaves or “chunks”, where each +chunk is a 64-bit integer. Each bit position of the integer corresponds to +whether a particular codepoint is in the set or not. These chunks are not +just a compact representation of the final states of the trie, but are also +a form of suffix compression. In particular, if multiple ranges of 64 +contiguous codepoints have the same Unicode properties, then they all map to +the same chunk in the final level of the trie.

+

Being tailored for Unicode codepoints, this trie is partitioned into three +disjoint sets: tree1, tree2, tree3. The first set corresponds to codepoints +[0, 0x800), the second [0x800, 0x10000) and the third [0x10000, +0x110000). These partitions conveniently correspond to the space of 1 or 2 +byte UTF-8 encoded codepoints, 3 byte UTF-8 encoded codepoints and 4 byte +UTF-8 encoded codepoints, respectively.

+

Lookups in this data structure are significantly more efficient than binary +search. A lookup touches either 1, 2, or 3 cache lines based on which of the +trie partitions is being accessed.

+

One possible performance improvement would be for this crate to expose a way +to query based on a UTF-8 encoded string, returning the Unicode property +corresponding to the first character in the string. Without such an API, the +caller is required to tokenize their UTF-8 encoded input data into char, +hand the char into ucd-trie, only for ucd-trie to undo that work by +converting back into the variable-length representation for trie traversal.

+
§fst
+

Uses a finite state transducer. This representation is built into +ucd-generate but I am not aware of any advantage over the ucd-trie +representation. In particular ucd-trie is optimized for storing Unicode +properties while fst is not.

+

As far as I can tell, the main thing that causes fst to have large size +and slow lookups for this use case relative to ucd-trie is that it does +not specialize for the fact that only 21 of the 32 bits in a char are +meaningful. There are some dense arrays in the structure with large ranges +that could never possibly be used.

+
§roaring
+

This crate is a pure-Rust implementation of Roaring Bitmap, a data +structure designed for storing sets of 32-bit unsigned integers.

+

Roaring bitmaps are compressed bitmaps which tend to outperform conventional +compressed bitmaps such as WAH, EWAH or Concise. In some instances, they can +be hundreds of times faster and they often offer significantly better +compression.

+

In this use case the performance was reasonably competitive but still +substantially slower than the Unicode-optimized crates. Meanwhile the +compression was significantly worse, requiring 6× as much storage for +the data structure.

+

I also benchmarked the croaring crate which is an FFI wrapper around the +C reference implementation of Roaring Bitmap. This crate was consistently +about 15% slower than pure-Rust roaring, which could just be FFI overhead. +I did not investigate further.

+
§unicode-ident
+

This crate is most similar to the ucd-trie library, in that it’s based on +bitmaps stored in the leafs of a trie representation, achieving both prefix +compression and suffix compression.

+

The key differences are:

+
    +
  • Uses a single 2-level trie, rather than 3 disjoint partitions of different +depth each.
  • +
  • Uses significantly larger chunks: 512 bits rather than 64 bits.
  • +
  • Compresses the XID_Start and XID_Continue properties together +simultaneously, rather than duplicating identical trie leaf chunks across +the two.
  • +
+

The following diagram show the XID_Start and XID_Continue Unicode boolean +properties in uncompressed form, in row-major order:

+ + + + + + +
XID_StartXID_Continue
XID_Start bitmapXID_Continue bitmap
+

Uncompressed, these would take 140 K to store, which is beyond what would be +reasonable. However, as you can see there is a large degree of similarity +between the two bitmaps and across the rows, which lends well to +compression.

+

This crate stores one 512-bit “row” of the above bitmaps in the leaf level +of a trie, and a single additional level to index into the leafs. It turns +out there are 124 unique 512-bit chunks across the two bitmaps so 7 bits are +sufficient to index them.

+

The chunk size of 512 bits is selected as the size that minimizes the total +size of the data structure. A smaller chunk, like 256 or 128 bits, would +achieve better deduplication but require a larger index. A larger chunk +would increase redundancy in the leaf bitmaps. 512 bit chunks are the +optimum for total size of the index plus leaf bitmaps.

+

In fact since there are only 124 unique chunks, we can use an 8-bit index +with a spare bit to index at the half-chunk level. This achieves an +additional 8.5% compression by eliminating redundancies between the second +half of any chunk and the first half of any other chunk. Note that this is +not the same as using chunks which are half the size, because it does not +necessitate raising the size of the trie’s first level.

+

In contrast to binary search or the ucd-trie crate, performing lookups in +this data structure is straight-line code with no need for branching.

+

Functions§

\ No newline at end of file diff --git a/unicode_ident/sidebar-items.js b/unicode_ident/sidebar-items.js new file mode 100644 index 0000000..e9f6d2c --- /dev/null +++ b/unicode_ident/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"fn":["is_xid_continue","is_xid_start"]}; \ No newline at end of file