211 lines
No EOL
17 KiB
HTML
211 lines
No EOL
17 KiB
HTML
<!DOCTYPE html>
|
||
<html lang="en">
|
||
<head>
|
||
<meta charset="utf-8">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||
<meta name="generator" content="rustdoc">
|
||
<meta name="description" content="API documentation for the Rust `ErrorKind` enum in crate `regex_syntax`.">
|
||
<meta name="keywords" content="rust, rustlang, rust-lang, ErrorKind">
|
||
|
||
<title>regex_syntax::ErrorKind - Rust</title>
|
||
|
||
<link rel="stylesheet" type="text/css" href="../rustdoc.css">
|
||
<link rel="stylesheet" type="text/css" href="../main.css">
|
||
|
||
|
||
|
||
|
||
</head>
|
||
<body class="rustdoc">
|
||
<!--[if lte IE 8]>
|
||
<div class="warning">
|
||
This old browser is unsupported and will most likely display funky
|
||
things.
|
||
</div>
|
||
<![endif]-->
|
||
|
||
|
||
|
||
<nav class="sidebar">
|
||
|
||
<p class='location'><a href='index.html'>regex_syntax</a></p><script>window.sidebarCurrent = {name: 'ErrorKind', ty: 'enum', relpath: ''};</script><script defer src="sidebar-items.js"></script>
|
||
</nav>
|
||
|
||
<nav class="sub">
|
||
<form class="search-form js-only">
|
||
<div class="search-container">
|
||
<input class="search-input" name="search"
|
||
autocomplete="off"
|
||
placeholder="Click or press ‘S’ to search, ‘?’ for more options…"
|
||
type="search">
|
||
</div>
|
||
</form>
|
||
</nav>
|
||
|
||
<section id='main' class="content enum">
|
||
<h1 class='fqn'><span class='in-band'>Enum <a href='index.html'>regex_syntax</a>::<wbr><a class='enum' href=''>ErrorKind</a></span><span class='out-of-band'><span id='render-detail'>
|
||
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
|
||
[<span class='inner'>−</span>]
|
||
</a>
|
||
</span><a id='src-2121' class='srclink' href='../src/regex_syntax/lib.rs.html#1238-1331' title='goto source code'>[src]</a></span></h1>
|
||
<pre class='rust enum'>pub enum ErrorKind {
|
||
DoubleFlagNegation,
|
||
DuplicateCaptureName(<a class='struct' href='https://doc.rust-lang.org/nightly/collections/string/struct.String.html' title='collections::string::String'>String</a>),
|
||
EmptyAlternate,
|
||
EmptyCaptureName,
|
||
EmptyFlagNegation,
|
||
EmptyGroup,
|
||
InvalidBase10(<a class='struct' href='https://doc.rust-lang.org/nightly/collections/string/struct.String.html' title='collections::string::String'>String</a>),
|
||
InvalidBase16(<a class='struct' href='https://doc.rust-lang.org/nightly/collections/string/struct.String.html' title='collections::string::String'>String</a>),
|
||
InvalidCaptureName(<a class='struct' href='https://doc.rust-lang.org/nightly/collections/string/struct.String.html' title='collections::string::String'>String</a>),
|
||
InvalidClassRange {
|
||
start: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.char.html'>char</a>,
|
||
end: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.char.html'>char</a>,
|
||
},
|
||
InvalidClassEscape(<a class='enum' href='../regex_syntax/enum.Expr.html' title='regex_syntax::Expr'>Expr</a>),
|
||
InvalidRepeatRange {
|
||
min: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u32.html'>u32</a>,
|
||
max: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u32.html'>u32</a>,
|
||
},
|
||
InvalidScalarValue(<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.u32.html'>u32</a>),
|
||
MissingBase10,
|
||
RepeaterExpectsExpr,
|
||
RepeaterUnexpectedExpr(<a class='enum' href='../regex_syntax/enum.Expr.html' title='regex_syntax::Expr'>Expr</a>),
|
||
UnclosedCaptureName(<a class='struct' href='https://doc.rust-lang.org/nightly/collections/string/struct.String.html' title='collections::string::String'>String</a>),
|
||
UnclosedHex,
|
||
UnclosedParen,
|
||
UnclosedRepeat,
|
||
UnclosedUnicodeName,
|
||
UnexpectedClassEof,
|
||
UnexpectedEscapeEof,
|
||
UnexpectedFlagEof,
|
||
UnexpectedTwoDigitHexEof,
|
||
UnopenedParen,
|
||
UnrecognizedEscape(<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.char.html'>char</a>),
|
||
UnrecognizedFlag(<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.char.html'>char</a>),
|
||
UnrecognizedUnicodeClass(<a class='struct' href='https://doc.rust-lang.org/nightly/collections/string/struct.String.html' title='collections::string::String'>String</a>),
|
||
StackExhausted,
|
||
FlagNotAllowed(<a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.char.html'>char</a>),
|
||
UnicodeNotAllowed,
|
||
// some variants omitted
|
||
}</pre><div class='docblock'><p>The specific type of parse error that can occur.</p>
|
||
</div><h2 class='variants'>Variants</h2>
|
||
<table class='variants_table'><tr><td id='variant.DoubleFlagNegation'><code>DoubleFlagNegation</code></td><td><div class='docblock'><p>A negation symbol is used twice in flag settings.
|
||
e.g., <code>(?-i-s)</code>.</p>
|
||
</div></td><td></td></tr><tr><td id='variant.DuplicateCaptureName'><code>DuplicateCaptureName</code></td><td><div class='docblock'><p>The same capture name was used more than once.
|
||
e.g., <code>(?P<a>.)(?P<a>.)</code>.</p>
|
||
</div></td><td></td></tr><tr><td id='variant.EmptyAlternate'><code>EmptyAlternate</code></td><td><div class='docblock'><p>An alternate is empty. e.g., <code>(|a)</code>.</p>
|
||
</div></td><td></td></tr><tr><td id='variant.EmptyCaptureName'><code>EmptyCaptureName</code></td><td><div class='docblock'><p>A capture group name is empty. e.g., <code>(?P<>a)</code>.</p>
|
||
</div></td><td></td></tr><tr><td id='variant.EmptyFlagNegation'><code>EmptyFlagNegation</code></td><td><div class='docblock'><p>A negation symbol was not proceded by any flags. e.g., <code>(?i-)</code>.</p>
|
||
</div></td><td></td></tr><tr><td id='variant.EmptyGroup'><code>EmptyGroup</code></td><td><div class='docblock'><p>A group is empty. e.g., <code>()</code>.</p>
|
||
</div></td><td></td></tr><tr><td id='variant.InvalidBase10'><code>InvalidBase10</code></td><td><div class='docblock'><p>An invalid number was used in a counted repetition. e.g., <code>a{b}</code>.</p>
|
||
</div></td><td></td></tr><tr><td id='variant.InvalidBase16'><code>InvalidBase16</code></td><td><div class='docblock'><p>An invalid hexadecimal number was used in an escape sequence.
|
||
e.g., <code>\xAG</code>.</p>
|
||
</div></td><td></td></tr><tr><td id='variant.InvalidCaptureName'><code>InvalidCaptureName</code></td><td><div class='docblock'><p>An invalid capture name was used. e.g., <code>(?P<0a>b)</code>.</p>
|
||
</div></td><td></td></tr><tr><td id='variant.InvalidClassRange'><code>InvalidClassRange</code></td><td><div class='docblock'><p>An invalid class range was givien. Specifically, when the start of the
|
||
range is greater than the end. e.g., <code>[z-a]</code>.</p>
|
||
</div><h3 class='fields'>Fields</h3>
|
||
|
||
<table><tr><td id='variant.InvalidClassRange.field.start'><code>start</code></td><td><div class='docblock'><p>The first character specified in the range.</p>
|
||
</div></td></tr><tr><td id='variant.InvalidClassRange.field.end'><code>end</code></td><td><div class='docblock'><p>The second character specified in the range.</p>
|
||
</div></td></tr></table></td><td></td></tr><tr><td id='variant.InvalidClassEscape'><code>InvalidClassEscape</code></td><td><div class='docblock'><p>An escape sequence was used in a character class where it is not
|
||
allowed. e.g., <code>[a-\pN]</code> or <code>[\A]</code>.</p>
|
||
</div></td><td></td></tr><tr><td id='variant.InvalidRepeatRange'><code>InvalidRepeatRange</code></td><td><div class='docblock'><p>An invalid counted repetition min/max was given. e.g., <code>a{2,1}</code>.</p>
|
||
</div><h3 class='fields'>Fields</h3>
|
||
|
||
<table><tr><td id='variant.InvalidRepeatRange.field.min'><code>min</code></td><td><div class='docblock'><p>The first number specified in the repetition.</p>
|
||
</div></td></tr><tr><td id='variant.InvalidRepeatRange.field.max'><code>max</code></td><td><div class='docblock'><p>The second number specified in the repetition.</p>
|
||
</div></td></tr></table></td><td></td></tr><tr><td id='variant.InvalidScalarValue'><code>InvalidScalarValue</code></td><td><div class='docblock'><p>An invalid Unicode scalar value was used in a long hexadecimal
|
||
sequence. e.g., <code>\x{D800}</code>.</p>
|
||
</div></td><td></td></tr><tr><td id='variant.MissingBase10'><code>MissingBase10</code></td><td><div class='docblock'><p>An empty counted repetition operator. e.g., <code>a{}</code>.</p>
|
||
</div></td><td></td></tr><tr><td id='variant.RepeaterExpectsExpr'><code>RepeaterExpectsExpr</code></td><td><div class='docblock'><p>A repetition operator was not applied to an expression. e.g., <code>*</code>.</p>
|
||
</div></td><td></td></tr><tr><td id='variant.RepeaterUnexpectedExpr'><code>RepeaterUnexpectedExpr</code></td><td><div class='docblock'><p>A repetition operator was applied to an expression that cannot be
|
||
repeated. e.g., <code>a+*</code> or <code>a|*</code>.</p>
|
||
</div></td><td></td></tr><tr><td id='variant.UnclosedCaptureName'><code>UnclosedCaptureName</code></td><td><div class='docblock'><p>A capture group name that is never closed. e.g., <code>(?P<a</code>.</p>
|
||
</div></td><td></td></tr><tr><td id='variant.UnclosedHex'><code>UnclosedHex</code></td><td><div class='docblock'><p>An unclosed hexadecimal literal. e.g., <code>\x{a</code>.</p>
|
||
</div></td><td></td></tr><tr><td id='variant.UnclosedParen'><code>UnclosedParen</code></td><td><div class='docblock'><p>An unclosed parenthesis. e.g., <code>(a</code>.</p>
|
||
</div></td><td></td></tr><tr><td id='variant.UnclosedRepeat'><code>UnclosedRepeat</code></td><td><div class='docblock'><p>An unclosed counted repetition operator. e.g., <code>a{2</code>.</p>
|
||
</div></td><td></td></tr><tr><td id='variant.UnclosedUnicodeName'><code>UnclosedUnicodeName</code></td><td><div class='docblock'><p>An unclosed named Unicode class. e.g., <code>\p{Yi</code>.</p>
|
||
</div></td><td></td></tr><tr><td id='variant.UnexpectedClassEof'><code>UnexpectedClassEof</code></td><td><div class='docblock'><p>Saw end of regex before class was closed. e.g., <code>[a</code>.</p>
|
||
</div></td><td></td></tr><tr><td id='variant.UnexpectedEscapeEof'><code>UnexpectedEscapeEof</code></td><td><div class='docblock'><p>Saw end of regex before escape sequence was closed. e.g., <code>\</code>.</p>
|
||
</div></td><td></td></tr><tr><td id='variant.UnexpectedFlagEof'><code>UnexpectedFlagEof</code></td><td><div class='docblock'><p>Saw end of regex before flags were closed. e.g., <code>(?i</code>.</p>
|
||
</div></td><td></td></tr><tr><td id='variant.UnexpectedTwoDigitHexEof'><code>UnexpectedTwoDigitHexEof</code></td><td><div class='docblock'><p>Saw end of regex before two hexadecimal digits were seen. e.g., <code>\xA</code>.</p>
|
||
</div></td><td></td></tr><tr><td id='variant.UnopenedParen'><code>UnopenedParen</code></td><td><div class='docblock'><p>Unopened parenthesis. e.g., <code>)</code>.</p>
|
||
</div></td><td></td></tr><tr><td id='variant.UnrecognizedEscape'><code>UnrecognizedEscape</code></td><td><div class='docblock'><p>Unrecognized escape sequence. e.g., <code>\q</code>.</p>
|
||
</div></td><td></td></tr><tr><td id='variant.UnrecognizedFlag'><code>UnrecognizedFlag</code></td><td><div class='docblock'><p>Unrecognized flag. e.g., <code>(?a)</code>.</p>
|
||
</div></td><td></td></tr><tr><td id='variant.UnrecognizedUnicodeClass'><code>UnrecognizedUnicodeClass</code></td><td><div class='docblock'><p>Unrecognized named Unicode class. e.g., <code>\p{Foo}</code>.</p>
|
||
</div></td><td></td></tr><tr><td id='variant.StackExhausted'><code>StackExhausted</code></td><td><div class='docblock'><p>Indicates that the regex uses too much nesting.</p>
|
||
|
||
<p>(N.B. This error exists because traversing the Expr is recursive and
|
||
an explicit heap allocated stack is not (yet?) used. Regardless, some
|
||
sort of limit must be applied to avoid unbounded memory growth.</p>
|
||
</div></td><td></td></tr><tr><td id='variant.FlagNotAllowed'><code>FlagNotAllowed</code></td><td><div class='docblock'><p>A disallowed flag was found (e.g., <code>b</code>).</p>
|
||
</div></td><td></td></tr><tr><td id='variant.UnicodeNotAllowed'><code>UnicodeNotAllowed</code></td><td><div class='docblock'><p>A Unicode class was used when the bytes (<code>b</code>) flag was enabled.</p>
|
||
</div></td><td></td></tr></table><h2 id='implementations'>Trait Implementations</h2><h3 class='impl'><code>impl <a class='trait' href='https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html' title='core::fmt::Display'>Display</a> for <a class='enum' href='../regex_syntax/enum.ErrorKind.html' title='regex_syntax::ErrorKind'>ErrorKind</a></code></h3><div class='impl-items'><h4 id='method.fmt' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class='struct' href='https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html' title='core::fmt::Formatter'>Formatter</a>) -> <a class='type' href='https://doc.rust-lang.org/nightly/core/fmt/type.Result.html' title='core::fmt::Result'>Result</a></code></h4>
|
||
</div><h3 id='derived_implementations'>Derived Implementations </h3><h3 class='impl'><code>impl <a class='trait' href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a> for <a class='enum' href='../regex_syntax/enum.ErrorKind.html' title='regex_syntax::ErrorKind'>ErrorKind</a></code></h3><div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&self, __arg_0: &<a class='enum' href='../regex_syntax/enum.ErrorKind.html' title='regex_syntax::ErrorKind'>ErrorKind</a>) -> <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></code></h4>
|
||
<h4 id='method.ne' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, __arg_0: &<a class='enum' href='../regex_syntax/enum.ErrorKind.html' title='regex_syntax::ErrorKind'>ErrorKind</a>) -> <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></code></h4>
|
||
</div><h3 class='impl'><code>impl <a class='trait' href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html' title='core::fmt::Debug'>Debug</a> for <a class='enum' href='../regex_syntax/enum.ErrorKind.html' title='regex_syntax::ErrorKind'>ErrorKind</a></code></h3><div class='impl-items'><h4 id='method.fmt-1' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, __arg_0: &mut <a class='struct' href='https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html' title='core::fmt::Formatter'>Formatter</a>) -> <a class='type' href='https://doc.rust-lang.org/nightly/core/fmt/type.Result.html' title='core::fmt::Result'>Result</a></code></h4>
|
||
</div><h3 class='impl'><code>impl <a class='trait' href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html' title='core::clone::Clone'>Clone</a> for <a class='enum' href='../regex_syntax/enum.ErrorKind.html' title='regex_syntax::ErrorKind'>ErrorKind</a></code></h3><div class='impl-items'><h4 id='method.clone' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&self) -> <a class='enum' href='../regex_syntax/enum.ErrorKind.html' title='regex_syntax::ErrorKind'>ErrorKind</a></code></h4>
|
||
<h4 id='method.clone_from' class='method'><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&mut self, source: &Self)</code><span class="since">1.0.0</span></h4>
|
||
</div></section>
|
||
<section id='search' class="content hidden"></section>
|
||
|
||
<section class="footer"></section>
|
||
|
||
<aside id="help" class="hidden">
|
||
<div>
|
||
<h1 class="hidden">Help</h1>
|
||
|
||
<div class="shortcuts">
|
||
<h2>Keyboard Shortcuts</h2>
|
||
|
||
<dl>
|
||
<dt>?</dt>
|
||
<dd>Show this help dialog</dd>
|
||
<dt>S</dt>
|
||
<dd>Focus the search field</dd>
|
||
<dt>⇤</dt>
|
||
<dd>Move up in search results</dd>
|
||
<dt>⇥</dt>
|
||
<dd>Move down in search results</dd>
|
||
<dt>⏎</dt>
|
||
<dd>Go to active search result</dd>
|
||
</dl>
|
||
</div>
|
||
|
||
<div class="infos">
|
||
<h2>Search Tricks</h2>
|
||
|
||
<p>
|
||
Prefix searches with a type followed by a colon (e.g.
|
||
<code>fn:</code>) to restrict the search to a given type.
|
||
</p>
|
||
|
||
<p>
|
||
Accepted types are: <code>fn</code>, <code>mod</code>,
|
||
<code>struct</code>, <code>enum</code>,
|
||
<code>trait</code>, <code>type</code>, <code>macro</code>,
|
||
and <code>const</code>.
|
||
</p>
|
||
|
||
<p>
|
||
Search functions by type signature (e.g.
|
||
<code>vec -> usize</code> or <code>* -> vec</code>)
|
||
</p>
|
||
</div>
|
||
</div>
|
||
</aside>
|
||
|
||
|
||
|
||
<script>
|
||
window.rootPath = "../";
|
||
window.currentCrate = "regex_syntax";
|
||
window.playgroundUrl = "";
|
||
</script>
|
||
<script src="../jquery.js"></script>
|
||
<script src="../main.js"></script>
|
||
|
||
<script defer src="../search-index.js"></script>
|
||
</body>
|
||
</html> |