<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">iter</a>::<wbr><aclass="struct"href="#">Searcher</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/iter.rs.html#147-156">source</a> · <buttonid="toggle-all-docs"title="collapse all docs">[<span>−</span>]</button></span></div><preclass="rust item-decl"><code>pub struct Searcher<'h> { <spanclass="comment">/* private fields */</span> }</code></pre><detailsclass="toggle top-doc"open><summaryclass="hideme"><span>Expand description</span></summary><divclass="docblock"><p>A searcher for creating iterators and performing lower level iteration.</p>
<p>This searcher encapsulates the logic required for finding all successive
non-overlapping matches in a haystack. In theory, iteration would look
something like this:</p>
<ol>
<li>Setting the start position to <code>0</code>.</li>
<li>Execute a regex search. If no match, end iteration.</li>
<li>Report the match and set the start position to the end of the match.</li>
<li>Go back to (2).</li>
</ol>
<p>And if this were indeed the case, it’s likely that <code>Searcher</code> wouldn’t
exist. Unfortunately, because a regex may match the empty string, the above
logic won’t work for all possible regexes. Namely, if an empty match is
found, then step (3) would set the start position of the search to the
position it was at. Thus, iteration would never end.</p>
<p>Instead, a <code>Searcher</code> knows how to detect these cases and forcefully
advance iteration in the case of an empty match that overlaps with a
previous match.</p>
<p>If you know that your regex cannot match any empty string, then the simple
algorithm described above will work correctly.</p>
<p>When possible, prefer the iterators defined on the regex engine you’re
using. This tries to abstract over the regex engine and is thus a bit more
unwieldy to use.</p>
<p>In particular, a <code>Searcher</code> is not itself an iterator. Instead, it provides
<code>advance</code> routines that permit moving the search along explicitly. It also
provides various routines, like <ahref="struct.Searcher.html#method.into_matches_iter"title="method regex_automata::util::iter::Searcher::into_matches_iter"><code>Searcher::into_matches_iter</code></a>, that
accept a closure (representing how a regex engine executes a search) and
returns a conventional iterator.</p>
<p>The lifetime parameters come from the <ahref="../../struct.Input.html"title="struct regex_automata::Input"><code>Input</code></a> type passed to
<ahref="struct.Searcher.html#method.new"title="associated function regex_automata::util::iter::Searcher::new"><code>Searcher::new</code></a>:</p>
<ul>
<li><code>'h</code> is the lifetime of the underlying haystack.</li>
if we use a closure internally, it’s not possible to name this type in the
return type of the iterator constructor. Thus, the only way around it is
to erase the type by boxing it and turning it into a <code>Box<dyn FnMut ...></code>.
This boxed closure is unlikely to be inlined <em>and</em> it infects the public
API in subtle ways. Namely, unless you declare the closure as implementing
<code>Send</code> and <code>Sync</code>, then the resulting iterator type won’t implement it
either. But there are practical issues with requiring the closure to
implement <code>Send</code> and <code>Sync</code> that result in other API complexities that
are beyond the scope of this already long exposition.</li>
<li>Some regex engines expose more complex match information than just
“which pattern matched” and “at what offsets.” For example, the PikeVM
exposes match spans for each capturing group that participated in the
match. In such cases, it can be quite beneficial to reuse the capturing
group allocation on subsequent searches. A proper iterator doesn’t permit
this API due to its interface, so it’s useful to have something a bit lower
level that permits callers to amortize allocations while also reusing a
shared implementation of iteration. (See the documentation for
<ahref="struct.Searcher.html#method.advance"title="method regex_automata::util::iter::Searcher::advance"><code>Searcher::advance</code></a> for an example of using the “advance” API with the
PikeVM.)</li>
</ol>
<p>What this boils down to is that there are “advance” APIs which require
handing a closure to it for every call, and there are also APIs to create
iterators from a closure. The former are useful for <em>implementing</em>
iterators or when you need more flexibility, while the latter are useful
for conveniently writing custom iterators on-the-fly.</p>
<p>Several regex engines in this crate over convenient iterator APIs over
<ahref="../captures/struct.Captures.html"title="struct regex_automata::util::captures::Captures"><code>Captures</code></a> values. To do so, this requires allocating a new <code>Captures</code>
value for each iteration step. This can perhaps be more costly than you
might want. Instead of implementing your own iterator to avoid that
cost (which can be a little subtle if you want to handle empty matches
correctly), you can use this <code>Searcher</code> to do it for you:</p>
</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-Searcher%3C'h%3E"class="impl"><aclass="src rightside"href="../../../src/regex_automata/util/iter.rs.html#158-681">source</a><ahref="#impl-Searcher%3C'h%3E"class="anchor">§</a><h3class="code-header">impl<'h><aclass="struct"href="struct.Searcher.html"title="struct regex_automata::util::iter::Searcher">Searcher</a><'h></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.new"class="method"><aclass="src rightside"href="../../../src/regex_automata/util/iter.rs.html#165-167">source</a><h4class="code-header">pub fn <ahref="#method.new"class="fn">new</a>(input: <aclass="struct"href="../../struct.Input.html"title="struct regex_automata::Input">Input</a><'h>) -><aclass="struct"href="struct.Searcher.html"title="struct regex_automata::util::iter::Searcher">Searcher</a><'h></h4></section></summary><divclass="docblock"><p>Create a new fallible non-overlapping matches iterator.</p>
<p>The given <code>input</code> provides the parameters (including the haystack),
while the <code>finder</code> represents a closure that calls the underlying regex
engine. The closure may borrow any additional state that is needed,
such as a prefilter scanner.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.input"class="method"><aclass="src rightside"href="../../../src/regex_automata/util/iter.rs.html#174-176">source</a><h4class="code-header">pub fn <ahref="#method.input"class="fn">input</a><'s>(&'s self) ->&'s <aclass="struct"href="../../struct.Input.html"title="struct regex_automata::Input">Input</a><'h></h4></section></summary><divclass="docblock"><p>Returns the current <code>Input</code> used by this searcher.</p>
<p>The <code>Input</code> returned is generally equivalent to the one given to
<ahref="struct.Searcher.html#method.new"title="associated function regex_automata::util::iter::Searcher::new"><code>Searcher::new</code></a>, but its start position may be different to reflect
F: <aclass="trait"href="https://doc.rust-lang.org/1.78.0/core/ops/function/trait.FnMut.html"title="trait core::ops::function::FnMut">FnMut</a>(&<aclass="struct"href="../../struct.Input.html"title="struct regex_automata::Input">Input</a><'_>) -><aclass="enum"href="https://doc.rust-lang.org/1.78.0/core/result/enum.Result.html"title="enum core::result::Result">Result</a><<aclass="enum"href="https://doc.rust-lang.org/1.78.0/core/option/enum.Option.html"title="enum core::option::Option">Option</a><<aclass="struct"href="../../struct.HalfMatch.html"title="struct regex_automata::HalfMatch">HalfMatch</a>>, <aclass="struct"href="../../struct.MatchError.html"title="struct regex_automata::MatchError">MatchError</a>>,</div></h4></section></summary><divclass="docblock"><p>Return the next half match for an infallible search if one exists, and
F: <aclass="trait"href="https://doc.rust-lang.org/1.78.0/core/ops/function/trait.FnMut.html"title="trait core::ops::function::FnMut">FnMut</a>(&<aclass="struct"href="../../struct.Input.html"title="struct regex_automata::Input">Input</a><'_>) -><aclass="enum"href="https://doc.rust-lang.org/1.78.0/core/result/enum.Result.html"title="enum core::result::Result">Result</a><<aclass="enum"href="https://doc.rust-lang.org/1.78.0/core/option/enum.Option.html"title="enum core::option::Option">Option</a><<aclass="struct"href="../../struct.Match.html"title="struct regex_automata::Match">Match</a>>, <aclass="struct"href="../../struct.MatchError.html"title="struct regex_automata::MatchError">MatchError</a>>,</div></h4></section></summary><divclass="docblock"><p>Return the next match for an infallible search if one exists, and
F: <aclass="trait"href="https://doc.rust-lang.org/1.78.0/core/ops/function/trait.FnMut.html"title="trait core::ops::function::FnMut">FnMut</a>(&<aclass="struct"href="../../struct.Input.html"title="struct regex_automata::Input">Input</a><'_>) -><aclass="enum"href="https://doc.rust-lang.org/1.78.0/core/result/enum.Result.html"title="enum core::result::Result">Result</a><<aclass="enum"href="https://doc.rust-lang.org/1.78.0/core/option/enum.Option.html"title="enum core::option::Option">Option</a><<aclass="struct"href="../../struct.HalfMatch.html"title="struct regex_automata::HalfMatch">HalfMatch</a>>, <aclass="struct"href="../../struct.MatchError.html"title="struct regex_automata::MatchError">MatchError</a>>,</div></h4></section></summary><divclass="docblock"><p>Return the next half match for a fallible search if one exists, and
F: <aclass="trait"href="https://doc.rust-lang.org/1.78.0/core/ops/function/trait.FnMut.html"title="trait core::ops::function::FnMut">FnMut</a>(&<aclass="struct"href="../../struct.Input.html"title="struct regex_automata::Input">Input</a><'_>) -><aclass="enum"href="https://doc.rust-lang.org/1.78.0/core/result/enum.Result.html"title="enum core::result::Result">Result</a><<aclass="enum"href="https://doc.rust-lang.org/1.78.0/core/option/enum.Option.html"title="enum core::option::Option">Option</a><<aclass="struct"href="../../struct.Match.html"title="struct regex_automata::Match">Match</a>>, <aclass="struct"href="../../struct.MatchError.html"title="struct regex_automata::MatchError">MatchError</a>>,</div></h4></section></summary><divclass="docblock"><p>Return the next match for a fallible search if one exists, and advance
F: <aclass="trait"href="https://doc.rust-lang.org/1.78.0/core/ops/function/trait.FnMut.html"title="trait core::ops::function::FnMut">FnMut</a>(&<aclass="struct"href="../../struct.Input.html"title="struct regex_automata::Input">Input</a><'_>) -><aclass="enum"href="https://doc.rust-lang.org/1.78.0/core/result/enum.Result.html"title="enum core::result::Result">Result</a><<aclass="enum"href="https://doc.rust-lang.org/1.78.0/core/option/enum.Option.html"title="enum core::option::Option">Option</a><<aclass="struct"href="../../struct.HalfMatch.html"title="struct regex_automata::HalfMatch">HalfMatch</a>>, <aclass="struct"href="../../struct.MatchError.html"title="struct regex_automata::MatchError">MatchError</a>>,</div></h4></section></summary><divclass="docblock"><p>Given a closure that executes a single search, return an iterator over
<p>The iterator returned yields result values. If the underlying regex
engine is configured to never return an error, consider calling
<ahref="struct.TryHalfMatchesIter.html#method.infallible"title="method regex_automata::util::iter::TryHalfMatchesIter::infallible"><code>TryHalfMatchesIter::infallible</code></a> to convert errors into panics.</p>
F: <aclass="trait"href="https://doc.rust-lang.org/1.78.0/core/ops/function/trait.FnMut.html"title="trait core::ops::function::FnMut">FnMut</a>(&<aclass="struct"href="../../struct.Input.html"title="struct regex_automata::Input">Input</a><'_>) -><aclass="enum"href="https://doc.rust-lang.org/1.78.0/core/result/enum.Result.html"title="enum core::result::Result">Result</a><<aclass="enum"href="https://doc.rust-lang.org/1.78.0/core/option/enum.Option.html"title="enum core::option::Option">Option</a><<aclass="struct"href="../../struct.Match.html"title="struct regex_automata::Match">Match</a>>, <aclass="struct"href="../../struct.MatchError.html"title="struct regex_automata::MatchError">MatchError</a>>,</div></h4></section></summary><divclass="docblock"><p>Given a closure that executes a single search, return an iterator over
<p>The iterator returned yields result values. If the underlying regex
engine is configured to never return an error, consider calling
<ahref="struct.TryMatchesIter.html#method.infallible"title="method regex_automata::util::iter::TryMatchesIter::infallible"><code>TryMatchesIter::infallible</code></a> to convert errors into panics.</p>
F: <aclass="trait"href="https://doc.rust-lang.org/1.78.0/core/ops/function/trait.FnMut.html"title="trait core::ops::function::FnMut">FnMut</a>(&<aclass="struct"href="../../struct.Input.html"title="struct regex_automata::Input">Input</a><'_>, &mut <aclass="struct"href="../captures/struct.Captures.html"title="struct regex_automata::util::captures::Captures">Captures</a>) -><aclass="enum"href="https://doc.rust-lang.org/1.78.0/core/result/enum.Result.html"title="enum core::result::Result">Result</a><<aclass="primitive"href="https://doc.rust-lang.org/1.78.0/std/primitive.unit.html">()</a>, <aclass="struct"href="../../struct.MatchError.html"title="struct regex_automata::MatchError">MatchError</a>>,</div></h4></section></summary><divclass="docblock"><p>Given a closure that executes a single search, return an iterator over
all successive non-overlapping <code>Captures</code> values.</p>
<p>The iterator returned yields result values. If the underlying regex
engine is configured to never return an error, consider calling
<ahref="struct.TryCapturesIter.html#method.infallible"title="method regex_automata::util::iter::TryCapturesIter::infallible"><code>TryCapturesIter::infallible</code></a> to convert errors into panics.</p>
<p>Unlike the other iterator constructors, this accepts an initial
<code>Captures</code> value. This <code>Captures</code> value is reused for each search, and
the iterator implementation clones it before returning it. The caller
must provide this value because the iterator is purposely ignorant
of the underlying regex engine and thus doesn’t know how to create
one itself. More to the point, a <code>Captures</code> value itself has a few
different constructors, which change which kind of information is
available to query in exchange for search performance.</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-Searcher%3C'h%3E"class="impl"><aclass="src rightside"href="../../../src/regex_automata/util/iter.rs.html#146">source</a><ahref="#impl-Clone-for-Searcher%3C'h%3E"class="anchor">§</a><h3class="code-header">impl<'h><aclass="trait"href="https://doc.rust-lang.org/1.78.0/core/clone/trait.Clone.html"title="trait core::clone::Clone">Clone</a> for <aclass="struct"href="struct.Searcher.html"title="struct regex_automata::util::iter::Searcher">Searcher</a><'h></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/iter.rs.html#146">source</a><ahref="#method.clone"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.78.0/core/clone/trait.Clone.html#tymethod.clone"class="fn">clone</a>(&self) -><aclass="struct"href="struct.Searcher.html"title="struct regex_automata::util::iter::Searcher">Searcher</a><'h></h4></section></summary><divclass='docblock'>Returns a copy of the value. <ahref="https://doc.rust-lang.org/1.78.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.78.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.78.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.78.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.78.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-Searcher%3C'h%3E"class="impl"><aclass="src rightside"href="../../../src/regex_automata/util/iter.rs.html#146">source</a><ahref="#impl-Debug-for-Searcher%3C'h%3E"class="anchor">§</a><h3class="code-header">impl<'h><aclass="trait"href="https://doc.rust-lang.org/1.78.0/core/fmt/trait.Debug.html"title="trait core::fmt::Debug">Debug</a> for <aclass="struct"href="struct.Searcher.html"title="struct regex_automata::util::iter::Searcher">Searcher</a><'h></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/iter.rs.html#146">source</a><ahref="#method.fmt"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.78.0/core/fmt/trait.Debug.html#tymethod.fmt"class="fn">fmt</a>(&self, f: &mut <aclass="struct"href="https://doc.rust-lang.org/1.78.0/core/fmt/struct.Formatter.html"title="struct core::fmt::Formatter">Formatter</a><'_>) -><aclass="type"href="https://doc.rust-lang.org/1.78.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.78.0/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></div></details></div></details></div><h2id="synthetic-implementations"class="section-header">Auto Trait Implementations<ahref="#synthetic-implementations"class="anchor">§</a></h2><divid="synthetic-implementations-list"><sectionid="impl-F
T: 'static + ?<aclass="trait"href="https://doc.rust-lang.org/1.78.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.78.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.78.0/core/any/trait.Any.html#tymethod.type_id"class="fn">type_id</a>(&self) -><aclass="struct"href="https://doc.rust-lang.org/1.78.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.78.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.78.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.78.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.78.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.78.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.78.0/core/borrow/trait.Borrow.html#tymethod.borrow"class="fn">borrow</a>(&self) -><aclass="primitive"href="https://doc.rust-lang.org/1.78.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.78.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.78.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.78.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.78.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.78.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.78.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.78.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.78.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.78.0/src/core/convert/mod.rs.html#765">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.78.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.78.0/src/core/convert/mod.rs.html#768">source</a><ahref="#method.from"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.78.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.78.0/src/core/convert/mod.rs.html#748-750">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.78.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.78.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.78.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.78.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.78.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.78.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.78.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.78.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.78.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.78.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.78.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.78.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.78.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.78.0/src/core/convert/mod.rs.html#805-807">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.78.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.78.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"><ahref="#associatedtype.Error-1"class="anchor">§</a><h4class="code-header">type <ahref="https://doc.rust-lang.org/1.78.0/core/convert/trait.TryFrom.html#associatedtype.Error"class="associatedtype">Error</a> = <aclass="enum"href="https://doc.rust-lang.org/1.78.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.78.0/src/core/convert/mod.rs.html#812">source</a><ahref="#method.try_from"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.78.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.78.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.78.0/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><U>>::<aclass="associatedtype"href="https://doc.rust-lang.org/1.78.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.78.0/src/core/convert/mod.rs.html#790-792">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.78.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.78.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"><ahref="#associatedtype.Error"class="anchor">§</a><h4class="code-header">type <ahref="https://doc.rust-lang.org/1.78.0/core/convert/trait.TryInto.html#associatedtype.Error"class="associatedtype">Error</a> = <U as <aclass="trait"href="https://doc.rust-lang.org/1.78.0/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><T>>::<aclass="associatedtype"href="https://doc.rust-lang.org/1.78.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.78.0/src/core/convert/mod.rs.html#797">source</a><ahref="#method.try_into"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.78.0/core/convert/trait.TryInto.html#tymethod.try_into"class="fn">try_into</a>(self) -><aclass="enum"href="https://doc.rust-lang.org/1.78.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.78.0/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><T>>::<aclass="associatedtype"href="https://doc.rust-lang.org/1.78.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">{"TryCapturesIter<'h,F>":"<h3>Notabletraitsfor<code><aclass=\"struct\"href=\"struct.TryCapturesIter.html\"title=\"structregex_automata::util::iter::TryCapturesIter\">TryCapturesIter</a><'h,F></code></h3><pre><code><divclass=\"where\">impl<'h,F><aclass=\"trait\"href=\"https://doc.rust-lang.org/1.78.0/core/iter/traits/iterator/trait.Iterator.html\"title=\"traitcore::iter::traits::iterator::Iterator\">Iterator</a>for<aclass=\"struct\"href=\"struct.TryCapturesIter.html\"title=\"structregex_automata::util::iter::TryCapturesIter\">TryCapturesIter</a><'h,F><divclass=\"where\">where\nF:<aclass=\"trait\"href=\"https://doc.rust-lang.org/1.78.0/core/ops/function/trait.FnMut.html\"title=\"traitcore::ops::function::FnMut\">FnMut</a>(&<aclass=\"struct\"href=\"../../struct.Input.html\"title=\"structregex_automata::Input\">Input</a><'_>,&mut<aclass=\"struct\"href=\"../captures/struct.Captures.html\"title=\"structregex_automata::util::captures::Captures\">Captures</a>)-><aclass=\"enum\"href=\"https://doc.rust-lang.org/1.78.0/core/result/enum.Result.html\"title=\"enumcore::result::Result\">Result</a><<aclass=\"primitive\"href=\"https://doc.rust-lang.org/1.78.0/std/primitive.unit.html\">()</a>,<aclass=\"struct\"href=\"../../struct.MatchError.html\"title=\"structregex_automata::MatchError\">MatchError</a>>,</div></div><divclass=\"where\">type<ahref=\"https://doc.rust-lang.org/1.78.0/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item\"class=\"associatedtype\">Item</a>=<aclass=\"enum\"href=\"https://doc.rust-lang.org/1.78.0/core/result/enum.Result.html\"title=\"enumcore::result::Result\">Result</a><<aclass=\"struct\"href=\"../captures/struct.Captures.html\"title=\"structregex_automata::util::captures::Captures\">Captures</a>,<aclass=\"struct\"href=\"../../struct.MatchError.html\"title=\"structregex_automata::MatchError\">MatchError</a>>;</div>","TryHalfMatchesIter<'h,F>":"<h3>Notabletraitsfor<code><aclass=\"st