<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>Module <ahref="../index.html">syn</a>::<wbr><aclass="mod"href="#">punctuated</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/punctuated.rs.html#1-1109">source</a> · <buttonid="toggle-all-docs"title="collapse all docs">[<span>−</span>]</button></span></div><detailsclass="toggle top-doc"open><summaryclass="hideme"><span>Expand description</span></summary><divclass="docblock"><p>A punctuated sequence of syntax tree nodes separated by punctuation.</p>
<p>Lots of things in Rust are punctuated sequences.</p>
<ul>
<li>The fields of a struct are <code>Punctuated<Field, Token![,]></code>.</li>
<li>The segments of a path are <code>Punctuated<PathSegment, Token![::]></code>.</li>
<li>The bounds on a generic parameter are <code>Punctuated<TypeParamBound, Token![+]></code>.</li>
<li>The arguments to a function call are <code>Punctuated<Expr, Token![,]></code>.</li>
</ul>
<p>This module provides a common representation for these punctuated sequences
in the form of the <ahref="struct.Punctuated.html"title="struct syn::punctuated::Punctuated"><code>Punctuated<T, P></code></a> type. We store a vector of pairs of
syntax tree node + punctuation, where every node in the sequence is followed
by punctuation except for possibly the final one.</p>
</code></pre></div></div></details><h2id="structs"class="section-header">Structs<ahref="#structs"class="anchor">§</a></h2><ulclass="item-table"><li><divclass="item-name"><aclass="struct"href="struct.IntoIter.html"title="struct syn::punctuated::IntoIter">IntoIter</a></div><divclass="desc docblock-short">An iterator over owned values of type <code>T</code>.</div></li><li><divclass="item-name"><aclass="struct"href="struct.IntoPairs.html"title="struct syn::punctuated::IntoPairs">IntoPairs</a></div><divclass="desc docblock-short">An iterator over owned pairs of type <code>Pair<T, P></code>.</div></li><li><divclass="item-name"><aclass="struct"href="struct.Iter.html"title="struct syn::punctuated::Iter">Iter</a></div><divclass="desc docblock-short">An iterator over borrowed values of type <code>&T</code>.</div></li><li><divclass="item-name"><aclass="struct"href="struct.IterMut.html"title="struct syn::punctuated::IterMut">IterMut</a></div><divclass="desc docblock-short">An iterator over mutably borrowed values of type <code>&mut T</code>.</div></li><li><divclass="item-name"><aclass="struct"href="struct.Pairs.html"title="struct syn::punctuated::Pairs">Pairs</a></div><divclass="desc docblock-short">An iterator over borrowed pairs of type <code>Pair<&T, &P></code>.</div></li><li><divclass="item-name"><aclass="struct"href="struct.PairsMut.html"title="struct syn::punctuated::PairsMut">PairsMut</a></div><divclass="desc docblock-short">An iterator over mutably borrowed pairs of type <code>Pair<&mut T, &mut P></code>.</div></li><li><divclass="item-name"><aclass="struct"href="struct.Punctuated.html"title="struct syn::punctuated::Punctuated">Punctuated</a></div><divclass="desc docblock-short"><strong>A punctuated sequence of syntax tree nodes of type <code>T</code> separated by
punctuation of type <code>P</code>.</strong></div></li></ul><h2id="enums"class="section-header">Enums<ahref="#enums"class="anchor">§</a></h2><ulclass="item-table"><li><divclass="item-name"><aclass="enum"href="enum.Pair.html"title="enum syn::punctuated::Pair">Pair</a></div><divclass="desc docblock-short">A single syntax tree node of type <code>T</code> followed by its trailing punctuation