<!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="An abstract stream of tokens, or more concretely a sequence of token trees."><title>TokenStream in proc_macro2 - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/${f}">`).join(""))</script><linkrel="stylesheet"href="../static.files/normalize-9960930a.css"><linkrel="stylesheet"href="../static.files/rustdoc-84e720fa.css"><metaname="rustdoc-vars"data-root-path="../"data-static-root-path="../static.files/"data-current-crate="proc_macro2"data-themes=""data-resource-suffix=""data-rustdoc-version="1.89.0 (29483883e 2025-08-04)"data-channel="1.89.0"data-search-js="search-92309212.js"data-settings-js="settings-5514c975.js"><scriptsrc="../static.files/storage-4e99c027.js"></script><scriptdefersrc="sidebar-items.js"></script><scriptdefersrc="../static.files/main-fd3af306.js"></script><noscript><linkrel="stylesheet"href="../static.files/noscript-32bb7600.css"></noscript><linkrel="alternate icon"type="image/png"href="../static.files/favicon-32x32-6580c154.png"><linkrel="icon"type="image/svg+xml"href="../static.files/favicon-044be391.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"title="show sidebar"></button></nav><navclass="sidebar"><divclass="sidebar-crate"><h2><ahref="../proc_macro2/index.html">proc_<wbr>macro2</a><spanclass="version">1.0.101</span></h2></div><divclass="sidebar-elems"><sectionid="rustdoc-toc"><h2class="location"><ahref="#">Token<wbr>Stream</a></h2><h3><ahref="#implementations">Methods</a></h3><ulclass="block method"><li><ahref="#method.is_empty"title="is_empty">is_empty</a></li><li><ahref="#method.new"title="new">new</a></li></ul><h3><ahref="#trait-implementations">Trait Implementations</a></h3><ulclass="block trait-implementation"><li><ahref="#impl-Clone-for-TokenStream"title="Clone">Clone</a></li><li><ahref="#impl-Debug-for-TokenStream"title="Debug">Debug</a></li><li><ahref="#impl-Default-for-TokenStream"title="Default">Default</a></li><li><ahref="#impl-Display-for-TokenStream"title="Display">Display</a></li><li><ahref="#impl-Extend%3CTokenStream%3E-for-TokenStream"title="Extend<TokenStream>">Extend<TokenStream></a></li><li><ahref="#impl-Extend%3CTokenTree%3E-for-TokenStream"title="Extend<TokenTree>">Extend<TokenTree></a></li><li><ahref="#impl-From%3CTokenStream%3E-for-TokenStream"title="From<TokenStream>">From<TokenStream></a></li><li><ahref="#impl-From%3CTokenStream%3E-for-TokenStream-1"title="From<TokenStream>">From<TokenStream></a></li><li><ahref="#impl-From%3CTokenTree%3E-for-TokenStream"title="From<TokenTree>">From<TokenTree></a></li><li><ahref="#impl-FromIterator%3CTokenStream%3E-for-TokenStream"title="FromIterator<TokenStream>">FromIterator<TokenStream></a></li><li><ahref="#impl-FromIterator%3CTokenTree%3E-for-TokenStream"title="FromIterator<TokenTree>">FromIterator<TokenTree></a></li><li><ahref="#impl-FromStr-for-TokenStream"title="FromStr">FromStr</a></li><li><ahref="#impl-IntoIterator-for-TokenStream"title="IntoIterator">IntoIterator</a></li></ul><h3><ahref="#synthetic-implementations">Auto Trait Implementations</a></h3><ulclass="block synthetic-implementation"><li><ahref="#impl-Send-for-TokenStream"title="!Send">!Send</a></li><l
</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-TokenStream"class="impl"><aclass="src rightside"href="../src/proc_macro2/lib.rs.html#203-227">Source</a><ahref="#impl-TokenStream"class="anchor">§</a><h3class="code-header">impl <aclass="struct"href="struct.TokenStream.html"title="struct proc_macro2::TokenStream">TokenStream</a></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.new"class="method"><aclass="src rightside"href="../src/proc_macro2/lib.rs.html#219-221">Source</a><h4class="code-header">pub fn <ahref="#method.new"class="fn">new</a>() -> Self</h4></section></summary><divclass="docblock"><p>Returns an empty <code>TokenStream</code> containing no token trees.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.is_empty"class="method"><aclass="src rightside"href="../src/proc_macro2/lib.rs.html#224-226">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.89.0/std/primitive.bool.html">bool</a></h4></section></summary><divclass="docblock"><p>Checks if this <code>TokenStream</code> is empty.</p>
</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-Clone-for-TokenStream"class="impl"><aclass="src rightside"href="../src/proc_macro2/lib.rs.html#191">Source</a><ahref="#impl-Clone-for-TokenStream"class="anchor">§</a><h3class="code-header">impl <aclass="trait"href="https://doc.rust-lang.org/1.89.0/core/clone/trait.Clone.html"title="trait core::clone::Clone">Clone</a> for <aclass="struct"href="struct.TokenStream.html"title="struct proc_macro2::TokenStream">TokenStream</a></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.clone"class="method trait-impl"><aclass="src rightside"href="../src/proc_macro2/lib.rs.html#191">Source</a><ahref="#method.clone"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.89.0/core/clone/trait.Clone.html#tymethod.clone"class="fn">clone</a>(&self) -><aclass="struct"href="struct.TokenStream.html"title="struct proc_macro2::TokenStream">TokenStream</a></h4></section></summary><divclass='docblock'>Returns a duplicate of the value. <ahref="https://doc.rust-lang.org/1.89.0/core/clone/trait.Clone.html#tymethod.clone">Read more</a></div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.clone_from"class="method trait-impl"><spanclass="rightside"><spanclass="since"title="Stable since Rust version 1.0.0">1.0.0</span> · <aclass="src"href="https://doc.rust-lang.org/1.89.0/src/core/clone.rs.html#213-215">Source</a></span><ahref="#method.clone_from"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.89.0/core/clone/trait.Clone.html#method.clone_from"class="fn">clone_from</a>(&mut self, source: &Self)</h4></section></summary><divclass='docblock'>Performs copy-assignment from <code>source</code>. <ahref="https://doc.rust-lang.org/1.89.0/core/clone/trait.Clone.html#method.clone_from">Read more</a></div></details></div></details><detailsclass="toggle implementors-toggle"open><summary><sectionid="impl-Debug-for-TokenStream"class="impl"><aclass="src rightside"href="../src/proc_macro2/lib.rs.html#317-321">Source</a><ahref="#impl-Debug-for-TokenStream"class="anchor">§</a><h3class="code-header">impl <aclass="trait"href="https://doc.rust-lang.org/1.89.0/core/fmt/trait.Debug.html"title="trait core::fmt::Debug">Debug</a> for <aclass="struct"href="struct.TokenStream.html"title="struct proc_macro2::TokenStream">TokenStream</a></h3><divclass="docblock"><p>Prints token in a form convenient for debugging.</p>
</div></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.fmt-1"class="method trait-impl"><aclass="src rightside"href="../src/proc_macro2/lib.rs.html#318-320">Source</a><ahref="#method.fmt-1"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.89.0/core/fmt/trait.Debug.html#tymethod.fmt"class="fn">fmt</a>(&self, f: &mut <aclass="struct"href="https://doc.rust-lang.org/1.89.0/core/fmt/struct.Formatter.html"title="struct core::fmt::Formatter">Formatter</a><'_>) -><aclass="type"href="https://doc.rust-lang.org/1.89.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.89.0/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></div></details></div></details><detailsclass="toggle implementors-toggle"open><summary><sectionid="impl-Default-for-TokenStream"class="impl"><aclass="src rightside"href="../src/proc_macro2/lib.rs.html#231-235">Source</a><ahref="#impl-Default-for-TokenStream"class="anchor">§</a><h3class="code-header">impl <aclass="trait"href="https://doc.rust-lang.org/1.89.0/core/default/trait.Default.html"title="trait core::default::Default">Default</a> for <aclass="struct"href="struct.TokenStream.html"title="struct proc_macro2::TokenStream">TokenStream</a></h3><divclass="docblock"><p><code>TokenStream::default()</code> returns an empty stream,
</div></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.default"class="method trait-impl"><aclass="src rightside"href="../src/proc_macro2/lib.rs.html#232-234">Source</a><ahref="#method.default"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.89.0/core/default/trait.Default.html#tymethod.default"class="fn">default</a>() -> Self</h4></section></summary><divclass='docblock'>Returns the “default value” for a type. <ahref="https://doc.rust-lang.org/1.89.0/core/default/trait.Default.html#tymethod.default">Read more</a></div></details></div></details><detailsclass="toggle implementors-toggle"open><summary><sectionid="impl-Display-for-TokenStream"class="impl"><aclass="src rightside"href="../src/proc_macro2/lib.rs.html#310-314">Source</a><ahref="#impl-Display-for-TokenStream"class="anchor">§</a><h3class="code-header">impl <aclass="trait"href="https://doc.rust-lang.org/1.89.0/core/fmt/trait.Display.html"title="trait core::fmt::Display">Display</a> for <aclass="struct"href="struct.TokenStream.html"title="struct proc_macro2::TokenStream">TokenStream</a></h3><divclass="docblock"><p>Prints the token stream as a string that is supposed to be losslessly
</div></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.fmt"class="method trait-impl"><aclass="src rightside"href="../src/proc_macro2/lib.rs.html#311-313">Source</a><ahref="#method.fmt"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.89.0/core/fmt/trait.Display.html#tymethod.fmt"class="fn">fmt</a>(&self, f: &mut <aclass="struct"href="https://doc.rust-lang.org/1.89.0/core/fmt/struct.Formatter.html"title="struct core::fmt::Formatter">Formatter</a><'_>) -><aclass="type"href="https://doc.rust-lang.org/1.89.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.89.0/core/fmt/trait.Display.html#tymethod.fmt">Read more</a></div></details></div></details><detailsclass="toggle implementors-toggle"open><summary><sectionid="impl-Extend%3CTokenStream%3E-for-TokenStream"class="impl"><aclass="src rightside"href="../src/proc_macro2/lib.rs.html#287-292">Source</a><ahref="#impl-Extend%3CTokenStream%3E-for-TokenStream"class="anchor">§</a><h3class="code-header">impl <aclass="trait"href="https://doc.rust-lang.org/1.89.0/core/iter/traits/collect/trait.Extend.html"title="trait core::iter::traits::collect::Extend">Extend</a><<aclass="struct"href="struct.TokenStream.html"title="struct proc_macro2::TokenStream">TokenStream</a>> for <aclass="struct"href="struct.TokenStream.html"title="struct proc_macro2::TokenStream">TokenStream</a></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.extend-1"class="method trait-impl"><aclass="src rightside"href="../src/proc_macro2/lib.rs.html#288-291">Source</a><ahref="#method.extend-1"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.89.0/core/iter/traits/collect/trait.Extend.html#tymethod.extend"class="fn">extend</a><I: <aclass="trait"href="https://doc.rust-lang.org/1.89.0/core/iter/traits/collect/trait.IntoIterator.html"title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a><Item = <aclass="struct"href="struct.TokenStream.html"title="struct proc_macro2::TokenStream">TokenStream</a>>>(&mut self, streams: I)</h4></section></summary><divclass='docblock'>Extends a collection with the contents of an iterator. <ahref="https://doc.rust-lang.org/1.89.0/core/iter/traits/collect/trait.Extend.html#tymethod.extend">Read more</a></div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.extend_one-1"class="method trait-impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.89.0/src/core/iter/traits/collect.rs.html#417">Source</a><ahref="#method.extend_one-1"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.89.0/core/iter/traits/collect/trait.Extend.html#method.extend_one"class="fn">extend_one</a>(&mut self, item: A)</h4></section></summary><spanclass="item-info"><divclass="stab unstable"><spanclass="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>extend_one</code>)</span></div></span><divclass='docblock'>Extends a collection with exactly one element.</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.extend_reserve-1"class="method trait-impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.89.0/src/core/iter/traits/collect.rs.html#425">Source</a><ahref="#method.extend_reserve-1"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.89.0/core/iter/traits/collect/trait.Extend.html#method.extend_reserve"class="fn">extend_reserve</a>(&mut self, additional: <aclass="primitive"href="https://doc.rust-lang.org/1.89.0/std/primitive.usize.html">usize</a>)</h4></section></summary><spanclass="item-info"><divclass="stab unstable"><spanclass="emoji">🔬</span><span>This is a nightly-only experime
</div></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.from_iter"class="method trait-impl"><aclass="src rightside"href="../src/proc_macro2/lib.rs.html#296-298">Source</a><ahref="#method.from_iter"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.89.0/core/iter/traits/collect/trait.FromIterator.html#tymethod.from_iter"class="fn">from_iter</a><I: <aclass="trait"href="https://doc.rust-lang.org/1.89.0/core/iter/traits/collect/trait.IntoIterator.html"title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a><Item = <aclass="enum"href="enum.TokenTree.html"title="enum proc_macro2::TokenTree">TokenTree</a>>>(streams: I) -> Self</h4></section></summary><divclass='docblock'>Creates a value from an iterator. <ahref="https://doc.rust-lang.org/1.89.0/core/iter/traits/collect/trait.FromIterator.html#tymethod.from_iter">Read more</a></div></details></div></details><detailsclass="toggle implementors-toggle"open><summary><sectionid="impl-FromStr-for-TokenStream"class="impl"><aclass="src rightside"href="../src/proc_macro2/lib.rs.html#245-257">Source</a><ahref="#impl-FromStr-for-TokenStream"class="anchor">§</a><h3class="code-header">impl <aclass="trait"href="https://doc.rust-lang.org/1.89.0/core/str/traits/trait.FromStr.html"title="trait core::str::traits::FromStr">FromStr</a> for <aclass="struct"href="struct.TokenStream.html"title="struct proc_macro2::TokenStream">TokenStream</a></h3><divclass="docblock"><p>Attempts to break the string into tokens and parse those tokens into a token
</div><divclass="impl-items"><detailsclass="toggle"open><summary><sectionid="associatedtype.Err"class="associatedtype trait-impl"><aclass="src rightside"href="../src/proc_macro2/lib.rs.html#246">Source</a><ahref="#associatedtype.Err"class="anchor">§</a><h4class="code-header">type <ahref="https://doc.rust-lang.org/1.89.0/core/str/traits/trait.FromStr.html#associatedtype.Err"class="associatedtype">Err</a> = <aclass="struct"href="struct.LexError.html"title="struct proc_macro2::LexError">LexError</a></h4></section></summary><divclass='docblock'>The associated error which can be returned from parsing.</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.from_str"class="method trait-impl"><aclass="src rightside"href="../src/proc_macro2/lib.rs.html#248-256">Source</a><ahref="#method.from_str"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.89.0/core/str/traits/trait.FromStr.html#tymethod.from_str"class="fn">from_str</a>(src: &<aclass="primitive"href="https://doc.rust-lang.org/1.89.0/std/primitive.str.html">str</a>) -><aclass="enum"href="https://doc.rust-lang.org/1.89.0/core/result/enum.Result.html"title="enum core::result::Result">Result</a><<aclass="struct"href="struct.TokenStream.html"title="struct proc_macro2::TokenStream">TokenStream</a>, <aclass="struct"href="struct.LexError.html"title="struct proc_macro2::LexError">LexError</a>></h4></section></summary><divclass='docblock'>Parses a string <code>s</code> to return a value of this type. <ahref="https://doc.rust-lang.org/1.89.0/core/str/traits/trait.FromStr.html#tymethod.from_str">Read more</a></div></details></div></details><detailsclass="toggle implementors-toggle"open><summary><sectionid="impl-IntoIterator-for-TokenStream"class="impl"><aclass="src rightside"href="../src/proc_macro2/lib.rs.html#1338-1348">Source</a><ahref="#impl-IntoIterator-for-TokenStream"class="anchor">§</a><h3class="code-header">impl <aclass="trait"href="https://doc.rust-lang.org/1.89.0/core/iter/traits/collect/trait.IntoIterator.html"title="trait core::iter::traits::collect::IntoIterator">IntoIterator</a> for <aclass="struct"href="struct.TokenStream.html"title="struct proc_macro2::TokenStream">TokenStream</a></h3></section></summary><divclass="impl-items"><detailsclass="toggle"open><summary><sectionid="associatedtype.Item"class="associatedtype trait-impl"><aclass="src rightside"href="../src/proc_macro2/lib.rs.html#1339">Source</a><ahref="#associatedtype.Item"class="anchor">§</a><h4class="code-header">type <ahref="https://doc.rust-lang.org/1.89.0/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.Item"class="associatedtype">Item</a> = <aclass="enum"href="enum.TokenTree.html"title="enum proc_macro2::TokenTree">TokenTree</a></h4></section></summary><divclass='docblock'>The type of the elements being iterated over.</div></details><detailsclass="toggle"open><summary><sectionid="associatedtype.IntoIter"class="associatedtype trait-impl"><aclass="src rightside"href="../src/proc_macro2/lib.rs.html#1340">Source</a><ahref="#associatedtype.IntoIter"class="anchor">§</a><h4class="code-header">type <ahref="https://doc.rust-lang.org/1.89.0/core/iter/traits/collect/trait.IntoIterator.html#associatedtype.IntoIter"class="associatedtype">IntoIter</a> = <aclass="struct"href="token_stream/struct.IntoIter.html"title="struct proc_macro2::token_stream::IntoIter">IntoIter</a></h4></section></summary><divclass='docblock'>Which kind of iterator are we turning this into?</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.into_iter"class="method trait-impl"><aclass="src rightside"href="../src/proc_macro2/lib.rs.html#1342-1347">Source</a><ahref="#method.into_iter"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.89.0/core/iter/traits/collect/trait.IntoIterator.html#tymethod.into_iter"class="fn">into_iter</a>(self) -><aclass="struct"href="token_stream/struct.IntoIter.html
T: 'static + ?<a class="trait"href="https://doc.rust-lang.org/1.89.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.type_id"class="method trait-impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.89.0/src/core/any.rs.html#139">Source</a><ahref="#method.type_id"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.89.0/core/any/trait.Any.html#tymethod.type_id"class="fn">type_id</a>(&self) -><aclass="struct"href="https://doc.rust-lang.org/1.89.0/core/any/struct.TypeId.html"title="struct core::any::TypeId">TypeId</a></h4></section></summary><divclass='docblock'>Gets the <code>TypeId</code> of <code>self</code>. <ahref="https://doc.rust-lang.org/1.89.0/core/any/trait.Any.html#tymethod.type_id">Read more</a></div></details></div></details><detailsclass="toggle implementors-toggle"><summary><sectionid="impl-Borrow%3CT%3E-for-T"class="impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.89.0/src/core/borrow.rs.html#209">Source</a><ahref="#impl-Borrow%3CT%3E-for-T"class="anchor">§</a><h3class="code-header">impl<T><aclass="trait"href="https://doc.rust-lang.org/1.89.0/core/borrow/trait.Borrow.html"title="trait core::borrow::Borrow">Borrow</a><T> for T<divclass="where">where
T: ?<aclass="trait"href="https://doc.rust-lang.org/1.89.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.borrow"class="method trait-impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.89.0/src/core/borrow.rs.html#211">Source</a><ahref="#method.borrow"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.89.0/core/borrow/trait.Borrow.html#tymethod.borrow"class="fn">borrow</a>(&self) -><aclass="primitive"href="https://doc.rust-lang.org/1.89.0/std/primitive.reference.html">&T</a></h4></section></summary><divclass='docblock'>Immutably borrows from an owned value. <ahref="https://doc.rust-lang.org/1.89.0/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></div></details></div></details><detailsclass="toggle implementors-toggle"><summary><sectionid="impl-BorrowMut%3CT%3E-for-T"class="impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.89.0/src/core/borrow.rs.html#217">Source</a><ahref="#impl-BorrowMut%3CT%3E-for-T"class="anchor">§</a><h3class="code-header">impl<T><aclass="trait"href="https://doc.rust-lang.org/1.89.0/core/borrow/trait.BorrowMut.html"title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T<divclass="where">where
T: ?<aclass="trait"href="https://doc.rust-lang.org/1.89.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.borrow_mut"class="method trait-impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.89.0/src/core/borrow.rs.html#218">Source</a><ahref="#method.borrow_mut"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.89.0/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut"class="fn">borrow_mut</a>(&mut self) -><aclass="primitive"href="https://doc.rust-lang.org/1.89.0/std/primitive.reference.html">&mut T</a></h4></section></summary><divclass='docblock'>Mutably borrows from an owned value. <ahref="https://doc.rust-lang.org/1.89.0/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></div></details></div></details><detailsclass="toggle implementors-toggle"><summary><sectionid="impl-CloneToUninit-for-T"class="impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.89.0/src/core/clone.rs.html#483">Source</a><ahref="#impl-CloneToUninit-for-T"class="anchor">§</a><h3class="code-header">impl<T><aclass="trait"href="https://doc.rust-lang.org/1.89.0/core/clone/trait.CloneToUninit.html"title="trait core::clone::CloneToUninit">CloneToUninit</a> for T<divclass="where">where
T: <aclass="trait"href="https://doc.rust-lang.org/1.89.0/core/clone/trait.Clone.html"title="trait core::clone::Clone">Clone</a>,</div></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.clone_to_uninit"class="method trait-impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.89.0/src/core/clone.rs.html#485">Source</a><ahref="#method.clone_to_uninit"class="anchor">§</a><h4class="code-header">unsafe fn <ahref="https://doc.rust-lang.org/1.89.0/core/clone/trait.CloneToUninit.html#tymethod.clone_to_uninit"class="fn">clone_to_uninit</a>(&self, dest: <aclass="primitive"href="https://doc.rust-lang.org/1.89.0/std/primitive.pointer.html">*mut </a><aclass="primitive"href="https://doc.rust-lang.org/1.89.0/std/primitive.u8.html">u8</a>)</h4></section></summary><spanclass="item-info"><divclass="stab unstable"><spanclass="emoji">🔬</span><span>This is a nightly-only experimental API. (<code>clone_to_uninit</code>)</span></div></span><divclass='docblock'>Performs copy-assignment from <code>self</code> to <code>dest</code>. <ahref="https://doc.rust-lang.org/1.89.0/core/clone/trait.CloneToUninit.html#tymethod.clone_to_uninit">Read more</a></div></details></div></details><detailsclass="toggle implementors-toggle"><summary><sectionid="impl-From%3CT%3E-for-T"class="impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.89.0/src/core/convert/mod.rs.html#774">Source</a><ahref="#impl-From%3CT%3E-for-T"class="anchor">§</a><h3class="code-header">impl<T><aclass="trait"href="https://doc.rust-lang.org/1.89.0/core/convert/trait.From.html"title="trait core::convert::From">From</a><T> for T</h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.from-3"class="method trait-impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.89.0/src/core/convert/mod.rs.html#777">Source</a><ahref="#method.from-3"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.89.0/core/convert/trait.From.html#tymethod.from"class="fn">from</a>(t: T) -> T</h4></section></summary><divclass="docblock"><p>Returns the argument unchanged.</p>
</div></details></div></details><detailsclass="toggle implementors-toggle"><summary><sectionid="impl-Into%3CU%3E-for-T"class="impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.89.0/src/core/convert/mod.rs.html#757-759">Source</a><ahref="#impl-Into%3CU%3E-for-T"class="anchor">§</a><h3class="code-header">impl<T, U><aclass="trait"href="https://doc.rust-lang.org/1.89.0/core/convert/trait.Into.html"title="trait core::convert::Into">Into</a><U> for T<divclass="where">where
<code><ahref="https://doc.rust-lang.org/1.89.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-ToOwned-for-T"class="impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.89.0/src/alloc/borrow.rs.html#82-84">Source</a><ahref="#impl-ToOwned-for-T"class="anchor">§</a><h3class="code-header">impl<T><aclass="trait"href="https://doc.rust-lang.org/1.89.0/alloc/borrow/trait.ToOwned.html"title="trait alloc::borrow::ToOwned">ToOwned</a> for T<divclass="where">where
T: <aclass="trait"href="https://doc.rust-lang.org/1.89.0/core/clone/trait.Clone.html"title="trait core::clone::Clone">Clone</a>,</div></h3></section></summary><divclass="impl-items"><detailsclass="toggle"open><summary><sectionid="associatedtype.Owned"class="associatedtype trait-impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.89.0/src/alloc/borrow.rs.html#86">Source</a><ahref="#associatedtype.Owned"class="anchor">§</a><h4class="code-header">type <ahref="https://doc.rust-lang.org/1.89.0/alloc/borrow/trait.ToOwned.html#associatedtype.Owned"class="associatedtype">Owned</a> = T</h4></section></summary><divclass='docblock'>The resulting type after obtaining ownership.</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.to_owned"class="method trait-impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.89.0/src/alloc/borrow.rs.html#87">Source</a><ahref="#method.to_owned"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.89.0/alloc/borrow/trait.ToOwned.html#tymethod.to_owned"class="fn">to_owned</a>(&self) -> T</h4></section></summary><divclass='docblock'>Creates owned data from borrowed data, usually by cloning. <ahref="https://doc.rust-lang.org/1.89.0/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.clone_into"class="method trait-impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.89.0/src/alloc/borrow.rs.html#91">Source</a><ahref="#method.clone_into"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.89.0/alloc/borrow/trait.ToOwned.html#method.clone_into"class="fn">clone_into</a>(&self, target: <aclass="primitive"href="https://doc.rust-lang.org/1.89.0/std/primitive.reference.html">&mut T</a>)</h4></section></summary><divclass='docblock'>Uses borrowed data to replace owned data, usually by cloning. <ahref="https://doc.rust-lang.org/1.89.0/alloc/borrow/trait.ToOwned.html#method.clone_into">Read more</a></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.89.0/src/alloc/string.rs.html#2805">Source</a><ahref="#impl-ToString-for-T"class="anchor">§</a><h3class="code-header">impl<T><aclass="trait"href="https://doc.rust-lang.org/1.89.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.89.0/core/fmt/trait.Display.html"title="trait core::fmt::Display">Display</a> + ?<aclass="trait"href="https://doc.rust-lang.org/1.89.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.89.0/src/alloc/string.rs.html#2807">Source</a><ahref="#method.to_string"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.89.0/alloc/string/trait.ToString.html#tymethod.to_string"class="fn">to_string</a>(&self) -><aclass="struct"href="https://doc.rust-lang.org/1.89.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.89.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.89.0/src/core/convert/mod.rs.html#813-815">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.89.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.89.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-1"class="associatedtype trait-impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.89.0/src/core/convert/mod.rs.html#817">Source</a><ahref="#associatedtype.Error-1"class="anchor">§</a><h4class="code-header">type <ahref="https://doc.rust-lang.org/1.89.0/core/convert/trait.TryFrom.html#associatedtype.Error"class="associatedtype">Error</a> = <aclass="enum"href="https://doc.rust-lang.org/1.89.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.89.0/src/core/convert/mod.rs.html#820">Source</a><ahref="#method.try_from"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.89.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.89.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.89.0/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><U>>::<aclass="associatedtype"href="https://doc.rust-lang.org/1.89.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.89.0/src/core/convert/mod.rs.html#798-800">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.89.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.89.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"class="associatedtype trait-impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.89.0/src/core/convert/mod.rs.html#802">Source</a><ahref="#associatedtype.Error"class="anchor">§</a><h4class="code-header">type <ahref="https://doc.rust-lang.org/1.89.0/core/convert/trait.TryInto.html#associatedtype.Error"class="associatedtype">Error</a> = <U as <aclass="trait"href="https://doc.rust-lang.org/1.89.0/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><T>>::<aclass="associatedtype"href="https://doc.rust-lang.org/1.89.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.89.0/src/core/convert/mod.rs.html#805">Source</a><ahref="#method.try_into"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.89.0/core/convert/trait.TryInto.html#tymethod.try_into"class="fn">try_into</a>(self) -><aclass="enum"href="https://doc.rust-lang.org/1.89.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.89.0/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><T>>::<aclass="associatedtype"href="https://doc.rust-lang.org/1.89.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><scripttype="text/json"id="notable-traits-data">{"IntoIter":"<h3>Notable traits for <code><a class=\"struct\" href=\"token_stream/struct.IntoIter.html\" title=\"struct proc_macro2::token_stream::IntoIter\">IntoIter</a></code></h3><pre><code><div class=\"where\">impl <a class=\"trait\" href=\"https://doc.rust-lang.org/1.89.0/core/iter/traits/iterator/trait.Iterator.html\" title=\"trait core::iter::traits::iterator::Iterator\">Iterator</a> for <a class=\"struct\" href=\"token_stream/struct.IntoIter.html\" title=\"struct proc_macro2::token_stream::IntoIter\">IntoIter</a></div><div class=\"where\"> type <a href=\"https://doc.rust-lang.org/1.89.0/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item\" class=\"associatedtype\">Item</a> = <a class=\"enum\" href=\"enum.TokenTree.html\" title=\"enum proc_macro2::TokenTree\">TokenTree</a>;</div>"}</script></section></div></main></body></html>