diff options
author | 2015-06-29 20:16:15 +0000 | |
---|---|---|
committer | 2015-06-29 20:16:15 +0000 | |
commit | 64106c4d3d4ddba8c7bc2af75376e6d3d3d75601 (patch) | |
tree | 8c64d6e8be006486d975a651505fbbde61365cd6 /regex_syntax | |
download | irsc-gh-pages.tar.gz irsc-gh-pages.tar.xz irsc-gh-pages.zip |
Update documentationgh-pages
Diffstat (limited to 'regex_syntax')
-rw-r--r-- | regex_syntax/enum.ErrorKind.html | 190 | ||||
-rw-r--r-- | regex_syntax/enum.Expr.html | 181 | ||||
-rw-r--r-- | regex_syntax/enum.Repeater.html | 127 | ||||
-rw-r--r-- | regex_syntax/fn.quote.html | 105 | ||||
-rw-r--r-- | regex_syntax/index.html | 223 | ||||
-rw-r--r-- | regex_syntax/parser/index.html | 0 | ||||
-rw-r--r-- | regex_syntax/parser/sidebar-items.js | 1 | ||||
-rw-r--r-- | regex_syntax/sidebar-items.js | 1 | ||||
-rw-r--r-- | regex_syntax/struct.CharClass.html | 493 | ||||
-rw-r--r-- | regex_syntax/struct.ClassRange.html | 140 | ||||
-rw-r--r-- | regex_syntax/struct.Error.html | 123 | ||||
-rw-r--r-- | regex_syntax/type.Result.html | 102 |
12 files changed, 1686 insertions, 0 deletions
diff --git a/regex_syntax/enum.ErrorKind.html b/regex_syntax/enum.ErrorKind.html new file mode 100644 index 0000000..b7074a5 --- /dev/null +++ b/regex_syntax/enum.ErrorKind.html @@ -0,0 +1,190 @@ +<!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="../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]--> + + + + <section 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> + </section> + + <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-45262' class='srclink' href='../src/regex_syntax/lib.rs.html#655-738' title='goto source code'>[src]</a></span></h1> +<pre class='rust enum'>pub enum ErrorKind { + DoubleFlagNegation, + DuplicateCaptureName(<a class='struct' href='http://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='http://doc.rust-lang.org/nightly/collections/string/struct.String.html' title='collections::string::String'>String</a>), + InvalidBase16(<a class='struct' href='http://doc.rust-lang.org/nightly/collections/string/struct.String.html' title='collections::string::String'>String</a>), + InvalidCaptureName(<a class='struct' href='http://doc.rust-lang.org/nightly/collections/string/struct.String.html' title='collections::string::String'>String</a>), + InvalidClassRange { + start: <a href='http://doc.rust-lang.org/nightly/std/primitive.char.html'>char</a>, + end: <a href='http://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 href='http://doc.rust-lang.org/nightly/std/primitive.u32.html'>u32</a>, + max: <a href='http://doc.rust-lang.org/nightly/std/primitive.u32.html'>u32</a>, + }, + InvalidScalarValue(<a href='http://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='http://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 href='http://doc.rust-lang.org/nightly/std/primitive.char.html'>char</a>), + UnrecognizedFlag(<a href='http://doc.rust-lang.org/nightly/std/primitive.char.html'>char</a>), + UnrecognizedUnicodeClass(<a class='struct' href='http://doc.rust-lang.org/nightly/collections/string/struct.String.html' title='collections::string::String'>String</a>), + // 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><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></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></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></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></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></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></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></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></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></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></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></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></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></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></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></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></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></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></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></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></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></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></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></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></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></tr><tr><td id='variant.UnopenedParen'><code>UnopenedParen</code></td><td><div class='docblock'><p>Unopened parenthesis. e.g., <code>)</code>.</p> +</div></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></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></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></tr></table><h2 id='implementations'>Trait Implementations</h2><h3 class='impl'><code>impl <a class='trait' href='http://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='http://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#method.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class='struct' href='http://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html' title='core::fmt::Formatter'>Formatter</a>) -> <a class='type' href='http://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='http://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='http://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.eq' class='fnname'>eq</a>(&self, __arg_0: &<a class='enum' href='../regex_syntax/enum.ErrorKind.html' title='regex_syntax::ErrorKind'>ErrorKind</a>) -> <a href='http://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></code></h4> +<h4 id='method.ne' class='method'><code>fn <a href='http://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 href='http://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></code></h4> +</div><h3 class='impl'><code>impl <a class='trait' href='http://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' class='method'><code>fn <a href='http://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#method.fmt' class='fnname'>fmt</a>(&self, __arg_0: &mut <a class='struct' href='http://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html' title='core::fmt::Formatter'>Formatter</a>) -> <a class='type' href='http://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='http://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='http://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.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='http://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&mut self, source: &Self)</code></h4> +</div></section> + <section id='search' class="content hidden"></section> + + <section class="footer"></section> + + <div id="help" class="hidden"> + <div class="shortcuts"> + <h1>Keyboard shortcuts</h1> + <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"> + <h1>Search tricks</h1> + <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>typedef</code> (or + <code>tdef</code>). + </p> + <p> + Search functions by type signature (e.g. + <code>vec -> usize</code>) + </p> + </div> + </div> + + + + <script> + window.rootPath = "../"; + window.currentCrate = "regex_syntax"; + window.playgroundUrl = ""; + </script> + <script src="../jquery.js"></script> + <script src="../main.js"></script> + + <script async src="../search-index.js"></script> +</body> +</html>
\ No newline at end of file diff --git a/regex_syntax/enum.Expr.html b/regex_syntax/enum.Expr.html new file mode 100644 index 0000000..c461971 --- /dev/null +++ b/regex_syntax/enum.Expr.html @@ -0,0 +1,181 @@ +<!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 `Expr` enum in crate `regex_syntax`."> + <meta name="keywords" content="rust, rustlang, rust-lang, Expr"> + + <title>regex_syntax::Expr - Rust</title> + + <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]--> + + + + <section class="sidebar"> + + <p class='location'><a href='index.html'>regex_syntax</a></p><script>window.sidebarCurrent = {name: 'Expr', ty: 'enum', relpath: ''};</script><script defer src="sidebar-items.js"></script> + </section> + + <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=''>Expr</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-40319' class='srclink' href='../src/regex_syntax/lib.rs.html#90-150' title='goto source code'>[src]</a></span></h1> +<pre class='rust enum'>pub enum Expr { + Empty, + Literal { + chars: <a class='struct' href='http://doc.rust-lang.org/nightly/collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><<a href='http://doc.rust-lang.org/nightly/std/primitive.char.html'>char</a>>, + casei: <a href='http://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a>, + }, + AnyChar, + AnyCharNoNL, + Class(<a class='struct' href='../regex_syntax/struct.CharClass.html' title='regex_syntax::CharClass'>CharClass</a>), + StartLine, + EndLine, + StartText, + EndText, + WordBoundary, + NotWordBoundary, + Group { + e: <a class='struct' href='http://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html' title='alloc::boxed::Box'>Box</a><<a class='enum' href='../regex_syntax/enum.Expr.html' title='regex_syntax::Expr'>Expr</a>>, + i: <a class='enum' href='http://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a><<a href='http://doc.rust-lang.org/nightly/std/primitive.usize.html'>usize</a>>, + name: <a class='enum' href='http://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a><<a class='struct' href='http://doc.rust-lang.org/nightly/collections/string/struct.String.html' title='collections::string::String'>String</a>>, + }, + Repeat { + e: <a class='struct' href='http://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html' title='alloc::boxed::Box'>Box</a><<a class='enum' href='../regex_syntax/enum.Expr.html' title='regex_syntax::Expr'>Expr</a>>, + r: <a class='enum' href='../regex_syntax/enum.Repeater.html' title='regex_syntax::Repeater'>Repeater</a>, + greedy: <a href='http://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a>, + }, + Concat(<a class='struct' href='http://doc.rust-lang.org/nightly/collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><<a class='enum' href='../regex_syntax/enum.Expr.html' title='regex_syntax::Expr'>Expr</a>>), + Alternate(<a class='struct' href='http://doc.rust-lang.org/nightly/collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><<a class='enum' href='../regex_syntax/enum.Expr.html' title='regex_syntax::Expr'>Expr</a>>), +}</pre><div class='docblock'><p>A regular expression abstract syntax tree.</p> + +<p>An <code>Expr</code> represents the abstract syntax of a regular expression.</p> +</div><h2 class='variants'>Variants</h2> +<table><tr><td id='variant.Empty'><code>Empty</code></td><td><div class='docblock'><p>An empty regex (which never matches any text).</p> +</div></td></tr><tr><td id='variant.Literal'><code>Literal</code></td><td><div class='docblock'><p>A sequence of one or more literal characters to be matched.</p> +</div><h3 class='fields'>Fields</h3> + + <table><tr><td id='variant.Literal.field.chars'><code>chars</code></td><td><div class='docblock'><p>The characters.</p> +</div></td></tr><tr><td id='variant.Literal.field.casei'><code>casei</code></td><td><div class='docblock'><p>Whether to match case insensitively.</p> +</div></td></tr></table></td></tr><tr><td id='variant.AnyChar'><code>AnyChar</code></td><td><div class='docblock'><p>Match any character, excluding new line.</p> +</div></td></tr><tr><td id='variant.AnyCharNoNL'><code>AnyCharNoNL</code></td><td><div class='docblock'><p>Match any character.</p> +</div></td></tr><tr><td id='variant.Class'><code>Class</code></td><td><div class='docblock'><p>A character class.</p> +</div></td></tr><tr><td id='variant.StartLine'><code>StartLine</code></td><td><div class='docblock'><p>Match the start of a line or beginning of input.</p> +</div></td></tr><tr><td id='variant.EndLine'><code>EndLine</code></td><td><div class='docblock'><p>Match the end of a line or end of input.</p> +</div></td></tr><tr><td id='variant.StartText'><code>StartText</code></td><td><div class='docblock'><p>Match the beginning of input.</p> +</div></td></tr><tr><td id='variant.EndText'><code>EndText</code></td><td><div class='docblock'><p>Match the end of input.</p> +</div></td></tr><tr><td id='variant.WordBoundary'><code>WordBoundary</code></td><td><div class='docblock'><p>Match a word boundary (word character on one side and a non-word +character on the other).</p> +</div></td></tr><tr><td id='variant.NotWordBoundary'><code>NotWordBoundary</code></td><td><div class='docblock'><p>Match a position that is not a word boundary (word or non-word +characters on both sides).</p> +</div></td></tr><tr><td id='variant.Group'><code>Group</code></td><td><div class='docblock'><p>A group, possibly non-capturing.</p> +</div><h3 class='fields'>Fields</h3> + + <table><tr><td id='variant.Group.field.e'><code>e</code></td><td><div class='docblock'><p>The expression inside the group.</p> +</div></td></tr><tr><td id='variant.Group.field.i'><code>i</code></td><td><div class='docblock'><p>The capture index (starting at <code>1</code>) only for capturing groups.</p> +</div></td></tr><tr><td id='variant.Group.field.name'><code>name</code></td><td><div class='docblock'><p>The capture name, only for capturing named groups.</p> +</div></td></tr></table></td></tr><tr><td id='variant.Repeat'><code>Repeat</code></td><td><div class='docblock'><p>A repeat operator (<code>?</code>, <code>*</code>, <code>+</code> or <code>{m,n}</code>).</p> +</div><h3 class='fields'>Fields</h3> + + <table><tr><td id='variant.Repeat.field.e'><code>e</code></td><td><div class='docblock'><p>The expression to be repeated. Limited to literals, <code>.</code>, classes +or grouped expressions.</p> +</div></td></tr><tr><td id='variant.Repeat.field.r'><code>r</code></td><td><div class='docblock'><p>The type of repeat operator used.</p> +</div></td></tr><tr><td id='variant.Repeat.field.greedy'><code>greedy</code></td><td><div class='docblock'><p>Whether the repeat is greedy (match the most) or not (match the +least).</p> +</div></td></tr></table></td></tr><tr><td id='variant.Concat'><code>Concat</code></td><td><div class='docblock'><p>A concatenation of expressions. Must be matched one after the other.</p> + +<p>N.B. A concat expression can only appear at the top-level or +immediately inside a group expression.</p> +</div></td></tr><tr><td id='variant.Alternate'><code>Alternate</code></td><td><div class='docblock'><p>An alternation of expressions. Only one must match.</p> + +<p>N.B. An alternate expression can only appear at the top-level or +immediately inside a group expression.</p> +</div></td></tr></table><h2 id='methods'>Methods</h2><h3 class='impl'><code>impl <a class='enum' href='../regex_syntax/enum.Expr.html' title='regex_syntax::Expr'>Expr</a></code></h3><div class='impl-items'><h4 id='method.parse' class='method'><code>fn <a href='#method.parse' class='fnname'>parse</a>(s: &<a href='http://doc.rust-lang.org/nightly/std/primitive.str.html'>str</a>) -> <a class='type' href='../regex_syntax/type.Result.html' title='regex_syntax::Result'>Result</a><<a class='enum' href='../regex_syntax/enum.Expr.html' title='regex_syntax::Expr'>Expr</a>></code></h4> +<div class='docblock'><p>Parses a string in a regular expression syntax tree.</p> +</div></div><h2 id='implementations'>Trait Implementations</h2><h3 class='impl'><code>impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/fmt/trait.Display.html' title='core::fmt::Display'>Display</a> for <a class='enum' href='../regex_syntax/enum.Expr.html' title='regex_syntax::Expr'>Expr</a></code></h3><div class='docblock'><p>This implementation of <code>Display</code> will write a regular expression from the +syntax tree. It does not write the original string parsed.</p> +</div><div class='impl-items'><h4 id='method.fmt' class='method'><code>fn <a href='http://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#method.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class='struct' href='http://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html' title='core::fmt::Formatter'>Formatter</a>) -> <a class='type' href='http://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='http://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html' title='core::cmp::Eq'>Eq</a> for <a class='enum' href='../regex_syntax/enum.Expr.html' title='regex_syntax::Expr'>Expr</a></code></h3><div class='impl-items'></div><h3 class='impl'><code>impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a> for <a class='enum' href='../regex_syntax/enum.Expr.html' title='regex_syntax::Expr'>Expr</a></code></h3><div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='http://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.eq' class='fnname'>eq</a>(&self, __arg_0: &<a class='enum' href='../regex_syntax/enum.Expr.html' title='regex_syntax::Expr'>Expr</a>) -> <a href='http://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></code></h4> +<h4 id='method.ne' class='method'><code>fn <a href='http://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.Expr.html' title='regex_syntax::Expr'>Expr</a>) -> <a href='http://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></code></h4> +</div><h3 class='impl'><code>impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html' title='core::fmt::Debug'>Debug</a> for <a class='enum' href='../regex_syntax/enum.Expr.html' title='regex_syntax::Expr'>Expr</a></code></h3><div class='impl-items'><h4 id='method.fmt' class='method'><code>fn <a href='http://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#method.fmt' class='fnname'>fmt</a>(&self, __arg_0: &mut <a class='struct' href='http://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html' title='core::fmt::Formatter'>Formatter</a>) -> <a class='type' href='http://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='http://doc.rust-lang.org/nightly/core/clone/trait.Clone.html' title='core::clone::Clone'>Clone</a> for <a class='enum' href='../regex_syntax/enum.Expr.html' title='regex_syntax::Expr'>Expr</a></code></h3><div class='impl-items'><h4 id='method.clone' class='method'><code>fn <a href='http://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone' class='fnname'>clone</a>(&self) -> <a class='enum' href='../regex_syntax/enum.Expr.html' title='regex_syntax::Expr'>Expr</a></code></h4> +<h4 id='method.clone_from' class='method'><code>fn <a href='http://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&mut self, source: &Self)</code></h4> +</div></section> + <section id='search' class="content hidden"></section> + + <section class="footer"></section> + + <div id="help" class="hidden"> + <div class="shortcuts"> + <h1>Keyboard shortcuts</h1> + <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"> + <h1>Search tricks</h1> + <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>typedef</code> (or + <code>tdef</code>). + </p> + <p> + Search functions by type signature (e.g. + <code>vec -> usize</code>) + </p> + </div> + </div> + + + + <script> + window.rootPath = "../"; + window.currentCrate = "regex_syntax"; + window.playgroundUrl = ""; + </script> + <script src="../jquery.js"></script> + <script src="../main.js"></script> + + <script async src="../search-index.js"></script> +</body> +</html>
\ No newline at end of file diff --git a/regex_syntax/enum.Repeater.html b/regex_syntax/enum.Repeater.html new file mode 100644 index 0000000..2ed4b45 --- /dev/null +++ b/regex_syntax/enum.Repeater.html @@ -0,0 +1,127 @@ +<!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 `Repeater` enum in crate `regex_syntax`."> + <meta name="keywords" content="rust, rustlang, rust-lang, Repeater"> + + <title>regex_syntax::Repeater - Rust</title> + + <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]--> + + + + <section class="sidebar"> + + <p class='location'><a href='index.html'>regex_syntax</a></p><script>window.sidebarCurrent = {name: 'Repeater', ty: 'enum', relpath: ''};</script><script defer src="sidebar-items.js"></script> + </section> + + <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=''>Repeater</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-41420' class='srclink' href='../src/regex_syntax/lib.rs.html#158-174' title='goto source code'>[src]</a></span></h1> +<pre class='rust enum'>pub enum Repeater { + ZeroOrOne, + ZeroOrMore, + OneOrMore, + Range { + min: <a href='http://doc.rust-lang.org/nightly/std/primitive.u32.html'>u32</a>, + max: <a class='enum' href='http://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a><<a href='http://doc.rust-lang.org/nightly/std/primitive.u32.html'>u32</a>>, + }, +}</pre><div class='docblock'><p>The type of a repeat operator expression.</p> +</div><h2 class='variants'>Variants</h2> +<table><tr><td id='variant.ZeroOrOne'><code>ZeroOrOne</code></td><td><div class='docblock'><p>Match zero or one (<code>?</code>).</p> +</div></td></tr><tr><td id='variant.ZeroOrMore'><code>ZeroOrMore</code></td><td><div class='docblock'><p>Match zero or more (<code>*</code>).</p> +</div></td></tr><tr><td id='variant.OneOrMore'><code>OneOrMore</code></td><td><div class='docblock'><p>Match one or more (<code>+</code>).</p> +</div></td></tr><tr><td id='variant.Range'><code>Range</code></td><td><div class='docblock'><p>Match for at least <code>min</code> and at most <code>max</code> (<code>{m,n}</code>).</p> + +<p>When <code>max</code> is <code>None</code>, there is no upper bound on the number of matches.</p> +</div><h3 class='fields'>Fields</h3> + + <table><tr><td id='variant.Range.field.min'><code>min</code></td><td><div class='docblock'><p>Lower bound on the number of matches.</p> +</div></td></tr><tr><td id='variant.Range.field.max'><code>max</code></td><td><div class='docblock'><p>Optional upper bound on the number of matches.</p> +</div></td></tr></table></td></tr></table><h2 id='implementations'>Trait Implementations</h2><h3 class='impl'><code>impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/fmt/trait.Display.html' title='core::fmt::Display'>Display</a> for <a class='enum' href='../regex_syntax/enum.Repeater.html' title='regex_syntax::Repeater'>Repeater</a></code></h3><div class='impl-items'><h4 id='method.fmt' class='method'><code>fn <a href='http://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#method.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class='struct' href='http://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html' title='core::fmt::Formatter'>Formatter</a>) -> <a class='type' href='http://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='http://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html' title='core::cmp::Eq'>Eq</a> for <a class='enum' href='../regex_syntax/enum.Repeater.html' title='regex_syntax::Repeater'>Repeater</a></code></h3><div class='impl-items'></div><h3 class='impl'><code>impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a> for <a class='enum' href='../regex_syntax/enum.Repeater.html' title='regex_syntax::Repeater'>Repeater</a></code></h3><div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='http://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.eq' class='fnname'>eq</a>(&self, __arg_0: &<a class='enum' href='../regex_syntax/enum.Repeater.html' title='regex_syntax::Repeater'>Repeater</a>) -> <a href='http://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></code></h4> +<h4 id='method.ne' class='method'><code>fn <a href='http://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.Repeater.html' title='regex_syntax::Repeater'>Repeater</a>) -> <a href='http://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></code></h4> +</div><h3 class='impl'><code>impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html' title='core::fmt::Debug'>Debug</a> for <a class='enum' href='../regex_syntax/enum.Repeater.html' title='regex_syntax::Repeater'>Repeater</a></code></h3><div class='impl-items'><h4 id='method.fmt' class='method'><code>fn <a href='http://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#method.fmt' class='fnname'>fmt</a>(&self, __arg_0: &mut <a class='struct' href='http://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html' title='core::fmt::Formatter'>Formatter</a>) -> <a class='type' href='http://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='http://doc.rust-lang.org/nightly/core/marker/trait.Copy.html' title='core::marker::Copy'>Copy</a> for <a class='enum' href='../regex_syntax/enum.Repeater.html' title='regex_syntax::Repeater'>Repeater</a></code></h3><div class='impl-items'></div><h3 class='impl'><code>impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/clone/trait.Clone.html' title='core::clone::Clone'>Clone</a> for <a class='enum' href='../regex_syntax/enum.Repeater.html' title='regex_syntax::Repeater'>Repeater</a></code></h3><div class='impl-items'><h4 id='method.clone' class='method'><code>fn <a href='http://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone' class='fnname'>clone</a>(&self) -> <a class='enum' href='../regex_syntax/enum.Repeater.html' title='regex_syntax::Repeater'>Repeater</a></code></h4> +<h4 id='method.clone_from' class='method'><code>fn <a href='http://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&mut self, source: &Self)</code></h4> +</div></section> + <section id='search' class="content hidden"></section> + + <section class="footer"></section> + + <div id="help" class="hidden"> + <div class="shortcuts"> + <h1>Keyboard shortcuts</h1> + <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"> + <h1>Search tricks</h1> + <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>typedef</code> (or + <code>tdef</code>). + </p> + <p> + Search functions by type signature (e.g. + <code>vec -> usize</code>) + </p> + </div> + </div> + + + + <script> + window.rootPath = "../"; + window.currentCrate = "regex_syntax"; + window.playgroundUrl = ""; + </script> + <script src="../jquery.js"></script> + <script src="../main.js"></script> + + <script async src="../search-index.js"></script> +</body> +</html>
\ No newline at end of file diff --git a/regex_syntax/fn.quote.html b/regex_syntax/fn.quote.html new file mode 100644 index 0000000..e753698 --- /dev/null +++ b/regex_syntax/fn.quote.html @@ -0,0 +1,105 @@ +<!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 `quote` fn in crate `regex_syntax`."> + <meta name="keywords" content="rust, rustlang, rust-lang, quote"> + + <title>regex_syntax::quote - Rust</title> + + <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]--> + + + + <section class="sidebar"> + + <p class='location'><a href='index.html'>regex_syntax</a></p><script>window.sidebarCurrent = {name: 'quote', ty: 'fn', relpath: ''};</script><script defer src="sidebar-items.js"></script> + </section> + + <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 fn"> +<h1 class='fqn'><span class='in-band'>Function <a href='index.html'>regex_syntax</a>::<wbr><a class='fn' href=''>quote</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-47856' class='srclink' href='../src/regex_syntax/lib.rs.html#913-922' title='goto source code'>[src]</a></span></h1> +<pre class='rust fn'>pub fn quote(text: &<a href='http://doc.rust-lang.org/nightly/std/primitive.str.html'>str</a>) -> <a class='struct' href='http://doc.rust-lang.org/nightly/collections/string/struct.String.html' title='collections::string::String'>String</a></pre><div class='docblock'><p>Escapes all regular expression meta characters in <code>text</code>.</p> + +<p>The string returned may be safely used as a literal in a regular +expression.</p> +</div></section> + <section id='search' class="content hidden"></section> + + <section class="footer"></section> + + <div id="help" class="hidden"> + <div class="shortcuts"> + <h1>Keyboard shortcuts</h1> + <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"> + <h1>Search tricks</h1> + <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>typedef</code> (or + <code>tdef</code>). + </p> + <p> + Search functions by type signature (e.g. + <code>vec -> usize</code>) + </p> + </div> + </div> + + + + <script> + window.rootPath = "../"; + window.currentCrate = "regex_syntax"; + window.playgroundUrl = ""; + </script> + <script src="../jquery.js"></script> + <script src="../main.js"></script> + + <script async src="../search-index.js"></script> +</body> +</html>
\ No newline at end of file diff --git a/regex_syntax/index.html b/regex_syntax/index.html new file mode 100644 index 0000000..2c4ad5c --- /dev/null +++ b/regex_syntax/index.html @@ -0,0 +1,223 @@ +<!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 `regex_syntax` crate."> + <meta name="keywords" content="rust, rustlang, rust-lang, regex_syntax"> + + <title>regex_syntax - Rust</title> + + <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]--> + + + + <section class="sidebar"> + + <p class='location'></p><script>window.sidebarCurrent = {name: 'regex_syntax', ty: 'mod', relpath: '../'};</script> + </section> + + <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 mod"> +<h1 class='fqn'><span class='in-band'>Crate <a class='mod' href=''>regex_syntax</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-0' class='srclink' href='../src/regex_syntax/lib.rs.html#11-1184' title='goto source code'>[src]</a></span></h1> +<div class='docblock'><p>This crate provides a regular expression parser and an abstract syntax for +regular expressions. The abstract syntax is defined by the <code>Expr</code> type. The +concrete syntax is enumerated in the +<a href="../regex/index.html#syntax"><code>regex</code></a> +crate documentation.</p> + +<p>Note that since this crate is first and foremost an implementation detail for +the <code>regex</code> crate, it may experience more frequent breaking changes. It is +exposed as a separate crate so that others may use it to do analysis on regular +expressions or even build their own matching engine.</p> + +<h1 id="example:-parsing-an-expression" class='section-header'><a + href="#example:-parsing-an-expression">Example: parsing an expression</a></h1> +<p>Parsing a regular expression can be done with the <code>Expr::parse</code> function.</p> +<pre class='rust rust-example-rendered'> +<span class='kw'>use</span> <span class='ident'>regex_syntax</span>::<span class='ident'>Expr</span>; + +<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>Expr</span>::<span class='ident'>parse</span>(<span class='string'>r"ab|yz"</span>).<span class='ident'>unwrap</span>(), <span class='ident'>Expr</span>::<span class='ident'>Alternate</span>(<span class='macro'>vec</span><span class='macro'>!</span>[ + <span class='ident'>Expr</span>::<span class='ident'>Literal</span> { <span class='ident'>chars</span>: <span class='macro'>vec</span><span class='macro'>!</span>[<span class='string'>'a'</span>, <span class='string'>'b'</span>], <span class='ident'>casei</span>: <span class='boolval'>false</span> }, + <span class='ident'>Expr</span>::<span class='ident'>Literal</span> { <span class='ident'>chars</span>: <span class='macro'>vec</span><span class='macro'>!</span>[<span class='string'>'y'</span>, <span class='string'>'z'</span>], <span class='ident'>casei</span>: <span class='boolval'>false</span> }, +])); +</pre> + +<h1 id="example:-inspecting-an-error" class='section-header'><a + href="#example:-inspecting-an-error">Example: inspecting an error</a></h1> +<p>The parser in this crate provides very detailed error values. For example, +if an invalid character class range is given:</p> +<pre class='rust rust-example-rendered'> +<span class='kw'>use</span> <span class='ident'>regex_syntax</span>::{<span class='ident'>Expr</span>, <span class='ident'>ErrorKind</span>}; + +<span class='kw'>let</span> <span class='ident'>err</span> <span class='op'>=</span> <span class='ident'>Expr</span>::<span class='ident'>parse</span>(<span class='string'>r"[z-a]"</span>).<span class='ident'>unwrap_err</span>(); +<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>err</span>.<span class='ident'>position</span>(), <span class='number'>4</span>); +<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>err</span>.<span class='ident'>kind</span>(), <span class='kw-2'>&</span><span class='ident'>ErrorKind</span>::<span class='ident'>InvalidClassRange</span> { + <span class='ident'>start</span>: <span class='string'>'z'</span>, + <span class='ident'>end</span>: <span class='string'>'a'</span>, +}); +</pre> + +<p>Or unbalanced parentheses:</p> +<pre class='rust rust-example-rendered'> +<span class='kw'>use</span> <span class='ident'>regex_syntax</span>::{<span class='ident'>Expr</span>, <span class='ident'>ErrorKind</span>}; + +<span class='kw'>let</span> <span class='ident'>err</span> <span class='op'>=</span> <span class='ident'>Expr</span>::<span class='ident'>parse</span>(<span class='string'>r"ab(cd"</span>).<span class='ident'>unwrap_err</span>(); +<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>err</span>.<span class='ident'>position</span>(), <span class='number'>2</span>); +<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>err</span>.<span class='ident'>kind</span>(), <span class='kw-2'>&</span><span class='ident'>ErrorKind</span>::<span class='ident'>UnclosedParen</span>); +</pre> +</div><h2 id='structs' class='section-header'><a href="#structs">Structs</a></h2> +<table> + <tr class=' module-item'> + <td><a class='struct' href='struct.CharClass.html' + title='regex_syntax::CharClass'>CharClass</a></td> + <td class='docblock short'> + <p>A character class.</p> + + </td> + </tr> + + <tr class=' module-item'> + <td><a class='struct' href='struct.ClassRange.html' + title='regex_syntax::ClassRange'>ClassRange</a></td> + <td class='docblock short'> + <p>A single inclusive range in a character class.</p> + + </td> + </tr> + + <tr class=' module-item'> + <td><a class='struct' href='struct.Error.html' + title='regex_syntax::Error'>Error</a></td> + <td class='docblock short'> + <p>A parse error.</p> + + </td> + </tr> + </table><h2 id='enums' class='section-header'><a href="#enums">Enums</a></h2> +<table> + <tr class=' module-item'> + <td><a class='enum' href='enum.ErrorKind.html' + title='regex_syntax::ErrorKind'>ErrorKind</a></td> + <td class='docblock short'> + <p>The specific type of parse error that can occur.</p> + + </td> + </tr> + + <tr class=' module-item'> + <td><a class='enum' href='enum.Expr.html' + title='regex_syntax::Expr'>Expr</a></td> + <td class='docblock short'> + <p>A regular expression abstract syntax tree.</p> + + </td> + </tr> + + <tr class=' module-item'> + <td><a class='enum' href='enum.Repeater.html' + title='regex_syntax::Repeater'>Repeater</a></td> + <td class='docblock short'> + <p>The type of a repeat operator expression.</p> + + </td> + </tr> + </table><h2 id='functions' class='section-header'><a href="#functions">Functions</a></h2> +<table> + <tr class=' module-item'> + <td><a class='fn' href='fn.quote.html' + title='regex_syntax::quote'>quote</a></td> + <td class='docblock short'> + <p>Escapes all regular expression meta characters in <code>text</code>.</p> + + </td> + </tr> + </table><h2 id='types' class='section-header'><a href="#types">Type Definitions</a></h2> +<table> + <tr class=' module-item'> + <td><a class='type' href='type.Result.html' + title='regex_syntax::Result'>Result</a></td> + <td class='docblock short'> + <p>An alias for computations that can return a <code>Error</code>.</p> + + </td> + </tr> + </table></section> + <section id='search' class="content hidden"></section> + + <section class="footer"></section> + + <div id="help" class="hidden"> + <div class="shortcuts"> + <h1>Keyboard shortcuts</h1> + <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"> + <h1>Search tricks</h1> + <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>typedef</code> (or + <code>tdef</code>). + </p> + <p> + Search functions by type signature (e.g. + <code>vec -> usize</code>) + </p> + </div> + </div> + + + + <script> + window.rootPath = "../"; + window.currentCrate = "regex_syntax"; + window.playgroundUrl = ""; + </script> + <script src="../jquery.js"></script> + <script src="../main.js"></script> + + <script async src="../search-index.js"></script> +</body> +</html>
\ No newline at end of file diff --git a/regex_syntax/parser/index.html b/regex_syntax/parser/index.html new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/regex_syntax/parser/index.html diff --git a/regex_syntax/parser/sidebar-items.js b/regex_syntax/parser/sidebar-items.js new file mode 100644 index 0000000..48333d3 --- /dev/null +++ b/regex_syntax/parser/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({});
\ No newline at end of file diff --git a/regex_syntax/sidebar-items.js b/regex_syntax/sidebar-items.js new file mode 100644 index 0000000..7f23766 --- /dev/null +++ b/regex_syntax/sidebar-items.js @@ -0,0 +1 @@ +initSidebarItems({"enum":[["ErrorKind","The specific type of parse error that can occur."],["Expr","A regular expression abstract syntax tree."],["Repeater","The type of a repeat operator expression."]],"fn":[["quote","Escapes all regular expression meta characters in `text`."]],"struct":[["CharClass","A character class."],["ClassRange","A single inclusive range in a character class."],["Error","A parse error."]],"type":[["Result","An alias for computations that can return a `Error`."]]});
\ No newline at end of file diff --git a/regex_syntax/struct.CharClass.html b/regex_syntax/struct.CharClass.html new file mode 100644 index 0000000..9e6ebfc --- /dev/null +++ b/regex_syntax/struct.CharClass.html @@ -0,0 +1,493 @@ +<!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 `CharClass` struct in crate `regex_syntax`."> + <meta name="keywords" content="rust, rustlang, rust-lang, CharClass"> + + <title>regex_syntax::CharClass - Rust</title> + + <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]--> + + + + <section class="sidebar"> + + <p class='location'><a href='index.html'>regex_syntax</a></p><script>window.sidebarCurrent = {name: 'CharClass', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script> + </section> + + <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 struct"> +<h1 class='fqn'><span class='in-band'>Struct <a href='index.html'>regex_syntax</a>::<wbr><a class='struct' href=''>CharClass</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-41805' class='srclink' href='../src/regex_syntax/lib.rs.html#200-203' title='goto source code'>[src]</a></span></h1> +<pre class='rust struct'>pub struct CharClass { + // some fields omitted +}</pre><div class='docblock'><p>A character class.</p> + +<p>A character class has a canonical format that the parser guarantees. Its +canonical format is defined by the following invariants:</p> + +<ol> +<li>Given any Unicode scalar value, it is matched by <em>at most</em> one character +range in a canonical character class.</li> +<li>Every adjacent character range is separated by at least one Unicode +scalar value.</li> +<li>Given any pair of character ranges <code>r1</code> and <code>r2</code>, if +<code>r1.end < r2.start</code>, then <code>r1</code> comes before <code>r2</code> in a canonical +character class.</li> +</ol> + +<p>In sum, any <code>CharClass</code> produced by this crate's parser is a sorted +sequence of non-overlapping ranges. This makes it possible to test whether +a character is matched by a class with a binary search.</p> + +<p>Additionally, a character class may be marked <em>case insensitive</em>. If it's +case insensitive, then:</p> + +<ol> +<li>Simple case folding has been applied to all ranges.</li> +<li>Simple case folding must be applied to a character before testing +whether it matches the character class.</li> +</ol> +</div><h2 id='methods'>Methods</h2><h3 class='impl'><code>impl <a class='struct' href='../regex_syntax/struct.CharClass.html' title='regex_syntax::CharClass'>CharClass</a></code></h3><div class='impl-items'><h4 id='method.matches' class='method'><code>fn <a href='#method.matches' class='fnname'>matches</a>(&self, c: <a href='http://doc.rust-lang.org/nightly/std/primitive.char.html'>char</a>) -> <a href='http://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></code></h4> +<div class='docblock'><p>Returns true if <code>c</code> is matched by this character class.</p> + +<p>If this character class is case insensitive, then simple case folding +is applied to <code>c</code> before checking for a match.</p> +</div><h4 id='method.is_case_insensitive' class='method'><code>fn <a href='#method.is_case_insensitive' class='fnname'>is_case_insensitive</a>(&self) -> <a href='http://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></code></h4> +<div class='docblock'><p>Returns true if this character class should be matched case +insensitively.</p> + +<p>When <code>true</code>, simple case folding has already been applied to the +class.</p> +</div></div><h2 id='deref-methods'>Methods from <a class='trait' href='http://doc.rust-lang.org/nightly/core/ops/trait.Deref.html' title='core::ops::Deref'>Deref</a><Target=<a class='struct' href='http://doc.rust-lang.org/nightly/collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><<a class='struct' href='../regex_syntax/struct.ClassRange.html' title='regex_syntax::ClassRange'>ClassRange</a>>></h2><div class='impl-items'><h4 id='method.capacity' class='method'><code>fn <a href='#method.capacity' class='fnname'>capacity</a>(&self) -> <a href='http://doc.rust-lang.org/nightly/std/primitive.usize.html'>usize</a></code></h4> +<div class='docblock'><p>Returns the number of elements the vector can hold without +reallocating.</p> + +<h1 id="examples" class='section-header'><a + href="#examples">Examples</a></h1><pre class='rust rust-example-rendered'> +<span class='kw'>let</span> <span class='ident'>vec</span>: <span class='ident'>Vec</span><span class='op'><</span><span class='ident'>i32</span><span class='op'>></span> <span class='op'>=</span> <span class='ident'>Vec</span>::<span class='ident'>with_capacity</span>(<span class='number'>10</span>); +<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>vec</span>.<span class='ident'>capacity</span>(), <span class='number'>10</span>); +</pre> +</div><h4 id='method.reserve' class='method'><code>fn <a href='#method.reserve' class='fnname'>reserve</a>(&mut self, additional: <a href='http://doc.rust-lang.org/nightly/std/primitive.usize.html'>usize</a>)</code></h4> +<div class='docblock'><p>Reserves capacity for at least <code>additional</code> more elements to be inserted +in the given <code>Vec<T></code>. The collection may reserve more space to avoid +frequent reallocations.</p> + +<h1 id="panics" class='section-header'><a + href="#panics">Panics</a></h1> +<p>Panics if the new capacity overflows <code>usize</code>.</p> + +<h1 id="examples" class='section-header'><a + href="#examples">Examples</a></h1><pre class='rust rust-example-rendered'> +<span class='kw'>let</span> <span class='kw-2'>mut</span> <span class='ident'>vec</span> <span class='op'>=</span> <span class='macro'>vec</span><span class='macro'>!</span>[<span class='number'>1</span>]; +<span class='ident'>vec</span>.<span class='ident'>reserve</span>(<span class='number'>10</span>); +<span class='macro'>assert</span><span class='macro'>!</span>(<span class='ident'>vec</span>.<span class='ident'>capacity</span>() <span class='op'>>=</span> <span class='number'>11</span>); +</pre> +</div><h4 id='method.reserve_exact' class='method'><code>fn <a href='#method.reserve_exact' class='fnname'>reserve_exact</a>(&mut self, additional: <a href='http://doc.rust-lang.org/nightly/std/primitive.usize.html'>usize</a>)</code></h4> +<div class='docblock'><p>Reserves the minimum capacity for exactly <code>additional</code> more elements to +be inserted in the given <code>Vec<T></code>. Does nothing if the capacity is already +sufficient.</p> + +<p>Note that the allocator may give the collection more space than it +requests. Therefore capacity can not be relied upon to be precisely +minimal. Prefer <code>reserve</code> if future insertions are expected.</p> + +<h1 id="panics" class='section-header'><a + href="#panics">Panics</a></h1> +<p>Panics if the new capacity overflows <code>usize</code>.</p> + +<h1 id="examples" class='section-header'><a + href="#examples">Examples</a></h1><pre class='rust rust-example-rendered'> +<span class='kw'>let</span> <span class='kw-2'>mut</span> <span class='ident'>vec</span> <span class='op'>=</span> <span class='macro'>vec</span><span class='macro'>!</span>[<span class='number'>1</span>]; +<span class='ident'>vec</span>.<span class='ident'>reserve_exact</span>(<span class='number'>10</span>); +<span class='macro'>assert</span><span class='macro'>!</span>(<span class='ident'>vec</span>.<span class='ident'>capacity</span>() <span class='op'>>=</span> <span class='number'>11</span>); +</pre> +</div><h4 id='method.shrink_to_fit' class='method'><code>fn <a href='#method.shrink_to_fit' class='fnname'>shrink_to_fit</a>(&mut self)</code></h4> +<div class='docblock'><p>Shrinks the capacity of the vector as much as possible.</p> + +<p>It will drop down as close as possible to the length but the allocator +may still inform the vector that there is space for a few more elements.</p> + +<h1 id="examples" class='section-header'><a + href="#examples">Examples</a></h1><pre class='rust rust-example-rendered'> +<span class='kw'>let</span> <span class='kw-2'>mut</span> <span class='ident'>vec</span> <span class='op'>=</span> <span class='ident'>Vec</span>::<span class='ident'>with_capacity</span>(<span class='number'>10</span>); +<span class='ident'>vec</span>.<span class='ident'>extend</span>([<span class='number'>1</span>, <span class='number'>2</span>, <span class='number'>3</span>].<span class='ident'>iter</span>().<span class='ident'>cloned</span>()); +<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>vec</span>.<span class='ident'>capacity</span>(), <span class='number'>10</span>); +<span class='ident'>vec</span>.<span class='ident'>shrink_to_fit</span>(); +<span class='macro'>assert</span><span class='macro'>!</span>(<span class='ident'>vec</span>.<span class='ident'>capacity</span>() <span class='op'>>=</span> <span class='number'>3</span>); +</pre> +</div><h4 id='method.into_boxed_slice' class='method'><code>fn <a href='#method.into_boxed_slice' class='fnname'>into_boxed_slice</a>(self) -> <a class='struct' href='http://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html' title='alloc::boxed::Box'>Box</a><<a href='http://doc.rust-lang.org/nightly/std/primitive.slice.html'>[T]</a>></code></h4> +<div class='docblock'><p>Converts the vector into Box<[T]>.</p> + +<p>Note that this will drop any excess capacity. Calling this and +converting back to a vector with <code>into_vec()</code> is equivalent to calling +<code>shrink_to_fit()</code>.</p> +</div><h4 id='method.truncate' class='method'><code>fn <a href='#method.truncate' class='fnname'>truncate</a>(&mut self, len: <a href='http://doc.rust-lang.org/nightly/std/primitive.usize.html'>usize</a>)</code></h4> +<div class='docblock'><p>Shorten a vector, dropping excess elements.</p> + +<p>If <code>len</code> is greater than the vector's current length, this has no +effect.</p> + +<h1 id="examples" class='section-header'><a + href="#examples">Examples</a></h1><pre class='rust rust-example-rendered'> +<span class='kw'>let</span> <span class='kw-2'>mut</span> <span class='ident'>vec</span> <span class='op'>=</span> <span class='macro'>vec</span><span class='macro'>!</span>[<span class='number'>1</span>, <span class='number'>2</span>, <span class='number'>3</span>, <span class='number'>4</span>]; +<span class='ident'>vec</span>.<span class='ident'>truncate</span>(<span class='number'>2</span>); +<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>vec</span>, [<span class='number'>1</span>, <span class='number'>2</span>]); +</pre> +</div><h4 id='method.as_slice' class='method'><code>fn <a href='#method.as_slice' class='fnname'>as_slice</a>(&self) -> <a href='http://doc.rust-lang.org/nightly/std/primitive.slice.html'>&[T]</a></code></h4> +<div class='stability'><em class='stab unstable'>Unstable<p>: waiting on RFC revision</p> +</em></div><div class='docblock'><p>Extracts a slice containing the entire vector.</p> + +<p>Equivalent to <code>&s[..]</code>.</p> +</div><h4 id='method.as_mut_slice' class='method'><code>fn <a href='#method.as_mut_slice' class='fnname'>as_mut_slice</a>(&mut self) -> <a href='http://doc.rust-lang.org/nightly/std/primitive.slice.html'>&mut [T]</a></code></h4> +<div class='stability'><em class='stab unstable'>Unstable<p>: waiting on RFC revision</p> +</em></div><div class='docblock'><p>Extracts a mutable slice of the entire vector.</p> + +<p>Equivalent to <code>&mut s[..]</code>.</p> +</div><h4 id='method.set_len' class='method'><code>unsafe fn <a href='#method.set_len' class='fnname'>set_len</a>(&mut self, len: <a href='http://doc.rust-lang.org/nightly/std/primitive.usize.html'>usize</a>)</code></h4> +<div class='docblock'><p>Sets the length of a vector.</p> + +<p>This will explicitly set the size of the vector, without actually +modifying its buffers, so it is up to the caller to ensure that the +vector is actually the specified size.</p> + +<h1 id="examples" class='section-header'><a + href="#examples">Examples</a></h1><pre class='rust rust-example-rendered'> +<span class='kw'>let</span> <span class='kw-2'>mut</span> <span class='ident'>v</span> <span class='op'>=</span> <span class='macro'>vec</span><span class='macro'>!</span>[<span class='number'>1</span>, <span class='number'>2</span>, <span class='number'>3</span>, <span class='number'>4</span>]; +<span class='kw'>unsafe</span> { + <span class='ident'>v</span>.<span class='ident'>set_len</span>(<span class='number'>1</span>); +} +</pre> +</div><h4 id='method.swap_remove' class='method'><code>fn <a href='#method.swap_remove' class='fnname'>swap_remove</a>(&mut self, index: <a href='http://doc.rust-lang.org/nightly/std/primitive.usize.html'>usize</a>) -> T</code></h4> +<div class='docblock'><p>Removes an element from anywhere in the vector and return it, replacing +it with the last element.</p> + +<p>This does not preserve ordering, but is O(1).</p> + +<h1 id="panics" class='section-header'><a + href="#panics">Panics</a></h1> +<p>Panics if <code>index</code> is out of bounds.</p> + +<h1 id="examples" class='section-header'><a + href="#examples">Examples</a></h1><pre class='rust rust-example-rendered'> +<span class='kw'>let</span> <span class='kw-2'>mut</span> <span class='ident'>v</span> <span class='op'>=</span> <span class='macro'>vec</span><span class='macro'>!</span>[<span class='string'>"foo"</span>, <span class='string'>"bar"</span>, <span class='string'>"baz"</span>, <span class='string'>"qux"</span>]; + +<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>v</span>.<span class='ident'>swap_remove</span>(<span class='number'>1</span>), <span class='string'>"bar"</span>); +<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>v</span>, [<span class='string'>"foo"</span>, <span class='string'>"qux"</span>, <span class='string'>"baz"</span>]); + +<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>v</span>.<span class='ident'>swap_remove</span>(<span class='number'>0</span>), <span class='string'>"foo"</span>); +<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>v</span>, [<span class='string'>"baz"</span>, <span class='string'>"qux"</span>]); +</pre> +</div><h4 id='method.insert' class='method'><code>fn <a href='#method.insert' class='fnname'>insert</a>(&mut self, index: <a href='http://doc.rust-lang.org/nightly/std/primitive.usize.html'>usize</a>, element: T)</code></h4> +<div class='docblock'><p>Inserts an element at position <code>index</code> within the vector, shifting all +elements after position <code>i</code> one position to the right.</p> + +<h1 id="panics" class='section-header'><a + href="#panics">Panics</a></h1> +<p>Panics if <code>index</code> is greater than the vector's length.</p> + +<h1 id="examples" class='section-header'><a + href="#examples">Examples</a></h1><pre class='rust rust-example-rendered'> +<span class='kw'>let</span> <span class='kw-2'>mut</span> <span class='ident'>vec</span> <span class='op'>=</span> <span class='macro'>vec</span><span class='macro'>!</span>[<span class='number'>1</span>, <span class='number'>2</span>, <span class='number'>3</span>]; +<span class='ident'>vec</span>.<span class='ident'>insert</span>(<span class='number'>1</span>, <span class='number'>4</span>); +<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>vec</span>, [<span class='number'>1</span>, <span class='number'>4</span>, <span class='number'>2</span>, <span class='number'>3</span>]); +<span class='ident'>vec</span>.<span class='ident'>insert</span>(<span class='number'>4</span>, <span class='number'>5</span>); +<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>vec</span>, [<span class='number'>1</span>, <span class='number'>4</span>, <span class='number'>2</span>, <span class='number'>3</span>, <span class='number'>5</span>]); +</pre> +</div><h4 id='method.remove' class='method'><code>fn <a href='#method.remove' class='fnname'>remove</a>(&mut self, index: <a href='http://doc.rust-lang.org/nightly/std/primitive.usize.html'>usize</a>) -> T</code></h4> +<div class='docblock'><p>Removes and returns the element at position <code>index</code> within the vector, +shifting all elements after position <code>index</code> one position to the left.</p> + +<h1 id="panics" class='section-header'><a + href="#panics">Panics</a></h1> +<p>Panics if <code>index</code> is out of bounds.</p> + +<h1 id="examples" class='section-header'><a + href="#examples">Examples</a></h1><pre class='rust rust-example-rendered'> +<span class='kw'>let</span> <span class='kw-2'>mut</span> <span class='ident'>v</span> <span class='op'>=</span> <span class='macro'>vec</span><span class='macro'>!</span>[<span class='number'>1</span>, <span class='number'>2</span>, <span class='number'>3</span>]; +<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>v</span>.<span class='ident'>remove</span>(<span class='number'>1</span>), <span class='number'>2</span>); +<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>v</span>, [<span class='number'>1</span>, <span class='number'>3</span>]); +</pre> +</div><h4 id='method.retain' class='method'><code>fn <a href='#method.retain' class='fnname'>retain</a><F>(&mut self, f: F) <span class='where'>where F: <a class='trait' href='http://doc.rust-lang.org/nightly/core/ops/trait.FnMut.html' title='core::ops::FnMut'>FnMut</a>(&T) -> <a href='http://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></span></code></h4> +<div class='docblock'><p>Retains only the elements specified by the predicate.</p> + +<p>In other words, remove all elements <code>e</code> such that <code>f(&e)</code> returns false. +This method operates in place and preserves the order of the retained +elements.</p> + +<h1 id="examples" class='section-header'><a + href="#examples">Examples</a></h1><pre class='rust rust-example-rendered'> +<span class='kw'>let</span> <span class='kw-2'>mut</span> <span class='ident'>vec</span> <span class='op'>=</span> <span class='macro'>vec</span><span class='macro'>!</span>[<span class='number'>1</span>, <span class='number'>2</span>, <span class='number'>3</span>, <span class='number'>4</span>]; +<span class='ident'>vec</span>.<span class='ident'>retain</span>(<span class='op'>|</span><span class='kw-2'>&</span><span class='ident'>x</span><span class='op'>|</span> <span class='ident'>x</span><span class='op'>%</span><span class='number'>2</span> <span class='op'>==</span> <span class='number'>0</span>); +<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>vec</span>, [<span class='number'>2</span>, <span class='number'>4</span>]); +</pre> +</div><h4 id='method.push' class='method'><code>fn <a href='#method.push' class='fnname'>push</a>(&mut self, value: T)</code></h4> +<div class='docblock'><p>Appends an element to the back of a collection.</p> + +<h1 id="panics" class='section-header'><a + href="#panics">Panics</a></h1> +<p>Panics if the number of elements in the vector overflows a <code>usize</code>.</p> + +<h1 id="examples" class='section-header'><a + href="#examples">Examples</a></h1><pre class='rust rust-example-rendered'> +<span class='kw'>let</span> <span class='kw-2'>mut</span> <span class='ident'>vec</span> <span class='op'>=</span> <span class='macro'>vec</span><span class='macro'>!</span>(<span class='number'>1</span>, <span class='number'>2</span>); +<span class='ident'>vec</span>.<span class='ident'>push</span>(<span class='number'>3</span>); +<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>vec</span>, [<span class='number'>1</span>, <span class='number'>2</span>, <span class='number'>3</span>]); +</pre> +</div><h4 id='method.pop' class='method'><code>fn <a href='#method.pop' class='fnname'>pop</a>(&mut self) -> <a class='enum' href='http://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a><T></code></h4> +<div class='docblock'><p>Removes the last element from a vector and returns it, or <code>None</code> if it is empty.</p> + +<h1 id="examples" class='section-header'><a + href="#examples">Examples</a></h1><pre class='rust rust-example-rendered'> +<span class='kw'>let</span> <span class='kw-2'>mut</span> <span class='ident'>vec</span> <span class='op'>=</span> <span class='macro'>vec</span><span class='macro'>!</span>[<span class='number'>1</span>, <span class='number'>2</span>, <span class='number'>3</span>]; +<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>vec</span>.<span class='ident'>pop</span>(), <span class='prelude-val'>Some</span>(<span class='number'>3</span>)); +<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>vec</span>, [<span class='number'>1</span>, <span class='number'>2</span>]); +</pre> +</div><h4 id='method.append' class='method'><code>fn <a href='#method.append' class='fnname'>append</a>(&mut self, other: &mut <a class='struct' href='http://doc.rust-lang.org/nightly/collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><T>)</code></h4> +<div class='stability'><em class='stab unstable'>Unstable<p>: new API, waiting for dust to settle</p> +</em></div><div class='docblock'><p>Moves all the elements of <code>other</code> into <code>Self</code>, leaving <code>other</code> empty.</p> + +<h1 id="panics" class='section-header'><a + href="#panics">Panics</a></h1> +<p>Panics if the number of elements in the vector overflows a <code>usize</code>.</p> + +<h1 id="examples" class='section-header'><a + href="#examples">Examples</a></h1><pre class='rust rust-example-rendered'> +<span class='kw'>let</span> <span class='kw-2'>mut</span> <span class='ident'>vec</span> <span class='op'>=</span> <span class='macro'>vec</span><span class='macro'>!</span>[<span class='number'>1</span>, <span class='number'>2</span>, <span class='number'>3</span>]; +<span class='kw'>let</span> <span class='kw-2'>mut</span> <span class='ident'>vec2</span> <span class='op'>=</span> <span class='macro'>vec</span><span class='macro'>!</span>[<span class='number'>4</span>, <span class='number'>5</span>, <span class='number'>6</span>]; +<span class='ident'>vec</span>.<span class='ident'>append</span>(<span class='kw-2'>&</span><span class='kw-2'>mut</span> <span class='ident'>vec2</span>); +<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>vec</span>, [<span class='number'>1</span>, <span class='number'>2</span>, <span class='number'>3</span>, <span class='number'>4</span>, <span class='number'>5</span>, <span class='number'>6</span>]); +<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>vec2</span>, []); +</pre> +</div><h4 id='method.drain' class='method'><code>fn <a href='#method.drain' class='fnname'>drain</a><R>(&mut self, range: R) -> <a class='struct' href='http://doc.rust-lang.org/nightly/collections/vec/struct.Drain.html' title='collections::vec::Drain'>Drain</a><T> <span class='where'>where R: <a class='trait' href='http://doc.rust-lang.org/nightly/collections/range/trait.RangeArgument.html' title='collections::range::RangeArgument'>RangeArgument</a><<a href='http://doc.rust-lang.org/nightly/std/primitive.usize.html'>usize</a>></span></code></h4> +<div class='stability'><em class='stab unstable'>Unstable<p>: recently added, matches RFC</p> +</em></div><div class='docblock'><p>Create a draining iterator that removes the specified range in the vector +and yields the removed items from start to end. The element range is +removed even if the iterator is not consumed until the end.</p> + +<p>Note: It is unspecified how many elements are removed from the vector, +if the <code>Drain</code> value is leaked.</p> + +<h1 id="panics" class='section-header'><a + href="#panics">Panics</a></h1> +<p>Panics if the starting point is greater than the end point or if +the end point is greater than the length of the vector.</p> + +<h1 id="examples" class='section-header'><a + href="#examples">Examples</a></h1><pre class='rust rust-example-rendered'> + +<span class='comment'>// Draining using `..` clears the whole vector.</span> +<span class='kw'>let</span> <span class='kw-2'>mut</span> <span class='ident'>v</span> <span class='op'>=</span> <span class='macro'>vec</span><span class='macro'>!</span>[<span class='number'>1</span>, <span class='number'>2</span>, <span class='number'>3</span>]; +<span class='kw'>let</span> <span class='ident'>u</span>: <span class='ident'>Vec</span><span class='op'><</span>_<span class='op'>></span> <span class='op'>=</span> <span class='ident'>v</span>.<span class='ident'>drain</span>(..).<span class='ident'>collect</span>(); +<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>v</span>, <span class='kw-2'>&</span>[]); +<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>u</span>, <span class='kw-2'>&</span>[<span class='number'>1</span>, <span class='number'>2</span>, <span class='number'>3</span>]); +</pre> +</div><h4 id='method.clear' class='method'><code>fn <a href='#method.clear' class='fnname'>clear</a>(&mut self)</code></h4> +<div class='docblock'><p>Clears the vector, removing all values.</p> + +<h1 id="examples" class='section-header'><a + href="#examples">Examples</a></h1><pre class='rust rust-example-rendered'> +<span class='kw'>let</span> <span class='kw-2'>mut</span> <span class='ident'>v</span> <span class='op'>=</span> <span class='macro'>vec</span><span class='macro'>!</span>[<span class='number'>1</span>, <span class='number'>2</span>, <span class='number'>3</span>]; + +<span class='ident'>v</span>.<span class='ident'>clear</span>(); + +<span class='macro'>assert</span><span class='macro'>!</span>(<span class='ident'>v</span>.<span class='ident'>is_empty</span>()); +</pre> +</div><h4 id='method.len' class='method'><code>fn <a href='#method.len' class='fnname'>len</a>(&self) -> <a href='http://doc.rust-lang.org/nightly/std/primitive.usize.html'>usize</a></code></h4> +<div class='docblock'><p>Returns the number of elements in the vector.</p> + +<h1 id="examples" class='section-header'><a + href="#examples">Examples</a></h1><pre class='rust rust-example-rendered'> +<span class='kw'>let</span> <span class='ident'>a</span> <span class='op'>=</span> <span class='macro'>vec</span><span class='macro'>!</span>[<span class='number'>1</span>, <span class='number'>2</span>, <span class='number'>3</span>]; +<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>a</span>.<span class='ident'>len</span>(), <span class='number'>3</span>); +</pre> +</div><h4 id='method.is_empty' class='method'><code>fn <a href='#method.is_empty' class='fnname'>is_empty</a>(&self) -> <a href='http://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></code></h4> +<div class='docblock'><p>Returns <code>true</code> if the vector contains no elements.</p> + +<h1 id="examples" class='section-header'><a + href="#examples">Examples</a></h1><pre class='rust rust-example-rendered'> +<span class='kw'>let</span> <span class='kw-2'>mut</span> <span class='ident'>v</span> <span class='op'>=</span> <span class='ident'>Vec</span>::<span class='ident'>new</span>(); +<span class='macro'>assert</span><span class='macro'>!</span>(<span class='ident'>v</span>.<span class='ident'>is_empty</span>()); + +<span class='ident'>v</span>.<span class='ident'>push</span>(<span class='number'>1</span>); +<span class='macro'>assert</span><span class='macro'>!</span>(<span class='op'>!</span><span class='ident'>v</span>.<span class='ident'>is_empty</span>()); +</pre> +</div><h4 id='method.map_in_place' class='method'><code>fn <a href='#method.map_in_place' class='fnname'>map_in_place</a><U, F>(self, f: F) -> <a class='struct' href='http://doc.rust-lang.org/nightly/collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><U> <span class='where'>where F: <a class='trait' href='http://doc.rust-lang.org/nightly/core/ops/trait.FnMut.html' title='core::ops::FnMut'>FnMut</a>(T) -> U</span></code></h4> +<div class='stability'><em class='stab unstable'>Unstable<p>: API may change to provide stronger guarantees</p> +</em></div><div class='docblock'><p>Converts a <code>Vec<T></code> to a <code>Vec<U></code> where <code>T</code> and <code>U</code> have the same +size and in case they are not zero-sized the same minimal alignment.</p> + +<h1 id="panics" class='section-header'><a + href="#panics">Panics</a></h1> +<p>Panics if <code>T</code> and <code>U</code> have differing sizes or are not zero-sized and +have differing minimal alignments.</p> + +<h1 id="examples" class='section-header'><a + href="#examples">Examples</a></h1><pre class='rust rust-example-rendered'> +<span class='kw'>let</span> <span class='ident'>v</span> <span class='op'>=</span> <span class='macro'>vec</span><span class='macro'>!</span>[<span class='number'>0</span>, <span class='number'>1</span>, <span class='number'>2</span>]; +<span class='kw'>let</span> <span class='ident'>w</span> <span class='op'>=</span> <span class='ident'>v</span>.<span class='ident'>map_in_place</span>(<span class='op'>|</span><span class='ident'>i</span><span class='op'>|</span> <span class='ident'>i</span> <span class='op'>+</span> <span class='number'>3</span>); +<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='kw-2'>&</span><span class='ident'>w</span>[..], <span class='kw-2'>&</span>[<span class='number'>3</span>, <span class='number'>4</span>, <span class='number'>5</span>]); + +<span class='attribute'>#[<span class='ident'>derive</span>(<span class='ident'>PartialEq</span>, <span class='ident'>Debug</span>)]</span> +<span class='kw'>struct</span> <span class='ident'>Newtype</span>(<span class='ident'>u8</span>); +<span class='kw'>let</span> <span class='ident'>bytes</span> <span class='op'>=</span> <span class='macro'>vec</span><span class='macro'>!</span>[<span class='number'>0x11</span>, <span class='number'>0x22</span>]; +<span class='kw'>let</span> <span class='ident'>newtyped_bytes</span> <span class='op'>=</span> <span class='ident'>bytes</span>.<span class='ident'>map_in_place</span>(<span class='op'>|</span><span class='ident'>x</span><span class='op'>|</span> <span class='ident'>Newtype</span>(<span class='ident'>x</span>)); +<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='kw-2'>&</span><span class='ident'>newtyped_bytes</span>[..], <span class='kw-2'>&</span>[<span class='ident'>Newtype</span>(<span class='number'>0x11</span>), <span class='ident'>Newtype</span>(<span class='number'>0x22</span>)]); +</pre> +</div><h4 id='method.split_off' class='method'><code>fn <a href='#method.split_off' class='fnname'>split_off</a>(&mut self, at: <a href='http://doc.rust-lang.org/nightly/std/primitive.usize.html'>usize</a>) -> <a class='struct' href='http://doc.rust-lang.org/nightly/collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><T></code></h4> +<div class='stability'><em class='stab unstable'>Unstable<p>: new API, waiting for dust to settle</p> +</em></div><div class='docblock'><p>Splits the collection into two at the given index.</p> + +<p>Returns a newly allocated <code>Self</code>. <code>self</code> contains elements <code>[0, at)</code>, +and the returned <code>Self</code> contains elements <code>[at, len)</code>.</p> + +<p>Note that the capacity of <code>self</code> does not change.</p> + +<h1 id="panics" class='section-header'><a + href="#panics">Panics</a></h1> +<p>Panics if <code>at > len</code>.</p> + +<h1 id="examples" class='section-header'><a + href="#examples">Examples</a></h1><pre class='rust rust-example-rendered'> +<span class='kw'>let</span> <span class='kw-2'>mut</span> <span class='ident'>vec</span> <span class='op'>=</span> <span class='macro'>vec</span><span class='macro'>!</span>[<span class='number'>1</span>,<span class='number'>2</span>,<span class='number'>3</span>]; +<span class='kw'>let</span> <span class='ident'>vec2</span> <span class='op'>=</span> <span class='ident'>vec</span>.<span class='ident'>split_off</span>(<span class='number'>1</span>); +<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>vec</span>, [<span class='number'>1</span>]); +<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>vec2</span>, [<span class='number'>2</span>, <span class='number'>3</span>]); +</pre> +</div></div><div class='impl-items'><h4 id='method.resize' class='method'><code>fn <a href='#method.resize' class='fnname'>resize</a>(&mut self, new_len: <a href='http://doc.rust-lang.org/nightly/std/primitive.usize.html'>usize</a>, value: T)</code></h4> +<div class='stability'><em class='stab unstable'>Unstable<p>: matches collection reform specification; waiting for dust to settle</p> +</em></div><div class='docblock'><p>Resizes the <code>Vec</code> in-place so that <code>len()</code> is equal to <code>new_len</code>.</p> + +<p>Calls either <code>extend()</code> or <code>truncate()</code> depending on whether <code>new_len</code> +is larger than the current value of <code>len()</code> or not.</p> + +<h1 id="examples" class='section-header'><a + href="#examples">Examples</a></h1><pre class='rust rust-example-rendered'> +<span class='kw'>let</span> <span class='kw-2'>mut</span> <span class='ident'>vec</span> <span class='op'>=</span> <span class='macro'>vec</span><span class='macro'>!</span>[<span class='string'>"hello"</span>]; +<span class='ident'>vec</span>.<span class='ident'>resize</span>(<span class='number'>3</span>, <span class='string'>"world"</span>); +<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>vec</span>, [<span class='string'>"hello"</span>, <span class='string'>"world"</span>, <span class='string'>"world"</span>]); + +<span class='kw'>let</span> <span class='kw-2'>mut</span> <span class='ident'>vec</span> <span class='op'>=</span> <span class='macro'>vec</span><span class='macro'>!</span>[<span class='number'>1</span>, <span class='number'>2</span>, <span class='number'>3</span>, <span class='number'>4</span>]; +<span class='ident'>vec</span>.<span class='ident'>resize</span>(<span class='number'>2</span>, <span class='number'>0</span>); +<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>vec</span>, [<span class='number'>1</span>, <span class='number'>2</span>]); +</pre> +</div><h4 id='method.push_all' class='method'><code>fn <a href='#method.push_all' class='fnname'>push_all</a>(&mut self, other: <a href='http://doc.rust-lang.org/nightly/std/primitive.slice.html'>&[T]</a>)</code></h4> +<div class='stability'><em class='stab unstable'>Unstable<p>: likely to be replaced by a more optimized extend</p> +</em></div><div class='docblock'><p>Appends all elements in a slice to the <code>Vec</code>.</p> + +<p>Iterates over the slice <code>other</code>, clones each element, and then appends +it to this <code>Vec</code>. The <code>other</code> vector is traversed in-order.</p> + +<h1 id="examples" class='section-header'><a + href="#examples">Examples</a></h1><pre class='rust rust-example-rendered'> +<span class='kw'>let</span> <span class='kw-2'>mut</span> <span class='ident'>vec</span> <span class='op'>=</span> <span class='macro'>vec</span><span class='macro'>!</span>[<span class='number'>1</span>]; +<span class='ident'>vec</span>.<span class='ident'>push_all</span>(<span class='kw-2'>&</span>[<span class='number'>2</span>, <span class='number'>3</span>, <span class='number'>4</span>]); +<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>vec</span>, [<span class='number'>1</span>, <span class='number'>2</span>, <span class='number'>3</span>, <span class='number'>4</span>]); +</pre> +</div></div><div class='impl-items'><h4 id='method.dedup' class='method'><code>fn <a href='#method.dedup' class='fnname'>dedup</a>(&mut self)</code></h4> +<div class='docblock'><p>Removes consecutive repeated elements in the vector.</p> + +<p>If the vector is sorted, this removes all duplicates.</p> + +<h1 id="examples" class='section-header'><a + href="#examples">Examples</a></h1><pre class='rust rust-example-rendered'> +<span class='kw'>let</span> <span class='kw-2'>mut</span> <span class='ident'>vec</span> <span class='op'>=</span> <span class='macro'>vec</span><span class='macro'>!</span>[<span class='number'>1</span>, <span class='number'>2</span>, <span class='number'>2</span>, <span class='number'>3</span>, <span class='number'>2</span>]; + +<span class='ident'>vec</span>.<span class='ident'>dedup</span>(); + +<span class='macro'>assert_eq</span><span class='macro'>!</span>(<span class='ident'>vec</span>, [<span class='number'>1</span>, <span class='number'>2</span>, <span class='number'>3</span>, <span class='number'>2</span>]); +</pre> +</div></div><h2 id='implementations'>Trait Implementations</h2><h3 class='impl'><code>impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/ops/trait.Deref.html' title='core::ops::Deref'>Deref</a> for <a class='struct' href='../regex_syntax/struct.CharClass.html' title='regex_syntax::CharClass'>CharClass</a></code></h3><div class='impl-items'><h4 id='assoc_type.Target' class='type'><code>type Target = <a class='struct' href='http://doc.rust-lang.org/nightly/collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><<a class='struct' href='../regex_syntax/struct.ClassRange.html' title='regex_syntax::ClassRange'>ClassRange</a>></code></h4> +<h4 id='method.deref' class='method'><code>fn <a href='http://doc.rust-lang.org/nightly/core/ops/trait.Deref.html#method.deref' class='fnname'>deref</a>(&self) -> &<a class='struct' href='http://doc.rust-lang.org/nightly/collections/vec/struct.Vec.html' title='collections::vec::Vec'>Vec</a><<a class='struct' href='../regex_syntax/struct.ClassRange.html' title='regex_syntax::ClassRange'>ClassRange</a>></code></h4> +</div><h3 class='impl'><code>impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/iter/trait.IntoIterator.html' title='core::iter::IntoIterator'>IntoIterator</a> for <a class='struct' href='../regex_syntax/struct.CharClass.html' title='regex_syntax::CharClass'>CharClass</a></code></h3><div class='impl-items'><h4 id='assoc_type.Item' class='type'><code>type Item = <a class='struct' href='../regex_syntax/struct.ClassRange.html' title='regex_syntax::ClassRange'>ClassRange</a></code></h4> +<h4 id='assoc_type.IntoIter' class='type'><code>type IntoIter = <a class='struct' href='http://doc.rust-lang.org/nightly/collections/vec/struct.IntoIter.html' title='collections::vec::IntoIter'>IntoIter</a><<a class='struct' href='../regex_syntax/struct.ClassRange.html' title='regex_syntax::ClassRange'>ClassRange</a>></code></h4> +<h4 id='method.into_iter' class='method'><code>fn <a href='http://doc.rust-lang.org/nightly/core/iter/trait.IntoIterator.html#method.into_iter' class='fnname'>into_iter</a>(self) -> <a class='struct' href='http://doc.rust-lang.org/nightly/collections/vec/struct.IntoIter.html' title='collections::vec::IntoIter'>IntoIter</a><<a class='struct' href='../regex_syntax/struct.ClassRange.html' title='regex_syntax::ClassRange'>ClassRange</a>></code></h4> +</div><h3 class='impl'><code>impl<'a> <a class='trait' href='http://doc.rust-lang.org/nightly/core/iter/trait.IntoIterator.html' title='core::iter::IntoIterator'>IntoIterator</a> for &'a <a class='struct' href='../regex_syntax/struct.CharClass.html' title='regex_syntax::CharClass'>CharClass</a></code></h3><div class='impl-items'><h4 id='assoc_type.Item' class='type'><code>type Item = &'a <a class='struct' href='../regex_syntax/struct.ClassRange.html' title='regex_syntax::ClassRange'>ClassRange</a></code></h4> +<h4 id='assoc_type.IntoIter' class='type'><code>type IntoIter = <a class='struct' href='http://doc.rust-lang.org/nightly/core/slice/struct.Iter.html' title='core::slice::Iter'>Iter</a><'a, <a class='struct' href='../regex_syntax/struct.ClassRange.html' title='regex_syntax::ClassRange'>ClassRange</a>></code></h4> +<h4 id='method.into_iter' class='method'><code>fn <a href='http://doc.rust-lang.org/nightly/core/iter/trait.IntoIterator.html#method.into_iter' class='fnname'>into_iter</a>(self) -> <a class='struct' href='http://doc.rust-lang.org/nightly/core/slice/struct.Iter.html' title='core::slice::Iter'>Iter</a><'a, <a class='struct' href='../regex_syntax/struct.ClassRange.html' title='regex_syntax::ClassRange'>ClassRange</a>></code></h4> +</div><h3 class='impl'><code>impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/fmt/trait.Display.html' title='core::fmt::Display'>Display</a> for <a class='struct' href='../regex_syntax/struct.CharClass.html' title='regex_syntax::CharClass'>CharClass</a></code></h3><div class='impl-items'><h4 id='method.fmt' class='method'><code>fn <a href='http://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#method.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class='struct' href='http://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html' title='core::fmt::Formatter'>Formatter</a>) -> <a class='type' href='http://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='http://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html' title='core::cmp::Eq'>Eq</a> for <a class='struct' href='../regex_syntax/struct.CharClass.html' title='regex_syntax::CharClass'>CharClass</a></code></h3><div class='impl-items'></div><h3 class='impl'><code>impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a> for <a class='struct' href='../regex_syntax/struct.CharClass.html' title='regex_syntax::CharClass'>CharClass</a></code></h3><div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='http://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.eq' class='fnname'>eq</a>(&self, __arg_0: &<a class='struct' href='../regex_syntax/struct.CharClass.html' title='regex_syntax::CharClass'>CharClass</a>) -> <a href='http://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></code></h4> +<h4 id='method.ne' class='method'><code>fn <a href='http://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, __arg_0: &<a class='struct' href='../regex_syntax/struct.CharClass.html' title='regex_syntax::CharClass'>CharClass</a>) -> <a href='http://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></code></h4> +</div><h3 class='impl'><code>impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html' title='core::fmt::Debug'>Debug</a> for <a class='struct' href='../regex_syntax/struct.CharClass.html' title='regex_syntax::CharClass'>CharClass</a></code></h3><div class='impl-items'><h4 id='method.fmt' class='method'><code>fn <a href='http://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#method.fmt' class='fnname'>fmt</a>(&self, __arg_0: &mut <a class='struct' href='http://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html' title='core::fmt::Formatter'>Formatter</a>) -> <a class='type' href='http://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='http://doc.rust-lang.org/nightly/core/clone/trait.Clone.html' title='core::clone::Clone'>Clone</a> for <a class='struct' href='../regex_syntax/struct.CharClass.html' title='regex_syntax::CharClass'>CharClass</a></code></h3><div class='impl-items'><h4 id='method.clone' class='method'><code>fn <a href='http://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone' class='fnname'>clone</a>(&self) -> <a class='struct' href='../regex_syntax/struct.CharClass.html' title='regex_syntax::CharClass'>CharClass</a></code></h4> +<h4 id='method.clone_from' class='method'><code>fn <a href='http://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&mut self, source: &Self)</code></h4> +</div></section> + <section id='search' class="content hidden"></section> + + <section class="footer"></section> + + <div id="help" class="hidden"> + <div class="shortcuts"> + <h1>Keyboard shortcuts</h1> + <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"> + <h1>Search tricks</h1> + <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>typedef</code> (or + <code>tdef</code>). + </p> + <p> + Search functions by type signature (e.g. + <code>vec -> usize</code>) + </p> + </div> + </div> + + + + <script> + window.rootPath = "../"; + window.currentCrate = "regex_syntax"; + window.playgroundUrl = ""; + </script> + <script src="../jquery.js"></script> + <script src="../main.js"></script> + + <script async src="../search-index.js"></script> +</body> +</html>
\ No newline at end of file diff --git a/regex_syntax/struct.ClassRange.html b/regex_syntax/struct.ClassRange.html new file mode 100644 index 0000000..d1d34f6 --- /dev/null +++ b/regex_syntax/struct.ClassRange.html @@ -0,0 +1,140 @@ +<!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 `ClassRange` struct in crate `regex_syntax`."> + <meta name="keywords" content="rust, rustlang, rust-lang, ClassRange"> + + <title>regex_syntax::ClassRange - Rust</title> + + <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]--> + + + + <section class="sidebar"> + + <p class='location'><a href='index.html'>regex_syntax</a></p><script>window.sidebarCurrent = {name: 'ClassRange', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script> + </section> + + <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 struct"> +<h1 class='fqn'><span class='in-band'>Struct <a href='index.html'>regex_syntax</a>::<wbr><a class='struct' href=''>ClassRange</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-41994' class='srclink' href='../src/regex_syntax/lib.rs.html#214-224' title='goto source code'>[src]</a></span></h1> +<pre class='rust struct'>pub struct ClassRange { + pub start: <a href='http://doc.rust-lang.org/nightly/std/primitive.char.html'>char</a>, + pub end: <a href='http://doc.rust-lang.org/nightly/std/primitive.char.html'>char</a>, +}</pre><div class='docblock'><p>A single inclusive range in a character class.</p> + +<p>Since range boundaries are defined by Unicode scalar values, the boundaries +can never be in the open interval <code>(0xD7FF, 0xE000)</code>. However, a range may +<em>cover</em> codepoints that are not scalar values.</p> + +<p>Note that this has a few convenient impls on <code>PartialEq</code> and <code>PartialOrd</code> +for testing whether a character is contained inside a given range.</p> +</div><h2 class='fields'>Fields</h2> +<table><tr class='stab '> + <td id='structfield.start'><code>start</code></td><td><div class='docblock'><p>The start character of the range.</p> + +<p>This must be less than or equal to <code>end</code>.</p> +</div></td></tr><tr class='stab '> + <td id='structfield.end'><code>end</code></td><td><div class='docblock'><p>The end character of the range.</p> + +<p>This must be greater than or equal to <code>end</code>.</p> +</div></td></tr></table><h2 id='implementations'>Trait Implementations</h2><h3 class='impl'><code>impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a><<a href='http://doc.rust-lang.org/nightly/std/primitive.char.html'>char</a>> for <a class='struct' href='../regex_syntax/struct.ClassRange.html' title='regex_syntax::ClassRange'>ClassRange</a></code></h3><div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='http://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.eq' class='fnname'>eq</a>(&self, other: &<a href='http://doc.rust-lang.org/nightly/std/primitive.char.html'>char</a>) -> <a href='http://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></code></h4> +<h4 id='method.ne' class='method'><code>fn <a href='http://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, other: &Rhs) -> <a href='http://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></code></h4> +</div><h3 class='impl'><code>impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html' title='core::cmp::PartialOrd'>PartialOrd</a><<a href='http://doc.rust-lang.org/nightly/std/primitive.char.html'>char</a>> for <a class='struct' href='../regex_syntax/struct.ClassRange.html' title='regex_syntax::ClassRange'>ClassRange</a></code></h3><div class='impl-items'><h4 id='method.partial_cmp' class='method'><code>fn <a href='http://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.partial_cmp' class='fnname'>partial_cmp</a>(&self, other: &<a href='http://doc.rust-lang.org/nightly/std/primitive.char.html'>char</a>) -> <a class='enum' href='http://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a><<a class='enum' href='http://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html' title='core::cmp::Ordering'>Ordering</a>></code></h4> +<h4 id='method.lt' class='method'><code>fn <a href='http://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt' class='fnname'>lt</a>(&self, other: &Rhs) -> <a href='http://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></code></h4> +<h4 id='method.le' class='method'><code>fn <a href='http://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le' class='fnname'>le</a>(&self, other: &Rhs) -> <a href='http://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></code></h4> +<h4 id='method.gt' class='method'><code>fn <a href='http://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt' class='fnname'>gt</a>(&self, other: &Rhs) -> <a href='http://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></code></h4> +<h4 id='method.ge' class='method'><code>fn <a href='http://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge' class='fnname'>ge</a>(&self, other: &Rhs) -> <a href='http://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></code></h4> +</div><h3 class='impl'><code>impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/fmt/trait.Display.html' title='core::fmt::Display'>Display</a> for <a class='struct' href='../regex_syntax/struct.ClassRange.html' title='regex_syntax::ClassRange'>ClassRange</a></code></h3><div class='impl-items'><h4 id='method.fmt' class='method'><code>fn <a href='http://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#method.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class='struct' href='http://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html' title='core::fmt::Formatter'>Formatter</a>) -> <a class='type' href='http://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='http://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html' title='core::cmp::Ord'>Ord</a> for <a class='struct' href='../regex_syntax/struct.ClassRange.html' title='regex_syntax::ClassRange'>ClassRange</a></code></h3><div class='impl-items'><h4 id='method.cmp' class='method'><code>fn <a href='http://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html#method.cmp' class='fnname'>cmp</a>(&self, __arg_0: &<a class='struct' href='../regex_syntax/struct.ClassRange.html' title='regex_syntax::ClassRange'>ClassRange</a>) -> <a class='enum' href='http://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html' title='core::cmp::Ordering'>Ordering</a></code></h4> +</div><h3 class='impl'><code>impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/cmp/trait.Eq.html' title='core::cmp::Eq'>Eq</a> for <a class='struct' href='../regex_syntax/struct.ClassRange.html' title='regex_syntax::ClassRange'>ClassRange</a></code></h3><div class='impl-items'></div><h3 class='impl'><code>impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html' title='core::cmp::PartialOrd'>PartialOrd</a> for <a class='struct' href='../regex_syntax/struct.ClassRange.html' title='regex_syntax::ClassRange'>ClassRange</a></code></h3><div class='impl-items'><h4 id='method.partial_cmp' class='method'><code>fn <a href='http://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.partial_cmp' class='fnname'>partial_cmp</a>(&self, __arg_0: &<a class='struct' href='../regex_syntax/struct.ClassRange.html' title='regex_syntax::ClassRange'>ClassRange</a>) -> <a class='enum' href='http://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a><<a class='enum' href='http://doc.rust-lang.org/nightly/core/cmp/enum.Ordering.html' title='core::cmp::Ordering'>Ordering</a>></code></h4> +<h4 id='method.lt' class='method'><code>fn <a href='http://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.lt' class='fnname'>lt</a>(&self, __arg_0: &<a class='struct' href='../regex_syntax/struct.ClassRange.html' title='regex_syntax::ClassRange'>ClassRange</a>) -> <a href='http://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></code></h4> +<h4 id='method.le' class='method'><code>fn <a href='http://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.le' class='fnname'>le</a>(&self, __arg_0: &<a class='struct' href='../regex_syntax/struct.ClassRange.html' title='regex_syntax::ClassRange'>ClassRange</a>) -> <a href='http://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></code></h4> +<h4 id='method.gt' class='method'><code>fn <a href='http://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.gt' class='fnname'>gt</a>(&self, __arg_0: &<a class='struct' href='../regex_syntax/struct.ClassRange.html' title='regex_syntax::ClassRange'>ClassRange</a>) -> <a href='http://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></code></h4> +<h4 id='method.ge' class='method'><code>fn <a href='http://doc.rust-lang.org/nightly/core/cmp/trait.PartialOrd.html#method.ge' class='fnname'>ge</a>(&self, __arg_0: &<a class='struct' href='../regex_syntax/struct.ClassRange.html' title='regex_syntax::ClassRange'>ClassRange</a>) -> <a href='http://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></code></h4> +</div><h3 class='impl'><code>impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a> for <a class='struct' href='../regex_syntax/struct.ClassRange.html' title='regex_syntax::ClassRange'>ClassRange</a></code></h3><div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='http://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.eq' class='fnname'>eq</a>(&self, __arg_0: &<a class='struct' href='../regex_syntax/struct.ClassRange.html' title='regex_syntax::ClassRange'>ClassRange</a>) -> <a href='http://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></code></h4> +<h4 id='method.ne' class='method'><code>fn <a href='http://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, __arg_0: &<a class='struct' href='../regex_syntax/struct.ClassRange.html' title='regex_syntax::ClassRange'>ClassRange</a>) -> <a href='http://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></code></h4> +</div><h3 class='impl'><code>impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html' title='core::fmt::Debug'>Debug</a> for <a class='struct' href='../regex_syntax/struct.ClassRange.html' title='regex_syntax::ClassRange'>ClassRange</a></code></h3><div class='impl-items'><h4 id='method.fmt' class='method'><code>fn <a href='http://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#method.fmt' class='fnname'>fmt</a>(&self, __arg_0: &mut <a class='struct' href='http://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html' title='core::fmt::Formatter'>Formatter</a>) -> <a class='type' href='http://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='http://doc.rust-lang.org/nightly/core/marker/trait.Copy.html' title='core::marker::Copy'>Copy</a> for <a class='struct' href='../regex_syntax/struct.ClassRange.html' title='regex_syntax::ClassRange'>ClassRange</a></code></h3><div class='impl-items'></div><h3 class='impl'><code>impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/clone/trait.Clone.html' title='core::clone::Clone'>Clone</a> for <a class='struct' href='../regex_syntax/struct.ClassRange.html' title='regex_syntax::ClassRange'>ClassRange</a></code></h3><div class='impl-items'><h4 id='method.clone' class='method'><code>fn <a href='http://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone' class='fnname'>clone</a>(&self) -> <a class='struct' href='../regex_syntax/struct.ClassRange.html' title='regex_syntax::ClassRange'>ClassRange</a></code></h4> +<h4 id='method.clone_from' class='method'><code>fn <a href='http://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&mut self, source: &Self)</code></h4> +</div></section> + <section id='search' class="content hidden"></section> + + <section class="footer"></section> + + <div id="help" class="hidden"> + <div class="shortcuts"> + <h1>Keyboard shortcuts</h1> + <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"> + <h1>Search tricks</h1> + <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>typedef</code> (or + <code>tdef</code>). + </p> + <p> + Search functions by type signature (e.g. + <code>vec -> usize</code>) + </p> + </div> + </div> + + + + <script> + window.rootPath = "../"; + window.currentCrate = "regex_syntax"; + window.playgroundUrl = ""; + </script> + <script src="../jquery.js"></script> + <script src="../main.js"></script> + + <script async src="../search-index.js"></script> +</body> +</html>
\ No newline at end of file diff --git a/regex_syntax/struct.Error.html b/regex_syntax/struct.Error.html new file mode 100644 index 0000000..3ab9c44 --- /dev/null +++ b/regex_syntax/struct.Error.html @@ -0,0 +1,123 @@ +<!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 `Error` struct in crate `regex_syntax`."> + <meta name="keywords" content="rust, rustlang, rust-lang, Error"> + + <title>regex_syntax::Error - Rust</title> + + <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]--> + + + + <section class="sidebar"> + + <p class='location'><a href='index.html'>regex_syntax</a></p><script>window.sidebarCurrent = {name: 'Error', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script> + </section> + + <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 struct"> +<h1 class='fqn'><span class='in-band'>Struct <a href='index.html'>regex_syntax</a>::<wbr><a class='struct' href=''>Error</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-45066' class='srclink' href='../src/regex_syntax/lib.rs.html#647-651' title='goto source code'>[src]</a></span></h1> +<pre class='rust struct'>pub struct Error { + // some fields omitted +}</pre><div class='docblock'><p>A parse error.</p> + +<p>This includes details about the specific type of error and a rough +approximation of where it occurred.</p> +</div><h2 id='methods'>Methods</h2><h3 class='impl'><code>impl <a class='struct' href='../regex_syntax/struct.Error.html' title='regex_syntax::Error'>Error</a></code></h3><div class='impl-items'><h4 id='method.position' class='method'><code>fn <a href='#method.position' class='fnname'>position</a>(&self) -> <a href='http://doc.rust-lang.org/nightly/std/primitive.usize.html'>usize</a></code></h4> +<div class='docblock'><p>Returns an approximate <em>character</em> offset at which the error occurred.</p> + +<p>The character offset may be equal to the number of characters in the +string, in which case it should be interpreted as pointing to the end +of the regex.</p> +</div><h4 id='method.kind' class='method'><code>fn <a href='#method.kind' class='fnname'>kind</a>(&self) -> &<a class='enum' href='../regex_syntax/enum.ErrorKind.html' title='regex_syntax::ErrorKind'>ErrorKind</a></code></h4> +<div class='docblock'><p>Returns the type of the regex parse error.</p> +</div></div><h2 id='implementations'>Trait Implementations</h2><h3 class='impl'><code>impl <a class='trait' href='http://doc.rust-lang.org/nightly/std/error/trait.Error.html' title='std::error::Error'>Error</a> for <a class='struct' href='../regex_syntax/struct.Error.html' title='regex_syntax::Error'>Error</a></code></h3><div class='impl-items'><h4 id='method.description' class='method'><code>fn <a href='http://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.description' class='fnname'>description</a>(&self) -> &<a href='http://doc.rust-lang.org/nightly/std/primitive.str.html'>str</a></code></h4> +<h4 id='method.cause' class='method'><code>fn <a href='http://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.cause' class='fnname'>cause</a>(&self) -> <a class='enum' href='http://doc.rust-lang.org/nightly/core/option/enum.Option.html' title='core::option::Option'>Option</a><&<a class='trait' href='http://doc.rust-lang.org/nightly/std/error/trait.Error.html' title='std::error::Error'>Error</a>></code></h4> +</div><h3 class='impl'><code>impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/fmt/trait.Display.html' title='core::fmt::Display'>Display</a> for <a class='struct' href='../regex_syntax/struct.Error.html' title='regex_syntax::Error'>Error</a></code></h3><div class='impl-items'><h4 id='method.fmt' class='method'><code>fn <a href='http://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#method.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class='struct' href='http://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html' title='core::fmt::Formatter'>Formatter</a>) -> <a class='type' href='http://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='http://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html' title='core::cmp::PartialEq'>PartialEq</a> for <a class='struct' href='../regex_syntax/struct.Error.html' title='regex_syntax::Error'>Error</a></code></h3><div class='impl-items'><h4 id='method.eq' class='method'><code>fn <a href='http://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.eq' class='fnname'>eq</a>(&self, __arg_0: &<a class='struct' href='../regex_syntax/struct.Error.html' title='regex_syntax::Error'>Error</a>) -> <a href='http://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></code></h4> +<h4 id='method.ne' class='method'><code>fn <a href='http://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&self, __arg_0: &<a class='struct' href='../regex_syntax/struct.Error.html' title='regex_syntax::Error'>Error</a>) -> <a href='http://doc.rust-lang.org/nightly/std/primitive.bool.html'>bool</a></code></h4> +</div><h3 class='impl'><code>impl <a class='trait' href='http://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html' title='core::fmt::Debug'>Debug</a> for <a class='struct' href='../regex_syntax/struct.Error.html' title='regex_syntax::Error'>Error</a></code></h3><div class='impl-items'><h4 id='method.fmt' class='method'><code>fn <a href='http://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#method.fmt' class='fnname'>fmt</a>(&self, __arg_0: &mut <a class='struct' href='http://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html' title='core::fmt::Formatter'>Formatter</a>) -> <a class='type' href='http://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='http://doc.rust-lang.org/nightly/core/clone/trait.Clone.html' title='core::clone::Clone'>Clone</a> for <a class='struct' href='../regex_syntax/struct.Error.html' title='regex_syntax::Error'>Error</a></code></h3><div class='impl-items'><h4 id='method.clone' class='method'><code>fn <a href='http://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone' class='fnname'>clone</a>(&self) -> <a class='struct' href='../regex_syntax/struct.Error.html' title='regex_syntax::Error'>Error</a></code></h4> +<h4 id='method.clone_from' class='method'><code>fn <a href='http://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&mut self, source: &Self)</code></h4> +</div></section> + <section id='search' class="content hidden"></section> + + <section class="footer"></section> + + <div id="help" class="hidden"> + <div class="shortcuts"> + <h1>Keyboard shortcuts</h1> + <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"> + <h1>Search tricks</h1> + <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>typedef</code> (or + <code>tdef</code>). + </p> + <p> + Search functions by type signature (e.g. + <code>vec -> usize</code>) + </p> + </div> + </div> + + + + <script> + window.rootPath = "../"; + window.currentCrate = "regex_syntax"; + window.playgroundUrl = ""; + </script> + <script src="../jquery.js"></script> + <script src="../main.js"></script> + + <script async src="../search-index.js"></script> +</body> +</html>
\ No newline at end of file diff --git a/regex_syntax/type.Result.html b/regex_syntax/type.Result.html new file mode 100644 index 0000000..ca0c192 --- /dev/null +++ b/regex_syntax/type.Result.html @@ -0,0 +1,102 @@ +<!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 `Result` type in crate `regex_syntax`."> + <meta name="keywords" content="rust, rustlang, rust-lang, Result"> + + <title>regex_syntax::Result - Rust</title> + + <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]--> + + + + <section class="sidebar"> + + <p class='location'><a href='index.html'>regex_syntax</a></p><script>window.sidebarCurrent = {name: 'Result', ty: 'type', relpath: ''};</script><script defer src="sidebar-items.js"></script> + </section> + + <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 type"> +<h1 class='fqn'><span class='in-band'><a href='index.html'>regex_syntax</a>::<wbr><a class='type' href=''>Result</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-45060' class='srclink' href='../src/regex_syntax/lib.rs.html#640' title='goto source code'>[src]</a></span></h1> +<pre class='rust typedef'>type Result<T> = <a class='enum' href='http://doc.rust-lang.org/nightly/core/result/enum.Result.html' title='core::result::Result'>Result</a><T, <a class='struct' href='../regex_syntax/struct.Error.html' title='regex_syntax::Error'>Error</a>>;</pre><div class='docblock'><p>An alias for computations that can return a <code>Error</code>.</p> +</div></section> + <section id='search' class="content hidden"></section> + + <section class="footer"></section> + + <div id="help" class="hidden"> + <div class="shortcuts"> + <h1>Keyboard shortcuts</h1> + <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"> + <h1>Search tricks</h1> + <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>typedef</code> (or + <code>tdef</code>). + </p> + <p> + Search functions by type signature (e.g. + <code>vec -> usize</code>) + </p> + </div> + </div> + + + + <script> + window.rootPath = "../"; + window.currentCrate = "regex_syntax"; + window.playgroundUrl = ""; + </script> + <script src="../jquery.js"></script> + <script src="../main.js"></script> + + <script async src="../search-index.js"></script> +</body> +</html>
\ No newline at end of file |