<!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="The configuration used for a Thompson NFA compiler."><title>Config in regex_automata::nfa::thompson - 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.2 (25ef9e3d8 2024-04-09)"data-channel="1.77.2"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="#">Config</a></h2><divclass="sidebar-elems"><section><h3><ahref="#implementations">Methods</a></h3><ulclass="block method"><li><ahref="#method.captures">captures</a></li><li><ahref="#method.get_captures">get_captures</a></li><li><ahref="#method.get_look_matcher">get_look_matcher</a></li><li><ahref="#method.get_nfa_size_limit">get_nfa_size_limit</a></li><li><ahref="#method.get_reverse">get_reverse</a></li><li><ahref="#method.get_shrink">get_shrink</a></li><li><ahref="#method.get_utf8">get_utf8</a></li><li><ahref="#method.get_which_captures">get_which_captures</a></li><li><ahref="#method.look_matcher">look_matcher</a></li><li><ahref="#method.new">new</a></li><li><ahref="#method.nfa_size_limit">nfa_size_limit</a></li><li><ahref="#method.reverse">reverse</a></li><li><ahref="#method.shrink">shrink</a></li><li><ahref="#method.utf8">utf8</a></li><li><ahref="#method.which_captures">which_captures</a></li></ul><h3><ahref="#trait-implementations">Trait Implementations</a></h3><ulclass="block trait-implementation"><li><ahref="#impl-Clone-for-Config">Clone</a></li><li><ahref="#impl-Debug-for-Config">Debug</a></li><li><ahref="#impl-Default-for-Config">Default</a></li></ul><h3><ahref="#synthetic-implementations">Auto Trait Implementations</a></h3><ulclass="block synthetic-implementation"><li><ahref="#impl-RefUnwindSafe-for-Config">RefUnwindSafe</a></li><li><ahref="#impl-Send-for-Config">Send</a></li><li><ahref="#impl-Sync-for-Config">Sync</a></li><li><ahref="#impl-Unpin-for-Config">Unpin</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">nfa</a>::<wbr><ahref="index.html">thompson</a>::<wbr><aclass="struct"href="#">Config</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/nfa/thompson/compiler.rs.html#28-37">source</a> · <buttonid="toggle-all-docs"title="collapse all docs">[<span>−</span>]</button></span></div><preclass="rust item-decl"><code>pub struct Config { <spanclass="comment">/* private fields */</span> }</code></pre><detailsclass="toggle top-doc"open><summaryclass="hideme"><span>Expand description</span></summary><divclass="docblock"><p>The configuration used for a Thompson NFA compiler.</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-Config"class="impl"><aclass="src rightside"href="../../../src/regex_automata/nfa/thompson/compiler.rs.html#39-537">source</a><ahref="#impl-Config"class="anchor">§</a><h3class="code-header">impl <aclass="struct"href="struct.Config.html"title="struct regex_automata::nfa::thompson::Config">Config</a></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.new"class="method"><aclass="src rightside"href="../../../src/regex_automata/nfa/thompson/compiler.rs.html#41-43">source</a><h4class="code-header">pub fn <ahref="#method.new"class="fn">new</a>() -><aclass="struct"href="struct.Config.html"title="struct regex_automata::nfa::thompson::Config">Config</a></h4></section></summary><divclass="docblock"><p>Return a new default Thompson NFA compiler configuration.</p>
<p>A regex engine is said to be in UTF-8 mode when it guarantees that
all matches returned by it have spans consisting of only valid UTF-8.
That is, it is impossible for a match span to be returned that
contains any invalid UTF-8.</p>
<p>UTF-8 mode generally consists of two things:</p>
<ol>
<li>Whether the NFA’s states are constructed such that all paths to a
match state that consume at least one byte always correspond to valid
UTF-8.</li>
<li>Whether all paths to a match state that do <em>not</em> consume any bytes
should always correspond to valid UTF-8 boundaries.</li>
</ol>
<p>(1) is a guarantee made by whoever constructs the NFA.
If you’re parsing a regex from its concrete syntax, then
<ahref="../../util/syntax/struct.Config.html#method.utf8"title="method regex_automata::util::syntax::Config::utf8"><code>syntax::Config::utf8</code></a> can make
this guarantee for you. It does it by returning an error if the regex
pattern could every report a non-empty match span that contains invalid
UTF-8. So long as <code>syntax::Config::utf8</code> mode is enabled and your regex
successfully parses, then you’re guaranteed that the corresponding NFA
will only ever report non-empty match spans containing valid UTF-8.</p>
<p>(2) is a trickier guarantee because it cannot be enforced by the NFA
state graph itself. Consider, for example, the regex <code>a*</code>. It matches
the empty strings in <code>☃</code> at positions <code>0</code>, <code>1</code>, <code>2</code> and <code>3</code>, where
positions <code>1</code> and <code>2</code> occur within the UTF-8 encoding of a codepoint,
and thus correspond to invalid UTF-8 boundaries. Therefore, this
guarantee must be made at a higher level than the NFA state graph
itself. This crate deals with this case in each regex engine. Namely,
when a zero-width match that splits a codepoint is found and UTF-8
mode enabled, then it is ignored and the engine moves on looking for
the next match.</p>
<p>Thus, UTF-8 mode is both a promise that the NFA built only reports
non-empty matches that are valid UTF-8, and an <em>instruction</em> to regex
engines that empty matches that split codepoints should be banned.</p>
<p>Because UTF-8 mode is fundamentally about avoiding invalid UTF-8 spans,
it only makes sense to enable this option when you <em>know</em> your haystack
is valid UTF-8. (For example, a <code>&str</code>.) Enabling UTF-8 mode and
searching a haystack that contains invalid UTF-8 leads to <strong>unspecified
behavior</strong>.</p>
<p>Therefore, it may make sense to enable <code>syntax::Config::utf8</code> while
simultaneously <em>disabling</em> this option. That would ensure all non-empty
match spans are valid UTF-8, but that empty match spans may still split
a codepoint or match at other places that aren’t valid UTF-8.</p>
<p>In general, this mode is only relevant if your regex can match the
<p>A NFA reversal is performed by reversing all of the concatenated
sub-expressions in the original pattern, recursively. (Look around
operators are also inverted.) The resulting NFA can be used to match
the pattern starting from the end of a string instead of the beginning
of a string.</p>
<p>Reversing the NFA is useful for building a reverse DFA, which is most
useful for finding the start of a match after its ending position has
been found. NFA execution engines typically do not work on reverse
NFAs. For example, currently, the Pike VM reports the starting location
of matches without a reverse NFA.</p>
<p>Currently, enabling this setting requires disabling the
<ahref="struct.Config.html#method.captures"title="method regex_automata::nfa::thompson::Config::captures"><code>captures</code></a> setting. If both are enabled, then the
compiler will return an error. It is expected that this limitation will
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.nfa_size_limit"class="method"><aclass="src rightside"href="../../../src/regex_automata/nfa/thompson/compiler.rs.html#248-251">source</a><h4class="code-header">pub fn <ahref="#method.nfa_size_limit"class="fn">nfa_size_limit</a>(self, bytes: <aclass="enum"href="https://doc.rust-lang.org/1.77.2/core/option/enum.Option.html"title="enum core::option::Option">Option</a><<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.usize.html">usize</a>>) -><aclass="struct"href="struct.Config.html"title="struct regex_automata::nfa::thompson::Config">Config</a></h4></section></summary><divclass="docblock"><p>Sets an approximate size limit on the total heap used by the NFA being
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.shrink"class="method"><aclass="src rightside"href="../../../src/regex_automata/nfa/thompson/compiler.rs.html#302-305">source</a><h4class="code-header">pub fn <ahref="#method.shrink"class="fn">shrink</a>(self, yes: <aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.bool.html">bool</a>) -><aclass="struct"href="struct.Config.html"title="struct regex_automata::nfa::thompson::Config">Config</a></h4></section></summary><divclass="docblock"><p>Apply best effort heuristics to shrink the NFA at the expense of more
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.captures"class="method"><aclass="src rightside"href="../../../src/regex_automata/nfa/thompson/compiler.rs.html#343-349">source</a><h4class="code-header">pub fn <ahref="#method.captures"class="fn">captures</a>(self, yes: <aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.bool.html">bool</a>) -><aclass="struct"href="struct.Config.html"title="struct regex_automata::nfa::thompson::Config">Config</a></h4></section><spanclass="item-info"><divclass="stab deprecated"><spanclass="emoji">👎</span><span>Deprecated since 0.3.5: use which_captures instead</span></div></span></summary><divclass="docblock"><p>Whether to include ‘Capture’ states in the NFA.</p>
<p>Currently, enabling this setting requires disabling the
<ahref="struct.Config.html#method.reverse"title="method regex_automata::nfa::thompson::Config::reverse"><code>reverse</code></a> setting. If both are enabled, then the
compiler will return an error. It is expected that this limitation will
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.which_captures"class="method"><aclass="src rightside"href="../../../src/regex_automata/nfa/thompson/compiler.rs.html#410-413">source</a><h4class="code-header">pub fn <ahref="#method.which_captures"class="fn">which_captures</a>(self, which_captures: <aclass="enum"href="enum.WhichCaptures.html"title="enum regex_automata::nfa::thompson::WhichCaptures">WhichCaptures</a>) -><aclass="struct"href="struct.Config.html"title="struct regex_automata::nfa::thompson::Config">Config</a></h4></section></summary><divclass="docblock"><p>Configures what kinds of capture groups are compiled into
<ahref="enum.State.html#variant.Capture"title="variant regex_automata::nfa::thompson::State::Capture"><code>State::Capture</code></a> states in a
Thompson NFA.</p>
<p>Currently, using any option except for <ahref="enum.WhichCaptures.html#variant.None"title="variant regex_automata::nfa::thompson::WhichCaptures::None"><code>WhichCaptures::None</code></a> requires
disabling the <ahref="struct.Config.html#method.reverse"title="method regex_automata::nfa::thompson::Config::reverse"><code>reverse</code></a> setting. If both are
enabled, then the compiler will return an error. It is expected that
this limitation will be lifted in the future.</p>
<p>This is set to <ahref="enum.WhichCaptures.html#variant.All"title="variant regex_automata::nfa::thompson::WhichCaptures::All"><code>WhichCaptures::All</code></a> by default. Callers may wish to
use <ahref="enum.WhichCaptures.html#variant.Implicit"title="variant regex_automata::nfa::thompson::WhichCaptures::Implicit"><code>WhichCaptures::Implicit</code></a> in cases where one wants avoid the
overhead of capture states for explicit groups. Usually this occurs
when one wants to use the <code>PikeVM</code> only for determining the overall
match. Otherwise, the <code>PikeVM</code> could use much more memory than is
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.look_matcher"class="method"><aclass="src rightside"href="../../../src/regex_automata/nfa/thompson/compiler.rs.html#454-457">source</a><h4class="code-header">pub fn <ahref="#method.look_matcher"class="fn">look_matcher</a>(self, m: <aclass="struct"href="../../util/look/struct.LookMatcher.html"title="struct regex_automata::util::look::LookMatcher">LookMatcher</a>) -><aclass="struct"href="struct.Config.html"title="struct regex_automata::nfa::thompson::Config">Config</a></h4></section></summary><divclass="docblock"><p>Sets the look-around matcher that should be used with this NFA.</p>
<p>A look-around matcher determines how to match look-around assertions.
In particular, some assertions are configurable. For example, the
<code>(?m:^)</code> and <code>(?m:$)</code> assertions can have their line terminator changed
from the default of <code>\n</code> to any other byte.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.get_utf8"class="method"><aclass="src rightside"href="../../../src/regex_automata/nfa/thompson/compiler.rs.html#470-472">source</a><h4class="code-header">pub fn <ahref="#method.get_utf8"class="fn">get_utf8</a>(&self) -><aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.bool.html">bool</a></h4></section></summary><divclass="docblock"><p>Returns whether this configuration has enabled UTF-8 mode.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.get_reverse"class="method"><aclass="src rightside"href="../../../src/regex_automata/nfa/thompson/compiler.rs.html#475-477">source</a><h4class="code-header">pub fn <ahref="#method.get_reverse"class="fn">get_reverse</a>(&self) -><aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.bool.html">bool</a></h4></section></summary><divclass="docblock"><p>Returns whether this configuration has enabled reverse NFA compilation.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.get_nfa_size_limit"class="method"><aclass="src rightside"href="../../../src/regex_automata/nfa/thompson/compiler.rs.html#481-483">source</a><h4class="code-header">pub fn <ahref="#method.get_nfa_size_limit"class="fn">get_nfa_size_limit</a>(&self) -><aclass="enum"href="https://doc.rust-lang.org/1.77.2/core/option/enum.Option.html"title="enum core::option::Option">Option</a><<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.usize.html">usize</a>></h4></section></summary><divclass="docblock"><p>Return the configured NFA size limit, if it exists, in the number of
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.get_captures"class="method"><aclass="src rightside"href="../../../src/regex_automata/nfa/thompson/compiler.rs.html#492-494">source</a><h4class="code-header">pub fn <ahref="#method.get_captures"class="fn">get_captures</a>(&self) -><aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.bool.html">bool</a></h4></section><spanclass="item-info"><divclass="stab deprecated"><spanclass="emoji">👎</span><span>Deprecated since 0.3.5: use get_which_captures instead</span></div></span></summary><divclass="docblock"><p>Return whether NFA compilation is configured to produce capture states.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.get_which_captures"class="method"><aclass="src rightside"href="../../../src/regex_automata/nfa/thompson/compiler.rs.html#497-499">source</a><h4class="code-header">pub fn <ahref="#method.get_which_captures"class="fn">get_which_captures</a>(&self) -><aclass="enum"href="enum.WhichCaptures.html"title="enum regex_automata::nfa::thompson::WhichCaptures">WhichCaptures</a></h4></section></summary><divclass="docblock"><p>Return what kinds of capture states will be compiled into an NFA.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.get_look_matcher"class="method"><aclass="src rightside"href="../../../src/regex_automata/nfa/thompson/compiler.rs.html#502-504">source</a><h4class="code-header">pub fn <ahref="#method.get_look_matcher"class="fn">get_look_matcher</a>(&self) -><aclass="struct"href="../../util/look/struct.LookMatcher.html"title="struct regex_automata::util::look::LookMatcher">LookMatcher</a></h4></section></summary><divclass="docblock"><p>Return the look-around matcher for this NFA.</p>
<code><ahref="https://doc.rust-lang.org/1.77.2/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.2/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.2/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.2/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.2/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.2/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.2/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.2/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.2/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.2/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.2/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.2/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.2/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.2/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.2/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.2/core/convert/trait.TryFrom.html#associatedtype.Error"class="associatedtype">Error</a> = <aclass="enum"href="https://doc.rust-lang.org/1.77.2/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.2/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.2/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.2/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.2/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><U>>::<aclass="associatedtype"href="https://doc.rust-lang.org/1.77.2/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.2/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.2/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.2/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.2/core/convert/trait.TryInto.html#associatedtype.Error"class="associatedtype">Error</a> = <U as <aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><T>>::<aclass="associatedtype"href="https://doc.rust-lang.org/1.77.2/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.2/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.2/core/convert/trait.TryInto.html#tymethod.try_into"class="fn">try_into</a>(self) -><aclass="enum"href="https://doc.rust-lang.org/1.77.2/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.2/core/convert/trait.TryFrom.html"title="trait core::convert::TryFrom">TryFrom</a><T>>::<aclass="associatedtype"href="https://doc.rust-lang.org/1.77.2/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></section></div></main></body></html>