<!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="Cursor position within a buffered token stream."><title>ParseBuffer in syn::parse - Rust</title><linkrel="preload"as="font"type="font/woff2"crossoriginhref="../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><linkrel="preload"as="font"type="font/woff2"crossoriginhref="../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><linkrel="preload"as="font"type="font/woff2"crossoriginhref="../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><linkrel="preload"as="font"type="font/woff2"crossoriginhref="../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><linkrel="preload"as="font"type="font/woff2"crossoriginhref="../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><linkrel="stylesheet"href="../../static.files/normalize-76eba96aa4d2e634.css"><linkrel="stylesheet"href="../../static.files/rustdoc-ac92e1bbe349e143.css"><metaname="rustdoc-vars"data-root-path="../../"data-static-root-path="../../static.files/"data-current-crate="syn"data-themes=""data-resource-suffix=""data-rustdoc-version="1.76.0 (07dca489a 2024-02-04)"data-channel="1.76.0"data-search-js="search-2b6ce74ff89ae146.js"data-settings-js="settings-4313503d2e1961c2.js"><scriptsrc="../../static.files/storage-f2adc0d6ca4d09fb.js"></script><scriptdefersrc="sidebar-items.js"></script><scriptdefersrc="../../static.files/main-305769736d49e732.js"></script><noscript><linkrel="stylesheet"href="../../static.files/noscript-feafe1bb7466e4bd.css"></noscript><linkrel="alternate icon"type="image/png"href="../../static.files/favicon-16x16-8b506e7a72182f1c.png"><linkrel="alternate icon"type="image/png"href="../../static.files/favicon-32x32-422f7d1d52889060.png"><linkrel="icon"type="image/svg+xml"href="../../static.files/favicon-2c020d218678b618.svg"></head><bodyclass="rustdoc struct"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><navclass="mobile-topbar"><buttonclass="sidebar-menu-toggle">☰</button></nav><navclass="sidebar"><divclass="sidebar-crate"><h2><ahref="../../syn/index.html">syn</a><spanclass="version">2.0.51</span></h2></div><h2class="location"><ahref="#">ParseBuffer</a></h2><divclass="sidebar-elems"><section><h3><ahref="#implementations">Methods</a></h3><ulclass="block method"><li><ahref="#method.call">call</a></li><li><ahref="#method.cursor">cursor</a></li><li><ahref="#method.error">error</a></li><li><ahref="#method.fork">fork</a></li><li><ahref="#method.is_empty">is_empty</a></li><li><ahref="#method.lookahead1">lookahead1</a></li><li><ahref="#method.parse">parse</a></li><li><ahref="#method.parse_terminated">parse_terminated</a></li><li><ahref="#method.peek">peek</a></li><li><ahref="#method.peek2">peek2</a></li><li><ahref="#method.peek3">peek3</a></li><li><ahref="#method.span">span</a></li><li><ahref="#method.step">step</a></li></ul><h3><ahref="#trait-implementations">Trait Implementations</a></h3><ulclass="block trait-implementation"><li><ahref="#impl-AnyDelimiter-for-ParseBuffer%3C'a%3E">AnyDelimiter</a></li><li><ahref="#impl-Debug-for-ParseBuffer%3C'a%3E">Debug</a></li><li><ahref="#impl-Display-for-ParseBuffer%3C'a%3E">Display</a></li><li><ahref="#impl-Drop-for-ParseBuffer%3C'a%3E">Drop</a></li><li><ahref="#impl-Speculative-for-ParseBuffer%3C'a%3E">Speculative</a></li></ul><h3><ahref="#synthetic-implementations">Auto Trait Implementations</a></h3><ulclass="block synthetic-implementation"><li><ahref="#impl-RefUnwindSafe-for-ParseBuffer%3C'a%3E">!RefUnwindSafe</a></li><li><ahref="#impl-Send-for-ParseBuffer%3C'a%3E">!Send</a></li><li><ahref="#impl-Sync-for-ParseBuffer%3C'a%3E">!Sync</a></li><li><ahref="#impl-UnwindSafe-for-ParseBuffer%3C'a%3E">!UnwindSafe</a></li><li><ahref="#impl-Unpin-for-ParseBuffer%3C'a%3E">Unpin</a></li></ul><h3
<main><divclass="width-limiter"><navclass="sub"><formclass="search-form"><span></span><divid="sidebar-button"tabindex="-1"><ahref="../../syn/all.html"title="show sidebar"></a></div><inputclass="search-input"name="search"aria-label="Run search in the documentation"autocomplete="off"spellcheck="false"placeholder="Click or press ‘S’ to search, ‘?’ for more options…"type="search"><divid="help-button"tabindex="-1"><ahref="../../help.html"title="help">?</a></div><divid="settings-menu"tabindex="-1"><ahref="../../settings.html"title="settings"><imgwidth="22"height="22"alt="Change settings"src="../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><sectionid="main-content"class="content"><divclass="main-heading"><h1>Struct <ahref="../index.html">syn</a>::<wbr><ahref="index.html">parse</a>::<wbr><aclass="struct"href="#">ParseBuffer</a><buttonid="copy-path"title="Copy item path to clipboard"><imgsrc="../../static.files/clipboard-7571035ce49a181d.svg"width="19"height="18"alt="Copy item path"></button></h1><spanclass="out-of-band"><aclass="src"href="../../src/syn/parse.rs.html#243-259">source</a> · <buttonid="toggle-all-docs"title="collapse all docs">[<span>−</span>]</button></span></div><preclass="rust item-decl"><code>pub struct ParseBuffer<'a> { <spanclass="comment">/* private fields */</span> }</code></pre><detailsclass="toggle top-doc"open><summaryclass="hideme"><span>Expand description</span></summary><divclass="docblock"><p>Cursor position within a buffered token stream.</p>
<p>This type is more commonly used through the type alias <ahref="type.ParseStream.html"title="type syn::parse::ParseStream"><code>ParseStream</code></a> which
is an alias for <code>&ParseBuffer</code>.</p>
<p><code>ParseStream</code> is the input type for all parser functions in Syn. They have
the signature <code>fn(ParseStream) -> Result<T></code>.</p>
<h3id="calling-a-parser-function"><ahref="#calling-a-parser-function">Calling a parser function</a></h3>
<p>There is no public way to construct a <code>ParseBuffer</code>. Instead, if you are
looking to invoke a parser function that requires <code>ParseStream</code> as input,
you will need to go through one of the public parsing entry points.</p>
<ul>
<li>The <ahref="../macro.parse_macro_input.html"title="macro syn::parse_macro_input"><code>parse_macro_input!</code></a> macro if parsing input of a procedural macro;</li>
<li>One of <ahref="index.html#the-synparse-functions"title="mod syn::parse">the <code>syn::parse*</code> functions</a>; or</li>
<li>A method of the <ahref="trait.Parser.html"title="trait syn::parse::Parser"><code>Parser</code></a> trait.</li>
</div></details><h2id="implementations"class="section-header">Implementations<ahref="#implementations"class="anchor">§</a></h2><divid="implementations-list"><detailsclass="toggle implementors-toggle"open><summary><sectionid="impl-ParseBuffer%3C'a%3E"class="impl"><aclass="src rightside"href="../../src/syn/parse.rs.html#455-1159">source</a><ahref="#impl-ParseBuffer%3C'a%3E"class="anchor">§</a><h3class="code-header">impl<'a><aclass="struct"href="struct.ParseBuffer.html"title="struct syn::parse::ParseBuffer">ParseBuffer</a><'a></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.parse"class="method"><aclass="src rightside"href="../../src/syn/parse.rs.html#458-460">source</a><h4class="code-header">pub fn <ahref="#method.parse"class="fn">parse</a><T: <aclass="trait"href="trait.Parse.html"title="trait syn::parse::Parse">Parse</a>>(&self) -><aclass="type"href="type.Result.html"title="type syn::parse::Result">Result</a><T></h4></section></summary><divclass="docblock"><p>Parses a syntax tree node of type <code>T</code>, advancing the position of our
) -><aclass="type"href="type.Result.html"title="type syn::parse::Result">Result</a><T></h4></section></summary><divclass="docblock"><p>Calls the given parser function to parse a syntax tree node of type <code>T</code>
<p>The parser below invokes <ahref="../struct.Attribute.html#method.parse_outer"title="associated function syn::Attribute::parse_outer"><code>Attribute::parse_outer</code></a> to parse a vector of
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.peek"class="method"><aclass="src rightside"href="../../src/syn/parse.rs.html#574-577">source</a><h4class="code-header">pub fn <ahref="#method.peek"class="fn">peek</a><T: <aclass="trait"href="trait.Peek.html"title="trait syn::parse::Peek">Peek</a>>(&self, token: T) -><aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.bool.html">bool</a></h4></section></summary><divclass="docblock"><p>Looks at the next token in the parse stream to determine whether it
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.peek2"class="method"><aclass="src rightside"href="../../src/syn/parse.rs.html#613-625">source</a><h4class="code-header">pub fn <ahref="#method.peek2"class="fn">peek2</a><T: <aclass="trait"href="trait.Peek.html"title="trait syn::parse::Peek">Peek</a>>(&self, token: T) -><aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.bool.html">bool</a></h4></section></summary><divclass="docblock"><p>Looks at the second-next token in the parse stream.</p>
<p>This example needs to use <code>peek2</code> because the symbol <code>union</code> is not a
keyword in Rust. We can’t use just <code>peek</code> and decide to parse a union if
the very next token is <code>union</code>, because someone is free to write a <code>mod union</code> and a macro invocation that looks like <code>union::some_macro! { ... }</code>. In other words <code>union</code> is a contextual keyword.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.peek3"class="method"><aclass="src rightside"href="../../src/syn/parse.rs.html#628-644">source</a><h4class="code-header">pub fn <ahref="#method.peek3"class="fn">peek3</a><T: <aclass="trait"href="trait.Peek.html"title="trait syn::parse::Peek">Peek</a>>(&self, token: T) -><aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.bool.html">bool</a></h4></section></summary><divclass="docblock"><p>Looks at the third-next token in the parse stream.</p>
P::<aclass="associatedtype"href="trait.Peek.html#associatedtype.Token"title="type syn::parse::Peek::Token">Token</a>: <aclass="trait"href="trait.Parse.html"title="trait syn::parse::Parse">Parse</a>,</div></h4></section></summary><divclass="docblock"><p>Parses zero or more occurrences of <code>T</code> separated by punctuation of type
<code>P</code>, with optional trailing punctuation.</p>
<p>Parsing continues until the end of this parse stream. The entire content
of this parse stream must consist of <code>T</code> and <code>P</code>.</p>
<p>If your separator is anything more complicated than an invocation of the
<code>Token!</code> macro, this method won’t be applicable and you can instead
directly use <code>Punctuated</code>’s parser functions: <ahref="../punctuated/struct.Punctuated.html#method.parse_terminated"title="associated function syn::punctuated::Punctuated::parse_terminated"><code>parse_terminated</code></a>,
<ahref="../punctuated/struct.Punctuated.html#method.parse_separated_nonempty"title="associated function syn::punctuated::Punctuated::parse_separated_nonempty"><code>parse_separated_nonempty</code></a> etc.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.is_empty"class="method"><aclass="src rightside"href="../../src/syn/parse.rs.html#787-789">source</a><h4class="code-header">pub fn <ahref="#method.is_empty"class="fn">is_empty</a>(&self) -><aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.bool.html">bool</a></h4></section></summary><divclass="docblock"><p>Returns whether there are tokens remaining in this stream.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.lookahead1"class="method"><aclass="src rightside"href="../../src/syn/parse.rs.html#832-834">source</a><h4class="code-header">pub fn <ahref="#method.lookahead1"class="fn">lookahead1</a>(&self) -><aclass="struct"href="struct.Lookahead1.html"title="struct syn::parse::Lookahead1">Lookahead1</a><'a></h4></section></summary><divclass="docblock"><p>Constructs a helper for peeking at the next token in this stream and
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.fork"class="method"><aclass="src rightside"href="../../src/syn/parse.rs.html#962-971">source</a><h4class="code-header">pub fn <ahref="#method.fork"class="fn">fork</a>(&self) -> Self</h4></section></summary><divclass="docblock"><p>Forks a parse stream so that parsing tokens out of either the original
<p>As a rule, avoid parsing an unbounded amount of tokens out of a forked
parse stream. Only use a fork when the amount of work performed against
the fork is small and bounded.</p>
<p>When complex speculative parsing against the forked stream is
unavoidable, use <ahref="discouraged/trait.Speculative.html"title="trait syn::parse::discouraged::Speculative"><code>parse::discouraged::Speculative</code></a> to advance the
original stream once the fork’s parse is determined to have been
successful.</p>
<p>For a lower level way to perform speculative parsing at the token level,
consider using <ahref="struct.ParseBuffer.html#method.step"title="method syn::parse::ParseBuffer::step"><code>ParseStream::step</code></a> instead.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.error"class="method"><aclass="src rightside"href="../../src/syn/parse.rs.html#1001-1003">source</a><h4class="code-header">pub fn <ahref="#method.error"class="fn">error</a><T: <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/fmt/trait.Display.html"title="trait core::fmt::Display">Display</a>>(&self, message: T) -><aclass="struct"href="struct.Error.html"title="struct syn::parse::Error">Error</a></h4></section></summary><divclass="docblock"><p>Triggers an error at the current position of the parse stream.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.span"class="method"><aclass="src rightside"href="../../src/syn/parse.rs.html#1083-1090">source</a><h4class="code-header">pub fn <ahref="#method.span"class="fn">span</a>(&self) -><aclass="struct"href="../../proc_macro2/struct.Span.html"title="struct proc_macro2::Span">Span</a></h4></section></summary><divclass="docblock"><p>Returns the <code>Span</code> of the next token in the parse stream, or
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.cursor"class="method"><aclass="src rightside"href="../../src/syn/parse.rs.html#1149-1151">source</a><h4class="code-header">pub fn <ahref="#method.cursor"class="fn">cursor</a>(&self) -><aclass="struct"href="../buffer/struct.Cursor.html"title="struct syn::buffer::Cursor">Cursor</a><'a></h4></section></summary><divclass="docblock"><p>Provides low-level access to the token representation underlying this
</div></details></div></details></div><h2id="trait-implementations"class="section-header">Trait Implementations<ahref="#trait-implementations"class="anchor">§</a></h2><divid="trait-implementations-list"><detailsclass="toggle implementors-toggle"open><summary><sectionid="impl-AnyDelimiter-for-ParseBuffer%3C'a%3E"class="impl"><aclass="src rightside"href="../../src/syn/discouraged.rs.html#211-225">source</a><ahref="#impl-AnyDelimiter-for-ParseBuffer%3C'a%3E"class="anchor">§</a><h3class="code-header">impl<'a><aclass="trait"href="discouraged/trait.AnyDelimiter.html"title="trait syn::parse::discouraged::AnyDelimiter">AnyDelimiter</a> for <aclass="struct"href="struct.ParseBuffer.html"title="struct syn::parse::ParseBuffer">ParseBuffer</a><'a></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.parse_any_delimiter"class="method trait-impl"><aclass="src rightside"href="../../src/syn/discouraged.rs.html#212-224">source</a><ahref="#method.parse_any_delimiter"class="anchor">§</a><h4class="code-header">fn <ahref="discouraged/trait.AnyDelimiter.html#tymethod.parse_any_delimiter"class="fn">parse_any_delimiter</a>(&self) -><aclass="type"href="type.Result.html"title="type syn::parse::Result">Result</a><(<aclass="enum"href="../../proc_macro2/enum.Delimiter.html"title="enum proc_macro2::Delimiter">Delimiter</a>, <aclass="struct"href="../../proc_macro2/extra/struct.DelimSpan.html"title="struct proc_macro2::extra::DelimSpan">DelimSpan</a>, <aclass="struct"href="struct.ParseBuffer.html"title="struct syn::parse::ParseBuffer">ParseBuffer</a><'_>)></h4></section></summary><divclass='docblock'>Returns the delimiter, the span of the delimiter token, and the nested
contents for further parsing.</div></details></div></details><detailsclass="toggle implementors-toggle"open><summary><sectionid="impl-Debug-for-ParseBuffer%3C'a%3E"class="impl"><aclass="src rightside"href="../../src/syn/parse.rs.html#278-282">source</a><ahref="#impl-Debug-for-ParseBuffer%3C'a%3E"class="anchor">§</a><h3class="code-header">impl<'a><aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/fmt/trait.Debug.html"title="trait core::fmt::Debug">Debug</a> for <aclass="struct"href="struct.ParseBuffer.html"title="struct syn::parse::ParseBuffer">ParseBuffer</a><'a></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.fmt-1"class="method trait-impl"><aclass="src rightside"href="../../src/syn/parse.rs.html#279-281">source</a><ahref="#method.fmt-1"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.76.0/core/fmt/trait.Debug.html#tymethod.fmt"class="fn">fmt</a>(&self, f: &mut <aclass="struct"href="https://doc.rust-lang.org/1.76.0/core/fmt/struct.Formatter.html"title="struct core::fmt::Formatter">Formatter</a><'_>) -><aclass="type"href="https://doc.rust-lang.org/1.76.0/core/fmt/type.Result.html"title="type core::fmt::Result">Result</a></h4></section></summary><divclass='docblock'>Formats the value using the given formatter. <ahref="https://doc.rust-lang.org/1.76.0/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></div></details></div></details><detailsclass="toggle implementors-toggle"open><summary><sectionid="impl-Display-for-ParseBuffer%3C'a%3E"class="impl"><aclass="src rightside"href="../../src/syn/parse.rs.html#272-276">source</a><ahref="#impl-Display-for-ParseBuffer%3C'a%3E"class="anchor">§</a><h3class="code-header">impl<'a><aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/fmt/trait.Display.html"title="trait core::fmt::Display">Display</a> for <aclass="struct"href="struct.ParseBuffer.html"title="struct syn::parse::ParseBuffer">ParseBuffer</a><'a></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.fmt"class="method trait-impl"><aclass="src rightside"href="../../src/syn/parse.rs.html#273-275">source</a><ahref="#method.fmt"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.76.0/core/fmt/trait.Display.html#tymethod.fmt"class="fn">fmt</a>(&self, f: &mut <aclass="struct"href="https://doc.rust-lang.org/1.76.0/core/fmt/struct.Formatter.html"title="struct core::fmt::Formatter">Formatter</a><'_>) -><aclass="type"href="https://doc.rust-lang.org/1.76.0/core/fmt/type.Result.html"title="type core::fmt::Result">Result</a></h4></section></summary><divclass='docblock'>Formats the value using the given formatter. <ahref="https://doc.rust-lang.org/1.76.0/core/fmt/trait.Display.html#tymethod.fmt">Read more</a></div></details></div></details><detailsclass="toggle implementors-toggle"open><summary><sectionid="impl-Drop-for-ParseBuffer%3C'a%3E"class="impl"><aclass="src rightside"href="../../src/syn/parse.rs.html#261-270">source</a><ahref="#impl-Drop-for-ParseBuffer%3C'a%3E"class="anchor">§</a><h3class="code-header">impl<'a><aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/ops/drop/trait.Drop.html"title="trait core::ops::drop::Drop">Drop</a> for <aclass="struct"href="struct.ParseBuffer.html"title="struct syn::parse::ParseBuffer">ParseBuffer</a><'a></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.drop"class="method trait-impl"><aclass="src rightside"href="../../src/syn/parse.rs.html#262-269">source</a><ahref="#method.drop"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.76.0/core/ops/drop/trait.Drop.html#tymethod.drop"class="fn">drop</a>(&mut self)</h4></section></summary><divclass='docblock'>Executes the destructor for this type. <ahref="https://doc.r
<p>That is, this conversion is whatever the implementation of
<code><ahref="https://doc.rust-lang.org/1.76.0/core/convert/trait.From.html"title="trait core::convert::From">From</a><T> for U</code> chooses to do.</p>
</div></details></div></details><detailsclass="toggle implementors-toggle"><summary><sectionid="impl-ToString-for-T"class="impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.76.0/src/alloc/string.rs.html#2600">source</a><ahref="#impl-ToString-for-T"class="anchor">§</a><h3class="code-header">impl<T><aclass="trait"href="https://doc.rust-lang.org/1.76.0/alloc/string/trait.ToString.html"title="trait alloc::string::ToString">ToString</a> for T<divclass="where">where
T: <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/fmt/trait.Display.html"title="trait core::fmt::Display">Display</a> + ?<aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/marker/trait.Sized.html"title="trait core::marker::Sized">Sized</a>,</div></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.to_string"class="method trait-impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.76.0/src/alloc/string.rs.html#2606">source</a><ahref="#method.to_string"class="anchor">§</a><h4class="code-header">default fn <ahref="https://doc.rust-lang.org/1.76.0/alloc/string/trait.ToString.html#tymethod.to_string"class="fn">to_string</a>(&self) -><aclass="struct"href="https://doc.rust-lang.org/1.76.0/alloc/string/struct.String.html"title="struct alloc::string::String">String</a></h4></section></summary><divclass='docblock'>Converts the given value to a <code>String</code>. <ahref="https://doc.rust-lang.org/1.76.0/alloc/string/trait.ToString.html#tymethod.to_string">Read more</a></div></details></div></details><detailsclass="toggle implementors-toggle"><summary><sectionid="impl-TryFrom%3CU%3E-for-T"class="impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.76.0/src/core/convert/mod.rs.html#803-805">source</a><ahref="#impl-TryFrom%3CU%3E-for-T"class="anchor">§</a><h3class="code-header">impl<T, U><aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><U> for T<divclass="where">where
U: <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/convert/trait.Into.html"title="trait core::convert::Into">Into</a><T>,</div></h3></section></summary><divclass="impl-items"><detailsclass="toggle"open><summary><sectionid="associatedtype.Error"class="associatedtype trait-impl"><ahref="#associatedtype.Error"class="anchor">§</a><h4class="code-header">type <ahref="https://doc.rust-lang.org/1.76.0/core/convert/trait.TryFrom.html#associatedtype.Error"class="associatedtype">Error</a> = <aclass="enum"href="https://doc.rust-lang.org/1.76.0/core/convert/enum.Infallible.html"title="enum core::convert::Infallible">Infallible</a></h4></section></summary><divclass='docblock'>The type returned in the event of a conversion error.</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.try_from"class="method trait-impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.76.0/src/core/convert/mod.rs.html#810">source</a><ahref="#method.try_from"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.76.0/core/convert/trait.TryFrom.html#tymethod.try_from"class="fn">try_from</a>(value: U) -><aclass="enum"href="https://doc.rust-lang.org/1.76.0/core/result/enum.Result.html"title="enum core::result::Result">Result</a><T, <T as <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><U>>::<aclass="associatedtype"href="https://doc.rust-lang.org/1.76.0/core/convert/trait.TryFrom.html#associatedtype.Error"title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><divclass='docblock'>Performs the conversion.</div></details></div></details><detailsclass="toggle implementors-toggle"><summary><sectionid="impl-TryInto%3CU%3E-for-T"class="impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.76.0/src/core/convert/mod.rs.html#788-790">source</a><ahref="#impl-TryInto%3CU%3E-for-T"class="anchor">§</a><h3class="code-header">impl<T, U><aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/convert/trait.TryInto.html"title="trait core::convert::TryInto">TryInto</a><U> for T<divclass="where">where
U: <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><T>,</div></h3></section></summary><divclass="impl-items"><detailsclass="toggle"open><summary><sectionid="associatedtype.Error-1"class="associatedtype trait-impl"><ahref="#associatedtype.Error-1"class="anchor">§</a><h4class="code-header">type <ahref="https://doc.rust-lang.org/1.76.0/core/convert/trait.TryInto.html#associatedtype.Error"class="associatedtype">Error</a> = <U as <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><T>>::<aclass="associatedtype"href="https://doc.rust-lang.org/1.76.0/core/convert/trait.TryFrom.html#associatedtype.Error"title="type core::convert::TryFrom::Error">Error</a></h4></section></summary><divclass='docblock'>The type returned in the event of a conversion error.</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.try_into"class="method trait-impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.76.0/src/core/convert/mod.rs.html#795">source</a><ahref="#method.try_into"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.76.0/core/convert/trait.TryInto.html#tymethod.try_into"class="fn">try_into</a>(self) -><aclass="enum"href="https://doc.rust-lang.org/1.76.0/core/result/enum.Result.html"title="enum core::result::Result">Result</a><U, <U as <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><T>>::<aclass="associatedtype"href="https://doc.rust-lang.org/1.76.0/core/convert/trait.TryFrom.html#associatedtype.Error"title="type core::convert::TryFrom::Error">Error</a>></h4></section></summary><divclass='docblock'>Performs the conversion.</div></details></div></details></div></section></div></main></body></html>