mentat/docs/apis/rust/mentat_parser_utils/macros/struct.KeywordMapParser.html

268 lines
122 KiB
HTML
Raw Normal View History

2018-06-21 14:44:35 +00:00
<!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 `KeywordMapParser` struct in crate `mentat_parser_utils`.">
<meta name="keywords" content="rust, rustlang, rust-lang, KeywordMapParser">
<title>mentat_parser_utils::macros::KeywordMapParser - Rust</title>
<link rel="stylesheet" type="text/css" href="../../normalize.css">
<link rel="stylesheet" type="text/css" href="../../rustdoc.css"
id="mainThemeStyle">
<link rel="stylesheet" type="text/css" href="../../dark.css">
<link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle">
<script src="../../storage.js"></script>
</head>
<body class="rustdoc struct">
<!--[if lte IE 8]>
<div class="warning">
This old browser is unsupported and will most likely display funky
things.
</div>
<![endif]-->
<nav class="sidebar">
<div class="sidebar-menu">&#9776;</div>
<p class='location'>Struct KeywordMapParser</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Parser">Parser</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a></div></div><p class='location'><a href='../index.html'>mentat_parser_utils</a>::<wbr><a href='index.html'>macros</a></p><script>window.sidebarCurrent = {name: 'KeywordMapParser', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div>
</nav>
<div class="theme-picker">
<button id="theme-picker" aria-label="Pick another theme!">
<img src="../../brush.svg" width="18" alt="Pick another theme!">
</button>
<div id="theme-choices"></div>
</div>
<script src="../../theme.js"></script>
<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"><h1 class='fqn'><span class='in-band'>Struct <a href='../index.html'>mentat_parser_utils</a>::<wbr><a href='index.html'>macros</a>::<wbr><a class="struct" href=''>KeywordMapParser</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'>&#x2212;</span>]
</a>
</span><a class='srclink' href='../../src/mentat_parser_utils/macros.rs.html#39' title='goto source code'>[src]</a></span></h1><div class="docblock type-decl"><pre class='rust struct'>pub struct KeywordMapParser&lt;T&gt;(pub T);</pre></div>
<h2 id='implementations' class='small-section-header'>
Trait Implementations<a href='#implementations' class='anchor'></a>
</h2>
<div id='implementations-list'>
2018-06-22 17:25:54 +00:00
<h3 id='impl-Parser' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;'a, Av, Bv&gt; Parser for <a class="struct" href="../../mentat_parser_utils/macros/struct.KeywordMapParser.html" title="struct mentat_parser_utils::macros::KeywordMapParser">KeywordMapParser</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>&amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, Av<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>&amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, Bv<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Av: Parser&lt;Input = <a class="struct" href="../../mentat_parser_utils/value_and_span/struct.Stream.html" title="struct mentat_parser_utils::value_and_span::Stream">Stream</a>&lt;'a&gt;&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;Bv: Parser&lt;Input = <a class="struct" href="../../mentat_parser_utils/value_and_span/struct.Stream.html" title="struct mentat_parser_utils::value_and_span::Stream">Stream</a>&lt;'a&gt;&gt;,&nbsp;</span></code><a href='#impl-Parser' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/mentat_parser_utils/value_and_span.rs.html#569-643' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='associatedtype.Input' class="type"><span id='Input.t' class='invisible'><code>type <a href='#associatedtype.Input' class="type">Input</a> = <a class="struct" href="../../mentat_parser_utils/value_and_span/struct.Stream.html" title="struct mentat_parser_utils::value_and_span::Stream">Stream</a>&lt;'a&gt;</code></span></h4>
<div class='docblock'><p>The type which is taken as input for the parser. The type must implement the <code>Stream</code> trait which allows the parser to read items from the type. <a href="#associatedtype.Input">Read more</a></p>
</div><h4 id='associatedtype.Output' class="type"><span id='Output.t' class='invisible'><code>type <a href='#associatedtype.Output' class="type">Output</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Av::Output&gt;, <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Bv::Output&gt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a></code></span></h4>
2018-06-21 14:44:35 +00:00
<div class='docblock'><p>The type which is returned if the parser is successful.</p>
2018-06-22 17:25:54 +00:00
</div><h4 id='method.parse_lazy' class="method"><span id='parse_lazy.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.parse_lazy' class='fnname'>parse_lazy</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;mut self, <br>&nbsp;&nbsp;&nbsp;&nbsp;input: <a class="struct" href="../../mentat_parser_utils/value_and_span/struct.Stream.html" title="struct mentat_parser_utils::value_and_span::Stream">Stream</a>&lt;'a&gt;<br>) -&gt; ConsumedResult&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Av::Output&gt;, <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Bv::Output&gt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>, <a class="struct" href="../../mentat_parser_utils/value_and_span/struct.Stream.html" title="struct mentat_parser_utils::value_and_span::Stream">Stream</a>&lt;'a&gt;&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/mentat_parser_utils/value_and_span.rs.html#576-642' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Parses using the stream <code>input</code> by calling [<code>Stream::uncons</code>] one or more times. <a href="#method.parse_lazy">Read more</a></p>
</div><h4 id='method.parse' class="method"><span id='parse.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.parse' class='fnname'>parse</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;mut self, <br>&nbsp;&nbsp;&nbsp;&nbsp;input: Self::Input<br>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>Self::Output, Self::Input<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>, ParseError&lt;Self::Input&gt;&gt;</code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Entry point of the parser. Takes some input and tries to parse it. <a href="#method.parse">Read more</a></p>
</div><h4 id='method.parse_stream' class="method"><span id='parse_stream.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.parse_stream' class='fnname'>parse_stream</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;mut self, <br>&nbsp;&nbsp;&nbsp;&nbsp;input: Self::Input<br>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>Self::Output, Consumed&lt;Self::Input&gt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>, Consumed&lt;ParseError&lt;Self::Input&gt;&gt;&gt;</code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Parses using the stream <code>input</code> by calling [<code>Stream::uncons</code>] one or more times. <a href="#method.parse_stream">Read more</a></p>
</div><h4 id='method.parse_stream_consumed' class="method"><span id='parse_stream_consumed.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.parse_stream_consumed' class='fnname'>parse_stream_consumed</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;mut self, <br>&nbsp;&nbsp;&nbsp;&nbsp;input: Self::Input<br>) -&gt; FastResult&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>Self::Output, Self::Input<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>, ParseError&lt;Self::Input&gt;&gt;</code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Parses using the stream <code>input</code> by calling [<code>Stream::uncons</code>] one or more times. <a href="#method.parse_stream_consumed">Read more</a></p>
</div><h4 id='method.add_error' class="method"><span id='add_error.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.add_error' class='fnname'>add_error</a>(&amp;mut self, _error: &amp;mut ParseError&lt;Self::Input&gt;)</code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Adds the first error that would normally be returned by this parser if it failed with an <code>EmptyErr</code> result. <a href="#method.add_error">Read more</a></p>
</div><h4 id='method.by_ref' class="method"><span id='by_ref.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.by_ref' class='fnname'>by_ref</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>Self</code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Borrows a parser instead of consuming it. <a href="#method.by_ref">Read more</a></p>
</div><h4 id='method.with' class="method"><span id='with.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.with' class='fnname'>with</a>&lt;P2&gt;(self, p: P2) -&gt; With&lt;Self, P2&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;P2: Parser&lt;Input = Self::Input&gt;,&nbsp;</span></code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Discards the value of the <code>self</code> parser and returns the value of <code>p</code>. Fails if any of the parsers fails. <a href="#method.with">Read more</a></p>
</div><h4 id='method.skip' class="method"><span id='skip.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.skip' class='fnname'>skip</a>&lt;P2&gt;(self, p: P2) -&gt; Skip&lt;Self, P2&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;P2: Parser&lt;Input = Self::Input&gt;,&nbsp;</span></code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Discards the value of the <code>p</code> parser and returns the value of <code>self</code>. Fails if any of the parsers fails. <a href="#method.skip">Read more</a></p>
</div><h4 id='method.and' class="method"><span id='and.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.and' class='fnname'>and</a>&lt;P2&gt;(self, p: P2) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>Self, P2<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;P2: Parser&lt;Input = Self::Input&gt;,&nbsp;</span></code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Parses with <code>self</code> followed by <code>p</code>. Succeeds if both parsers succeed, otherwise fails. Returns a tuple with both values on success. <a href="#method.and">Read more</a></p>
</div><h4 id='method.or' class="method"><span id='or.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.or' class='fnname'>or</a>&lt;P2&gt;(self, p: P2) -&gt; Or&lt;Self, P2&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;P2: Parser&lt;Input = Self::Input, Output = Self::Output&gt;,&nbsp;</span></code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns a parser which attempts to parse using <code>self</code>. If <code>self</code> fails without consuming any input it tries to consume the same input using <code>p</code>. <a href="#method.or">Read more</a></p>
</div><h4 id='method.then' class="method"><span id='then.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.then' class='fnname'>then</a>&lt;N, F&gt;(self, f: F) -&gt; Then&lt;Self, F&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::Output) -&gt; N,<br>&nbsp;&nbsp;&nbsp;&nbsp;N: Parser&lt;Input = Self::Input&gt;,&nbsp;</span></code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Parses using <code>self</code> and then passes the value to <code>f</code> which returns a parser used to parse the rest of the input. <a href="#method.then">Read more</a></p>
</div><h4 id='method.map' class="method"><span id='map.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.map' class='fnname'>map</a>&lt;F, B&gt;(self, f: F) -&gt; Map&lt;Self, F&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::Output) -&gt; B,&nbsp;</span></code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Uses <code>f</code> to map over the parsed value. <a href="#method.map">Read more</a></p>
</div><h4 id='method.flat_map' class="method"><span id='flat_map.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.flat_map' class='fnname'>flat_map</a>&lt;F, B&gt;(self, f: F) -&gt; FlatMap&lt;Self, F&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::Output) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;B, ParseError&lt;Self::Input&gt;&gt;,&nbsp;</span></code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Uses <code>f</code> to map over the output of <code>self</code>. If <code>f</code> returns an error the parser fails. <a href="#method.flat_map">Read more</a></p>
</div><h4 id='method.message' class="method"><span id='message.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.message' class='fnname'>message</a>&lt;S&gt;(self, msg: S) -&gt; Message&lt;Self&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;Info&lt;&lt;Self::Input as StreamOnce&gt;::Item, &lt;Self::Input as StreamOnce&gt;::Range&gt;&gt;,&nbsp;</span></code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Parses with <code>self</code> and if it fails, adds the message <code>msg</code> to the error. <a href="#method.message">Read more</a></p>
</div><h4 id='method.expected' class="method"><span id='expected.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.expected' class='fnname'>expected</a>&lt;S&gt;(self, msg: S) -&gt; Expected&lt;Self&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;Info&lt;&lt;Self::Input as StreamOnce&gt;::Item, &lt;Self::Input as StreamOnce&gt;::Range&gt;&gt;,&nbsp;</span></code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Parses with <code>self</code> and if it fails without consuming any input any expected errors are replaced by <code>msg</code>. <code>msg</code> is then used in error messages as &quot;Expected <code>msg</code>&quot;. <a href="#method.expected">Read more</a></p>
</div><h4 id='method.and_then' class="method"><span id='and_then.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.and_then' class='fnname'>and_then</a>&lt;F, O, E&gt;(self, f: F) -&gt; AndThen&lt;Self, F&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;E: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;Error&lt;&lt;Self::Input as StreamOnce&gt;::Item, &lt;Self::Input as StreamOnce&gt;::Range&gt;&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::Output) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;O, E&gt;,&nbsp;</span></code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Parses with <code>self</code> and applies <code>f</code> on the result if <code>self</code> parses successfully. <code>f</code> may optionally fail with an error which is automatically converted to a <code>ParseError</code>. <a href="#method.and_then">Read more</a></p>
</div><h4 id='method.iter' class="method"><span id='iter.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.iter' class='fnname'>iter</a>(self, input: Self::Input) -&gt; Iter&lt;Self&gt;</code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Creates an iterator from a parser and a state. Can be used as an alternative to [<code>many</code>] when collecting directly into a <code>FromIterator</code> type is not desirable. <a href="#method.iter">Read more</a></p>
</div><h4 id='method.boxed' class="method"><span id='boxed.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.boxed' class='fnname'>boxed</a>&lt;'a&gt;(<br>&nbsp;&nbsp;&nbsp;&nbsp;self<br>) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;Parser&lt;Input = Self::Input, Output = Self::Output&gt; + 'a&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: 'a,&nbsp;</span></code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Turns the parser into a trait object by putting it in a <code>Box</code>. Can be used to easily return parsers from functions without naming the type. <a href="#method.boxed">Read more</a></p>
</div></div><h3 id='impl-Parser-1' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;'a, Av, Bv, Cv&gt; Parser for <a class="struct" href="../../mentat_parser_utils/macros/struct.KeywordMapParser.html" title="struct mentat_parser_utils::macros::KeywordMapParser">KeywordMapParser</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>&amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, Av<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>&amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, Bv<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>&amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, Cv<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Av: Parser&lt;Input = <a class="struct" href="../../mentat_parser_utils/value_and_span/struct.Stream.html" title="struct mentat_parser_utils::value_and_span::Stream">Stream</a>&lt;'a&gt;&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;Bv: Parser&lt;Input = <a class="struct" href="../../mentat_parser_utils/value_and_span/struct.Stream.html" title="struct mentat_parser_utils::value_and_span::Stream">Stream</a>&lt;'a&gt;&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;Cv: Parser&lt;Input = <a class="struct" href="../../mentat_parser_utils/value_and_span/struct.Stream.html" title="struct mentat_parser_utils::value_and_span::Stream">Stream</a>&lt;'a&gt;&gt;,&nbsp;</span></code><a href='#impl-Parser-1' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/mentat_parser_utils/value_and_span.rs.html#569-643' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='associatedtype.Input-1' class="type"><span id='Input.t-1' class='invisible'><code>type <a href='#associatedtype.Input' class="type">Input</a> = <a class="struct" href="../../mentat_parser_utils/value_and_span/struct.Stream.html" title="struct mentat_parser_utils::value_and_span::Stream">Stream</a>&lt;'a&gt;</code></span></h4>
<div class='docblock'><p>The type which is taken as input for the parser. The type must implement the <code>Stream</code> trait which allows the parser to read items from the type. <a href="#associatedtype.Input">Read more</a></p>
</div><h4 id='associatedtype.Output-1' class="type"><span id='Output.t-1' class='invisible'><code>type <a href='#associatedtype.Output' class="type">Output</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Av::Output&gt;, <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Bv::Output&gt;, <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Cv::Output&gt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a></code></span></h4>
2018-06-21 14:44:35 +00:00
<div class='docblock'><p>The type which is returned if the parser is successful.</p>
2018-06-22 17:25:54 +00:00
</div><h4 id='method.parse_lazy-1' class="method"><span id='parse_lazy.v-1' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.parse_lazy' class='fnname'>parse_lazy</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;mut self, <br>&nbsp;&nbsp;&nbsp;&nbsp;input: <a class="struct" href="../../mentat_parser_utils/value_and_span/struct.Stream.html" title="struct mentat_parser_utils::value_and_span::Stream">Stream</a>&lt;'a&gt;<br>) -&gt; ConsumedResult&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Av::Output&gt;, <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Bv::Output&gt;, <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Cv::Output&gt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>, <a class="struct" href="../../mentat_parser_utils/value_and_span/struct.Stream.html" title="struct mentat_parser_utils::value_and_span::Stream">Stream</a>&lt;'a&gt;&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/mentat_parser_utils/value_and_span.rs.html#576-642' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Parses using the stream <code>input</code> by calling [<code>Stream::uncons</code>] one or more times. <a href="#method.parse_lazy">Read more</a></p>
</div><h4 id='method.parse-1' class="method"><span id='parse.v-1' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.parse' class='fnname'>parse</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;mut self, <br>&nbsp;&nbsp;&nbsp;&nbsp;input: Self::Input<br>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>Self::Output, Self::Input<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>, ParseError&lt;Self::Input&gt;&gt;</code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Entry point of the parser. Takes some input and tries to parse it. <a href="#method.parse">Read more</a></p>
</div><h4 id='method.parse_stream-1' class="method"><span id='parse_stream.v-1' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.parse_stream' class='fnname'>parse_stream</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;mut self, <br>&nbsp;&nbsp;&nbsp;&nbsp;input: Self::Input<br>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>Self::Output, Consumed&lt;Self::Input&gt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>, Consumed&lt;ParseError&lt;Self::Input&gt;&gt;&gt;</code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Parses using the stream <code>input</code> by calling [<code>Stream::uncons</code>] one or more times. <a href="#method.parse_stream">Read more</a></p>
</div><h4 id='method.parse_stream_consumed-1' class="method"><span id='parse_stream_consumed.v-1' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.parse_stream_consumed' class='fnname'>parse_stream_consumed</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;mut self, <br>&nbsp;&nbsp;&nbsp;&nbsp;input: Self::Input<br>) -&gt; FastResult&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>Self::Output, Self::Input<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>, ParseError&lt;Self::Input&gt;&gt;</code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Parses using the stream <code>input</code> by calling [<code>Stream::uncons</code>] one or more times. <a href="#method.parse_stream_consumed">Read more</a></p>
</div><h4 id='method.add_error-1' class="method"><span id='add_error.v-1' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.add_error' class='fnname'>add_error</a>(&amp;mut self, _error: &amp;mut ParseError&lt;Self::Input&gt;)</code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Adds the first error that would normally be returned by this parser if it failed with an <code>EmptyErr</code> result. <a href="#method.add_error">Read more</a></p>
</div><h4 id='method.by_ref-1' class="method"><span id='by_ref.v-1' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.by_ref' class='fnname'>by_ref</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>Self</code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Borrows a parser instead of consuming it. <a href="#method.by_ref">Read more</a></p>
</div><h4 id='method.with-1' class="method"><span id='with.v-1' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.with' class='fnname'>with</a>&lt;P2&gt;(self, p: P2) -&gt; With&lt;Self, P2&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;P2: Parser&lt;Input = Self::Input&gt;,&nbsp;</span></code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Discards the value of the <code>self</code> parser and returns the value of <code>p</code>. Fails if any of the parsers fails. <a href="#method.with">Read more</a></p>
</div><h4 id='method.skip-1' class="method"><span id='skip.v-1' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.skip' class='fnname'>skip</a>&lt;P2&gt;(self, p: P2) -&gt; Skip&lt;Self, P2&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;P2: Parser&lt;Input = Self::Input&gt;,&nbsp;</span></code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Discards the value of the <code>p</code> parser and returns the value of <code>self</code>. Fails if any of the parsers fails. <a href="#method.skip">Read more</a></p>
</div><h4 id='method.and-1' class="method"><span id='and.v-1' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.and' class='fnname'>and</a>&lt;P2&gt;(self, p: P2) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>Self, P2<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;P2: Parser&lt;Input = Self::Input&gt;,&nbsp;</span></code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Parses with <code>self</code> followed by <code>p</code>. Succeeds if both parsers succeed, otherwise fails. Returns a tuple with both values on success. <a href="#method.and">Read more</a></p>
</div><h4 id='method.or-1' class="method"><span id='or.v-1' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.or' class='fnname'>or</a>&lt;P2&gt;(self, p: P2) -&gt; Or&lt;Self, P2&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;P2: Parser&lt;Input = Self::Input, Output = Self::Output&gt;,&nbsp;</span></code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns a parser which attempts to parse using <code>self</code>. If <code>self</code> fails without consuming any input it tries to consume the same input using <code>p</code>. <a href="#method.or">Read more</a></p>
</div><h4 id='method.then-1' class="method"><span id='then.v-1' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.then' class='fnname'>then</a>&lt;N, F&gt;(self, f: F) -&gt; Then&lt;Self, F&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::Output) -&gt; N,<br>&nbsp;&nbsp;&nbsp;&nbsp;N: Parser&lt;Input = Self::Input&gt;,&nbsp;</span></code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Parses using <code>self</code> and then passes the value to <code>f</code> which returns a parser used to parse the rest of the input. <a href="#method.then">Read more</a></p>
</div><h4 id='method.map-1' class="method"><span id='map.v-1' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.map' class='fnname'>map</a>&lt;F, B&gt;(self, f: F) -&gt; Map&lt;Self, F&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::Output) -&gt; B,&nbsp;</span></code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Uses <code>f</code> to map over the parsed value. <a href="#method.map">Read more</a></p>
</div><h4 id='method.flat_map-1' class="method"><span id='flat_map.v-1' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.flat_map' class='fnname'>flat_map</a>&lt;F, B&gt;(self, f: F) -&gt; FlatMap&lt;Self, F&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::Output) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;B, ParseError&lt;Self::Input&gt;&gt;,&nbsp;</span></code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Uses <code>f</code> to map over the output of <code>self</code>. If <code>f</code> returns an error the parser fails. <a href="#method.flat_map">Read more</a></p>
</div><h4 id='method.message-1' class="method"><span id='message.v-1' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.message' class='fnname'>message</a>&lt;S&gt;(self, msg: S) -&gt; Message&lt;Self&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;Info&lt;&lt;Self::Input as StreamOnce&gt;::Item, &lt;Self::Input as StreamOnce&gt;::Range&gt;&gt;,&nbsp;</span></code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Parses with <code>self</code> and if it fails, adds the message <code>msg</code> to the error. <a href="#method.message">Read more</a></p>
</div><h4 id='method.expected-1' class="method"><span id='expected.v-1' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.expected' class='fnname'>expected</a>&lt;S&gt;(self, msg: S) -&gt; Expected&lt;Self&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;Info&lt;&lt;Self::Input as StreamOnce&gt;::Item, &lt;Self::Input as StreamOnce&gt;::Range&gt;&gt;,&nbsp;</span></code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Parses with <code>self</code> and if it fails without consuming any input any expected errors are replaced by <code>msg</code>. <code>msg</code> is then used in error messages as &quot;Expected <code>msg</code>&quot;. <a href="#method.expected">Read more</a></p>
</div><h4 id='method.and_then-1' class="method"><span id='and_then.v-1' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.and_then' class='fnname'>and_then</a>&lt;F, O, E&gt;(self, f: F) -&gt; AndThen&lt;Self, F&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;E: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;Error&lt;&lt;Self::Input as StreamOnce&gt;::Item, &lt;Self::Input as StreamOnce&gt;::Range&gt;&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::Output) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;O, E&gt;,&nbsp;</span></code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Parses with <code>self</code> and applies <code>f</code> on the result if <code>self</code> parses successfully. <code>f</code> may optionally fail with an error which is automatically converted to a <code>ParseError</code>. <a href="#method.and_then">Read more</a></p>
</div><h4 id='method.iter-1' class="method"><span id='iter.v-1' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.iter' class='fnname'>iter</a>(self, input: Self::Input) -&gt; Iter&lt;Self&gt;</code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Creates an iterator from a parser and a state. Can be used as an alternative to [<code>many</code>] when collecting directly into a <code>FromIterator</code> type is not desirable. <a href="#method.iter">Read more</a></p>
</div><h4 id='method.boxed-1' class="method"><span id='boxed.v-1' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.boxed' class='fnname'>boxed</a>&lt;'a&gt;(<br>&nbsp;&nbsp;&nbsp;&nbsp;self<br>) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;Parser&lt;Input = Self::Input, Output = Self::Output&gt; + 'a&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: 'a,&nbsp;</span></code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Turns the parser into a trait object by putting it in a <code>Box</code>. Can be used to easily return parsers from functions without naming the type. <a href="#method.boxed">Read more</a></p>
</div></div><h3 id='impl-Parser-2' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;'a, Av, Bv, Cv, Dv&gt; Parser for <a class="struct" href="../../mentat_parser_utils/macros/struct.KeywordMapParser.html" title="struct mentat_parser_utils::macros::KeywordMapParser">KeywordMapParser</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>&amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, Av<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>&amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, Bv<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>&amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, Cv<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>&amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, Dv<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Av: Parser&lt;Input = <a class="struct" href="../../mentat_parser_utils/value_and_span/struct.Stream.html" title="struct mentat_parser_utils::value_and_span::Stream">Stream</a>&lt;'a&gt;&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;Bv: Parser&lt;Input = <a class="struct" href="../../mentat_parser_utils/value_and_span/struct.Stream.html" title="struct mentat_parser_utils::value_and_span::Stream">Stream</a>&lt;'a&gt;&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;Cv: Parser&lt;Input = <a class="struct" href="../../mentat_parser_utils/value_and_span/struct.Stream.html" title="struct mentat_parser_utils::value_and_span::Stream">Stream</a>&lt;'a&gt;&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;Dv: Parser&lt;Input = <a class="struct" href="../../mentat_parser_utils/value_and_span/struct.Stream.html" title="struct mentat_parser_utils::value_and_span::Stream">Stream</a>&lt;'a&gt;&gt;,&nbsp;</span></code><a href='#impl-Parser-2' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/mentat_parser_utils/value_and_span.rs.html#569-643' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='associatedtype.Input-2' class="type"><span id='Input.t-2' class='invisible'><code>type <a href='#associatedtype.Input' class="type">Input</a> = <a class="struct" href="../../mentat_parser_utils/value_and_span/struct.Stream.html" title="struct mentat_parser_utils::value_and_span::Stream">Stream</a>&lt;'a&gt;</code></span></h4>
<div class='docblock'><p>The type which is taken as input for the parser. The type must implement the <code>Stream</code> trait which allows the parser to read items from the type. <a href="#associatedtype.Input">Read more</a></p>
</div><h4 id='associatedtype.Output-2' class="type"><span id='Output.t-2' class='invisible'><code>type <a href='#associatedtype.Output' class="type">Output</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Av::Output&gt;, <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Bv::Output&gt;, <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Cv::Output&gt;, <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Dv::Output&gt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a></code></span></h4>
2018-06-21 14:44:35 +00:00
<div class='docblock'><p>The type which is returned if the parser is successful.</p>
2018-06-22 17:25:54 +00:00
</div><h4 id='method.parse_lazy-2' class="method"><span id='parse_lazy.v-2' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.parse_lazy' class='fnname'>parse_lazy</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;mut self, <br>&nbsp;&nbsp;&nbsp;&nbsp;input: <a class="struct" href="../../mentat_parser_utils/value_and_span/struct.Stream.html" title="struct mentat_parser_utils::value_and_span::Stream">Stream</a>&lt;'a&gt;<br>) -&gt; ConsumedResult&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Av::Output&gt;, <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Bv::Output&gt;, <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Cv::Output&gt;, <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Dv::Output&gt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>, <a class="struct" href="../../mentat_parser_utils/value_and_span/struct.Stream.html" title="struct mentat_parser_utils::value_and_span::Stream">Stream</a>&lt;'a&gt;&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/mentat_parser_utils/value_and_span.rs.html#576-642' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Parses using the stream <code>input</code> by calling [<code>Stream::uncons</code>] one or more times. <a href="#method.parse_lazy">Read more</a></p>
</div><h4 id='method.parse-2' class="method"><span id='parse.v-2' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.parse' class='fnname'>parse</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;mut self, <br>&nbsp;&nbsp;&nbsp;&nbsp;input: Self::Input<br>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>Self::Output, Self::Input<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>, ParseError&lt;Self::Input&gt;&gt;</code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Entry point of the parser. Takes some input and tries to parse it. <a href="#method.parse">Read more</a></p>
</div><h4 id='method.parse_stream-2' class="method"><span id='parse_stream.v-2' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.parse_stream' class='fnname'>parse_stream</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;mut self, <br>&nbsp;&nbsp;&nbsp;&nbsp;input: Self::Input<br>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>Self::Output, Consumed&lt;Self::Input&gt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>, Consumed&lt;ParseError&lt;Self::Input&gt;&gt;&gt;</code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Parses using the stream <code>input</code> by calling [<code>Stream::uncons</code>] one or more times. <a href="#method.parse_stream">Read more</a></p>
</div><h4 id='method.parse_stream_consumed-2' class="method"><span id='parse_stream_consumed.v-2' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.parse_stream_consumed' class='fnname'>parse_stream_consumed</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;mut self, <br>&nbsp;&nbsp;&nbsp;&nbsp;input: Self::Input<br>) -&gt; FastResult&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>Self::Output, Self::Input<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>, ParseError&lt;Self::Input&gt;&gt;</code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Parses using the stream <code>input</code> by calling [<code>Stream::uncons</code>] one or more times. <a href="#method.parse_stream_consumed">Read more</a></p>
</div><h4 id='method.add_error-2' class="method"><span id='add_error.v-2' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.add_error' class='fnname'>add_error</a>(&amp;mut self, _error: &amp;mut ParseError&lt;Self::Input&gt;)</code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Adds the first error that would normally be returned by this parser if it failed with an <code>EmptyErr</code> result. <a href="#method.add_error">Read more</a></p>
</div><h4 id='method.by_ref-2' class="method"><span id='by_ref.v-2' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.by_ref' class='fnname'>by_ref</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>Self</code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Borrows a parser instead of consuming it. <a href="#method.by_ref">Read more</a></p>
</div><h4 id='method.with-2' class="method"><span id='with.v-2' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.with' class='fnname'>with</a>&lt;P2&gt;(self, p: P2) -&gt; With&lt;Self, P2&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;P2: Parser&lt;Input = Self::Input&gt;,&nbsp;</span></code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Discards the value of the <code>self</code> parser and returns the value of <code>p</code>. Fails if any of the parsers fails. <a href="#method.with">Read more</a></p>
</div><h4 id='method.skip-2' class="method"><span id='skip.v-2' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.skip' class='fnname'>skip</a>&lt;P2&gt;(self, p: P2) -&gt; Skip&lt;Self, P2&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;P2: Parser&lt;Input = Self::Input&gt;,&nbsp;</span></code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Discards the value of the <code>p</code> parser and returns the value of <code>self</code>. Fails if any of the parsers fails. <a href="#method.skip">Read more</a></p>
</div><h4 id='method.and-2' class="method"><span id='and.v-2' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.and' class='fnname'>and</a>&lt;P2&gt;(self, p: P2) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>Self, P2<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;P2: Parser&lt;Input = Self::Input&gt;,&nbsp;</span></code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Parses with <code>self</code> followed by <code>p</code>. Succeeds if both parsers succeed, otherwise fails. Returns a tuple with both values on success. <a href="#method.and">Read more</a></p>
</div><h4 id='method.or-2' class="method"><span id='or.v-2' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.or' class='fnname'>or</a>&lt;P2&gt;(self, p: P2) -&gt; Or&lt;Self, P2&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;P2: Parser&lt;Input = Self::Input, Output = Self::Output&gt;,&nbsp;</span></code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns a parser which attempts to parse using <code>self</code>. If <code>self</code> fails without consuming any input it tries to consume the same input using <code>p</code>. <a href="#method.or">Read more</a></p>
</div><h4 id='method.then-2' class="method"><span id='then.v-2' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.then' class='fnname'>then</a>&lt;N, F&gt;(self, f: F) -&gt; Then&lt;Self, F&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::Output) -&gt; N,<br>&nbsp;&nbsp;&nbsp;&nbsp;N: Parser&lt;Input = Self::Input&gt;,&nbsp;</span></code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Parses using <code>self</code> and then passes the value to <code>f</code> which returns a parser used to parse the rest of the input. <a href="#method.then">Read more</a></p>
</div><h4 id='method.map-2' class="method"><span id='map.v-2' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.map' class='fnname'>map</a>&lt;F, B&gt;(self, f: F) -&gt; Map&lt;Self, F&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::Output) -&gt; B,&nbsp;</span></code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Uses <code>f</code> to map over the parsed value. <a href="#method.map">Read more</a></p>
</div><h4 id='method.flat_map-2' class="method"><span id='flat_map.v-2' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.flat_map' class='fnname'>flat_map</a>&lt;F, B&gt;(self, f: F) -&gt; FlatMap&lt;Self, F&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::Output) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;B, ParseError&lt;Self::Input&gt;&gt;,&nbsp;</span></code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Uses <code>f</code> to map over the output of <code>self</code>. If <code>f</code> returns an error the parser fails. <a href="#method.flat_map">Read more</a></p>
</div><h4 id='method.message-2' class="method"><span id='message.v-2' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.message' class='fnname'>message</a>&lt;S&gt;(self, msg: S) -&gt; Message&lt;Self&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;Info&lt;&lt;Self::Input as StreamOnce&gt;::Item, &lt;Self::Input as StreamOnce&gt;::Range&gt;&gt;,&nbsp;</span></code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Parses with <code>self</code> and if it fails, adds the message <code>msg</code> to the error. <a href="#method.message">Read more</a></p>
</div><h4 id='method.expected-2' class="method"><span id='expected.v-2' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.expected' class='fnname'>expected</a>&lt;S&gt;(self, msg: S) -&gt; Expected&lt;Self&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;Info&lt;&lt;Self::Input as StreamOnce&gt;::Item, &lt;Self::Input as StreamOnce&gt;::Range&gt;&gt;,&nbsp;</span></code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Parses with <code>self</code> and if it fails without consuming any input any expected errors are replaced by <code>msg</code>. <code>msg</code> is then used in error messages as &quot;Expected <code>msg</code>&quot;. <a href="#method.expected">Read more</a></p>
</div><h4 id='method.and_then-2' class="method"><span id='and_then.v-2' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.and_then' class='fnname'>and_then</a>&lt;F, O, E&gt;(self, f: F) -&gt; AndThen&lt;Self, F&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;E: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;Error&lt;&lt;Self::Input as StreamOnce&gt;::Item, &lt;Self::Input as StreamOnce&gt;::Range&gt;&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::Output) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;O, E&gt;,&nbsp;</span></code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Parses with <code>self</code> and applies <code>f</code> on the result if <code>self</code> parses successfully. <code>f</code> may optionally fail with an error which is automatically converted to a <code>ParseError</code>. <a href="#method.and_then">Read more</a></p>
</div><h4 id='method.iter-2' class="method"><span id='iter.v-2' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.iter' class='fnname'>iter</a>(self, input: Self::Input) -&gt; Iter&lt;Self&gt;</code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Creates an iterator from a parser and a state. Can be used as an alternative to [<code>many</code>] when collecting directly into a <code>FromIterator</code> type is not desirable. <a href="#method.iter">Read more</a></p>
</div><h4 id='method.boxed-2' class="method"><span id='boxed.v-2' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.boxed' class='fnname'>boxed</a>&lt;'a&gt;(<br>&nbsp;&nbsp;&nbsp;&nbsp;self<br>) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;Parser&lt;Input = Self::Input, Output = Self::Output&gt; + 'a&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: 'a,&nbsp;</span></code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Turns the parser into a trait object by putting it in a <code>Box</code>. Can be used to easily return parsers from functions without naming the type. <a href="#method.boxed">Read more</a></p>
</div></div><h3 id='impl-Parser-3' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;'a, Av, Bv, Cv, Dv, Ev&gt; Parser for <a class="struct" href="../../mentat_parser_utils/macros/struct.KeywordMapParser.html" title="struct mentat_parser_utils::macros::KeywordMapParser">KeywordMapParser</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>&amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, Av<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>&amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, Bv<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>&amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, Cv<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>&amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, Dv<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>&amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, Ev<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Av: Parser&lt;Input = <a class="struct" href="../../mentat_parser_utils/value_and_span/struct.Stream.html" title="struct mentat_parser_utils::value_and_span::Stream">Stream</a>&lt;'a&gt;&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;Bv: Parser&lt;Input = <a class="struct" href="../../mentat_parser_utils/value_and_span/struct.Stream.html" title="struct mentat_parser_utils::value_and_span::Stream">Stream</a>&lt;'a&gt;&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;Cv: Parser&lt;Input = <a class="struct" href="../../mentat_parser_utils/value_and_span/struct.Stream.html" title="struct mentat_parser_utils::value_and_span::Stream">Stream</a>&lt;'a&gt;&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;Dv: Parser&lt;Input = <a class="struct" href="../../mentat_parser_utils/value_and_span/struct.Stream.html" title="struct mentat_parser_utils::value_and_span::Stream">Stream</a>&lt;'a&gt;&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;Ev: Parser&lt;Input = <a class="struct" href="../../mentat_parser_utils/value_and_span/struct.Stream.html" title="struct mentat_parser_utils::value_and_span::Stream">Stream</a>&lt;'a&gt;&gt;,&nbsp;</span></code><a href='#impl-Parser-3' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/mentat_parser_utils/value_and_span.rs.html#569-643' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='associatedtype.Input-3' class="type"><span id='Input.t-3' class='invisible'><code>type <a href='#associatedtype.Input' class="type">Input</a> = <a class="struct" href="../../mentat_parser_utils/value_and_span/struct.Stream.html" title="struct mentat_parser_utils::value_and_span::Stream">Stream</a>&lt;'a&gt;</code></span></h4>
<div class='docblock'><p>The type which is taken as input for the parser. The type must implement the <code>Stream</code> trait which allows the parser to read items from the type. <a href="#associatedtype.Input">Read more</a></p>
</div><h4 id='associatedtype.Output-3' class="type"><span id='Output.t-3' class='invisible'><code>type <a href='#associatedtype.Output' class="type">Output</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Av::Output&gt;, <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Bv::Output&gt;, <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Cv::Output&gt;, <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Dv::Output&gt;, <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Ev::Output&gt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a></code></span></h4>
2018-06-21 14:44:35 +00:00
<div class='docblock'><p>The type which is returned if the parser is successful.</p>
2018-06-22 17:25:54 +00:00
</div><h4 id='method.parse_lazy-3' class="method"><span id='parse_lazy.v-3' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.parse_lazy' class='fnname'>parse_lazy</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;mut self, <br>&nbsp;&nbsp;&nbsp;&nbsp;input: <a class="struct" href="../../mentat_parser_utils/value_and_span/struct.Stream.html" title="struct mentat_parser_utils::value_and_span::Stream">Stream</a>&lt;'a&gt;<br>) -&gt; ConsumedResult&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Av::Output&gt;, <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Bv::Output&gt;, <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Cv::Output&gt;, <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Dv::Output&gt;, <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Ev::Output&gt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>, <a class="struct" href="../../mentat_parser_utils/value_and_span/struct.Stream.html" title="struct mentat_parser_utils::value_and_span::Stream">Stream</a>&lt;'a&gt;&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/mentat_parser_utils/value_and_span.rs.html#576-642' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Parses using the stream <code>input</code> by calling [<code>Stream::uncons</code>] one or more times. <a href="#method.parse_lazy">Read more</a></p>
</div><h4 id='method.parse-3' class="method"><span id='parse.v-3' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.parse' class='fnname'>parse</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;mut self, <br>&nbsp;&nbsp;&nbsp;&nbsp;input: Self::Input<br>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>Self::Output, Self::Input<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>, ParseError&lt;Self::Input&gt;&gt;</code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Entry point of the parser. Takes some input and tries to parse it. <a href="#method.parse">Read more</a></p>
</div><h4 id='method.parse_stream-3' class="method"><span id='parse_stream.v-3' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.parse_stream' class='fnname'>parse_stream</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;mut self, <br>&nbsp;&nbsp;&nbsp;&nbsp;input: Self::Input<br>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>Self::Output, Consumed&lt;Self::Input&gt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>, Consumed&lt;ParseError&lt;Self::Input&gt;&gt;&gt;</code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Parses using the stream <code>input</code> by calling [<code>Stream::uncons</code>] one or more times. <a href="#method.parse_stream">Read more</a></p>
</div><h4 id='method.parse_stream_consumed-3' class="method"><span id='parse_stream_consumed.v-3' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.parse_stream_consumed' class='fnname'>parse_stream_consumed</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;mut self, <br>&nbsp;&nbsp;&nbsp;&nbsp;input: Self::Input<br>) -&gt; FastResult&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>Self::Output, Self::Input<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>, ParseError&lt;Self::Input&gt;&gt;</code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Parses using the stream <code>input</code> by calling [<code>Stream::uncons</code>] one or more times. <a href="#method.parse_stream_consumed">Read more</a></p>
</div><h4 id='method.add_error-3' class="method"><span id='add_error.v-3' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.add_error' class='fnname'>add_error</a>(&amp;mut self, _error: &amp;mut ParseError&lt;Self::Input&gt;)</code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Adds the first error that would normally be returned by this parser if it failed with an <code>EmptyErr</code> result. <a href="#method.add_error">Read more</a></p>
</div><h4 id='method.by_ref-3' class="method"><span id='by_ref.v-3' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.by_ref' class='fnname'>by_ref</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>Self</code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Borrows a parser instead of consuming it. <a href="#method.by_ref">Read more</a></p>
</div><h4 id='method.with-3' class="method"><span id='with.v-3' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.with' class='fnname'>with</a>&lt;P2&gt;(self, p: P2) -&gt; With&lt;Self, P2&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;P2: Parser&lt;Input = Self::Input&gt;,&nbsp;</span></code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Discards the value of the <code>self</code> parser and returns the value of <code>p</code>. Fails if any of the parsers fails. <a href="#method.with">Read more</a></p>
</div><h4 id='method.skip-3' class="method"><span id='skip.v-3' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.skip' class='fnname'>skip</a>&lt;P2&gt;(self, p: P2) -&gt; Skip&lt;Self, P2&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;P2: Parser&lt;Input = Self::Input&gt;,&nbsp;</span></code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Discards the value of the <code>p</code> parser and returns the value of <code>self</code>. Fails if any of the parsers fails. <a href="#method.skip">Read more</a></p>
</div><h4 id='method.and-3' class="method"><span id='and.v-3' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.and' class='fnname'>and</a>&lt;P2&gt;(self, p: P2) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>Self, P2<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;P2: Parser&lt;Input = Self::Input&gt;,&nbsp;</span></code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Parses with <code>self</code> followed by <code>p</code>. Succeeds if both parsers succeed, otherwise fails. Returns a tuple with both values on success. <a href="#method.and">Read more</a></p>
</div><h4 id='method.or-3' class="method"><span id='or.v-3' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.or' class='fnname'>or</a>&lt;P2&gt;(self, p: P2) -&gt; Or&lt;Self, P2&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;P2: Parser&lt;Input = Self::Input, Output = Self::Output&gt;,&nbsp;</span></code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns a parser which attempts to parse using <code>self</code>. If <code>self</code> fails without consuming any input it tries to consume the same input using <code>p</code>. <a href="#method.or">Read more</a></p>
</div><h4 id='method.then-3' class="method"><span id='then.v-3' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.then' class='fnname'>then</a>&lt;N, F&gt;(self, f: F) -&gt; Then&lt;Self, F&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::Output) -&gt; N,<br>&nbsp;&nbsp;&nbsp;&nbsp;N: Parser&lt;Input = Self::Input&gt;,&nbsp;</span></code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Parses using <code>self</code> and then passes the value to <code>f</code> which returns a parser used to parse the rest of the input. <a href="#method.then">Read more</a></p>
</div><h4 id='method.map-3' class="method"><span id='map.v-3' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.map' class='fnname'>map</a>&lt;F, B&gt;(self, f: F) -&gt; Map&lt;Self, F&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::Output) -&gt; B,&nbsp;</span></code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Uses <code>f</code> to map over the parsed value. <a href="#method.map">Read more</a></p>
</div><h4 id='method.flat_map-3' class="method"><span id='flat_map.v-3' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.flat_map' class='fnname'>flat_map</a>&lt;F, B&gt;(self, f: F) -&gt; FlatMap&lt;Self, F&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::Output) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;B, ParseError&lt;Self::Input&gt;&gt;,&nbsp;</span></code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Uses <code>f</code> to map over the output of <code>self</code>. If <code>f</code> returns an error the parser fails. <a href="#method.flat_map">Read more</a></p>
</div><h4 id='method.message-3' class="method"><span id='message.v-3' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.message' class='fnname'>message</a>&lt;S&gt;(self, msg: S) -&gt; Message&lt;Self&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;Info&lt;&lt;Self::Input as StreamOnce&gt;::Item, &lt;Self::Input as StreamOnce&gt;::Range&gt;&gt;,&nbsp;</span></code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Parses with <code>self</code> and if it fails, adds the message <code>msg</code> to the error. <a href="#method.message">Read more</a></p>
</div><h4 id='method.expected-3' class="method"><span id='expected.v-3' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.expected' class='fnname'>expected</a>&lt;S&gt;(self, msg: S) -&gt; Expected&lt;Self&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;Info&lt;&lt;Self::Input as StreamOnce&gt;::Item, &lt;Self::Input as StreamOnce&gt;::Range&gt;&gt;,&nbsp;</span></code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Parses with <code>self</code> and if it fails without consuming any input any expected errors are replaced by <code>msg</code>. <code>msg</code> is then used in error messages as &quot;Expected <code>msg</code>&quot;. <a href="#method.expected">Read more</a></p>
</div><h4 id='method.and_then-3' class="method"><span id='and_then.v-3' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.and_then' class='fnname'>and_then</a>&lt;F, O, E&gt;(self, f: F) -&gt; AndThen&lt;Self, F&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;E: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;Error&lt;&lt;Self::Input as StreamOnce&gt;::Item, &lt;Self::Input as StreamOnce&gt;::Range&gt;&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::Output) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;O, E&gt;,&nbsp;</span></code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Parses with <code>self</code> and applies <code>f</code> on the result if <code>self</code> parses successfully. <code>f</code> may optionally fail with an error which is automatically converted to a <code>ParseError</code>. <a href="#method.and_then">Read more</a></p>
</div><h4 id='method.iter-3' class="method"><span id='iter.v-3' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.iter' class='fnname'>iter</a>(self, input: Self::Input) -&gt; Iter&lt;Self&gt;</code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Creates an iterator from a parser and a state. Can be used as an alternative to [<code>many</code>] when collecting directly into a <code>FromIterator</code> type is not desirable. <a href="#method.iter">Read more</a></p>
</div><h4 id='method.boxed-3' class="method"><span id='boxed.v-3' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.boxed' class='fnname'>boxed</a>&lt;'a&gt;(<br>&nbsp;&nbsp;&nbsp;&nbsp;self<br>) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;Parser&lt;Input = Self::Input, Output = Self::Output&gt; + 'a&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: 'a,&nbsp;</span></code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Turns the parser into a trait object by putting it in a <code>Box</code>. Can be used to easily return parsers from functions without naming the type. <a href="#method.boxed">Read more</a></p>
</div></div><h3 id='impl-Parser-4' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;'a, Av, Bv, Cv, Dv, Ev, Fv&gt; Parser for <a class="struct" href="../../mentat_parser_utils/macros/struct.KeywordMapParser.html" title="struct mentat_parser_utils::macros::KeywordMapParser">KeywordMapParser</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>&amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, Av<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>&amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, Bv<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>&amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, Cv<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>&amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, Dv<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>&amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, Ev<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>&amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, Fv<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Av: Parser&lt;Input = <a class="struct" href="../../mentat_parser_utils/value_and_span/struct.Stream.html" title="struct mentat_parser_utils::value_and_span::Stream">Stream</a>&lt;'a&gt;&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;Bv: Parser&lt;Input = <a class="struct" href="../../mentat_parser_utils/value_and_span/struct.Stream.html" title="struct mentat_parser_utils::value_and_span::Stream">Stream</a>&lt;'a&gt;&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;Cv: Parser&lt;Input = <a class="struct" href="../../mentat_parser_utils/value_and_span/struct.Stream.html" title="struct mentat_parser_utils::value_and_span::Stream">Stream</a>&lt;'a&gt;&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;Dv: Parser&lt;Input = <a class="struct" href="../../mentat_parser_utils/value_and_span/struct.Stream.html" title="struct mentat_parser_utils::value_and_span::Stream">Stream</a>&lt;'a&gt;&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;Ev: Parser&lt;Input = <a class="struct" href="../../mentat_parser_utils/value_and_span/struct.Stream.html" title="struct mentat_parser_utils::value_and_span::Stream">Stream</a>&lt;'a&gt;&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;Fv: Parser&lt;Input = <a class="struct" href="../../mentat_parser_utils/value_and_span/struct.Stream.html" title="struct mentat_parser_utils::value_and_span::Stream">Stream</a>&lt;'a&gt;&gt;,&nbsp;</span></code><a href='#impl-Parser-4' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/mentat_parser_utils/value_and_span.rs.html#569-643' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='associatedtype.Input-4' class="type"><span id='Input.t-4' class='invisible'><code>type <a href='#associatedtype.Input' clas
<div class='docblock'><p>The type which is taken as input for the parser. The type must implement the <code>Stream</code> trait which allows the parser to read items from the type. <a href="#associatedtype.Input">Read more</a></p>
</div><h4 id='associatedtype.Output-4' class="type"><span id='Output.t-4' class='invisible'><code>type <a href='#associatedtype.Output' class="type">Output</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Av::Output&gt;, <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Bv::Output&gt;, <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Cv::Output&gt;, <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Dv::Output&gt;, <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Ev::Output&gt;, <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Fv::Output&gt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a></code></span></h4>
2018-06-21 14:44:35 +00:00
<div class='docblock'><p>The type which is returned if the parser is successful.</p>
2018-06-22 17:25:54 +00:00
</div><h4 id='method.parse_lazy-4' class="method"><span id='parse_lazy.v-4' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.parse_lazy' class='fnname'>parse_lazy</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;mut self, <br>&nbsp;&nbsp;&nbsp;&nbsp;input: <a class="struct" href="../../mentat_parser_utils/value_and_span/struct.Stream.html" title="struct mentat_parser_utils::value_and_span::Stream">Stream</a>&lt;'a&gt;<br>) -&gt; ConsumedResult&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Av::Output&gt;, <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Bv::Output&gt;, <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Cv::Output&gt;, <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Dv::Output&gt;, <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Ev::Output&gt;, <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Fv::Output&gt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>, <a class="struct" href="../../mentat_parser_utils/value_and_span/struct.Stream.html" title="struct mentat_parser_utils::value_and_span::Stream">Stream</a>&lt;'a&gt;&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/mentat_parser_utils/value_and_span.rs.html#576-642' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Parses using the stream <code>input</code> by calling [<code>Stream::uncons</code>] one or more times. <a href="#method.parse_lazy">Read more</a></p>
</div><h4 id='method.parse-4' class="method"><span id='parse.v-4' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.parse' class='fnname'>parse</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;mut self, <br>&nbsp;&nbsp;&nbsp;&nbsp;input: Self::Input<br>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>Self::Output, Self::Input<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>, ParseError&lt;Self::Input&gt;&gt;</code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Entry point of the parser. Takes some input and tries to parse it. <a href="#method.parse">Read more</a></p>
</div><h4 id='method.parse_stream-4' class="method"><span id='parse_stream.v-4' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.parse_stream' class='fnname'>parse_stream</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;mut self, <br>&nbsp;&nbsp;&nbsp;&nbsp;input: Self::Input<br>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>Self::Output, Consumed&lt;Self::Input&gt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>, Consumed&lt;ParseError&lt;Self::Input&gt;&gt;&gt;</code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Parses using the stream <code>input</code> by calling [<code>Stream::uncons</code>] one or more times. <a href="#method.parse_stream">Read more</a></p>
</div><h4 id='method.parse_stream_consumed-4' class="method"><span id='parse_stream_consumed.v-4' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.parse_stream_consumed' class='fnname'>parse_stream_consumed</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;mut self, <br>&nbsp;&nbsp;&nbsp;&nbsp;input: Self::Input<br>) -&gt; FastResult&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>Self::Output, Self::Input<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>, ParseError&lt;Self::Input&gt;&gt;</code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Parses using the stream <code>input</code> by calling [<code>Stream::uncons</code>] one or more times. <a href="#method.parse_stream_consumed">Read more</a></p>
</div><h4 id='method.add_error-4' class="method"><span id='add_error.v-4' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.add_error' class='fnname'>add_error</a>(&amp;mut self, _error: &amp;mut ParseError&lt;Self::Input&gt;)</code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Adds the first error that would normally be returned by this parser if it failed with an <code>EmptyErr</code> result. <a href="#method.add_error">Read more</a></p>
</div><h4 id='method.by_ref-4' class="method"><span id='by_ref.v-4' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.by_ref' class='fnname'>by_ref</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>Self</code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Borrows a parser instead of consuming it. <a href="#method.by_ref">Read more</a></p>
</div><h4 id='method.with-4' class="method"><span id='with.v-4' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.with' class='fnname'>with</a>&lt;P2&gt;(self, p: P2) -&gt; With&lt;Self, P2&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;P2: Parser&lt;Input = Self::Input&gt;,&nbsp;</span></code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Discards the value of the <code>self</code> parser and returns the value of <code>p</code>. Fails if any of the parsers fails. <a href="#method.with">Read more</a></p>
</div><h4 id='method.skip-4' class="method"><span id='skip.v-4' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.skip' class='fnname'>skip</a>&lt;P2&gt;(self, p: P2) -&gt; Skip&lt;Self, P2&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;P2: Parser&lt;Input = Self::Input&gt;,&nbsp;</span></code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Discards the value of the <code>p</code> parser and returns the value of <code>self</code>. Fails if any of the parsers fails. <a href="#method.skip">Read more</a></p>
</div><h4 id='method.and-4' class="method"><span id='and.v-4' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.and' class='fnname'>and</a>&lt;P2&gt;(self, p: P2) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>Self, P2<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;P2: Parser&lt;Input = Self::Input&gt;,&nbsp;</span></code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Parses with <code>self</code> followed by <code>p</code>. Succeeds if both parsers succeed, otherwise fails. Returns a tuple with both values on success. <a href="#method.and">Read more</a></p>
</div><h4 id='method.or-4' class="method"><span id='or.v-4' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.or' class='fnname'>or</a>&lt;P2&gt;(self, p: P2) -&gt; Or&lt;Self, P2&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;P2: Parser&lt;Input = Self::Input, Output = Self::Output&gt;,&nbsp;</span></code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns a parser which attempts to parse using <code>self</code>. If <code>self</code> fails without consuming any input it tries to consume the same input using <code>p</code>. <a href="#method.or">Read more</a></p>
</div><h4 id='method.then-4' class="method"><span id='then.v-4' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.then' class='fnname'>then</a>&lt;N, F&gt;(self, f: F) -&gt; Then&lt;Self, F&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::Output) -&gt; N,<br>&nbsp;&nbsp;&nbsp;&nbsp;N: Parser&lt;Input = Self::Input&gt;,&nbsp;</span></code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Parses using <code>self</code> and then passes the value to <code>f</code> which returns a parser used to parse the rest of the input. <a href="#method.then">Read more</a></p>
</div><h4 id='method.map-4' class="method"><span id='map.v-4' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.map' class='fnname'>map</a>&lt;F, B&gt;(self, f: F) -&gt; Map&lt;Self, F&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::Output) -&gt; B,&nbsp;</span></code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Uses <code>f</code> to map over the parsed value. <a href="#method.map">Read more</a></p>
</div><h4 id='method.flat_map-4' class="method"><span id='flat_map.v-4' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.flat_map' class='fnname'>flat_map</a>&lt;F, B&gt;(self, f: F) -&gt; FlatMap&lt;Self, F&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::Output) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;B, ParseError&lt;Self::Input&gt;&gt;,&nbsp;</span></code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Uses <code>f</code> to map over the output of <code>self</code>. If <code>f</code> returns an error the parser fails. <a href="#method.flat_map">Read more</a></p>
</div><h4 id='method.message-4' class="method"><span id='message.v-4' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.message' class='fnname'>message</a>&lt;S&gt;(self, msg: S) -&gt; Message&lt;Self&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;Info&lt;&lt;Self::Input as StreamOnce&gt;::Item, &lt;Self::Input as StreamOnce&gt;::Range&gt;&gt;,&nbsp;</span></code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Parses with <code>self</code> and if it fails, adds the message <code>msg</code> to the error. <a href="#method.message">Read more</a></p>
</div><h4 id='method.expected-4' class="method"><span id='expected.v-4' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.expected' class='fnname'>expected</a>&lt;S&gt;(self, msg: S) -&gt; Expected&lt;Self&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;Info&lt;&lt;Self::Input as StreamOnce&gt;::Item, &lt;Self::Input as StreamOnce&gt;::Range&gt;&gt;,&nbsp;</span></code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Parses with <code>self</code> and if it fails without consuming any input any expected errors are replaced by <code>msg</code>. <code>msg</code> is then used in error messages as &quot;Expected <code>msg</code>&quot;. <a href="#method.expected">Read more</a></p>
</div><h4 id='method.and_then-4' class="method"><span id='and_then.v-4' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.and_then' class='fnname'>and_then</a>&lt;F, O, E&gt;(self, f: F) -&gt; AndThen&lt;Self, F&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;E: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;Error&lt;&lt;Self::Input as StreamOnce&gt;::Item, &lt;Self::Input as StreamOnce&gt;::Range&gt;&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::Output) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;O, E&gt;,&nbsp;</span></code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Parses with <code>self</code> and applies <code>f</code> on the result if <code>self</code> parses successfully. <code>f</code> may optionally fail with an error which is automatically converted to a <code>ParseError</code>. <a href="#method.and_then">Read more</a></p>
</div><h4 id='method.iter-4' class="method"><span id='iter.v-4' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.iter' class='fnname'>iter</a>(self, input: Self::Input) -&gt; Iter&lt;Self&gt;</code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Creates an iterator from a parser and a state. Can be used as an alternative to [<code>many</code>] when collecting directly into a <code>FromIterator</code> type is not desirable. <a href="#method.iter">Read more</a></p>
</div><h4 id='method.boxed-4' class="method"><span id='boxed.v-4' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.boxed' class='fnname'>boxed</a>&lt;'a&gt;(<br>&nbsp;&nbsp;&nbsp;&nbsp;self<br>) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;Parser&lt;Input = Self::Input, Output = Self::Output&gt; + 'a&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: 'a,&nbsp;</span></code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Turns the parser into a trait object by putting it in a <code>Box</code>. Can be used to easily return parsers from functions without naming the type. <a href="#method.boxed">Read more</a></p>
</div></div><h3 id='impl-Parser-5' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;'a, Av, Bv, Cv, Dv, Ev, Fv, Gv&gt; Parser for <a class="struct" href="../../mentat_parser_utils/macros/struct.KeywordMapParser.html" title="struct mentat_parser_utils::macros::KeywordMapParser">KeywordMapParser</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>&amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, Av<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>&amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, Bv<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>&amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, Cv<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>&amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, Dv<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>&amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, Ev<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>&amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, Fv<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>&amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, Gv<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Av: Parser&lt;Input = <a class="struct" href="../../mentat_parser_utils/value_and_span/struct.Stream.html" title="struct mentat_parser_utils::value_and_span::Stream">Stream</a>&lt;'a&gt;&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;Bv: Parser&lt;Input = <a class="struct" href="../../mentat_parser_utils/value_and_span/struct.Stream.html" title="struct mentat_parser_utils::value_and_span::Stream">Stream</a>&lt;'a&gt;&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;Cv: Parser&lt;Input = <a class="struct" href="../../mentat_parser_utils/value_and_span/struct.Stream.html" title="struct mentat_parser_utils::value_and_span::Stream">Stream</a>&lt;'a&gt;&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;Dv: Parser&lt;Input = <a class="struct" href="../../mentat_parser_utils/value_and_span/struct.Stream.html" title="struct mentat_parser_utils::value_and_span::Stream">Stream</a>&lt;'a&gt;&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;Ev: Parser&lt;Input = <a class="struct" href="../../mentat_parser_utils/value_and_span/struct.Stream.html" title="struct mentat_parser_utils::value_and_span::Stream">Stream</a>&lt;'a&gt;&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;Fv: Parser&lt;Input = <a class="struct" href="../../mentat_parser_utils/value_and_span/struct.Stream.html" title="struct mentat_parser_utils::value_and_span::Stream">Stream</a>&lt;'a&gt;&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;Gv: Parser&lt;Input = <a class="struct" href="../../mentat_parser_utils/value_and_span/struct.Stream.html" title="stru
<div class='docblock'><p>The type which is taken as input for the parser. The type must implement the <code>Stream</code> trait which allows the parser to read items from the type. <a href="#associatedtype.Input">Read more</a></p>
</div><h4 id='associatedtype.Output-5' class="type"><span id='Output.t-5' class='invisible'><code>type <a href='#associatedtype.Output' class="type">Output</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Av::Output&gt;, <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Bv::Output&gt;, <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Cv::Output&gt;, <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Dv::Output&gt;, <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Ev::Output&gt;, <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Fv::Output&gt;, <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Gv::Output&gt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a></code></span></h4>
2018-06-21 14:44:35 +00:00
<div class='docblock'><p>The type which is returned if the parser is successful.</p>
2018-06-22 17:25:54 +00:00
</div><h4 id='method.parse_lazy-5' class="method"><span id='parse_lazy.v-5' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.parse_lazy' class='fnname'>parse_lazy</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;mut self, <br>&nbsp;&nbsp;&nbsp;&nbsp;input: <a class="struct" href="../../mentat_parser_utils/value_and_span/struct.Stream.html" title="struct mentat_parser_utils::value_and_span::Stream">Stream</a>&lt;'a&gt;<br>) -&gt; ConsumedResult&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Av::Output&gt;, <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Bv::Output&gt;, <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Cv::Output&gt;, <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Dv::Output&gt;, <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Ev::Output&gt;, <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Fv::Output&gt;, <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Gv::Output&gt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>, <a class="struct" href="../../mentat_parser_utils/value_and_span/struct.Stream.html" title="struct mentat_parser_utils::value_and_span::Stream">Stream</a>&lt;'a&gt;&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/mentat_parser_utils/value_and_span.rs.html#576-642' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Parses using the stream <code>input</code> by calling [<code>Stream::uncons</code>] one or more times. <a href="#method.parse_lazy">Read more</a></p>
</div><h4 id='method.parse-5' class="method"><span id='parse.v-5' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.parse' class='fnname'>parse</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;mut self, <br>&nbsp;&nbsp;&nbsp;&nbsp;input: Self::Input<br>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>Self::Output, Self::Input<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>, ParseError&lt;Self::Input&gt;&gt;</code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Entry point of the parser. Takes some input and tries to parse it. <a href="#method.parse">Read more</a></p>
</div><h4 id='method.parse_stream-5' class="method"><span id='parse_stream.v-5' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.parse_stream' class='fnname'>parse_stream</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;mut self, <br>&nbsp;&nbsp;&nbsp;&nbsp;input: Self::Input<br>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>Self::Output, Consumed&lt;Self::Input&gt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>, Consumed&lt;ParseError&lt;Self::Input&gt;&gt;&gt;</code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Parses using the stream <code>input</code> by calling [<code>Stream::uncons</code>] one or more times. <a href="#method.parse_stream">Read more</a></p>
</div><h4 id='method.parse_stream_consumed-5' class="method"><span id='parse_stream_consumed.v-5' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.parse_stream_consumed' class='fnname'>parse_stream_consumed</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;mut self, <br>&nbsp;&nbsp;&nbsp;&nbsp;input: Self::Input<br>) -&gt; FastResult&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>Self::Output, Self::Input<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>, ParseError&lt;Self::Input&gt;&gt;</code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Parses using the stream <code>input</code> by calling [<code>Stream::uncons</code>] one or more times. <a href="#method.parse_stream_consumed">Read more</a></p>
</div><h4 id='method.add_error-5' class="method"><span id='add_error.v-5' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.add_error' class='fnname'>add_error</a>(&amp;mut self, _error: &amp;mut ParseError&lt;Self::Input&gt;)</code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Adds the first error that would normally be returned by this parser if it failed with an <code>EmptyErr</code> result. <a href="#method.add_error">Read more</a></p>
</div><h4 id='method.by_ref-5' class="method"><span id='by_ref.v-5' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.by_ref' class='fnname'>by_ref</a>(&amp;mut self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;mut </a>Self</code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Borrows a parser instead of consuming it. <a href="#method.by_ref">Read more</a></p>
</div><h4 id='method.with-5' class="method"><span id='with.v-5' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.with' class='fnname'>with</a>&lt;P2&gt;(self, p: P2) -&gt; With&lt;Self, P2&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;P2: Parser&lt;Input = Self::Input&gt;,&nbsp;</span></code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Discards the value of the <code>self</code> parser and returns the value of <code>p</code>. Fails if any of the parsers fails. <a href="#method.with">Read more</a></p>
</div><h4 id='method.skip-5' class="method"><span id='skip.v-5' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.skip' class='fnname'>skip</a>&lt;P2&gt;(self, p: P2) -&gt; Skip&lt;Self, P2&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;P2: Parser&lt;Input = Self::Input&gt;,&nbsp;</span></code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Discards the value of the <code>p</code> parser and returns the value of <code>self</code>. Fails if any of the parsers fails. <a href="#method.skip">Read more</a></p>
</div><h4 id='method.and-5' class="method"><span id='and.v-5' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.and' class='fnname'>and</a>&lt;P2&gt;(self, p: P2) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a>Self, P2<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a> <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;P2: Parser&lt;Input = Self::Input&gt;,&nbsp;</span></code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Parses with <code>self</code> followed by <code>p</code>. Succeeds if both parsers succeed, otherwise fails. Returns a tuple with both values on success. <a href="#method.and">Read more</a></p>
</div><h4 id='method.or-5' class="method"><span id='or.v-5' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.or' class='fnname'>or</a>&lt;P2&gt;(self, p: P2) -&gt; Or&lt;Self, P2&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;P2: Parser&lt;Input = Self::Input, Output = Self::Output&gt;,&nbsp;</span></code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns a parser which attempts to parse using <code>self</code>. If <code>self</code> fails without consuming any input it tries to consume the same input using <code>p</code>. <a href="#method.or">Read more</a></p>
</div><h4 id='method.then-5' class="method"><span id='then.v-5' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.then' class='fnname'>then</a>&lt;N, F&gt;(self, f: F) -&gt; Then&lt;Self, F&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::Output) -&gt; N,<br>&nbsp;&nbsp;&nbsp;&nbsp;N: Parser&lt;Input = Self::Input&gt;,&nbsp;</span></code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Parses using <code>self</code> and then passes the value to <code>f</code> which returns a parser used to parse the rest of the input. <a href="#method.then">Read more</a></p>
</div><h4 id='method.map-5' class="method"><span id='map.v-5' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.map' class='fnname'>map</a>&lt;F, B&gt;(self, f: F) -&gt; Map&lt;Self, F&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::Output) -&gt; B,&nbsp;</span></code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Uses <code>f</code> to map over the parsed value. <a href="#method.map">Read more</a></p>
</div><h4 id='method.flat_map-5' class="method"><span id='flat_map.v-5' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.flat_map' class='fnname'>flat_map</a>&lt;F, B&gt;(self, f: F) -&gt; FlatMap&lt;Self, F&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::Output) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;B, ParseError&lt;Self::Input&gt;&gt;,&nbsp;</span></code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Uses <code>f</code> to map over the output of <code>self</code>. If <code>f</code> returns an error the parser fails. <a href="#method.flat_map">Read more</a></p>
</div><h4 id='method.message-5' class="method"><span id='message.v-5' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.message' class='fnname'>message</a>&lt;S&gt;(self, msg: S) -&gt; Message&lt;Self&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;Info&lt;&lt;Self::Input as StreamOnce&gt;::Item, &lt;Self::Input as StreamOnce&gt;::Range&gt;&gt;,&nbsp;</span></code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Parses with <code>self</code> and if it fails, adds the message <code>msg</code> to the error. <a href="#method.message">Read more</a></p>
</div><h4 id='method.expected-5' class="method"><span id='expected.v-5' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.expected' class='fnname'>expected</a>&lt;S&gt;(self, msg: S) -&gt; Expected&lt;Self&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;Info&lt;&lt;Self::Input as StreamOnce&gt;::Item, &lt;Self::Input as StreamOnce&gt;::Range&gt;&gt;,&nbsp;</span></code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Parses with <code>self</code> and if it fails without consuming any input any expected errors are replaced by <code>msg</code>. <code>msg</code> is then used in error messages as &quot;Expected <code>msg</code>&quot;. <a href="#method.expected">Read more</a></p>
</div><h4 id='method.and_then-5' class="method"><span id='and_then.v-5' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.and_then' class='fnname'>and_then</a>&lt;F, O, E&gt;(self, f: F) -&gt; AndThen&lt;Self, F&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;E: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a>&lt;Error&lt;&lt;Self::Input as StreamOnce&gt;::Item, &lt;Self::Input as StreamOnce&gt;::Range&gt;&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(Self::Output) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;O, E&gt;,&nbsp;</span></code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Parses with <code>self</code> and applies <code>f</code> on the result if <code>self</code> parses successfully. <code>f</code> may optionally fail with an error which is automatically converted to a <code>ParseError</code>. <a href="#method.and_then">Read more</a></p>
</div><h4 id='method.iter-5' class="method"><span id='iter.v-5' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.iter' class='fnname'>iter</a>(self, input: Self::Input) -&gt; Iter&lt;Self&gt;</code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Creates an iterator from a parser and a state. Can be used as an alternative to [<code>many</code>] when collecting directly into a <code>FromIterator</code> type is not desirable. <a href="#method.iter">Read more</a></p>
</div><h4 id='method.boxed-5' class="method"><span id='boxed.v-5' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.boxed' class='fnname'>boxed</a>&lt;'a&gt;(<br>&nbsp;&nbsp;&nbsp;&nbsp;self<br>) -&gt; <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;Parser&lt;Input = Self::Input, Output = Self::Output&gt; + 'a&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: 'a,&nbsp;</span></code></td><td></td></tr></tbody></table></span></h4><div class='docblock'><p>Turns the parser into a trait object by putting it in a <code>Box</code>. Can be used to easily return parsers from functions without naming the type. <a href="#method.boxed">Read more</a></p>
2018-06-21 14:44:35 +00:00
</div></div></div>
<h2 id='synthetic-implementations' class='small-section-header'>
Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a>
</h2>
<div id='synthetic-implementations-list'>
<h3 id='impl-Send' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../../mentat_parser_utils/macros/struct.KeywordMapParser.html" title="struct mentat_parser_utils::macros::KeywordMapParser">KeywordMapParser</a>&lt;T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a>,&nbsp;</span></code><a href='#impl-Send' class='anchor'></a></span></td><td><span class='out-of-band'></span></td></tr></tbody></table></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;T&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../../mentat_parser_utils/macros/struct.KeywordMapParser.html" title="struct mentat_parser_utils::macros::KeywordMapParser">KeywordMapParser</a>&lt;T&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>,&nbsp;</span></code><a href='#impl-Sync' class='anchor'></a></span></td><td><span class='out-of-band'></span></td></tr></tbody></table></h3><div class='impl-items'></div></div></section>
<section id='search' class="content hidden"></section>
<section class="footer"></section>
<aside id="help" class="hidden">
<div>
<h1 class="hidden">Help</h1>
<div class="shortcuts">
<h2>Keyboard Shortcuts</h2>
<dl>
<dt><kbd>?</kbd></dt>
<dd>Show this help dialog</dd>
<dt><kbd>S</kbd></dt>
<dd>Focus the search field</dd>
<dt><kbd></kbd></dt>
<dd>Move up in search results</dd>
<dt><kbd></kbd></dt>
<dd>Move down in search results</dd>
<dt><kbd></kbd></dt>
<dd>Switch tab</dd>
<dt><kbd>&#9166;</kbd></dt>
<dd>Go to active search result</dd>
<dt><kbd>+</kbd></dt>
<dd>Expand all sections</dd>
<dt><kbd>-</kbd></dt>
<dd>Collapse all sections</dd>
</dl>
</div>
<div class="infos">
<h2>Search Tricks</h2>
<p>
Prefix searches with a type followed by a colon (e.g.
<code>fn:</code>) to restrict the search to a given type.
</p>
<p>
Accepted types are: <code>fn</code>, <code>mod</code>,
<code>struct</code>, <code>enum</code>,
<code>trait</code>, <code>type</code>, <code>macro</code>,
and <code>const</code>.
</p>
<p>
Search functions by type signature (e.g.
<code>vec -> usize</code> or <code>* -> vec</code>)
</p>
</div>
</div>
</aside>
<script>
window.rootPath = "../../";
window.currentCrate = "mentat_parser_utils";
</script>
<script src="../../main.js"></script>
<script defer src="../../search-index.js"></script>
</body>
</html>