<!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-ac92e1bbe349e143.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.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="../../../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</a></li><li><a
<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
clone.</p>
<h2id="mapping-from-capture-groups-to-slots"><ahref="#mapping-from-capture-groups-to-slots">Mapping from capture groups to slots</a></h2>
<p>One of the main responsibilities of a <code>GroupInfo</code> is to build a mapping
from <code>(PatternID, u32)</code> (where the <code>u32</code> is a capture index) to something
called a “slot.” As mentioned above, a slot refers to one half of a
capturing group. Both combined provide the start and end offsets of
a capturing group that participated in a match.</p>
<p><strong>The mapping between group indices and slots is an API guarantee.</strong> That
is, the mapping won’t change within a semver compatible release.</p>
<p>Slots exist primarily because this is a convenient mechanism by which
regex engines report group offsets at search time. For example, the
<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"><ahref="#example-mapping-from-capture-groups-to-slots">Example: mapping from capture groups to slots</a></h2>
<p>This example shows the specific mapping from capture group indices for
each pattern to their corresponding slots. The slot values shown in this
N: <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/convert/trait.AsRef.html"title="trait core::convert::AsRef">AsRef</a><<aclass="primitive"href="https://doc.rust-lang.org/1.76.0/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
sequence of patterns yields a sequence of possible group names. The
index of each pattern in the sequence corresponds to its <code>PatternID</code>,
and the index of each group in each pattern’s sequence corresponds to
its corresponding group index.</p>
<p>While this constructor is very generic and therefore perhaps hard to
chew on, an example of a valid concrete type that can be passed to
this constructor is <code>Vec<Vec<Option<String>>></code>. The outer <code>Vec</code>
corresponds to the patterns, i.e., one <code>Vec<Option<String>></code> per
pattern. The inner <code>Vec</code> corresponds to the capturing groups for
each pattern. The <code>Option<String></code> corresponds to the name of the
capturing group, if present.</p>
<p>It is legal to pass an empty iterator to this constructor. It will
return an empty group info with zero slots. An empty group info is
useful for cases where you have no patterns or for cases where slots
aren’t being used at all (e.g., for most DFAs in this crate).</p>
<h5id="errors"><ahref="#errors">Errors</a></h5>
<p>This constructor returns an error if the given capturing groups are
invalid in some way. Those reasons include, but are not necessarily
limited to:</p>
<ul>
<li>Too many patterns (i.e., <code>PatternID</code> would overflow).</li>
<li>Too many capturing groups (e.g., <code>u32</code> would overflow).</li>
<li>A pattern is given that has no capturing groups. (All patterns must
have at least an implicit capturing group at index <code>0</code>.)</li>
<li>The capturing group at index <code>0</code> has a name. It must be unnamed.</li>
<li>There are duplicate capturing group names within the same pattern.
(Multiple capturing groups with the same name may exist, but they
must be in different patterns.)</li>
</ul>
<p>An example below shows how to trigger some of the above error
<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.76.0/std/primitive.str.html">str</a>) -><aclass="enum"href="https://doc.rust-lang.org/1.76.0/core/option/enum.Option.html"title="enum core::option::Option">Option</a><<aclass="primitive"href="https://doc.rust-lang.org/1.76.0/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.76.0/std/primitive.usize.html">usize</a>) -><aclass="enum"href="https://doc.rust-lang.org/1.76.0/core/option/enum.Option.html"title="enum core::option::Option">Option</a><&<aclass="primitive"href="https://doc.rust-lang.org/1.76.0/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.76.0/core/option/enum.Option.html"title="enum core::option::Option">Option</a><(<aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.usize.html">usize</a>, <aclass="primitive"href="https://doc.rust-lang.org/1.76.0/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.76.0/std/primitive.usize.html">usize</a>) -><aclass="enum"href="https://doc.rust-lang.org/1.76.0/core/option/enum.Option.html"title="enum core::option::Option">Option</a><<aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.usize.html">usize</a>></h4></section></summary><divclass="docblock"><p>Returns the starting slot corresponding to the given capturing group
for the given pattern. The ending slot is always one more than the
value returned.</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.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.76.0/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.76.0/std/primitive.usize.html">usize</a></h4></section></summary><divclass="docblock"><p>Return the number of capture groups in a pattern.</p>
<p>If the pattern ID is invalid, then this returns <code>0</code>.</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.76.0/std/primitive.usize.html">usize</a></h4></section></summary><divclass="docblock"><p>Return the total number of capture groups across all patterns.</p>
<p>This includes implicit groups that represent the entire match of a
</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.76.0/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
patterns.</p>
<p>The total number of slots is always twice the total number of capturing
groups, including both implicit and explicit groups.</p>
</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.76.0/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.76.0/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.76.0/std/primitive.usize.html">usize</a></h4></section></summary><divclass="docblock"><p>Returns the memory usage, in bytes, of this <code>GroupInfo</code>.</p>
<p>This does <strong>not</strong> include the stack size used up by this <code>GroupInfo</code>.
To compute that, use <code>std::mem::size_of::<GroupInfo>()</code>.</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-GroupInfo"class="impl"><aclass="src rightside"href="../../../src/regex_automata/util/captures.rs.html#1450">source</a><ahref="#impl-Clone-for-GroupInfo"class="anchor">§</a><h3class="code-header">impl <aclass="trait"href="https://doc.rust-lang.org/1.76.0/core/clone/trait.Clone.html"title="trait core::clone::Clone">Clone</a> for <aclass="struct"href="struct.GroupInfo.html"title="struct regex_automata::util::captures::GroupInfo">GroupInfo</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/regex_automata/util/captures.rs.html#1450">source</a><ahref="#method.clone"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.76.0/core/clone/trait.Clone.html#tymethod.clone"class="fn">clone</a>(&self) -><aclass="struct"href="struct.GroupInfo.html"title="struct regex_automata::util::captures::GroupInfo">GroupInfo</a></h4></section></summary><divclass='docblock'>Returns a copy of the value. <ahref="https://doc.rust-lang.org/1.76.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.76.0/src/core/clone.rs.html#169">source</a></span><ahref="#method.clone_from"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.76.0/core/clone/trait.Clone.html#method.clone_from"class="fn">clone_from</a>(&mut self, source: <aclass="primitive"href="https://doc.rust-lang.org/1.76.0/std/primitive.reference.html">&Self</a>)</h4></section></summary><divclass='docblock'>Performs copy-assignment from <code>source</code>. <ahref="https://doc.rust-lang.org/1.76.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-GroupInfo"class="impl"><aclass="src rightside"href="../../../src/regex_automata/util/captures.rs.html#1450">source</a><ahref="#impl-Debug-for-GroupInfo"class="anchor">§</a><h3class="code-header">impl <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.GroupInfo.html"title="struct regex_automata::util::captures::GroupInfo">GroupInfo</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/regex_automata/util/captures.rs.html#1450">source</a><ahref="#method.fmt"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-Default-for-GroupInfo"class="impl"><aclass="src rightside"href="../../../src/regex_automata/util/captures.rs.html#1450">source</a><ahref="#impl-Default-for-GroupInfo"cla
T: 'static + ?<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.type_id"class="method trait-impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.76.0/src/core/any.rs.html#141">source</a><ahref="#method.type_id"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.76.0/core/any/trait.Any.html#tymethod.type_id"class="fn">type_id</a>(&self) -><aclass="struct"href="https://doc.rust-lang.org/1.76.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.76.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.76.0/src/core/borrow.rs.html#208">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.76.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.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.borrow"class="method trait-impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.76.0/src/core/borrow.rs.html#210">source</a><ahref="#method.borrow"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.76.0/core/borrow/trait.Borrow.html#tymethod.borrow"class="fn">borrow</a>(&self) -><aclass="primitive"href="https://doc.rust-lang.org/1.76.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.76.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.76.0/src/core/borrow.rs.html#216">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.76.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.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.borrow_mut"class="method trait-impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.76.0/src/core/borrow.rs.html#217">source</a><ahref="#method.borrow_mut"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.76.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.76.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.76.0/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">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.76.0/src/core/convert/mod.rs.html#763">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.76.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"class="method trait-impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.76.0/src/core/convert/mod.rs.html#766">source</a><ahref="#method.from"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.76.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.76.0/src/core/convert/mod.rs.html#747-749">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.76.0/core/convert/trait.Into.html"title="trait core::convert::Into">Into</a><U> for T<divclass="where">where
<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-ToOwned-for-T"class="impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.76.0/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.76.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.76.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"><ahref="#associatedtype.Owned"class="anchor">§</a><h4class="code-header">type <ahref="https://doc.rust-lang.org/1.76.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.76.0/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.76.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.76.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.76.0/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.76.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.76.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.76.0/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.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><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.76.0/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.76.0/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.76.0/std/primitive.usize.html\">usize</a>,<aclass=\"enum\"href=\"https://doc.rust-lang.org/1.76.0/core/option/enum.Option.html\"title=\"enumcore::option::Option\">Option</a><&'a<aclass=\"primitive\"href=\"https://doc.rust-lang.org/1.76.0/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.76.0/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.76.0/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item\"class=\"associatedt