<!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="A sequence of literals."><title>Seq in regex_syntax::hir::literal - 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_syntax"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_syntax/index.html">regex_syntax</a><spanclass="version">0.8.3</span></h2></div><h2class="location"><ahref="#">Seq</a></h2><divclass="sidebar-elems"><section><h3><ahref="#implementations">Methods</a></h3><ulclass="block method"><li><ahref="#method.cross_forward">cross_forward</a></li><li><ahref="#method.cross_reverse">cross_reverse</a></li><li><ahref="#method.dedup">dedup</a></li><li><ahref="#method.empty">empty</a></li><li><ahref="#method.infinite">infinite</a></li><li><ahref="#method.is_empty">is_empty</a></li><li><ahref="#method.is_exact">is_exact</a></li><li><ahref="#method.is_finite">is_finite</a></li><li><ahref="#method.is_inexact">is_inexact</a></li><li><ahref="#method.keep_first_bytes">keep_first_bytes</a></li><li><ahref="#method.keep_last_bytes">keep_last_bytes</a></li><li><ahref="#method.len">len</a></li><li><ahref="#method.literals">literals</a></li><li><ahref="#method.longest_common_prefix">longest_common_prefix</a></li><li><ahref="#method.longest_common_suffix">longest_common_suffix</a></li><li><ahref="#method.make_inexact">make_inexact</a></li><li><ahref="#method.make_infinite">make_infinite</a></li><li><ahref="#method.max_cross_len">max_cross_len</a></li><li><ahref="#method.max_literal_len">max_literal_len</a></li><li><ahref="#method.max_union_len">max_union_len</a></li><li><ahref="#method.min_literal_len">min_literal_len</a></li><li><ahref="#method.minimize_by_preference">minimize_by_preference</a></li><li><ahref="#method.new">new</a></li><li><ahref="#method.optimize_for_prefix_by_preference">optimize_for_prefix_by_preference</a></li><li><ahref="#method.optimize_for_suffix_by_preference">optimize_for_suffix_b
<main><divclass="width-limiter"><navclass="sub"><formclass="search-form"><span></span><divid="sidebar-button"tabindex="-1"><ahref="../../../regex_syntax/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_syntax</a>::<wbr><ahref="../index.html">hir</a>::<wbr><ahref="index.html">literal</a>::<wbr><aclass="struct"href="#">Seq</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_syntax/hir/literal.rs.html#733-745">source</a> · <buttonid="toggle-all-docs"title="collapse all docs">[<span>−</span>]</button></span></div><preclass="rust item-decl"><code>pub struct Seq { <spanclass="comment">/* private fields */</span> }</code></pre><detailsclass="toggle top-doc"open><summaryclass="hideme"><span>Expand description</span></summary><divclass="docblock"><p>A sequence of literals.</p>
<p>A <code>Seq</code> is very much like a set in that it represents a union of its
members. That is, it corresponds to a set of literals where at least one
must match in order for a particular <ahref="../struct.Hir.html"title="struct regex_syntax::hir::Hir"><code>Hir</code></a> expression to match. (Whether
this corresponds to the entire <code>Hir</code> expression, a prefix of it or a suffix
of it depends on how the <code>Seq</code> was extracted from the <code>Hir</code>.)</p>
<p>It is also unlike a set in that multiple identical literals may appear,
and that the order of the literals in the <code>Seq</code> matters. For example, if
the sequence is <code>[sam, samwise]</code> and leftmost-first matching is used, then
<code>samwise</code> can never match and the sequence is equivalent to <code>[sam]</code>.</p>
<p>A <code>Seq</code> has a few different logical states to consider:</p>
<ul>
<li>The sequence can represent “any” literal. When this happens, the set does
not have a finite size. The purpose of this state is to inhibit callers
from making assumptions about what literals are required in order to match
a particular <ahref="../struct.Hir.html"title="struct regex_syntax::hir::Hir"><code>Hir</code></a> expression. Generally speaking, when a set is in this
state, literal optimizations are inhibited. A good example of a regex that
will cause this sort of set to appear is <code>[A-Za-z]</code>. The character class
is just too big (and also too narrow) to be usefully expanded into 52
different literals. (Note that the decision for when a seq should become
infinite is determined by the caller. A seq itself has no hard-coded
limits.)</li>
<li>The sequence can be empty, in which case, it is an affirmative statement
that there are no literals that can match the corresponding <code>Hir</code>.
Consequently, the <code>Hir</code> never matches any input. For example, <code>[a&&b]</code>.</li>
<li>The sequence can be non-empty, in which case, at least one of the
literals must match in order for the corresponding <code>Hir</code> to match.</li>
<p>An empty sequence matches zero literals, and thus corresponds to a
regex that itself can never match.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.infinite"class="method"><aclass="src rightside"href="../../../src/regex_syntax/hir/literal.rs.html#776-778">source</a><h4class="code-header">pub fn <ahref="#method.infinite"class="fn">infinite</a>() -><aclass="struct"href="struct.Seq.html"title="struct regex_syntax::hir::literal::Seq">Seq</a></h4></section></summary><divclass="docblock"><p>Returns a sequence of literals without a finite size and may contain
any literal.</p>
<p>A sequence without finite size does not reveal anything about the
characteristics of the literals in its set. There are no fixed prefixes
or suffixes, nor are lower or upper bounds on the length of the literals
in the set known.</p>
<p>This is useful to represent constructs in a regex that are “too big”
to useful represent as a sequence of literals. For example, <code>[A-Za-z]</code>.
When sequences get too big, they lose their discriminating nature and
are more likely to produce false positives, which in turn makes them
less likely to speed up searches.</p>
<p>More pragmatically, for many regexes, enumerating all possible literals
is itself not possible or might otherwise use too many resources. So
constraining the size of sets during extraction is a practical trade
off to make.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.singleton"class="method"><aclass="src rightside"href="../../../src/regex_syntax/hir/literal.rs.html#782-784">source</a><h4class="code-header">pub fn <ahref="#method.singleton"class="fn">singleton</a>(lit: <aclass="struct"href="struct.Literal.html"title="struct regex_syntax::hir::literal::Literal">Literal</a>) -><aclass="struct"href="struct.Seq.html"title="struct regex_syntax::hir::literal::Seq">Seq</a></h4></section></summary><divclass="docblock"><p>Returns a sequence containing a single literal.</p>
B: <aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/convert/trait.AsRef.html"title="trait core::convert::AsRef">AsRef</a><[<aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.u8.html">u8</a>]>,</div></h4></section></summary><divclass="docblock"><p>Returns a sequence of exact literals from the given byte strings.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.literals"class="method"><aclass="src rightside"href="../../../src/regex_syntax/hir/literal.rs.html#802-804">source</a><h4class="code-header">pub fn <ahref="#method.literals"class="fn">literals</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="struct"href="struct.Literal.html"title="struct regex_syntax::hir::literal::Literal">Literal</a>]></h4></section></summary><divclass="docblock"><p>If this is a finite sequence, return its members as a slice of
<p>The slice returned may be empty, in which case, there are no literals
that can match this sequence.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.push"class="method"><aclass="src rightside"href="../../../src/regex_syntax/hir/literal.rs.html#817-826">source</a><h4class="code-header">pub fn <ahref="#method.push"class="fn">push</a>(&mut self, lit: <aclass="struct"href="struct.Literal.html"title="struct regex_syntax::hir::literal::Literal">Literal</a>)</h4></section></summary><divclass="docblock"><p>Push a literal to the end of this sequence.</p>
<p>If this sequence is not finite, then this is a no-op.</p>
<p>Similarly, if the most recently added item of this sequence is
equivalent to the literal given, then it is not added. This reflects
a <code>Seq</code>’s “set like” behavior, and represents a practical trade off.
Namely, there is never any need to have two adjacent and equivalent
literals in the same sequence, <em>and</em> it is easy to detect in some
cases.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.make_inexact"class="method"><aclass="src rightside"href="../../../src/regex_syntax/hir/literal.rs.html#832-840">source</a><h4class="code-header">pub fn <ahref="#method.make_inexact"class="fn">make_inexact</a>(&mut self)</h4></section></summary><divclass="docblock"><p>Make all of the literals in this sequence inexact.</p>
<p>This is a no-op if this sequence is not finite.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.make_infinite"class="method"><aclass="src rightside"href="../../../src/regex_syntax/hir/literal.rs.html#846-848">source</a><h4class="code-header">pub fn <ahref="#method.make_infinite"class="fn">make_infinite</a>(&mut self)</h4></section></summary><divclass="docblock"><p>Converts this sequence to an infinite sequence.</p>
<p>This is a no-op if the sequence is already infinite.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.cross_forward"class="method"><aclass="src rightside"href="../../../src/regex_syntax/hir/literal.rs.html#959-984">source</a><h4class="code-header">pub fn <ahref="#method.cross_forward"class="fn">cross_forward</a>(&mut self, other: &mut <aclass="struct"href="struct.Seq.html"title="struct regex_syntax::hir::literal::Seq">Seq</a>)</h4></section></summary><divclass="docblock"><p>Modify this sequence to contain the cross product between it and the
sequence given.</p>
<p>The cross product only considers literals in this sequence that are
exact. That is, inexact literals are not extended.</p>
<p>The literals are always drained from <code>other</code>, even if none are used.
This permits callers to reuse the sequence allocation elsewhere.</p>
<p>If this sequence is infinite, then this is a no-op, regardless of what
<code>other</code> contains (and in this case, the literals are still drained from
<code>other</code>). If <code>other</code> is infinite and this sequence is finite, then this
is a no-op, unless this sequence contains a zero-length literal. In
which case, the infiniteness of <code>other</code> infects this sequence, and this
sequence is itself made infinite.</p>
<p>Like <ahref="struct.Seq.html#method.union"title="method regex_syntax::hir::literal::Seq::union"><code>Seq::union</code></a>, this may attempt to deduplicate literals. See
<ahref="struct.Seq.html#method.dedup"title="method regex_syntax::hir::literal::Seq::dedup"><code>Seq::dedup</code></a> for how deduplication deals with exact and inexact
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.cross_reverse"class="method"><aclass="src rightside"href="../../../src/regex_syntax/hir/literal.rs.html#1098-1134">source</a><h4class="code-header">pub fn <ahref="#method.cross_reverse"class="fn">cross_reverse</a>(&mut self, other: &mut <aclass="struct"href="struct.Seq.html"title="struct regex_syntax::hir::literal::Seq">Seq</a>)</h4></section></summary><divclass="docblock"><p>Modify this sequence to contain the cross product between it and
the sequence given, where the sequences are treated as suffixes
instead of prefixes. Namely, the sequence <code>other</code> is <em>prepended</em>
to <code>self</code> (as opposed to <code>other</code> being <em>appended</em> to <code>self</code> in
<p>The cross product only considers literals in this sequence that are
exact. That is, inexact literals are not extended.</p>
<p>The literals are always drained from <code>other</code>, even if none are used.
This permits callers to reuse the sequence allocation elsewhere.</p>
<p>If this sequence is infinite, then this is a no-op, regardless of what
<code>other</code> contains (and in this case, the literals are still drained from
<code>other</code>). If <code>other</code> is infinite and this sequence is finite, then this
is a no-op, unless this sequence contains a zero-length literal. In
which case, the infiniteness of <code>other</code> infects this sequence, and this
sequence is itself made infinite.</p>
<p>Like <ahref="struct.Seq.html#method.union"title="method regex_syntax::hir::literal::Seq::union"><code>Seq::union</code></a>, this may attempt to deduplicate literals. See
<ahref="struct.Seq.html#method.dedup"title="method regex_syntax::hir::literal::Seq::dedup"><code>Seq::dedup</code></a> for how deduplication deals with exact and inexact
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.union_into_empty"class="method"><aclass="src rightside"href="../../../src/regex_syntax/hir/literal.rs.html#1287-1314">source</a><h4class="code-header">pub fn <ahref="#method.union_into_empty"class="fn">union_into_empty</a>(&mut self, other: &mut <aclass="struct"href="struct.Seq.html"title="struct regex_syntax::hir::literal::Seq">Seq</a>)</h4></section></summary><divclass="docblock"><p>Unions the <code>other</code> sequence into this one by splice the <code>other</code>
sequence at the position of the first zero-length literal.</p>
<p>This is useful for preserving preference order semantics when combining
two literal sequences. For example, in the regex <code>(a||f)+foo</code>, the
correct preference order prefix sequence is <code>[a, foo, f]</code>.</p>
<p>The literals are always drained out of the given <code>other</code> sequence,
even if they are being unioned into an infinite sequence. This permits
the caller to reuse the <code>other</code> sequence in another context. Note that
the literals are drained even if no union is performed as well, i.e.,
when this sequence does not contain a zero-length literal.</p>
<p>Some literal deduping may be performed. If any deduping happens,
any leftmost-first or “preference” order match semantics will be
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.sort"class="method"><aclass="src rightside"href="../../../src/regex_syntax/hir/literal.rs.html#1378-1382">source</a><h4class="code-header">pub fn <ahref="#method.sort"class="fn">sort</a>(&mut self)</h4></section></summary><divclass="docblock"><p>Sorts this sequence of literals lexicographically.</p>
<p>Note that if, before sorting, if a literal that is a prefix of another
literal appears after it, then after sorting, the sequence will not
represent the same preference order match semantics. For example,
sorting the sequence <code>[samwise, sam]</code> yields the sequence <code>[sam, samwise]</code>. Under preference order semantics, the latter sequence will
never match <code>samwise</code> where as the first sequence can.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.reverse_literals"class="method"><aclass="src rightside"href="../../../src/regex_syntax/hir/literal.rs.html#1400-1406">source</a><h4class="code-header">pub fn <ahref="#method.reverse_literals"class="fn">reverse_literals</a>(&mut self)</h4></section></summary><divclass="docblock"><p>Reverses all of the literals in this sequence.</p>
<p>The order of the sequence itself is preserved.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.minimize_by_preference"class="method"><aclass="src rightside"href="../../../src/regex_syntax/hir/literal.rs.html#1463-1467">source</a><h4class="code-header">pub fn <ahref="#method.minimize_by_preference"class="fn">minimize_by_preference</a>(&mut self)</h4></section></summary><divclass="docblock"><p>Shrinks this seq to its minimal size while respecting the preference
order of its literals.</p>
<p>While this routine will remove duplicate literals from this seq, it
will also remove literals that can never match in a leftmost-first or
“preference order” search. Similar to <ahref="struct.Seq.html#method.dedup"title="method regex_syntax::hir::literal::Seq::dedup"><code>Seq::dedup</code></a>, if a literal is
deduped, then the one that remains is made inexact.</p>
<p>This is a no-op on seqs that are empty or not finite.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.keep_first_bytes"class="method"><aclass="src rightside"href="../../../src/regex_syntax/hir/literal.rs.html#1489-1495">source</a><h4class="code-header">pub fn <ahref="#method.keep_first_bytes"class="fn">keep_first_bytes</a>(&mut self, len: <aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.usize.html">usize</a>)</h4></section></summary><divclass="docblock"><p>Trims all literals in this seq such that only the first <code>len</code> bytes
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.keep_last_bytes"class="method"><aclass="src rightside"href="../../../src/regex_syntax/hir/literal.rs.html#1517-1523">source</a><h4class="code-header">pub fn <ahref="#method.keep_last_bytes"class="fn">keep_last_bytes</a>(&mut self, len: <aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.usize.html">usize</a>)</h4></section></summary><divclass="docblock"><p>Trims all literals in this seq such that only the last <code>len</code> bytes
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.is_finite"class="method"><aclass="src rightside"href="../../../src/regex_syntax/hir/literal.rs.html#1530-1532">source</a><h4class="code-header">pub fn <ahref="#method.is_finite"class="fn">is_finite</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 true if this sequence is finite.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.is_empty"class="method"><aclass="src rightside"href="../../../src/regex_syntax/hir/literal.rs.html#1539-1541">source</a><h4class="code-header">pub fn <ahref="#method.is_empty"class="fn">is_empty</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 true if and only if this sequence is finite and empty.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.len"class="method"><aclass="src rightside"href="../../../src/regex_syntax/hir/literal.rs.html#1546-1548">source</a><h4class="code-header">pub fn <ahref="#method.len"class="fn">len</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>Returns the number of literals in this sequence if the sequence is
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.is_exact"class="method"><aclass="src rightside"href="../../../src/regex_syntax/hir/literal.rs.html#1554-1556">source</a><h4class="code-header">pub fn <ahref="#method.is_exact"class="fn">is_exact</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 true if and only if all literals in this sequence are exact.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.is_inexact"class="method"><aclass="src rightside"href="../../../src/regex_syntax/hir/literal.rs.html#1562-1564">source</a><h4class="code-header">pub fn <ahref="#method.is_inexact"class="fn">is_inexact</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 true if and only if all literals in this sequence are inexact.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.max_union_len"class="method"><aclass="src rightside"href="../../../src/regex_syntax/hir/literal.rs.html#1570-1574">source</a><h4class="code-header">pub fn <ahref="#method.max_union_len"class="fn">max_union_len</a>(&self, other: &<aclass="struct"href="struct.Seq.html"title="struct regex_syntax::hir::literal::Seq">Seq</a>) -><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 maximum length of the sequence that would result from
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.max_cross_len"class="method"><aclass="src rightside"href="../../../src/regex_syntax/hir/literal.rs.html#1580-1584">source</a><h4class="code-header">pub fn <ahref="#method.max_cross_len"class="fn">max_cross_len</a>(&self, other: &<aclass="struct"href="struct.Seq.html"title="struct regex_syntax::hir::literal::Seq">Seq</a>) -><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 maximum length of the sequence that would result from the
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.min_literal_len"class="method"><aclass="src rightside"href="../../../src/regex_syntax/hir/literal.rs.html#1590-1592">source</a><h4class="code-header">pub fn <ahref="#method.min_literal_len"class="fn">min_literal_len</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>Returns the length of the shortest literal in this sequence.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.max_literal_len"class="method"><aclass="src rightside"href="../../../src/regex_syntax/hir/literal.rs.html#1598-1600">source</a><h4class="code-header">pub fn <ahref="#method.max_literal_len"class="fn">max_literal_len</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>Returns the length of the longest literal in this sequence.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.longest_common_prefix"class="method"><aclass="src rightside"href="../../../src/regex_syntax/hir/literal.rs.html#1629-1653">source</a><h4class="code-header">pub fn <ahref="#method.longest_common_prefix"class="fn">longest_common_prefix</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.u8.html">u8</a>]></h4></section></summary><divclass="docblock"><p>Returns the longest common prefix from this seq.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.longest_common_suffix"class="method"><aclass="src rightside"href="../../../src/regex_syntax/hir/literal.rs.html#1682-1707">source</a><h4class="code-header">pub fn <ahref="#method.longest_common_suffix"class="fn">longest_common_suffix</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.u8.html">u8</a>]></h4></section></summary><divclass="docblock"><p>Returns the longest common suffix from this seq.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.optimize_for_prefix_by_preference"class="method"><aclass="src rightside"href="../../../src/regex_syntax/hir/literal.rs.html#1819-1821">source</a><h4class="code-header">pub fn <ahref="#method.optimize_for_prefix_by_preference"class="fn">optimize_for_prefix_by_preference</a>(&mut self)</h4></section></summary><divclass="docblock"><p>Optimizes this seq while treating its literals as prefixes and
respecting the preference order of its literals.</p>
<p>The specific way “optimization” works is meant to be an implementation
detail, as it essentially represents a set of heuristics. The goal
that optimization tries to accomplish is to make the literals in this
set reflect inputs that will result in a more effective prefilter.
Principally by reducing the false positive rate of candidates found by
the literals in this sequence. That is, when a match of a literal is
found, we would like it to be a strong predictor of the overall match
of the regex. If it isn’t, then much time will be spent starting and
stopping the prefilter search and attempting to confirm the match only
to have it fail.</p>
<p>Some of those heuristics might be:</p>
<ul>
<li>Identifying a common prefix from a larger sequence of literals, and
shrinking the sequence down to that single common prefix.</li>
<li>Rejecting the sequence entirely if it is believed to result in very
high false positive rate. When this happens, the sequence is made
infinite.</li>
<li>Shrinking the sequence to a smaller number of literals representing
prefixes, but not shrinking it so much as to make literals too short.
(A sequence with very short literals, of 1 or 2 bytes, will typically
result in a higher false positive rate.)</li>
</ul>
<p>Optimization should only be run once extraction is complete. Namely,
optimization may make assumptions that do not compose with other
operations in the middle of extraction. For example, optimization will
reduce <code>[E(sam), E(samwise)]</code> to <code>[E(sam)]</code>, but such a transformation
is only valid if no other extraction will occur. If other extraction
may occur, then the correct transformation would be to <code>[I(sam)]</code>.</p>
<p>The <ahref="struct.Seq.html#method.optimize_for_suffix_by_preference"title="method regex_syntax::hir::literal::Seq::optimize_for_suffix_by_preference"><code>Seq::optimize_for_suffix_by_preference</code></a> does the same thing, but
<h5id="example-optimization-may-make-the-sequence-infinite"><aclass="doc-anchor"href="#example-optimization-may-make-the-sequence-infinite">§</a>Example: optimization may make the sequence infinite</h5>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.optimize_for_suffix_by_preference"class="method"><aclass="src rightside"href="../../../src/regex_syntax/hir/literal.rs.html#1831-1833">source</a><h4class="code-header">pub fn <ahref="#method.optimize_for_suffix_by_preference"class="fn">optimize_for_suffix_by_preference</a>(&mut self)</h4></section></summary><divclass="docblock"><p>Optimizes this seq while treating its literals as suffixes and
respecting the preference order of its literals.</p>
<p>Optimization should only be run once extraction is complete.</p>
<p>The <ahref="struct.Seq.html#method.optimize_for_prefix_by_preference"title="method regex_syntax::hir::literal::Seq::optimize_for_prefix_by_preference"><code>Seq::optimize_for_prefix_by_preference</code></a> does the same thing, but
for prefixes. See its documentation for more explanation.</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-Seq"class="impl"><aclass="src rightside"href="../../../src/regex_syntax/hir/literal.rs.html#732">source</a><ahref="#impl-Clone-for-Seq"class="anchor">§</a><h3class="code-header">impl <aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/clone/trait.Clone.html"title="trait core::clone::Clone">Clone</a> for <aclass="struct"href="struct.Seq.html"title="struct regex_syntax::hir::literal::Seq">Seq</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_syntax/hir/literal.rs.html#732">source</a><ahref="#method.clone"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.77.2/core/clone/trait.Clone.html#tymethod.clone"class="fn">clone</a>(&self) -><aclass="struct"href="struct.Seq.html"title="struct regex_syntax::hir::literal::Seq">Seq</a></h4></section></summary><divclass='docblock'>Returns a copy of the value. <ahref="https://doc.rust-lang.org/1.77.2/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.77.2/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.77.2/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.77.2/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.77.2/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-Seq"class="impl"><aclass="src rightside"href="../../../src/regex_syntax/hir/literal.rs.html#2013-2022">source</a><ahref="#impl-Debug-for-Seq"class="anchor">§</a><h3class="code-header">impl <aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/fmt/trait.Debug.html"title="trait core::fmt::Debug">Debug</a> for <aclass="struct"href="struct.Seq.html"title="struct regex_syntax::hir::literal::Seq">Seq</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_syntax/hir/literal.rs.html#2014-2021">source</a><ahref="#method.fmt"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.77.2/core/fmt/trait.Debug.html#tymethod.fmt"class="fn">fmt</a>(&self, f: &mut <aclass="struct"href="https://doc.rust-lang.org/1.77.2/core/fmt/struct.Formatter.html"title="struct core::fmt::Formatter">Formatter</a><'_>) -><aclass="type"href="https://doc.rust-lang.org/1.77.2/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.77.2/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></div></details></div></details><detailsclass="toggle implementors-toggle"open><summary><sectionid="impl-FromIterator%3CLiteral%3E-for-Seq"class="impl"><aclass="src rightside"href="../../../src/regex_syntax/hir/literal.rs.html#2024-2032">source</a><ahref="#impl-FromIterator%3CLiteral%3E-for-Seq"class="anchor">§</a><h3class="code-header">impl <aclass="trait"href="htt
by <code>==</code>.</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.ne"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.77.2/src/core/cmp.rs.html#242">source</a></span><ahref="#method.ne"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.77.2/core/cmp/trait.PartialEq.html#method.ne"class="fn">ne</a>(&self, other: <aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.reference.html">&Rhs</a>) -><aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.bool.html">bool</a></h4></section></summary><divclass='docblock'>This method tests for <code>!=</code>. The default implementation is almost always
sufficient, and should not be overridden without very good reason.</div></details></div></details><sectionid="impl-Eq-for-Seq"class="impl"><aclass="src rightside"href="../../../src/regex_syntax/hir/literal.rs.html#732">source</a><ahref="#impl-Eq-for-Seq"class="anchor">§</a><h3class="code-header">impl <aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/cmp/trait.Eq.html"title="trait core::cmp::Eq">Eq</a> for <aclass="struct"href="struct.Seq.html"title="struct regex_syntax::hir::literal::Seq">Seq</a></h3></section><sectionid="impl-StructuralPartialEq-for-Seq"class="impl"><aclass="src rightside"href="../../../src/regex_syntax/hir/literal.rs.html#732">source</a><ahref="#impl-StructuralPartialEq-for-Seq"class="anchor">§</a><h3class="code-header">impl <aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/marker/trait.StructuralPartialEq.html"title="trait core::marker::StructuralPartialEq">StructuralPartialEq</a> for <aclass="struct"href="struct.Seq.html"title="struct regex_syntax::hir::literal::Seq">Seq</a></h3></section></div><h2id="synthetic-implementations"class="section-header">Auto Trait Implementations<ahref="#synthetic-implementations"class="anchor">§</a></h2><divid="synthetic-implementations-list"><sectionid="impl-RefUnwindSafe-for-Seq"class="impl"><ahref="#impl-RefUnwindSafe-for-Seq"class="anchor">§</a><h3class="code-header">impl <aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/panic/unwind_safe/trait.RefUnwindSafe.html"title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a> for <aclass="struct"href="struct.Seq.html"title="struct regex_syntax::hir::literal::Seq">Seq</a></h3></section><sectionid="impl-Send-for-Seq"class="impl"><ahref="#impl-Send-for-Seq"class="anchor">§</a><h3class="code-header">impl <aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/marker/trait.Send.html"title="trait core::marker::Send">Send</a> for <aclass="struct"href="struct.Seq.html"title="struct regex_syntax::hir::literal::Seq">Seq</a></h3></section><sectionid="impl-Sync-for-Seq"class="impl"><ahref="#impl-Sync-for-Seq"class="anchor">§</a><h3class="code-header">impl <aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/marker/trait.Sync.html"title="trait core::marker::Sync">Sync</a> for <aclass="struct"href="struct.Seq.html"title="struct regex_syntax::hir::literal::Seq">Seq</a></h3></section><sectionid="impl-Unpin-for-Seq"class="impl"><ahref="#impl-Unpin-for-Seq"class="anchor">§</a><h3class="code-header">impl <aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/marker/trait.Unpin.html"title="trait core::marker::Unpin">Unpin</a> for <aclass="struct"href="struct.Seq.html"title="struct regex_syntax::hir::literal::Seq">Seq</a></h3></section><sectionid="impl-UnwindSafe-for-Seq"class="impl"><ahref="#impl-UnwindSafe-for-Seq"class="anchor">§</a><h3class="code-header">impl <aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/panic/unwind_safe/trait.UnwindSafe.html"title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a> for <aclass="struct"href="struct.Seq.html"title="struct regex_syntax::hir::literal::Seq">Seq</a></h3></section></div><h2id="blanket-implementations"class="section-header">Blanket Implementations<ahref="#blanket-implementations"class="anchor">§</a></h2><divid="blanket-implementations-list"><detailsclass="toggle implementors-toggle"><summary><sectionid="impl-Any-for-T"class="impl"><aclass="src rightside"href="https://doc.rust-lang.org/1.77.2/src/core/any.rs.html#140">source</a><ahref="#impl-Any-for-T"class="anchor">§</a><h3class="code-header">impl<T><aclass="trait"href="https://doc.rust-lang.org/1.77.2/core/any/trait.Any.html"title="trait core::any::Any">Any</a> for T<divclass="where">where
T: 'static + ?<aclass="trait"href="https://doc.rust-lang.org/1.77.2/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.77.2/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.77.2/core/any/trait.Any.html#tymethod.type_id"class="fn">type_id</a>(&self) -><aclass="struct"href="https://doc.rust-lang.org/1.77.2/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.77.2/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.77.2/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.77.2/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.77.2/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.77.2/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.77.2/core/borrow/trait.Borrow.html#tymethod.borrow"class="fn">borrow</a>(&self) -><aclass="primitive"href="https://doc.rust-lang.org/1.77.2/std/primitive.reference.html">&T</a></h4></section></summary><divclass='docblock'>Immutably borrows from an owned value. <ahref="https://doc.rust-lang.org/1.77.2/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.77.2/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.77.2/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.77.2/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.77.2/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.77.2/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut"class="fn">borrow_mut</a>(&mut self) -><aclass="primitive"href="https://doc.rust-lang.org/1.77.2/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.77.2/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.77.2/src/core/convert/mod.rs.html#764">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.77.2/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.77.2/src/core/convert/mod.rs.html#767">source</a><ahref="#method.from"class="anchor">§</a><h4class="code-header">fn <ahref="https://doc.rust-lang.org/1.77.2/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.77.2/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.77.2/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.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>