<!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="Represents information about capturing groups in a compiled regex."><title>GroupInfo in regex_automata::util::captures - 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-5bc39a1768837dd0.css"><metaname="rustdoc-vars"data-root-path="../../../"data-static-root-path="../../../static.files/"data-current-crate="regex_automata"data-themes=""data-resource-suffix=""data-rustdoc-version="1.77.1 (7cf61ebde 2024-03-27)"data-channel="1.77.1"data-search-js="search-dd67cee4cfa65049.js"data-settings-js="settings-4313503d2e1961c2.js"><scriptsrc="../../../static.files/storage-4c98445ec4002617.js"></script><scriptdefersrc="sidebar-items.js"></script><scriptdefersrc="../../../static.files/main-48f368f3872407c8.js"></script><noscript><linkrel="stylesheet"href="../../../static.files/noscript-04d5337699b92874.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"title="show sidebar"></button></nav><navclass="sidebar"><divclass="sidebar-crate"><h2><ahref="../../../regex_automata/index.html">regex_automata</a><spanclass="version">0.4.6</span></h2></div><h2class="location"><ahref="#">GroupInfo</a></h2><divclass="sidebar-elems"><section><h3><ahref="#implementations">Methods</a></h3><ulclass="block method"><li><ahref="#method.all_group_len">all_group_len</a></li><li><ahref="#method.all_names">all_names</a></li><li><ahref="#method.empty">empty</a></li><li><ahref="#method.explicit_slot_len">explicit_slot_len</a></li><li><ahref="#method.group_len">group_len</a></li><li><ahref="#method.implicit_slot_len">implicit_slot_len</a></li><li><ahref="#method.memory_usage">memory_usage</a></li><li><ahref="#method.new">new</a></li><li><ahref="#method.pattern_len">pattern_len</a></li><li><ahref="#method.pattern_names">pattern_names</a></li><li><ahref="#method.slot">slot</a></li><li><ahref="#method.slot_len">slot_len</a></li><li><ahref="#method.slots">slots</a></li><li><ahref="#method.to_index">to_index</a></li><li><ahref="#method.to_name">to_name</a></li></ul><h3><ahref="#trait-implementations">Trait Implementations</a></h3><ulclass="block trait-implementation"><li><ahref="#impl-Clone-for-GroupInfo">Clone</a></li><li><ahref="#impl-Debug-for-GroupInfo">Debug</a></li><li><ahref="#impl-Default-for-GroupInfo">Default</a></li></ul><h3><ahref="#synthetic-implementations">Auto Trait Implementations</a></h3><ulclass="block synthetic-implementation"><li><ahref="#impl-RefUnwindSafe-for-GroupInfo">RefUnwindSafe</a></li><li><ahref="#impl-Send-for-GroupInfo">Send</a></li><li><ahref="#impl-Sync-for-GroupInfo">Sync</a></li><li><ahref="#impl-Unpin-for-GroupInfo">Unpin</
<main><divclass="width-limiter"><navclass="sub"><formclass="search-form"><span></span><divid="sidebar-button"tabindex="-1"><ahref="../../../regex_automata/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">regex_automata</a>::<wbr><ahref="../index.html">util</a>::<wbr><ahref="index.html">captures</a>::<wbr><aclass="struct"href="#">GroupInfo</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/regex_automata/util/captures.rs.html#1451">source</a> · <buttonid="toggle-all-docs"title="collapse all docs">[<span>−</span>]</button></span></div><preclass="rust item-decl"><code>pub struct GroupInfo(<spanclass="comment">/* private fields */</span>);</code></pre><detailsclass="toggle top-doc"open><summaryclass="hideme"><span>Expand description</span></summary><divclass="docblock"><p>Represents information about capturing groups in a compiled regex.</p>
<p>The information encapsulated by this type consists of the following. For
each pattern:</p>
<ul>
<li>A map from every capture group name to its corresponding capture group
index.</li>
<li>A map from every capture group index to its corresponding capture group
name.</li>
<li>A map from capture group index to its corresponding slot index. A slot
refers to one half of a capturing group. That is, a capture slot is either
the start or end of a capturing group. A slot is usually the mechanism
by which a regex engine records offsets for each capturing group during a
search.</li>
</ul>
<p>A <code>GroupInfo</code> uses reference counting internally and is thus cheap to
<h2id="mapping-from-capture-groups-to-slots"><aclass="doc-anchor"href="#mapping-from-capture-groups-to-slots">§</a>Mapping from capture groups to slots</h2>
<p>Because this crate provides first class support for multi-pattern regexes,
and because of some performance related reasons, the mapping between
capturing groups and slots is a little complex. However, in the case of a
single pattern, the mapping can be described very simply: for all capture
group indices <code>i</code>, its corresponding slots are at <code>i * 2</code> and <code>i * 2 + 1</code>.
Notice that the pattern ID isn’t involved at all here, because it only
applies to a single-pattern regex, it is therefore always <code>0</code>.</p>
<p>In the multi-pattern case, the mapping is a bit more complicated. To talk
about it, we must define what we mean by “implicit” vs “explicit”
capturing groups:</p>
<ul>
<li>An <strong>implicit</strong> capturing group refers to the capturing group that is
present for every pattern automatically, and corresponds to the overall
match of a pattern. Every pattern has precisely one implicit capturing
group. It is always unnamed and it always corresponds to the capture group
index <code>0</code>.</li>
<li>An <strong>explicit</strong> capturing group refers to any capturing group that
appears in the concrete syntax of the pattern. (Or, if an NFA was hand
built without any concrete syntax, it refers to any capturing group with an
index greater than <code>0</code>.)</li>
</ul>
<p>Some examples:</p>
<ul>
<li><code>\w+</code> has one implicit capturing group and zero explicit capturing
groups.</li>
<li><code>(\w+)</code> has one implicit group and one explicit group.</li>
<li><code>foo(\d+)(?:\pL+)(\d+)</code> has one implicit group and two explicit groups.</li>
</ul>
<p>Turning back to the slot mapping, we can now state it as follows:</p>
<ul>
<li>Given a pattern ID <code>pid</code>, the slots for its implicit group are always
at <code>pid * 2</code> and <code>pid * 2 + 1</code>.</li>
<li>Given a pattern ID <code>0</code>, the slots for its explicit groups start
at <code>group_info.pattern_len() * 2</code>.</li>
<li>Given a pattern ID <code>pid > 0</code>, the slots for its explicit groups start
immediately following where the slots for the explicit groups of <code>pid - 1</code>
end.</li>
</ul>
<p>In particular, while there is a concrete formula one can use to determine
where the slots for the implicit group of any pattern are, there is no
general formula for determining where the slots for explicit capturing
groups are. This is because each pattern can contain a different number
of groups.</p>
<p>The intended way of getting the slots for a particular capturing group
(whether implicit or explicit) is via the <ahref="struct.GroupInfo.html#method.slot"title="method regex_automata::util::captures::GroupInfo::slot"><code>GroupInfo::slot</code></a> or
<h2id="example-mapping-from-capture-groups-to-slots"><aclass="doc-anchor"href="#example-mapping-from-capture-groups-to-slots">§</a>Example: mapping from capture groups to slots</h2>
N: <aclass="trait"href="https://doc.rust-lang.org/1.77.1/core/convert/trait.AsRef.html"title="trait core::convert::AsRef">AsRef</a><<aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.str.html">str</a>>,</div></h4></section></summary><divclass="docblock"><p>Creates a new group info from a sequence of patterns, where each
<spanclass="macro">vec!</span>[<spanclass="prelude-val">None</span>, <spanclass="prelude-val">Some</span>(<spanclass="string">"a"</span>)], <spanclass="comment">// ok
</span><spanclass="macro">vec!</span>[<spanclass="prelude-val">None</span>], <spanclass="comment">// ok
</span><spanclass="macro">vec!</span>[], <spanclass="comment">// not ok
</span>]).is_err());
<spanclass="comment">// Note that building an empty group info is OK.
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.to_index"class="method"><aclass="src rightside"href="../../../src/regex_automata/util/captures.rs.html#1682-1685">source</a><h4class="code-header">pub fn <ahref="#method.to_index"class="fn">to_index</a>(&self, pid: <aclass="struct"href="../../struct.PatternID.html"title="struct regex_automata::PatternID">PatternID</a>, name: &<aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.str.html">str</a>) -><aclass="enum"href="https://doc.rust-lang.org/1.77.1/core/option/enum.Option.html"title="enum core::option::Option">Option</a><<aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.usize.html">usize</a>></h4></section></summary><divclass="docblock"><p>Return the capture group index corresponding to the given name in the
given pattern. If no such capture group name exists in the given
pattern, then this returns <code>None</code>.</p>
<p>If the given pattern ID is invalid, then this returns <code>None</code>.</p>
<p>This also returns <code>None</code> for all inputs if these captures are empty
(e.g., built from an empty <ahref="struct.GroupInfo.html"title="struct regex_automata::util::captures::GroupInfo"><code>GroupInfo</code></a>). To check whether captures
are are present for a specific pattern, use <ahref="struct.GroupInfo.html#method.group_len"title="method regex_automata::util::captures::GroupInfo::group_len"><code>GroupInfo::group_len</code></a>.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.to_name"class="method"><aclass="src rightside"href="../../../src/regex_automata/util/captures.rs.html#1730-1733">source</a><h4class="code-header">pub fn <ahref="#method.to_name"class="fn">to_name</a>(&self, pid: <aclass="struct"href="../../struct.PatternID.html"title="struct regex_automata::PatternID">PatternID</a>, group_index: <aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.usize.html">usize</a>) -><aclass="enum"href="https://doc.rust-lang.org/1.77.1/core/option/enum.Option.html"title="enum core::option::Option">Option</a><&<aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.str.html">str</a>></h4></section></summary><divclass="docblock"><p>Return the capture name for the given index and given pattern. If the
corresponding group does not have a name, then this returns <code>None</code>.</p>
<p>If the pattern ID is invalid, then this returns <code>None</code>.</p>
<p>If the group index is invalid for the given pattern, then this returns
<code>None</code>. A group <code>index</code> is valid for a pattern <code>pid</code> in an <code>nfa</code> if and
only if <code>index < nfa.pattern_capture_len(pid)</code>.</p>
<p>This also returns <code>None</code> for all inputs if these captures are empty
(e.g., built from an empty <ahref="struct.GroupInfo.html"title="struct regex_automata::util::captures::GroupInfo"><code>GroupInfo</code></a>). To check whether captures
are are present for a specific pattern, use <ahref="struct.GroupInfo.html#method.group_len"title="method regex_automata::util::captures::GroupInfo::group_len"><code>GroupInfo::group_len</code></a>.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.pattern_names"class="method"><aclass="src rightside"href="../../../src/regex_automata/util/captures.rs.html#1768-1777">source</a><h4class="code-header">pub fn <ahref="#method.pattern_names"class="fn">pattern_names</a>(&self, pid: <aclass="struct"href="../../struct.PatternID.html"title="struct regex_automata::PatternID">PatternID</a>) -><aclass="struct"href="struct.GroupInfoPatternNames.html"title="struct regex_automata::util::captures::GroupInfoPatternNames">GroupInfoPatternNames</a><'_><ahref="#"class="tooltip"data-notable-ty="GroupInfoPatternNames<'_>">ⓘ</a></h4></section></summary><divclass="docblock"><p>Return an iterator of all capture groups and their names (if present)
for a particular pattern.</p>
<p>If the given pattern ID is invalid or if this <code>GroupInfo</code> is empty,
then the iterator yields no elements.</p>
<p>The number of elements yielded by this iterator is always equal to
the result of calling <ahref="struct.GroupInfo.html#method.group_len"title="method regex_automata::util::captures::GroupInfo::group_len"><code>GroupInfo::group_len</code></a> with the same
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.all_names"class="method"><aclass="src rightside"href="../../../src/regex_automata/util/captures.rs.html#1829-1836">source</a><h4class="code-header">pub fn <ahref="#method.all_names"class="fn">all_names</a>(&self) -><aclass="struct"href="struct.GroupInfoAllNames.html"title="struct regex_automata::util::captures::GroupInfoAllNames">GroupInfoAllNames</a><'_><ahref="#"class="tooltip"data-notable-ty="GroupInfoAllNames<'_>">ⓘ</a></h4></section></summary><divclass="docblock"><p>Return an iterator of all capture groups for all patterns supported by
this <code>GroupInfo</code>. Each item yielded is a triple of the group’s pattern
ID, index in the pattern and the group’s name, if present.</p>
) -><aclass="enum"href="https://doc.rust-lang.org/1.77.1/core/option/enum.Option.html"title="enum core::option::Option">Option</a><(<aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.usize.html">usize</a>, <aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.usize.html">usize</a>)></h4></section></summary><divclass="docblock"><p>Returns the starting and ending slot corresponding to the given
capturing group for the given pattern. The ending slot is always one
more than the starting slot returned.</p>
<p>Note that this is like <ahref="struct.GroupInfo.html#method.slot"title="method regex_automata::util::captures::GroupInfo::slot"><code>GroupInfo::slot</code></a>, except that it also returns
the ending slot value for convenience.</p>
<p>If either the pattern ID or the capture index is invalid, then this
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.slot"class="method"><aclass="src rightside"href="../../../src/regex_automata/util/captures.rs.html#1904-1921">source</a><h4class="code-header">pub fn <ahref="#method.slot"class="fn">slot</a>(&self, pid: <aclass="struct"href="../../struct.PatternID.html"title="struct regex_automata::PatternID">PatternID</a>, group_index: <aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.usize.html">usize</a>) -><aclass="enum"href="https://doc.rust-lang.org/1.77.1/core/option/enum.Option.html"title="enum core::option::Option">Option</a><<aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.usize.html">usize</a>></h4></section></summary><divclass="docblock"><p>Returns the starting slot corresponding to the given capturing group
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.pattern_len"class="method"><aclass="src rightside"href="../../../src/regex_automata/util/captures.rs.html#1948-1950">source</a><h4class="code-header">pub fn <ahref="#method.pattern_len"class="fn">pattern_len</a>(&self) -><aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.usize.html">usize</a></h4></section></summary><divclass="docblock"><p>Returns the total number of patterns in this <code>GroupInfo</code>.</p>
<p>This may return zero if the <code>GroupInfo</code> was constructed with no
patterns.</p>
<p>This is guaranteed to be no bigger than <ahref="../../struct.PatternID.html#associatedconstant.LIMIT"title="associated constant regex_automata::PatternID::LIMIT"><code>PatternID::LIMIT</code></a> because
<code>GroupInfo</code> construction will fail if too many patterns are added.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.group_len"class="method"><aclass="src rightside"href="../../../src/regex_automata/util/captures.rs.html#1989-1991">source</a><h4class="code-header">pub fn <ahref="#method.group_len"class="fn">group_len</a>(&self, pid: <aclass="struct"href="../../struct.PatternID.html"title="struct regex_automata::PatternID">PatternID</a>) -><aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.usize.html">usize</a></h4></section></summary><divclass="docblock"><p>Return the number of capture groups in a pattern.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.all_group_len"class="method"><aclass="src rightside"href="../../../src/regex_automata/util/captures.rs.html#2036-2038">source</a><h4class="code-header">pub fn <ahref="#method.all_group_len"class="fn">all_group_len</a>(&self) -><aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.usize.html">usize</a></h4></section></summary><divclass="docblock"><p>Return the total number of capture groups across all patterns.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.slot_len"class="method"><aclass="src rightside"href="../../../src/regex_automata/util/captures.rs.html#2067-2069">source</a><h4class="code-header">pub fn <ahref="#method.slot_len"class="fn">slot_len</a>(&self) -><aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.usize.html">usize</a></h4></section></summary><divclass="docblock"><p>Returns the total number of slots in this <code>GroupInfo</code> across all
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.implicit_slot_len"class="method"><aclass="src rightside"href="../../../src/regex_automata/util/captures.rs.html#2099-2101">source</a><h4class="code-header">pub fn <ahref="#method.implicit_slot_len"class="fn">implicit_slot_len</a>(&self) -><aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.usize.html">usize</a></h4></section></summary><divclass="docblock"><p>Returns the total number of slots for implicit capturing groups.</p>
<p>This is like <ahref="struct.GroupInfo.html#method.slot_len"title="method regex_automata::util::captures::GroupInfo::slot_len"><code>GroupInfo::slot_len</code></a>, except it doesn’t include the
explicit slots for each pattern. Since there are always exactly 2
implicit slots for each pattern, the number of implicit slots is always
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.explicit_slot_len"class="method"><aclass="src rightside"href="../../../src/regex_automata/util/captures.rs.html#2135-2137">source</a><h4class="code-header">pub fn <ahref="#method.explicit_slot_len"class="fn">explicit_slot_len</a>(&self) -><aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.usize.html">usize</a></h4></section></summary><divclass="docblock"><p>Returns the total number of slots for explicit capturing groups.</p>
<p>This is like <ahref="struct.GroupInfo.html#method.slot_len"title="method regex_automata::util::captures::GroupInfo::slot_len"><code>GroupInfo::slot_len</code></a>, except it doesn’t include the
implicit slots for each pattern. (There are always 2 implicit slots for
each pattern.)</p>
<p>For a non-empty <code>GroupInfo</code>, it is always the case that <code>slot_len</code> is
strictly greater than <code>explicit_slot_len</code>. For an empty <code>GroupInfo</code>,
both the total number of slots and the number of explicit slots is
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.memory_usage"class="method"><aclass="src rightside"href="../../../src/regex_automata/util/captures.rs.html#2144-2152">source</a><h4class="code-header">pub fn <ahref="#method.memory_usage"class="fn">memory_usage</a>(&self) -><aclass="primitive"href="https://doc.rust-lang.org/1.77.1/std/primitive.usize.html">usize</a></h4></section></summary><divclass="docblock"><p>Returns the memory usage, in bytes, of this <code>GroupInfo</code>.</p>
<code><ahref="https://doc.rust-lang.org/1.77.1/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.77.1/src/alloc/borrow.rs.html#83-85">source</a><ahref="#impl-ToOwned-for-T"class="anchor">§</a><h3class="code-header">impl<T><aclass="trait"href="https://doc.rust-lang.org/1.77.1/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.77.1/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"><ahref="#associatedtype.Owned"class="anchor">§</a><h4class="code-header">type <ahref="https://doc.rust-lang.org/1.77.1/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.77.1/src/alloc/borrow.rs.html#88">source</a><ahref="#method.to_owned"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.77.1/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.77.1/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.77.1/src/alloc/borrow.rs.html#92">source</a><ahref="#method.clone_into"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.77.1/alloc/borrow/trait.ToOwned.html#method.clone_into"class="fn">clone_into</a>(&self, target: <aclass="primitive"href="https://doc.rust-lang.org/1.77.1/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.77.1/alloc/borrow/trait.ToOwned.html#method.clone_into">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.77.1/src/core/convert/mod.rs.html#804-806">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.77.1/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.77.1/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"><ahref="#associatedtype.Error-1"class="anchor">§</a><h4class="code-header">type <ahref="https://doc.rust-lang.org/1.77.1/core/convert/trait.TryFrom.html#associatedtype.Error"class="associatedtype">Error</a> = <aclass="enum"href="https://doc.rust-lang.org/1.77.1/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.77.1/src/core/convert/mod.rs.html#811">source</a><ahref="#method.try_from"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.77.1/core/convert/trait.TryFrom.html#tymethod.try_from"class="fn">try_from</a>(value: U) -><aclass="enum"href="https://doc.rust-lang.org/1.77.1/core/result/enum.Result.html"title="enum core::result::Result">Result</a><T, <T as <aclass="trait"href="https://doc.rust-lang.org/1.77.1/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><U>>::<aclass="associatedtype"href="https://doc.rust-lang.org/1.77.1/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.77.1/src/core/convert/mod.rs.html#789-791">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.77.1/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.77.1/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"><ahref="#associatedtype.Error"class="anchor">§</a><h4class="code-header">type <ahref="https://doc.rust-lang.org/1.77.1/core/convert/trait.TryInto.html#associatedtype.Error"class="associatedtype">Error</a> = <U as <aclass="trait"href="https://doc.rust-lang.org/1.77.1/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><T>>::<aclass="associatedtype"href="https://doc.rust-lang.org/1.77.1/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.77.1/src/core/convert/mod.rs.html#796">source</a><ahref="#method.try_into"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.77.1/core/convert/trait.TryInto.html#tymethod.try_into"class="fn">try_into</a>(self) -><aclass="enum"href="https://doc.rust-lang.org/1.77.1/core/result/enum.Result.html"title="enum core::result::Result">Result</a><U, <U as <aclass="trait"href="https://doc.rust-lang.org/1.77.1/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><T>>::<aclass="associatedtype"href="https://doc.rust-lang.org/1.77.1/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">{"GroupInfoAllNames<'_>":"<h3>Notabletraitsfor<code><aclass=\"struct\"href=\"struct.GroupInfoAllNames.html\"title=\"structregex_automata::util::captures::GroupInfoAllNames\">GroupInfoAllNames</a><'a></code></h3><pre><code><divclass=\"where\">impl<'a><aclass=\"trait\"href=\"https://doc.rust-lang.org/1.77.1/core/iter/traits/iterator/trait.Iterator.html\"title=\"traitcore::iter::traits::iterator::Iterator\">Iterator</a>for<aclass=\"struct\"href=\"struct.GroupInfoAllNames.html\"title=\"structregex_automata::util::captures::GroupInfoAllNames\">GroupInfoAllNames</a><'a></div><divclass=\"where\">type<ahref=\"https://doc.rust-lang.org/1.77.1/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item\"class=\"associatedtype\">Item</a>=(<aclass=\"struct\"href=\"../../struct.PatternID.html\"title=\"structregex_automata::PatternID\">PatternID</a>,<aclass=\"primitive\"href=\"https://doc.rust-lang.org/1.77.1/std/primitive.usize.html\">usize</a>,<aclass=\"enum\"href=\"https://doc.rust-lang.org/1.77.1/core/option/enum.Option.html\"title=\"enumcore::option::Option\">Option</a><&'a<aclass=\"primitive\"href=\"https://doc.rust-lang.org/1.77.1/std/primitive.str.html\">str</a>>);</div>","GroupInfoPatternNames<'_>":"<h3>Notabletraitsfor<code><aclass=\"struct\"href=\"struct.GroupInfoPatternNames.html\"title=\"structregex_automata::util::captures::GroupInfoPatternNames\">GroupInfoPatternNames</a><'a></code></h3><pre><code><divclass=\"where\">impl<'a><aclass=\"trait\"href=\"https://doc.rust-lang.org/1.77.1/core/iter/traits/iterator/trait.Iterator.html\"title=\"traitcore::iter::traits::iterator::Iterator\">Iterator</a>for<aclass=\"struct\"href=\"struct.GroupInfoPatternNames.html\"title=\"structregex_automata::util::captures::GroupInfoPatternNames\">GroupInfoPatternNames</a><'a></div><divclass=\"where\">type<ahref=\"https://doc.rust-lang.org/1.77.1/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item\"class=\"associatedtype\