| <!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="github crates-io docs-rs"><meta name="keywords" content="rust, rustlang, rust-lang, syn"><title>syn - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../dark.css" disabled><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../storage.js"></script><script src="../crates.js"></script><script defer src="../main.js"></script> |
| <noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../favicon.svg"></head><body class="rustdoc mod crate"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">☰</div><a class="sidebar-logo" href="../syn/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.png" alt="logo"></div> |
| </a><h2 class="location">Crate syn</h2><div class="block version"><div class="narrow-helper"></div><p>Version 1.0.85</p></div><div class="sidebar-elems"><a id="all-types" href="all.html"><p>See all syn's items</p></a><div class="block items"><ul><li><a href="#modules">Modules</a></li><li><a href="#macros">Macros</a></li><li><a href="#structs">Structs</a></li><li><a href="#enums">Enums</a></li><li><a href="#functions">Functions</a></li><li><a href="#types">Type Definitions</a></li></ul></div><div id="sidebar-vars" data-name="syn" data-ty="mod" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../syn/index.html"><img class="rust-logo" src="../rust-logo.png" alt="logo"></a><nav class="sub"><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><div> |
| <input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading"> |
| <h1 class="fqn"><span class="in-band">Crate <a class="mod" href="#">syn</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"> |
| <a class="srclink" href="../src/syn/lib.rs.html#1-1009" title="goto source code">source</a> · |
| <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div> |
| <details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p><a href="https://github.com/dtolnay/syn"><img src="https://img.shields.io/badge/github-8da0cb?style=for-the-badge&labelColor=555555&logo=github" alt="github" /></a> <a href="https://crates.io/crates/syn"><img src="https://img.shields.io/badge/crates.io-fc8d62?style=for-the-badge&labelColor=555555&logo=rust" alt="crates-io" /></a> <a href="index.html"><img src="https://img.shields.io/badge/docs.rs-66c2a5?style=for-the-badge&labelColor=555555&logoColor=white&logo=data:image/svg+xml;base64,PHN2ZyByb2xlPSJpbWciIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDUxMiA1MTIiPjxwYXRoIGZpbGw9IiNmNWY1ZjUiIGQ9Ik00ODguNiAyNTAuMkwzOTIgMjE0VjEwNS41YzAtMTUtOS4zLTI4LjQtMjMuNC0zMy43bC0xMDAtMzcuNWMtOC4xLTMuMS0xNy4xLTMuMS0yNS4zIDBsLTEwMCAzNy41Yy0xNC4xIDUuMy0yMy40IDE4LjctMjMuNCAzMy43VjIxNGwtOTYuNiAzNi4yQzkuMyAyNTUuNSAwIDI2OC45IDAgMjgzLjlWMzk0YzAgMTMuNiA3LjcgMjYuMSAxOS45IDMyLjJsMTAwIDUwYzEwLjEgNS4xIDIyLjEgNS4xIDMyLjIgMGwxMDMuOS01MiAxMDMuOSA1MmMxMC4xIDUuMSAyMi4xIDUuMSAzMi4yIDBsMTAwLTUwYzEyLjItNi4xIDE5LjktMTguNiAxOS45LTMyLjJWMjgzLjljMC0xNS05LjMtMjguNC0yMy40LTMzLjd6TTM1OCAyMTQuOGwtODUgMzEuOXYtNjguMmw4NS0zN3Y3My4zek0xNTQgMTA0LjFsMTAyLTM4LjIgMTAyIDM4LjJ2LjZsLTEwMiA0MS40LTEwMi00MS40di0uNnptODQgMjkxLjFsLTg1IDQyLjV2LTc5LjFsODUtMzguOHY3NS40em0wLTExMmwtMTAyIDQxLjQtMTAyLTQxLjR2LS42bDEwMi0zOC4yIDEwMiAzOC4ydi42em0yNDAgMTEybC04NSA0Mi41di03OS4xbDg1LTM4Ljh2NzUuNHptMC0xMTJsLTEwMiA0MS40LTEwMi00MS40di0uNmwxMDItMzguMiAxMDIgMzguMnYuNnoiPjwvcGF0aD48L3N2Zz4K" alt="docs-rs" /></a></p> |
| <br> |
| <p>Syn is a parsing library for parsing a stream of Rust tokens into a syntax |
| tree of Rust source code.</p> |
| <p>Currently this library is geared toward use in Rust procedural macros, but |
| contains some APIs that may be useful more generally.</p> |
| <ul> |
| <li> |
| <p><strong>Data structures</strong> — Syn provides a complete syntax tree that can |
| represent any valid Rust source code. The syntax tree is rooted at |
| <a href="File"><code>syn::File</code></a> which represents a full source file, but there are other |
| entry points that may be useful to procedural macros including |
| <a href="Item"><code>syn::Item</code></a>, <a href="enum.Expr.html"><code>syn::Expr</code></a> and <a href="enum.Type.html"><code>syn::Type</code></a>.</p> |
| </li> |
| <li> |
| <p><strong>Derives</strong> — Of particular interest to derive macros is |
| <a href="struct.DeriveInput.html"><code>syn::DeriveInput</code></a> 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.</p> |
| </li> |
| <li> |
| <p><strong>Parsing</strong> — Parsing in Syn is built around <a href="parse/index.html">parser functions</a> with the |
| signature <code>fn(ParseStream) -> Result<T></code>. 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.</p> |
| </li> |
| <li> |
| <p><strong>Location information</strong> — Every token parsed by Syn is associated with a |
| <code>Span</code> 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.</p> |
| </li> |
| <li> |
| <p><strong>Feature flags</strong> — 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.</p> |
| </li> |
| </ul> |
| <br> |
| <h2 id="example-of-a-derive-macro" class="section-header"><a href="#example-of-a-derive-macro">Example of a derive macro</a></h2> |
| <p>The canonical derive macro using Syn looks like this. We write an ordinary |
| Rust function tagged with a <code>proc_macro_derive</code> 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.</p> |
| <div class="example-wrap"><pre class="language-toml"><code>[dependencies] |
| syn = "1.0" |
| quote = "1.0" |
| |
| [lib] |
| proc-macro = true</code></pre></div> |
| <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use</span> <span class="ident">proc_macro::TokenStream</span>; |
| <span class="kw">use</span> <span class="ident">quote::quote</span>; |
| <span class="kw">use</span> <span class="ident">syn</span>::{<span class="ident">parse_macro_input</span>, <span class="ident">DeriveInput</span>}; |
| |
| <span class="attribute">#[<span class="ident">proc_macro_derive</span>(<span class="ident">MyMacro</span>)]</span> |
| <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">my_macro</span>(<span class="ident">input</span>: <span class="ident">TokenStream</span>) -> <span class="ident">TokenStream</span> { |
| <span class="comment">// Parse the input tokens into a syntax tree</span> |
| <span class="kw">let</span> <span class="ident">input</span> <span class="op">=</span> <span class="macro">parse_macro_input!</span>(<span class="ident">input</span> <span class="kw">as</span> <span class="ident">DeriveInput</span>); |
| |
| <span class="comment">// Build the output, possibly using quasi-quotation</span> |
| <span class="kw">let</span> <span class="ident">expanded</span> <span class="op">=</span> <span class="macro">quote!</span> { |
| <span class="comment">// ...</span> |
| }; |
| |
| <span class="comment">// Hand the output tokens back to the compiler</span> |
| <span class="ident">TokenStream::from</span>(<span class="ident">expanded</span>) |
| }</code></pre></div> |
| <p>The <a href="https://github.com/dtolnay/syn/tree/master/examples/heapsize"><code>heapsize</code></a> example directory shows a complete working implementation |
| of a derive macro. It works on any Rust compiler 1.31+. The example derives |
| a <code>HeapSize</code> trait which computes an estimate of the amount of heap memory |
| owned by a value.</p> |
| |
| <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">pub</span> <span class="kw">trait</span> <span class="ident">HeapSize</span> { |
| <span class="doccomment">/// Total number of bytes of heap memory owned by `self`.</span> |
| <span class="kw">fn</span> <span class="ident">heap_size_of_children</span>(<span class="kw-2">&</span><span class="self">self</span>) -> <span class="ident">usize</span>; |
| }</code></pre></div> |
| <p>The derive macro allows users to write <code>#[derive(HeapSize)]</code> on data |
| structures in their program.</p> |
| |
| <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="attribute">#[<span class="ident">derive</span>(<span class="ident">HeapSize</span>)]</span> |
| <span class="kw">struct</span> <span class="ident">Demo</span><span class="op"><</span><span class="lifetime">'a</span>, <span class="ident">T</span>: <span class="question-mark">?</span><span class="ident">Sized</span><span class="op">></span> { |
| <span class="ident">a</span>: <span class="ident">Box</span><span class="op"><</span><span class="ident">T</span><span class="op">></span>, |
| <span class="ident">b</span>: <span class="ident">u8</span>, |
| <span class="ident">c</span>: <span class="kw-2">&</span><span class="lifetime">'a</span> <span class="ident">str</span>, |
| <span class="ident">d</span>: <span class="ident">String</span>, |
| }</code></pre></div> |
| <p><br></p> |
| <h2 id="spans-and-error-reporting" class="section-header"><a href="#spans-and-error-reporting">Spans and error reporting</a></h2> |
| <p>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 <code>HeapSize</code>.</p> |
| |
| <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="attribute">#[<span class="ident">derive</span>(<span class="ident">HeapSize</span>)]</span> |
| <span class="kw">struct</span> <span class="ident">Broken</span> { |
| <span class="ident">ok</span>: <span class="ident">String</span>, |
| <span class="ident">bad</span>: <span class="ident">std::thread::Thread</span>, |
| }</code></pre></div> |
| <p>By tracking span information all the way through the expansion of a |
| procedural macro as shown in the <code>heapsize</code> example, token-based macros in |
| Syn are able to trigger errors that directly pinpoint the source of the |
| problem.</p> |
| <div class="example-wrap"><pre class="language-text"><code>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`</code></pre></div><br> |
| <h2 id="parsing-a-custom-syntax" class="section-header"><a href="#parsing-a-custom-syntax">Parsing a custom syntax</a></h2> |
| <p>The <a href="https://github.com/dtolnay/syn/tree/master/examples/lazy-static"><code>lazy-static</code></a> example directory shows the implementation of a |
| <code>functionlike!(...)</code> procedural macro in which the input tokens are parsed |
| using Syn’s parsing API.</p> |
| <p>The example reimplements the popular <code>lazy_static</code> crate from crates.io as a |
| procedural macro.</p> |
| |
| <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="macro">lazy_static!</span> { |
| <span class="kw">static</span> <span class="kw-2">ref</span> <span class="ident">USERNAME</span>: <span class="ident">Regex</span> <span class="op">=</span> <span class="ident">Regex::new</span>(<span class="string">"^[a-z0-9_-]{3,16}$"</span>).<span class="ident">unwrap</span>(); |
| }</code></pre></div> |
| <p>The implementation shows how to trigger custom warnings and error messages |
| on the macro input.</p> |
| <div class="example-wrap"><pre class="language-text"><code>warning: come on, pick a more creative name |
| --> src/main.rs:10:16 |
| | |
| 10 | static ref FOO: String = "lazy_static".to_owned(); |
| | ^^^</code></pre></div><br> |
| <h2 id="testing" class="section-header"><a href="#testing">Testing</a></h2> |
| <p>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 <a href="https://github.com/dtolnay/trybuild"><code>trybuild</code></a> |
| 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.</p> |
| <br> |
| <h2 id="debugging" class="section-header"><a href="#debugging">Debugging</a></h2> |
| <p>When developing a procedural macro it can be helpful to look at what the |
| generated code looks like. Use <code>cargo rustc -- -Zunstable-options --pretty=expanded</code> or the <a href="https://github.com/dtolnay/cargo-expand"><code>cargo expand</code></a> subcommand.</p> |
| <p>To show the expanded code for some crate that uses your procedural macro, |
| run <code>cargo expand</code> from that crate. To show the expanded code for one of |
| your own test cases, run <code>cargo expand --test the_test_case</code> where the last |
| argument is the name of the test file without the <code>.rs</code> extension.</p> |
| <p>This write-up by Brandon W Maister discusses debugging in more detail: |
| <a href="https://quodlibetor.github.io/posts/debugging-rusts-new-custom-derive-system/">Debugging Rust’s new Custom Derive system</a>.</p> |
| <br> |
| <h2 id="optional-features" class="section-header"><a href="#optional-features">Optional features</a></h2> |
| <p>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.</p> |
| <ul> |
| <li><strong><code>derive</code></strong> <em>(enabled by default)</em> — Data structures for representing the |
| possible input to a derive macro, including structs and enums and types.</li> |
| <li><strong><code>full</code></strong> — Data structures for representing the syntax tree of all valid |
| Rust source code, including items and expressions.</li> |
| <li><strong><code>parsing</code></strong> <em>(enabled by default)</em> — Ability to parse input tokens into |
| a syntax tree node of a chosen type.</li> |
| <li><strong><code>printing</code></strong> <em>(enabled by default)</em> — Ability to print a syntax tree |
| node as tokens of Rust source code.</li> |
| <li><strong><code>visit</code></strong> — Trait for traversing a syntax tree.</li> |
| <li><strong><code>visit-mut</code></strong> — Trait for traversing and mutating in place a syntax |
| tree.</li> |
| <li><strong><code>fold</code></strong> — Trait for transforming an owned syntax tree.</li> |
| <li><strong><code>clone-impls</code></strong> <em>(enabled by default)</em> — Clone impls for all syntax tree |
| types.</li> |
| <li><strong><code>extra-traits</code></strong> — Debug, Eq, PartialEq, Hash impls for all syntax tree |
| types.</li> |
| <li><strong><code>proc-macro</code></strong> <em>(enabled by default)</em> — Runtime dependency on the |
| dynamic library libproc_macro from rustc toolchain.</li> |
| </ul> |
| </div></details><h2 id="modules" class="small-section-header"><a href="#modules">Modules</a></h2> |
| <div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="mod" href="buffer/index.html" title="syn::buffer mod">buffer</a><span class="stab portability" title="This is supported on crate feature `parsing` only"><code>parsing</code></span></div><div class="item-right docblock-short"><p>A stably addressed token buffer supporting efficient traversal based on a |
| cheaply copyable cursor.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="mod" href="ext/index.html" title="syn::ext mod">ext</a><span class="stab portability" title="This is supported on crate feature `parsing` only"><code>parsing</code></span></div><div class="item-right docblock-short"><p>Extension traits to provide parsing methods on foreign types.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="mod" href="parse/index.html" title="syn::parse mod">parse</a><span class="stab portability" title="This is supported on crate feature `parsing` only"><code>parsing</code></span></div><div class="item-right docblock-short"><p>Parsing interface for parsing a token stream into a syntax tree node.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="mod" href="punctuated/index.html" title="syn::punctuated mod">punctuated</a></div><div class="item-right docblock-short"><p>A punctuated sequence of syntax tree nodes separated by punctuation.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="mod" href="spanned/index.html" title="syn::spanned mod">spanned</a><span class="stab portability" title="This is supported on crate features `parsing` and `printing` only"><code>parsing</code> and <code>printing</code></span></div><div class="item-right docblock-short"><p>A trait that can provide the <code>Span</code> of the complete contents of a syntax |
| tree node.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="mod" href="token/index.html" title="syn::token mod">token</a></div><div class="item-right docblock-short"><p>Tokens representing Rust punctuation, keywords, and delimiters.</p> |
| </div></div></div><h2 id="macros" class="small-section-header"><a href="#macros">Macros</a></h2> |
| <div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="macro" href="macro.Token.html" title="syn::Token macro">Token</a></div><div class="item-right docblock-short"><p>A type-macro that expands to the name of the Rust type representation of a |
| given token.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="macro" href="macro.braced.html" title="syn::braced macro">braced</a><span class="stab portability" title="This is supported on crate feature `parsing` only"><code>parsing</code></span></div><div class="item-right docblock-short"><p>Parse a set of curly braces and expose their content to subsequent parsers.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="macro" href="macro.bracketed.html" title="syn::bracketed macro">bracketed</a><span class="stab portability" title="This is supported on crate feature `parsing` only"><code>parsing</code></span></div><div class="item-right docblock-short"><p>Parse a set of square brackets and expose their content to subsequent |
| parsers.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="macro" href="macro.custom_keyword.html" title="syn::custom_keyword macro">custom_keyword</a></div><div class="item-right docblock-short"><p>Define a type that supports parsing and printing a given identifier as if it |
| were a keyword.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="macro" href="macro.custom_punctuation.html" title="syn::custom_punctuation macro">custom_punctuation</a></div><div class="item-right docblock-short"><p>Define a type that supports parsing and printing a multi-character symbol |
| as if it were a punctuation token.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="macro" href="macro.parenthesized.html" title="syn::parenthesized macro">parenthesized</a><span class="stab portability" title="This is supported on crate feature `parsing` only"><code>parsing</code></span></div><div class="item-right docblock-short"><p>Parse a set of parentheses and expose their content to subsequent parsers.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="macro" href="macro.parse_macro_input.html" title="syn::parse_macro_input macro">parse_macro_input</a><span class="stab portability" title="This is supported on crate features `parsing` and `proc-macro` only"><code>parsing</code> and <code>proc-macro</code></span></div><div class="item-right docblock-short"><p>Parse the input TokenStream of a macro, triggering a compile error if the |
| tokens fail to parse.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="macro" href="macro.parse_quote.html" title="syn::parse_quote macro">parse_quote</a><span class="stab portability" title="This is supported on crate features `parsing` and `printing` only"><code>parsing</code> and <code>printing</code></span></div><div class="item-right docblock-short"><p>Quasi-quotation macro that accepts input like the <a href="https://docs.rs/quote/1.0/quote/index.html"><code>quote!</code></a> macro but uses |
| type inference to figure out a return type for those tokens.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="macro" href="macro.parse_quote_spanned.html" title="syn::parse_quote_spanned macro">parse_quote_spanned</a><span class="stab portability" title="This is supported on crate features `parsing` and `printing` only"><code>parsing</code> and <code>printing</code></span></div><div class="item-right docblock-short"><p>This macro is <a href="macro.parse_quote.html" title="parse_quote!"><code>parse_quote!</code></a> + <a href="../quote/macro.quote_spanned.html" title="quote::quote_spanned"><code>quote_spanned!</code></a>.</p> |
| </div></div></div><h2 id="structs" class="small-section-header"><a href="#structs">Structs</a></h2> |
| <div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.Abi.html" title="syn::Abi struct">Abi</a><span class="stab portability" title="This is supported on crate features `full` or `derive` only"><code>full</code> or <code>derive</code></span></div><div class="item-right docblock-short"><p>The binary interface of a function: <code>extern "C"</code>.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.AngleBracketedGenericArguments.html" title="syn::AngleBracketedGenericArguments struct">AngleBracketedGenericArguments</a><span class="stab portability" title="This is supported on crate features `full` or `derive` only"><code>full</code> or <code>derive</code></span></div><div class="item-right docblock-short"><p>Angle bracketed arguments of a path segment: the <code><K, V></code> in <code>HashMap<K, V></code>.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.Attribute.html" title="syn::Attribute struct">Attribute</a><span class="stab portability" title="This is supported on crate features `full` or `derive` only"><code>full</code> or <code>derive</code></span></div><div class="item-right docblock-short"><p>An attribute like <code>#[repr(transparent)]</code>.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.BareFnArg.html" title="syn::BareFnArg struct">BareFnArg</a><span class="stab portability" title="This is supported on crate features `full` or `derive` only"><code>full</code> or <code>derive</code></span></div><div class="item-right docblock-short"><p>An argument in a function type: the <code>usize</code> in <code>fn(usize) -> bool</code>.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.Binding.html" title="syn::Binding struct">Binding</a><span class="stab portability" title="This is supported on crate features `full` or `derive` only"><code>full</code> or <code>derive</code></span></div><div class="item-right docblock-short"><p>A binding (equality constraint) on an associated type: <code>Item = u8</code>.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.BoundLifetimes.html" title="syn::BoundLifetimes struct">BoundLifetimes</a><span class="stab portability" title="This is supported on crate features `full` or `derive` only"><code>full</code> or <code>derive</code></span></div><div class="item-right docblock-short"><p>A set of bound lifetimes: <code>for<'a, 'b, 'c></code>.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.ConstParam.html" title="syn::ConstParam struct">ConstParam</a><span class="stab portability" title="This is supported on crate features `full` or `derive` only"><code>full</code> or <code>derive</code></span></div><div class="item-right docblock-short"><p>A const generic parameter: <code>const LENGTH: usize</code>.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.Constraint.html" title="syn::Constraint struct">Constraint</a><span class="stab portability" title="This is supported on crate features `full` or `derive` only"><code>full</code> or <code>derive</code></span></div><div class="item-right docblock-short"><p>An associated type bound: <code>Iterator<Item: Display></code>.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.DataEnum.html" title="syn::DataEnum struct">DataEnum</a><span class="stab portability" title="This is supported on crate feature `derive` only"><code>derive</code></span></div><div class="item-right docblock-short"><p>An enum input to a <code>proc_macro_derive</code> macro.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.DataStruct.html" title="syn::DataStruct struct">DataStruct</a><span class="stab portability" title="This is supported on crate feature `derive` only"><code>derive</code></span></div><div class="item-right docblock-short"><p>A struct input to a <code>proc_macro_derive</code> macro.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.DataUnion.html" title="syn::DataUnion struct">DataUnion</a><span class="stab portability" title="This is supported on crate feature `derive` only"><code>derive</code></span></div><div class="item-right docblock-short"><p>An untagged union input to a <code>proc_macro_derive</code> macro.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.DeriveInput.html" title="syn::DeriveInput struct">DeriveInput</a><span class="stab portability" title="This is supported on crate feature `derive` only"><code>derive</code></span></div><div class="item-right docblock-short"><p>Data structure sent to a <code>proc_macro_derive</code> macro.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.Error.html" title="syn::Error struct">Error</a></div><div class="item-right docblock-short"><p>Error returned when a Syn parser cannot parse the input tokens.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.ExprArray.html" title="syn::ExprArray struct">ExprArray</a><span class="stab portability" title="This is supported on crate feature `full` only"><code>full</code></span></div><div class="item-right docblock-short"><p>A slice literal expression: <code>[a, b, c, d]</code>.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.ExprAssign.html" title="syn::ExprAssign struct">ExprAssign</a><span class="stab portability" title="This is supported on crate feature `full` only"><code>full</code></span></div><div class="item-right docblock-short"><p>An assignment expression: <code>a = compute()</code>.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.ExprAssignOp.html" title="syn::ExprAssignOp struct">ExprAssignOp</a><span class="stab portability" title="This is supported on crate feature `full` only"><code>full</code></span></div><div class="item-right docblock-short"><p>A compound assignment expression: <code>counter += 1</code>.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.ExprAsync.html" title="syn::ExprAsync struct">ExprAsync</a><span class="stab portability" title="This is supported on crate feature `full` only"><code>full</code></span></div><div class="item-right docblock-short"><p>An async block: <code>async { ... }</code>.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.ExprAwait.html" title="syn::ExprAwait struct">ExprAwait</a><span class="stab portability" title="This is supported on crate feature `full` only"><code>full</code></span></div><div class="item-right docblock-short"><p>An await expression: <code>fut.await</code>.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.ExprBinary.html" title="syn::ExprBinary struct">ExprBinary</a><span class="stab portability" title="This is supported on crate features `full` or `derive` only"><code>full</code> or <code>derive</code></span></div><div class="item-right docblock-short"><p>A binary operation: <code>a + b</code>, <code>a * b</code>.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.ExprBlock.html" title="syn::ExprBlock struct">ExprBlock</a><span class="stab portability" title="This is supported on crate feature `full` only"><code>full</code></span></div><div class="item-right docblock-short"><p>A blocked scope: <code>{ ... }</code>.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.ExprBox.html" title="syn::ExprBox struct">ExprBox</a><span class="stab portability" title="This is supported on crate feature `full` only"><code>full</code></span></div><div class="item-right docblock-short"><p>A box expression: <code>box f</code>.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.ExprBreak.html" title="syn::ExprBreak struct">ExprBreak</a><span class="stab portability" title="This is supported on crate feature `full` only"><code>full</code></span></div><div class="item-right docblock-short"><p>A <code>break</code>, with an optional label to break and an optional |
| expression.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.ExprCall.html" title="syn::ExprCall struct">ExprCall</a><span class="stab portability" title="This is supported on crate features `full` or `derive` only"><code>full</code> or <code>derive</code></span></div><div class="item-right docblock-short"><p>A function call expression: <code>invoke(a, b)</code>.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.ExprCast.html" title="syn::ExprCast struct">ExprCast</a><span class="stab portability" title="This is supported on crate features `full` or `derive` only"><code>full</code> or <code>derive</code></span></div><div class="item-right docblock-short"><p>A cast expression: <code>foo as f64</code>.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.ExprClosure.html" title="syn::ExprClosure struct">ExprClosure</a><span class="stab portability" title="This is supported on crate feature `full` only"><code>full</code></span></div><div class="item-right docblock-short"><p>A closure expression: <code>|a, b| a + b</code>.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.ExprContinue.html" title="syn::ExprContinue struct">ExprContinue</a><span class="stab portability" title="This is supported on crate feature `full` only"><code>full</code></span></div><div class="item-right docblock-short"><p>A <code>continue</code>, with an optional label.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.ExprField.html" title="syn::ExprField struct">ExprField</a><span class="stab portability" title="This is supported on crate features `full` or `derive` only"><code>full</code> or <code>derive</code></span></div><div class="item-right docblock-short"><p>Access of a named struct field (<code>obj.k</code>) or unnamed tuple struct |
| field (<code>obj.0</code>).</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.ExprForLoop.html" title="syn::ExprForLoop struct">ExprForLoop</a><span class="stab portability" title="This is supported on crate feature `full` only"><code>full</code></span></div><div class="item-right docblock-short"><p>A for loop: <code>for pat in expr { ... }</code>.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.ExprGroup.html" title="syn::ExprGroup struct">ExprGroup</a><span class="stab portability" title="This is supported on crate feature `full` only"><code>full</code></span></div><div class="item-right docblock-short"><p>An expression contained within invisible delimiters.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.ExprIf.html" title="syn::ExprIf struct">ExprIf</a><span class="stab portability" title="This is supported on crate feature `full` only"><code>full</code></span></div><div class="item-right docblock-short"><p>An <code>if</code> expression with an optional <code>else</code> block: <code>if expr { ... } else { ... }</code>.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.ExprIndex.html" title="syn::ExprIndex struct">ExprIndex</a><span class="stab portability" title="This is supported on crate features `full` or `derive` only"><code>full</code> or <code>derive</code></span></div><div class="item-right docblock-short"><p>A square bracketed indexing expression: <code>vector[2]</code>.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.ExprLet.html" title="syn::ExprLet struct">ExprLet</a><span class="stab portability" title="This is supported on crate feature `full` only"><code>full</code></span></div><div class="item-right docblock-short"><p>A <code>let</code> guard: <code>let Some(x) = opt</code>.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.ExprLit.html" title="syn::ExprLit struct">ExprLit</a><span class="stab portability" title="This is supported on crate features `full` or `derive` only"><code>full</code> or <code>derive</code></span></div><div class="item-right docblock-short"><p>A literal in place of an expression: <code>1</code>, <code>"foo"</code>.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.ExprLoop.html" title="syn::ExprLoop struct">ExprLoop</a><span class="stab portability" title="This is supported on crate feature `full` only"><code>full</code></span></div><div class="item-right docblock-short"><p>Conditionless loop: <code>loop { ... }</code>.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.ExprMacro.html" title="syn::ExprMacro struct">ExprMacro</a><span class="stab portability" title="This is supported on crate feature `full` only"><code>full</code></span></div><div class="item-right docblock-short"><p>A macro invocation expression: <code>format!("{}", q)</code>.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.ExprMatch.html" title="syn::ExprMatch struct">ExprMatch</a><span class="stab portability" title="This is supported on crate feature `full` only"><code>full</code></span></div><div class="item-right docblock-short"><p>A <code>match</code> expression: <code>match n { Some(n) => {}, None => {} }</code>.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.ExprMethodCall.html" title="syn::ExprMethodCall struct">ExprMethodCall</a><span class="stab portability" title="This is supported on crate feature `full` only"><code>full</code></span></div><div class="item-right docblock-short"><p>A method call expression: <code>x.foo::<T>(a, b)</code>.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.ExprParen.html" title="syn::ExprParen struct">ExprParen</a><span class="stab portability" title="This is supported on crate features `full` or `derive` only"><code>full</code> or <code>derive</code></span></div><div class="item-right docblock-short"><p>A parenthesized expression: <code>(a + b)</code>.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.ExprPath.html" title="syn::ExprPath struct">ExprPath</a><span class="stab portability" title="This is supported on crate features `full` or `derive` only"><code>full</code> or <code>derive</code></span></div><div class="item-right docblock-short"><p>A path like <code>std::mem::replace</code> possibly containing generic |
| parameters and a qualified self-type.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.ExprRange.html" title="syn::ExprRange struct">ExprRange</a><span class="stab portability" title="This is supported on crate feature `full` only"><code>full</code></span></div><div class="item-right docblock-short"><p>A range expression: <code>1..2</code>, <code>1..</code>, <code>..2</code>, <code>1..=2</code>, <code>..=2</code>.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.ExprReference.html" title="syn::ExprReference struct">ExprReference</a><span class="stab portability" title="This is supported on crate feature `full` only"><code>full</code></span></div><div class="item-right docblock-short"><p>A referencing operation: <code>&a</code> or <code>&mut a</code>.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.ExprRepeat.html" title="syn::ExprRepeat struct">ExprRepeat</a><span class="stab portability" title="This is supported on crate feature `full` only"><code>full</code></span></div><div class="item-right docblock-short"><p>An array literal constructed from one repeated element: <code>[0u8; N]</code>.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.ExprReturn.html" title="syn::ExprReturn struct">ExprReturn</a><span class="stab portability" title="This is supported on crate feature `full` only"><code>full</code></span></div><div class="item-right docblock-short"><p>A <code>return</code>, with an optional value to be returned.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.ExprStruct.html" title="syn::ExprStruct struct">ExprStruct</a><span class="stab portability" title="This is supported on crate feature `full` only"><code>full</code></span></div><div class="item-right docblock-short"><p>A struct literal expression: <code>Point { x: 1, y: 1 }</code>.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.ExprTry.html" title="syn::ExprTry struct">ExprTry</a><span class="stab portability" title="This is supported on crate feature `full` only"><code>full</code></span></div><div class="item-right docblock-short"><p>A try-expression: <code>expr?</code>.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.ExprTryBlock.html" title="syn::ExprTryBlock struct">ExprTryBlock</a><span class="stab portability" title="This is supported on crate feature `full` only"><code>full</code></span></div><div class="item-right docblock-short"><p>A try block: <code>try { ... }</code>.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.ExprTuple.html" title="syn::ExprTuple struct">ExprTuple</a><span class="stab portability" title="This is supported on crate feature `full` only"><code>full</code></span></div><div class="item-right docblock-short"><p>A tuple expression: <code>(a, b, c, d)</code>.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.ExprType.html" title="syn::ExprType struct">ExprType</a><span class="stab portability" title="This is supported on crate feature `full` only"><code>full</code></span></div><div class="item-right docblock-short"><p>A type ascription expression: <code>foo: f64</code>.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.ExprUnary.html" title="syn::ExprUnary struct">ExprUnary</a><span class="stab portability" title="This is supported on crate features `full` or `derive` only"><code>full</code> or <code>derive</code></span></div><div class="item-right docblock-short"><p>A unary operation: <code>!x</code>, <code>*x</code>.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.ExprUnsafe.html" title="syn::ExprUnsafe struct">ExprUnsafe</a><span class="stab portability" title="This is supported on crate feature `full` only"><code>full</code></span></div><div class="item-right docblock-short"><p>An unsafe block: <code>unsafe { ... }</code>.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.ExprWhile.html" title="syn::ExprWhile struct">ExprWhile</a><span class="stab portability" title="This is supported on crate feature `full` only"><code>full</code></span></div><div class="item-right docblock-short"><p>A while loop: <code>while expr { ... }</code>.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.ExprYield.html" title="syn::ExprYield struct">ExprYield</a><span class="stab portability" title="This is supported on crate feature `full` only"><code>full</code></span></div><div class="item-right docblock-short"><p>A yield expression: <code>yield expr</code>.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.Field.html" title="syn::Field struct">Field</a><span class="stab portability" title="This is supported on crate features `full` or `derive` only"><code>full</code> or <code>derive</code></span></div><div class="item-right docblock-short"><p>A field of a struct or enum variant.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.FieldsNamed.html" title="syn::FieldsNamed struct">FieldsNamed</a><span class="stab portability" title="This is supported on crate features `full` or `derive` only"><code>full</code> or <code>derive</code></span></div><div class="item-right docblock-short"><p>Named fields of a struct or struct variant such as <code>Point { x: f64, y: f64 }</code>.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.FieldsUnnamed.html" title="syn::FieldsUnnamed struct">FieldsUnnamed</a><span class="stab portability" title="This is supported on crate features `full` or `derive` only"><code>full</code> or <code>derive</code></span></div><div class="item-right docblock-short"><p>Unnamed fields of a tuple struct or tuple variant such as <code>Some(T)</code>.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.Generics.html" title="syn::Generics struct">Generics</a><span class="stab portability" title="This is supported on crate features `full` or `derive` only"><code>full</code> or <code>derive</code></span></div><div class="item-right docblock-short"><p>Lifetimes and type parameters attached to a declaration of a function, |
| enum, trait, etc.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.Ident.html" title="syn::Ident struct">Ident</a></div><div class="item-right docblock-short"><p>A word of Rust code, which may be a keyword or legal variable name.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.ImplGenerics.html" title="syn::ImplGenerics struct">ImplGenerics</a><span class="stab portability" title="This is supported on (crate features `full` or `derive`) and crate feature `printing` only">(<code>full</code> or <code>derive</code>) and <code>printing</code></span></div><div class="item-right docblock-short"><p>Returned by <code>Generics::split_for_impl</code>.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.Index.html" title="syn::Index struct">Index</a><span class="stab portability" title="This is supported on crate features `full` or `derive` only"><code>full</code> or <code>derive</code></span></div><div class="item-right docblock-short"><p>The index of an unnamed tuple struct field.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.Lifetime.html" title="syn::Lifetime struct">Lifetime</a></div><div class="item-right docblock-short"><p>A Rust lifetime: <code>'a</code>.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.LifetimeDef.html" title="syn::LifetimeDef struct">LifetimeDef</a><span class="stab portability" title="This is supported on crate features `full` or `derive` only"><code>full</code> or <code>derive</code></span></div><div class="item-right docblock-short"><p>A lifetime definition: <code>'a: 'b + 'c + 'd</code>.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.LitBool.html" title="syn::LitBool struct">LitBool</a></div><div class="item-right docblock-short"><p>A boolean literal: <code>true</code> or <code>false</code>.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.LitByte.html" title="syn::LitByte struct">LitByte</a></div><div class="item-right docblock-short"><p>A byte literal: <code>b'f'</code>.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.LitByteStr.html" title="syn::LitByteStr struct">LitByteStr</a></div><div class="item-right docblock-short"><p>A byte string literal: <code>b"foo"</code>.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.LitChar.html" title="syn::LitChar struct">LitChar</a></div><div class="item-right docblock-short"><p>A character literal: <code>'a'</code>.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.LitFloat.html" title="syn::LitFloat struct">LitFloat</a></div><div class="item-right docblock-short"><p>A floating point literal: <code>1f64</code> or <code>1.0e10f64</code>.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.LitInt.html" title="syn::LitInt struct">LitInt</a></div><div class="item-right docblock-short"><p>An integer literal: <code>1</code> or <code>1u16</code>.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.LitStr.html" title="syn::LitStr struct">LitStr</a></div><div class="item-right docblock-short"><p>A UTF-8 string literal: <code>"foo"</code>.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.Macro.html" title="syn::Macro struct">Macro</a><span class="stab portability" title="This is supported on crate features `full` or `derive` only"><code>full</code> or <code>derive</code></span></div><div class="item-right docblock-short"><p>A macro invocation: <code>println!("{}", mac)</code>.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.MetaList.html" title="syn::MetaList struct">MetaList</a><span class="stab portability" title="This is supported on crate features `full` or `derive` only"><code>full</code> or <code>derive</code></span></div><div class="item-right docblock-short"><p>A structured list within an attribute, like <code>derive(Copy, Clone)</code>.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.MetaNameValue.html" title="syn::MetaNameValue struct">MetaNameValue</a><span class="stab portability" title="This is supported on crate features `full` or `derive` only"><code>full</code> or <code>derive</code></span></div><div class="item-right docblock-short"><p>A name-value pair within an attribute, like <code>feature = "nightly"</code>.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.ParenthesizedGenericArguments.html" title="syn::ParenthesizedGenericArguments struct">ParenthesizedGenericArguments</a><span class="stab portability" title="This is supported on crate features `full` or `derive` only"><code>full</code> or <code>derive</code></span></div><div class="item-right docblock-short"><p>Arguments of a function path segment: the <code>(A, B) -> C</code> in <code>Fn(A,B) -> C</code>.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.Path.html" title="syn::Path struct">Path</a><span class="stab portability" title="This is supported on crate features `full` or `derive` only"><code>full</code> or <code>derive</code></span></div><div class="item-right docblock-short"><p>A path at which a named item is exported (e.g. <code>std::collections::HashMap</code>).</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.PathSegment.html" title="syn::PathSegment struct">PathSegment</a><span class="stab portability" title="This is supported on crate features `full` or `derive` only"><code>full</code> or <code>derive</code></span></div><div class="item-right docblock-short"><p>A segment of a path together with any path arguments on that segment.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.PredicateEq.html" title="syn::PredicateEq struct">PredicateEq</a><span class="stab portability" title="This is supported on crate features `full` or `derive` only"><code>full</code> or <code>derive</code></span></div><div class="item-right docblock-short"><p>An equality predicate in a <code>where</code> clause (unsupported).</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.PredicateLifetime.html" title="syn::PredicateLifetime struct">PredicateLifetime</a><span class="stab portability" title="This is supported on crate features `full` or `derive` only"><code>full</code> or <code>derive</code></span></div><div class="item-right docblock-short"><p>A lifetime predicate in a <code>where</code> clause: <code>'a: 'b + 'c</code>.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.PredicateType.html" title="syn::PredicateType struct">PredicateType</a><span class="stab portability" title="This is supported on crate features `full` or `derive` only"><code>full</code> or <code>derive</code></span></div><div class="item-right docblock-short"><p>A type predicate in a <code>where</code> clause: <code>for<'c> Foo<'c>: Trait<'c></code>.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.QSelf.html" title="syn::QSelf struct">QSelf</a><span class="stab portability" title="This is supported on crate features `full` or `derive` only"><code>full</code> or <code>derive</code></span></div><div class="item-right docblock-short"><p>The explicit Self type in a qualified path: the <code>T</code> in <code><T as Display>::fmt</code>.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.TraitBound.html" title="syn::TraitBound struct">TraitBound</a><span class="stab portability" title="This is supported on crate features `full` or `derive` only"><code>full</code> or <code>derive</code></span></div><div class="item-right docblock-short"><p>A trait used as a bound on a type parameter.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.Turbofish.html" title="syn::Turbofish struct">Turbofish</a><span class="stab portability" title="This is supported on (crate features `full` or `derive`) and crate feature `printing` only">(<code>full</code> or <code>derive</code>) and <code>printing</code></span></div><div class="item-right docblock-short"><p>Returned by <code>TypeGenerics::as_turbofish</code>.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.TypeArray.html" title="syn::TypeArray struct">TypeArray</a><span class="stab portability" title="This is supported on crate features `full` or `derive` only"><code>full</code> or <code>derive</code></span></div><div class="item-right docblock-short"><p>A fixed size array type: <code>[T; n]</code>.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.TypeBareFn.html" title="syn::TypeBareFn struct">TypeBareFn</a><span class="stab portability" title="This is supported on crate features `full` or `derive` only"><code>full</code> or <code>derive</code></span></div><div class="item-right docblock-short"><p>A bare function type: <code>fn(usize) -> bool</code>.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.TypeGenerics.html" title="syn::TypeGenerics struct">TypeGenerics</a><span class="stab portability" title="This is supported on (crate features `full` or `derive`) and crate feature `printing` only">(<code>full</code> or <code>derive</code>) and <code>printing</code></span></div><div class="item-right docblock-short"><p>Returned by <code>Generics::split_for_impl</code>.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.TypeGroup.html" title="syn::TypeGroup struct">TypeGroup</a><span class="stab portability" title="This is supported on crate features `full` or `derive` only"><code>full</code> or <code>derive</code></span></div><div class="item-right docblock-short"><p>A type contained within invisible delimiters.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.TypeImplTrait.html" title="syn::TypeImplTrait struct">TypeImplTrait</a><span class="stab portability" title="This is supported on crate features `full` or `derive` only"><code>full</code> or <code>derive</code></span></div><div class="item-right docblock-short"><p>An <code>impl Bound1 + Bound2 + Bound3</code> type where <code>Bound</code> is a trait or |
| a lifetime.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.TypeInfer.html" title="syn::TypeInfer struct">TypeInfer</a><span class="stab portability" title="This is supported on crate features `full` or `derive` only"><code>full</code> or <code>derive</code></span></div><div class="item-right docblock-short"><p>Indication that a type should be inferred by the compiler: <code>_</code>.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.TypeMacro.html" title="syn::TypeMacro struct">TypeMacro</a><span class="stab portability" title="This is supported on crate features `full` or `derive` only"><code>full</code> or <code>derive</code></span></div><div class="item-right docblock-short"><p>A macro in the type position.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.TypeNever.html" title="syn::TypeNever struct">TypeNever</a><span class="stab portability" title="This is supported on crate features `full` or `derive` only"><code>full</code> or <code>derive</code></span></div><div class="item-right docblock-short"><p>The never type: <code>!</code>.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.TypeParam.html" title="syn::TypeParam struct">TypeParam</a><span class="stab portability" title="This is supported on crate features `full` or `derive` only"><code>full</code> or <code>derive</code></span></div><div class="item-right docblock-short"><p>A generic type parameter: <code>T: Into<String></code>.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.TypeParen.html" title="syn::TypeParen struct">TypeParen</a><span class="stab portability" title="This is supported on crate features `full` or `derive` only"><code>full</code> or <code>derive</code></span></div><div class="item-right docblock-short"><p>A parenthesized type equivalent to the inner type.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.TypePath.html" title="syn::TypePath struct">TypePath</a><span class="stab portability" title="This is supported on crate features `full` or `derive` only"><code>full</code> or <code>derive</code></span></div><div class="item-right docblock-short"><p>A path like <code>std::slice::Iter</code>, optionally qualified with a |
| self-type as in <code><Vec<T> as SomeTrait>::Associated</code>.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.TypePtr.html" title="syn::TypePtr struct">TypePtr</a><span class="stab portability" title="This is supported on crate features `full` or `derive` only"><code>full</code> or <code>derive</code></span></div><div class="item-right docblock-short"><p>A raw pointer type: <code>*const T</code> or <code>*mut T</code>.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.TypeReference.html" title="syn::TypeReference struct">TypeReference</a><span class="stab portability" title="This is supported on crate features `full` or `derive` only"><code>full</code> or <code>derive</code></span></div><div class="item-right docblock-short"><p>A reference type: <code>&'a T</code> or <code>&'a mut T</code>.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.TypeSlice.html" title="syn::TypeSlice struct">TypeSlice</a><span class="stab portability" title="This is supported on crate features `full` or `derive` only"><code>full</code> or <code>derive</code></span></div><div class="item-right docblock-short"><p>A dynamically sized slice type: <code>[T]</code>.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.TypeTraitObject.html" title="syn::TypeTraitObject struct">TypeTraitObject</a><span class="stab portability" title="This is supported on crate features `full` or `derive` only"><code>full</code> or <code>derive</code></span></div><div class="item-right docblock-short"><p>A trait object type <code>Bound1 + Bound2 + Bound3</code> where <code>Bound</code> is a |
| trait or a lifetime.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.TypeTuple.html" title="syn::TypeTuple struct">TypeTuple</a><span class="stab portability" title="This is supported on crate features `full` or `derive` only"><code>full</code> or <code>derive</code></span></div><div class="item-right docblock-short"><p>A tuple type: <code>(A, B, C, String)</code>.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.Variadic.html" title="syn::Variadic struct">Variadic</a><span class="stab portability" title="This is supported on crate features `full` or `derive` only"><code>full</code> or <code>derive</code></span></div><div class="item-right docblock-short"><p>The variadic argument of a foreign function.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.Variant.html" title="syn::Variant struct">Variant</a><span class="stab portability" title="This is supported on crate features `full` or `derive` only"><code>full</code> or <code>derive</code></span></div><div class="item-right docblock-short"><p>An enum variant.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.VisCrate.html" title="syn::VisCrate struct">VisCrate</a><span class="stab portability" title="This is supported on crate features `full` or `derive` only"><code>full</code> or <code>derive</code></span></div><div class="item-right docblock-short"><p>A crate-level visibility: <code>crate</code>.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.VisPublic.html" title="syn::VisPublic struct">VisPublic</a><span class="stab portability" title="This is supported on crate features `full` or `derive` only"><code>full</code> or <code>derive</code></span></div><div class="item-right docblock-short"><p>A public visibility level: <code>pub</code>.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.VisRestricted.html" title="syn::VisRestricted struct">VisRestricted</a><span class="stab portability" title="This is supported on crate features `full` or `derive` only"><code>full</code> or <code>derive</code></span></div><div class="item-right docblock-short"><p>A visibility level restricted to some path: <code>pub(self)</code> or |
| <code>pub(super)</code> or <code>pub(crate)</code> or <code>pub(in some::module)</code>.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.WhereClause.html" title="syn::WhereClause struct">WhereClause</a><span class="stab portability" title="This is supported on crate features `full` or `derive` only"><code>full</code> or <code>derive</code></span></div><div class="item-right docblock-short"><p>A <code>where</code> clause in a definition: <code>where T: Deserialize<'de>, D: 'static</code>.</p> |
| </div></div></div><h2 id="enums" class="small-section-header"><a href="#enums">Enums</a></h2> |
| <div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="enum" href="enum.AttrStyle.html" title="syn::AttrStyle enum">AttrStyle</a><span class="stab portability" title="This is supported on crate features `full` or `derive` only"><code>full</code> or <code>derive</code></span></div><div class="item-right docblock-short"><p>Distinguishes between attributes that decorate an item and attributes |
| that are contained within an item.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="enum" href="enum.BinOp.html" title="syn::BinOp enum">BinOp</a><span class="stab portability" title="This is supported on crate features `full` or `derive` only"><code>full</code> or <code>derive</code></span></div><div class="item-right docblock-short"><p>A binary operator: <code>+</code>, <code>+=</code>, <code>&</code>.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="enum" href="enum.Data.html" title="syn::Data enum">Data</a><span class="stab portability" title="This is supported on crate feature `derive` only"><code>derive</code></span></div><div class="item-right docblock-short"><p>The storage of a struct, enum or union data structure.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="enum" href="enum.Expr.html" title="syn::Expr enum">Expr</a><span class="stab portability" title="This is supported on crate features `full` or `derive` only"><code>full</code> or <code>derive</code></span></div><div class="item-right docblock-short"><p>A Rust expression.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="enum" href="enum.Fields.html" title="syn::Fields enum">Fields</a><span class="stab portability" title="This is supported on crate features `full` or `derive` only"><code>full</code> or <code>derive</code></span></div><div class="item-right docblock-short"><p>Data stored within an enum variant or struct.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="enum" href="enum.GenericArgument.html" title="syn::GenericArgument enum">GenericArgument</a><span class="stab portability" title="This is supported on crate features `full` or `derive` only"><code>full</code> or <code>derive</code></span></div><div class="item-right docblock-short"><p>An individual generic argument, like <code>'a</code>, <code>T</code>, or <code>Item = T</code>.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="enum" href="enum.GenericParam.html" title="syn::GenericParam enum">GenericParam</a><span class="stab portability" title="This is supported on crate features `full` or `derive` only"><code>full</code> or <code>derive</code></span></div><div class="item-right docblock-short"><p>A generic type parameter, lifetime, or const generic: <code>T: Into<String></code>, |
| <code>'a: 'b</code>, <code>const LEN: usize</code>.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="enum" href="enum.Lit.html" title="syn::Lit enum">Lit</a></div><div class="item-right docblock-short"><p>A Rust literal such as a string or integer or boolean.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="enum" href="enum.MacroDelimiter.html" title="syn::MacroDelimiter enum">MacroDelimiter</a><span class="stab portability" title="This is supported on crate features `full` or `derive` only"><code>full</code> or <code>derive</code></span></div><div class="item-right docblock-short"><p>A grouping token that surrounds a macro body: <code>m!(...)</code> or <code>m!{...}</code> or <code>m![...]</code>.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="enum" href="enum.Member.html" title="syn::Member enum">Member</a><span class="stab portability" title="This is supported on crate features `full` or `derive` only"><code>full</code> or <code>derive</code></span></div><div class="item-right docblock-short"><p>A struct or tuple struct field accessed in a struct literal or field |
| expression.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="enum" href="enum.Meta.html" title="syn::Meta enum">Meta</a><span class="stab portability" title="This is supported on crate features `full` or `derive` only"><code>full</code> or <code>derive</code></span></div><div class="item-right docblock-short"><p>Content of a compile-time structured attribute.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="enum" href="enum.NestedMeta.html" title="syn::NestedMeta enum">NestedMeta</a><span class="stab portability" title="This is supported on crate features `full` or `derive` only"><code>full</code> or <code>derive</code></span></div><div class="item-right docblock-short"><p>Element of a compile-time attribute list.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="enum" href="enum.PathArguments.html" title="syn::PathArguments enum">PathArguments</a><span class="stab portability" title="This is supported on crate features `full` or `derive` only"><code>full</code> or <code>derive</code></span></div><div class="item-right docblock-short"><p>Angle bracketed or parenthesized arguments of a path segment.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="enum" href="enum.ReturnType.html" title="syn::ReturnType enum">ReturnType</a><span class="stab portability" title="This is supported on crate features `full` or `derive` only"><code>full</code> or <code>derive</code></span></div><div class="item-right docblock-short"><p>Return type of a function signature.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="enum" href="enum.StrStyle.html" title="syn::StrStyle enum">StrStyle</a></div><div class="item-right docblock-short"><p>The style of a string literal, either plain quoted or a raw string like |
| <code>r##"data"##</code>.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="enum" href="enum.TraitBoundModifier.html" title="syn::TraitBoundModifier enum">TraitBoundModifier</a><span class="stab portability" title="This is supported on crate features `full` or `derive` only"><code>full</code> or <code>derive</code></span></div><div class="item-right docblock-short"><p>A modifier on a trait bound, currently only used for the <code>?</code> in |
| <code>?Sized</code>.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="enum" href="enum.Type.html" title="syn::Type enum">Type</a><span class="stab portability" title="This is supported on crate features `full` or `derive` only"><code>full</code> or <code>derive</code></span></div><div class="item-right docblock-short"><p>The possible types that a Rust value could have.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="enum" href="enum.TypeParamBound.html" title="syn::TypeParamBound enum">TypeParamBound</a><span class="stab portability" title="This is supported on crate features `full` or `derive` only"><code>full</code> or <code>derive</code></span></div><div class="item-right docblock-short"><p>A trait or lifetime used as a bound on a type parameter.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="enum" href="enum.UnOp.html" title="syn::UnOp enum">UnOp</a><span class="stab portability" title="This is supported on crate features `full` or `derive` only"><code>full</code> or <code>derive</code></span></div><div class="item-right docblock-short"><p>A unary operator: <code>*</code>, <code>!</code>, <code>-</code>.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="enum" href="enum.Visibility.html" title="syn::Visibility enum">Visibility</a><span class="stab portability" title="This is supported on crate features `full` or `derive` only"><code>full</code> or <code>derive</code></span></div><div class="item-right docblock-short"><p>The visibility level of an item: inherited or <code>pub</code> or |
| <code>pub(restricted)</code>.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="enum" href="enum.WherePredicate.html" title="syn::WherePredicate enum">WherePredicate</a><span class="stab portability" title="This is supported on crate features `full` or `derive` only"><code>full</code> or <code>derive</code></span></div><div class="item-right docblock-short"><p>A single predicate in a <code>where</code> clause: <code>T: Deserialize<'de></code>.</p> |
| </div></div></div><h2 id="functions" class="small-section-header"><a href="#functions">Functions</a></h2> |
| <div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="fn" href="fn.parse.html" title="syn::parse fn">parse</a><span class="stab portability" title="This is supported on crate features `parsing` and `proc-macro` only"><code>parsing</code> and <code>proc-macro</code></span></div><div class="item-right docblock-short"><p>Parse tokens of source code into the chosen syntax tree node.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="fn" href="fn.parse2.html" title="syn::parse2 fn">parse2</a><span class="stab portability" title="This is supported on crate feature `parsing` only"><code>parsing</code></span></div><div class="item-right docblock-short"><p>Parse a proc-macro2 token stream into the chosen syntax tree node.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="fn" href="fn.parse_str.html" title="syn::parse_str fn">parse_str</a><span class="stab portability" title="This is supported on crate feature `parsing` only"><code>parsing</code></span></div><div class="item-right docblock-short"><p>Parse a string of Rust code into the chosen syntax tree node.</p> |
| </div></div></div><h2 id="types" class="small-section-header"><a href="#types">Type Definitions</a></h2> |
| <div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="type" href="type.AttributeArgs.html" title="syn::AttributeArgs type">AttributeArgs</a><span class="stab portability" title="This is supported on crate features `full` or `derive` only"><code>full</code> or <code>derive</code></span></div><div class="item-right docblock-short"><p>Conventional argument type associated with an invocation of an attribute |
| macro.</p> |
| </div></div><div class="item-row"><div class="item-left module-item"><a class="type" href="type.Result.html" title="syn::Result type">Result</a></div><div class="item-right docblock-short"><p>The result of a Syn parser.</p> |
| </div></div></div></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../" data-current-crate="syn" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.60.0-nightly (1bd4fdc94 2022-01-12)" ></div> |
| </body></html> |