<!DOCTYPE html><htmllang="en"><head><metacharset="utf-8"><metaname="viewport"content="width=device-width, initial-scale=1.0"><metaname="generator"content="rustdoc"><metaname="description"content="API documentation for the Rust `Attribute` struct in crate `syn`."><metaname="keywords"content="rust, rustlang, rust-lang, Attribute"><title>syn::Attribute - Rust</title><linkrel="stylesheet"type="text/css"href="../normalize.css"><linkrel="stylesheet"type="text/css"href="../rustdoc.css"id="mainThemeStyle"><linkrel="stylesheet"type="text/css"href="../dark.css"><linkrel="stylesheet"type="text/css"href="../light.css"id="themeStyle"><scriptsrc="../storage.js"></script><noscript><linkrel="stylesheet"href="../noscript.css"></noscript><linkrel="shortcut icon"href="../favicon.ico"><styletype="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><bodyclass="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><navclass="sidebar"><divclass="sidebar-menu">☰</div><ahref='../syn/index.html'><divclass='logo-container'><imgsrc='../rust-logo.png'alt='logo'></div></a><pclass='location'>Struct Attribute</p><divclass="sidebar-elems"><divclass="block items"><aclass="sidebar-title"href="#fields">Fields</a><divclass="sidebar-links"><ahref="#structfield.pound_token">pound_token</a><ahref="#structfield.style">style</a><ahref="#structfield.bracket_token">bracket_token</a><ahref="#structfield.path">path</a><ahref="#structfield.tokens">tokens</a></div><aclass="sidebar-title"href="#methods">Methods</a><divclass="sidebar-links"><ahref="#method.parse_args">parse_args</a><ahref="#method.parse_args_with">parse_args_with</a><ahref="#method.parse_inner">parse_inner</a><ahref="#method.parse_meta">parse_meta</a><ahref="#method.parse_outer">parse_outer</a></div><aclass="sidebar-title"href="#implementations">Trait Implementations</a><divclass="sidebar-links"><ahref="#impl-Clone">Clone</a><ahref="#impl-ToTokens">ToTokens</a></div><aclass="sidebar-title"href="#synthetic-implementations">Auto Trait Implementations</a><divclass="sidebar-links"><ahref="#impl-RefUnwindSafe">!RefUnwindSafe</a><ahref="#impl-Send">!Send</a><ahref="#impl-Sync">!Sync</a><ahref="#impl-Unpin">Unpin</a><ahref="#impl-UnwindSafe">UnwindSafe</a></div><aclass="sidebar-title"href="#blanket-implementations">Blanket Implementations</a><divclass="sidebar-links"><ahref="#impl-Any">Any</a><ahref="#impl-Borrow%3CT%3E">Borrow<T></a><ahref="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><ahref="#impl-From%3CT%3E">From<T></a><ahref="#impl-Into%3CU%3E">Into<U></a><ahref="#impl-Spanned">Spanned</a><ahref="#impl-ToOwned">ToOwned</a><ahref="#impl-TryFrom%3CU%3E">TryFrom<U></a><ahref="#impl-TryInto%3CU%3E">TryInto<U></a></div></div><pclass='location'><ahref='index.html'>syn</a></p><script>window.sidebarCurrent={name:'Attribute',ty:'struct',relpath:''};</script><scriptdefersrc="sidebar-items.js"></script></div></nav><divclass="theme-picker"><buttonid="theme-picker"aria-label="Pick another theme!"><imgsrc="../brush.svg"width="18"alt="Pick another theme!"></button><divid="theme-choices"></div></div><scriptsrc="../theme.js"></script><navclass="sub"><formclass="search-form js-only"><divclass="search-container"><div><selectid="crate-search"><optionvalue="All crates">All crates</option></select><inputclass="search-input"name="search"autocomplete="off"spellcheck="false"placeholder="Click or press ‘S’ to search, ‘?’ for more options…"type="search"></div><aid="settings-menu"href="../settings.html"><imgsrc="../wheel.svg"width="18"alt="Change settings"></a></div></form></nav><sectionid="main"class="content"><h1class='fqn'><spanclass='out-of-band'><spanid='render-detail'><aid="toggle-all-docs"href="javascript:void(0)"title="collapse all docs">[<spanclass='inner'>−</span>]</a></span><aclass='srclink'href='../src/syn/attr.rs.html#11
<li>Outer attributes like <code>#[repr(transparent)]</code>. These appear outside or
in front of the item they describe.</li>
<li>Inner attributes like <code>#![feature(proc_macro)]</code>. These appear inside
of the item they describe, usually a module.</li>
<li>Outer doc comments like <code>/// # Example</code>.</li>
<li>Inner doc comments like <code>//! Please file an issue</code>.</li>
<li>Outer block comments <code>/** # Example */</code>.</li>
<li>Inner block comments <code>/*! Please file an issue */</code>.</li>
</ul>
<p>The <code>style</code> field of type <code>AttrStyle</code> distinguishes whether an attribute
is outer or inner. Doc comments and block comments are promoted to
attributes, as this is how they are processed by the compiler and by
<code>macro_rules!</code> macros.</p>
<p>The <code>path</code> field gives the possibly colon-delimited path against which
the attribute is resolved. It is equal to <code>"doc"</code> for desugared doc
comments. The <code>tokens</code> field contains the rest of the attribute body as
tokens.</p>
<pre><codeclass="language-text">#[derive(Copy)] #[crate::precondition x < 5]
^^^^^^~~~~~~ ^^^^^^^^^^^^^^^^^^^ ~~~~~
path tokens path tokens
</code></pre>
<br>
<h1id="parsing-from-tokens-to-attribute"class="section-header"><ahref="#parsing-from-tokens-to-attribute">Parsing from tokens to Attribute</a></h1>
<p>This type does not implement the <ahref="../syn/parse/trait.Parse.html"><code>Parse</code></a> trait and thus cannot be
parsed directly by <ahref="../syn/parse/struct.ParseBuffer.html#method.parse"><code>ParseStream::parse</code></a>. Instead use
<ahref="../syn/parse/struct.ParseBuffer.html#method.call"><code>ParseStream::call</code></a> with one of the two parser functions
<ahref="../syn/struct.Attribute.html#method.parse_outer"title="`Attribute::parse_outer`"><code>Attribute::parse_outer</code></a> or <ahref="../syn/struct.Attribute.html#method.parse_inner"title="`Attribute::parse_inner`"><code>Attribute::parse_inner</code></a> depending on
<h1id="parsing-from-attribute-to-structured-arguments"class="section-header"><ahref="#parsing-from-attribute-to-structured-arguments">Parsing from Attribute to structured arguments</a></h1>
<p>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
attribute are held in an arbitrary <code>tokens: TokenStream</code>. Macros are
expected to check the <code>path</code> 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.</p>
<p>If the attribute you are parsing is expected to conform to the
conventional structured form of attribute, use <ahref="../syn/struct.Attribute.html#method.parse_meta"><code>parse_meta()</code></a> to
obtain that structured representation. If the attribute follows some
other grammar of its own, use <ahref="../syn/struct.Attribute.html#method.parse_args"><code>parse_args()</code></a> to parse that into the
Fields<ahref='#fields'class='anchor'></a></h2><spanid="structfield.pound_token"class="structfield small-section-header"><ahref="#structfield.pound_token"class="anchor field"></a><codeid="pound_token.v">pound_token: <aclass="struct"href="../syn/token/struct.Pound.html"title="struct syn::token::Pound">Pound</a></code></span><spanid="structfield.style"class="structfield small-section-header"><ahref="#structfield.style"class="anchor field"></a><codeid="style.v">style: <aclass="enum"href="../syn/enum.AttrStyle.html"title="enum syn::AttrStyle">AttrStyle</a></code></span><spanid="structfield.bracket_token"class="structfield small-section-header"><ahref="#structfield.bracket_token"class="anchor field"></a><codeid="bracket_token.v">bracket_token: <aclass="struct"href="../syn/token/struct.Bracket.html"title="struct syn::token::Bracket">Bracket</a></code></span><spanid="structfield.path"class="structfield small-section-header"><ahref="#structfield.path"class="anchor field"></a><codeid="path.v">path: <aclass="struct"href="../syn/struct.Path.html"title="struct syn::Path">Path</a></code></span><spanid="structfield.tokens"class="structfield small-section-header"><ahref="#structfield.tokens"class="anchor field"></a><codeid="tokens.v">tokens: <aclass="struct"href="../proc_macro2/struct.TokenStream.html"title="struct proc_macro2::TokenStream">TokenStream</a></code></span><h2id='methods'class='small-section-header'>Methods<ahref='#methods'class='anchor'></a></h2><h3id='impl'class='impl'><codeclass='in-band'>impl <aclass="struct"href="../syn/struct.Attribute.html"title="struct syn::Attribute">Attribute</a></code><ahref='#impl'class='anchor'></a><aclass='srclink'href='../src/syn/attr.rs.html#151-247'title='goto source code'>[src]</a></h3><divclass='impl-items'><h4id='method.parse_meta'class="method"><codeid='parse_meta.v'>pub fn <ahref='#method.parse_meta'class='fnname'>parse_meta</a>(&self) -><aclass="type"href="../syn/parse/type.Result.html"title="type syn::parse::Result">Result</a><<aclass="enum"href="../syn/enum.Meta.html"title="enum syn::Meta">Meta</a>></code><aclass='srclink'href='../src/syn/attr.rs.html#158-187'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Parses the content of the attribute, consisting of the path and tokens,
as a <ahref="../syn/enum.Meta.html"title="`Meta`"><code>Meta</code></a> if possible.</p>
<p><em>This function is available if Syn is built with the <code>"parsing"</code>
feature.</em></p>
</div><h4id='method.parse_args'class="method"><codeid='parse_args.v'>pub fn <ahref='#method.parse_args'class='fnname'>parse_args</a><T: <aclass="trait"href="../syn/parse/trait.Parse.html"title="trait syn::parse::Parse">Parse</a>>(&self) -><aclass="type"href="../syn/parse/type.Result.html"title="type syn::parse::Result">Result</a><T></code><aclass='srclink'href='../src/syn/attr.rs.html#205-207'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Parse the arguments to the attribute as a syntax tree.</p>
<p>This is similar to <code>syn::parse2::<T>(attr.tokens)</code> except that:</p>
<ul>
<li>the surrounding delimiters are <em>not</em> included in the input to the
parser; and</li>
<li>the error message has a more useful span when <code>tokens</code> is empty.</li>
<p><em>This function is available if Syn is built with the <code>"parsing"</code>
feature.</em></p>
</div><h4id='method.parse_args_with'class="method"><codeid='parse_args_with.v'>pub fn <ahref='#method.parse_args_with'class='fnname'>parse_args_with</a><F: <aclass="trait"href="../syn/parse/trait.Parser.html"title="trait syn::parse::Parser">Parser</a>>(&self, parser: F) -><aclass="type"href="../syn/parse/type.Result.html"title="type syn::parse::Result">Result</a><F::<aclass="type"href="../syn/parse/trait.Parser.html#associatedtype.Output"title="type syn::parse::Parser::Output">Output</a>></code><aclass='srclink'href='../src/syn/attr.rs.html#214-220'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Parse the arguments to the attribute using the given parser.</p>
<p><em>This function is available if Syn is built with the <code>"parsing"</code>
feature.</em></p>
</div><h4id='method.parse_outer'class="method"><codeid='parse_outer.v'>pub fn <ahref='#method.parse_outer'class='fnname'>parse_outer</a>(input: <aclass="type"href="../syn/parse/type.ParseStream.html"title="type syn::parse::ParseStream">ParseStream</a>) -><aclass="type"href="../syn/parse/type.Result.html"title="type syn::parse::Result">Result</a><<aclass="struct"href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html"title="struct alloc::vec::Vec">Vec</a><Self>></code><aclass='srclink'href='../src/syn/attr.rs.html#227-233'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Parses zero or more outer attributes from the stream.</p>
<p><em>This function is available if Syn is built with the <code>"parsing"</code>
feature.</em></p>
</div><h4id='method.parse_inner'class="method"><codeid='parse_inner.v'>pub fn <ahref='#method.parse_inner'class='fnname'>parse_inner</a>(input: <aclass="type"href="../syn/parse/type.ParseStream.html"title="type syn::parse::ParseStream">ParseStream</a>) -><aclass="type"href="../syn/parse/type.Result.html"title="type syn::parse::Result">Result</a><<aclass="struct"href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html"title="struct alloc::vec::Vec">Vec</a><Self>></code><aclass='srclink'href='../src/syn/attr.rs.html#240-246'title='goto source code'>[src]</a></h4><divclass='docblock'><p>Parses zero or more inner attributes from the stream.</p>
<p><em>This function is available if Syn is built with the <code>"parsing"</code>
feature.</em></p>
</div></div><h2id='implementations'class='small-section-header'>Trait Implementations<ahref='#implementations'class='anchor'></a></h2><divid='implementations-list'><h3id='impl-Clone'class='impl'><codeclass='in-band'>impl <aclass="trait"href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html"title="trait core::clone::Clone">Clone</a> for <aclass="struct"href="../syn/struct.Attribute.html"title="struct syn::Attribute">Attribute</a></code><ahref='#impl-Clone'class='anchor'></a><aclass='srclink'href='../src/syn/macros.rs.html#31'title='goto source code'>[src]</a></h3><divclass='impl-items'><h4id='method.clone'class="method hidden"><codeid='clone.v'>fn <ahref='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone'class='fnname'>clone</a>(&self) -><aclass="struct"href="../syn/struct.Attribute.html"title="struct syn::Attribute">Attribute</a></code><aclass='srclink'href='../src/syn/macros.rs.html#31'title='goto source code'>[src]</a></h4><divclass='docblock hidden'><p>Returns a copy of the value. <ahref="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
</div><h4id='method.clone_from'class="method hidden"><codeid='clone_from.v'>fn <ahref='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from'class='fnname'>clone_from</a>(&mut self, source: <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Self)</code><spanclass='since'title='Stable since Rust version 1.0.0'>1.0.0</span><aclass='srclink'href='https://doc.rust-lang.org/nightly/src/core/clone.rs.html#131-133'title='goto source code'>[src]</a></h4><divclass='docblock hidden'><p>Performs copy-assignment from <code>source</code>. <ahref="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
</div></div><h3id='impl-ToTokens'class='impl'><codeclass='in-band'>impl <aclass="trait"href="../quote/to_tokens/trait.ToTokens.html"title="trait quote::to_tokens::ToTokens">ToTokens</a> for <aclass="struct"href="../syn/struct.Attribute.html"title="struct syn::Attribute">Attribute</a></code><ahref='#impl-ToTokens'class='anchor'></a><aclass='srclink'href='../src/syn/attr.rs.html#616-627'title='goto source code'>[src]</a></h3><divclass='impl-items'><h4id='method.to_tokens'class="method hidden"><codeid='to_tokens.v'>fn <ahref='../quote/to_tokens/trait.ToTokens.html#tymethod.to_tokens'class='fnname'>to_tokens</a>(&self, tokens: &mut <aclass="struct"href="../proc_macro2/struct.TokenStream.html"title="struct proc_macro2::TokenStream">TokenStream</a>)</code><aclass='srclink'href='../src/syn/attr.rs.html#617-626'title='goto source code'>[src]</a></h4><divclass='docblock hidden'><p>Write <code>self</code> to the given <code>TokenStream</code>. <ahref="../quote/to_tokens/trait.ToTokens.html#tymethod.to_tokens">Read more</a></p>
</div><h4id='method.to_token_stream'class="method hidden"><codeid='to_token_stream.v'>fn <ahref='../quote/to_tokens/trait.ToTokens.html#method.to_token_stream'class='fnname'>to_token_stream</a>(&self) -><aclass="struct"href="../proc_macro2/struct.TokenStream.html"title="struct proc_macro2::TokenStream">TokenStream</a></code><aclass='srclink'href='../src/quote/to_tokens.rs.html#61-65'title='goto source code'>[src]</a></h4><divclass='docblock hidden'><p>Convert <code>self</code> directly into a <code>TokenStream</code> object. <ahref="../quote/to_tokens/trait.ToTokens.html#method.to_token_stream">Read more</a></p>
</div><h4id='method.into_token_stream'class="method hidden"><codeid='into_token_stream.v'>fn <ahref='../quote/to_tokens/trait.ToTokens.html#method.into_token_stream'class='fnname'>into_token_stream</a>(self) -><aclass="struct"href="../proc_macro2/struct.TokenStream.html"title="struct proc_macro2::TokenStream">TokenStream</a></code><aclass='srclink'href='../src/quote/to_tokens.rs.html#71-76'title='goto source code'>[src]</a></h4><divclass='docblock hidden'><p>Convert <code>self</code> directly into a <code>TokenStream</code> object. <ahref="../quote/to_tokens/trait.ToTokens.html#method.into_token_stream">Read more</a></p>
</div></div></div><h2id='synthetic-implementations'class='small-section-header'>Auto Trait Implementations<ahref='#synthetic-implementations'class='anchor'></a></h2><divid='synthetic-implementations-list'><h3id='impl-Sync'class='impl'><codeclass='in-band'>impl !<aclass="trait"href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html"title="trait core::marker::Sync">Sync</a> for <aclass="struct"href="../syn/struct.Attribute.html"title="struct syn::Attribute">Attribute</a></code><ahref='#impl-Sync'class='anchor'></a></h3><divclass='impl-items'></div><h3id='impl-Send'class='impl'><codeclass='in-band'>impl !<aclass="trait"href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html"title="trait core::marker::Send">Send</a> for <aclass="struct"href="../syn/struct.Attribute.html"title="struct syn::Attribute">Attribute</a></code><ahref='#impl-Send'class='anchor'></a></h3><divclass='impl-items'></div><h3id='impl-Unpin'class='impl'><codeclass='in-band'>impl <aclass="trait"href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html"title="trait core::marker::Unpin">Unpin</a> for <aclass="struct"href="../syn/struct.Attribute.html"title="struct syn::Attribute">Attribute</a></code><ahref='#impl-Unpin'class='anchor'></a></h3><divclass='impl-items'></div><h3id='impl-RefUnwindSafe'class='impl'><codeclass='in-band'>impl !<aclass="trait"href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html"title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <aclass="struct"href="../syn/struct.Attribute.html"title="struct syn::Attribute">Attribute</a></code><ahref='#impl-RefUnwindSafe'class='anchor'></a></h3><divclass='impl-items'></div><h3id='impl-UnwindSafe'class='impl'><codeclass='in-band'>impl <aclass="trait"href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html"title="trait std::panic::UnwindSafe">UnwindSafe</a> for <aclass="struct"href="../syn/struct.Attribute.html"title="struct syn::Attribute">Attribute</a></code><ahref='#impl-UnwindSafe'class='anchor'></a></h3><divclass='impl-items'></div></div><h2id='blanket-implementations'class='small-section-header'>Blanket Implementations<ahref='#blanket-implementations'class='anchor'></a></h2><divid='blanket-implementations-list'><h3id='impl-Spanned'class='impl'><codeclass='in-band'>impl<T><aclass="trait"href="../syn/spanned/trait.Spanned.html"title="trait syn::spanned::Spanned">Spanned</a> for T <spanclass="where fmt-newline">where<br> T: Spanned + ?<aclass="trait"href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html"title="trait core::marker::Sized">Sized</a>, </span></code><ahref='#impl-Spanned'class='anchor'></a><aclass='srclink'href='../src/syn/spanned.rs.html#110-114'title='goto source code'>[src]</a></h3><divclass='impl-items'><h4id='method.span'class="method hidden"><codeid='span.v'>fn <ahref='../syn/spanned/trait.Spanned.html#tymethod.span'class='fnname'>span</a>(<aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Self) -><aclass="struct"href="../proc_macro2/struct.Span.html"title="struct proc_macro2::Span">Span</a></code><aclass='srclink'href='../src/syn/spanned.rs.html#111-113'title='goto source code'>[src]</a></h4><divclass='docblock hidden'><p>Returns a <code>Span</code> covering the complete contents of this syntax tree node, or [<code>Span::call_site()</code>] if this node is empty. <ahref="../syn/spanned/trait.Spanned.html#tymethod.span">Read more</a></p>
</div></div><h3id='impl-ToOwned'class='impl'><codeclass='in-band'>impl<T><aclass="trait"href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html"title="trait alloc::borrow::ToOwned">ToOwned</a> for T <spanclass="where fmt-newline">where<br> T: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html"title="trait core::clone::Clone">Clone</a>, </span></code><ahref='#impl-ToOwned'class='anchor'></a><aclass='srclink'href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#81-92'title='goto source code'>[src]</a></h3><divclass='impl-items'><h4id='associatedtype.Owned'class="type"><codeid='Owned.t'>type <ahref='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned'class="type">Owned</a> = T</code></h4><divclass='docblock'><p>The resulting type after obtaining ownership.</p>
</div><h4id='method.to_owned'class="method hidden"><codeid='to_owned.v'>fn <ahref='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned'class='fnname'>to_owned</a>(&self) -> T</code><aclass='srclink'href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#85-87'title='goto source code'>[src]</a></h4><divclass='docblock hidden'><p>Creates owned data from borrowed data, usually by cloning. <ahref="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
</div><h4id='method.clone_into'class="method hidden"><codeid='clone_into.v'>fn <ahref='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into'class='fnname'>clone_into</a>(&self, target: <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T)</code><aclass='srclink'href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#89-91'title='goto source code'>[src]</a></h4><divclass='stability hidden'><divclass='stab unstable'><details><summary><spanclass='emoji'>🔬</span> This is a nightly-only experimental API. (<code>toowned_clone_into</code>)</summary><p>recently added</p>
</details></div></div><divclass='docblock hidden'><p>Uses borrowed data to replace owned data, usually by cloning. <ahref="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></p>
</div></div><h3id='impl-TryFrom%3CU%3E'class='impl'><codeclass='in-band'>impl<T, U><aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><U> for T <spanclass="where fmt-newline">where<br> U: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html"title="trait core::convert::Into">Into</a><T>, </span></code><ahref='#impl-TryFrom%3CU%3E'class='anchor'></a><aclass='srclink'href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#571-577'title='goto source code'>[src]</a></h3><divclass='impl-items'><h4id='associatedtype.Error'class="type"><codeid='Error.t'>type <ahref='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error'class="type">Error</a> = <aclass="enum"href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html"title="enum core::convert::Infallible">Infallible</a></code></h4><divclass='docblock'><p>The type returned in the event of a conversion error.</p>
</div><h4id='method.try_from'class="method hidden"><codeid='try_from.v'>fn <ahref='https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from'class='fnname'>try_from</a>(value: U) -><aclass="enum"href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html"title="enum core::result::Result">Result</a><T, <T as <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><U>>::<aclass="type"href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error"title="type core::convert::TryFrom::Error">Error</a>></code><aclass='srclink'href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#574-576'title='goto source code'>[src]</a></h4><divclass='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3id='impl-TryInto%3CU%3E'class='impl'><codeclass='in-band'>impl<T, U><aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html"title="trait core::convert::TryInto">TryInto</a><U> for T <spanclass="where fmt-newline">where<br> U: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><T>, </span></code><ahref='#impl-TryInto%3CU%3E'class='anchor'></a><aclass='srclink'href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#559-566'title='goto source code'>[src]</a></h3><divclass='impl-items'><h4id='associatedtype.Error-1'class="type"><codeid='Error.t-1'>type <ahref='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error'class="type">Error</a> = <U as <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><T>>::<aclass="type"href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error"title="type core::convert::TryFrom::Error">Error</a></code></h4><divclass='docblock'><p>The type returned in the event of a conversion error.</p>
</div><h4id='method.try_into'class="method hidden"><codeid='try_into.v'>fn <ahref='https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into'class='fnname'>try_into</a>(self) -><aclass="enum"href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html"title="enum core::result::Result">Result</a><U, <U as <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><T>>::<aclass="type"href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error"title="type core::convert::TryFrom::Error">Error</a>></code><aclass='srclink'href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#563-565'title='goto source code'>[src]</a></h4><divclass='docblock hidden'><p>Performs the conversion.</p>
</div></div><h3id='impl-BorrowMut%3CT%3E'class='impl'><codeclass='in-band'>impl<T><aclass="trait"href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html"title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <spanclass="where fmt-newline">where<br> T: ?<aclass="trait"href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html"title="trait core::marker::Sized">Sized</a>, </span></code><ahref='#impl-BorrowMut%3CT%3E'class='anchor'></a><aclass='srclink'href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-220'title='goto source code'>[src]</a></h3><divclass='impl-items'><h4id='method.borrow_mut'class="method hidden"><codeid='borrow_mut.v'>fn <ahref='https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut'class='fnname'>borrow_mut</a>(&mut self) -><aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>T</code><aclass='srclink'href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#219'title='goto source code'>[src]</a></h4><divclass='docblock hidden'><p>Mutably borrows from an owned value. <ahref="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
</div></div><h3id='impl-Borrow%3CT%3E'class='impl'><codeclass='in-band'>impl<T><aclass="trait"href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html"title="trait core::borrow::Borrow">Borrow</a><T> for T <spanclass="where fmt-newline">where<br> T: ?<aclass="trait"href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html"title="trait core::marker::Sized">Sized</a>, </span></code><ahref='#impl-Borrow%3CT%3E'class='anchor'></a><aclass='srclink'href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#213-215'title='goto source code'>[src]</a></h3><divclass='impl-items'><h4id='method.borrow'class="method hidden"><codeid='borrow.v'>fn <ahref='https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow'class='fnname'>borrow</a>(&self) -><aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><aclass='srclink'href='https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#214'title='goto source code'>[src]</a></h4><divclass='docblock hidden'><p>Immutably borrows from an owned value. <ahref="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
</div></div><h3id='impl-Any'class='impl'><codeclass='in-band'>impl<T><aclass="trait"href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html"title="trait core::any::Any">Any</a> for T <spanclass="where fmt-newline">where<br> T: 'static + ?<aclass="trait"href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html"title="trait core::marker::Sized">Sized</a>, </span></code><ahref='#impl-Any'class='anchor'></a><aclass='srclink'href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#100-102'title='goto source code'>[src]</a></h3><divclass='impl-items'><h4id='method.type_id'class="method hidden"><codeid='type_id.v'>fn <ahref='https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id'class='fnname'>type_id</a>(&self) -><aclass="struct"href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html"title="struct core::any::TypeId">TypeId</a></code><aclass='srclink'href='https://doc.rust-lang.org/nightly/src/core/any.rs.html#101'title='goto source code'>[src]</a></h4><divclass='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <ahref="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
</div></div></div></section><sectionid="search"class="content hidden"></section><sectionclass="footer"></section><asideid="help"class="hidden"><div><h1class="hidden">Help</h1><divclass="shortcuts"><h2>Keyboard Shortcuts</h2><dl><dt><kbd>?</kbd></dt><dd>Show this help dialog</dd><dt><kbd>S</kbd></dt><dd>Focus the search field</dd><dt><kbd>↑</kbd></dt><dd>Move up in search results</dd><dt><kbd>↓</kbd></dt><dd>Move down in search results</dd><dt><kbd>↹</kbd></dt><dd>Switch tab</dd><dt><kbd>⏎</kbd></dt><dd>Go to active search result</dd><dt><kbd>+</kbd></dt><dd>Expand all sections</dd><dt><kbd>-</kbd></dt><dd>Collapse all sections</dd></dl></div><divclass="infos"><h2>Search Tricks</h2><p>Prefix searches with a type followed by a colon (e.g., <code>fn:</code>) to restrict the search to a given type.</p><p>Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>.</p><p>Search functions by type signature (e.g., <code>vec -> usize</code> or <code>* -> vec</code>)</p><p>Search multiple things at once by splitting your query with comma (e.g., <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath="../";window.currentCrate="syn";</script><scriptsrc="../aliases.js"></script><scriptsrc="../main.js"></script><scriptdefersrc="../search-index.js"></script></body></html>