ssw/doc/nom/trait.Parser.html
2023-01-09 19:23:20 +01:00

35 lines
32 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!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="All nom parsers implement this trait"><meta name="keywords" content="rust, rustlang, rust-lang, Parser"><title>Parser in nom - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../SourceCodePro-Semibold.ttf.woff2"><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="../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../dark.css" disabled><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../storage.js"></script><script defer src="sidebar-items.js"></script><script defer src="../main.js"></script><noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../favicon.svg"></head><body class="rustdoc trait"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">&#9776;</button><a class="sidebar-logo" href="../nom/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div></a><h2 class="location"></h2></nav><nav class="sidebar"><a class="sidebar-logo" href="../nom/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div></a><h2 class="location"><a href="#">Parser</a></h2><div class="sidebar-elems"><section><div class="block"><h3 class="sidebar-title"><a href="#required-methods">Required Methods</a></h3><ul><li><a href="#tymethod.parse">parse</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#provided-methods">Provided Methods</a></h3><ul><li><a href="#method.and">and</a></li><li><a href="#method.and_then">and_then</a></li><li><a href="#method.flat_map">flat_map</a></li><li><a href="#method.into">into</a></li><li><a href="#method.map">map</a></li><li><a href="#method.or">or</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#foreign-impls">Implementations on Foreign Types</a></h3><ul><li><a href="#impl-Parser%3CI%2C%20O%2C%20E%3E-for-Box%3Cdyn%20Parser%3CI%2C%20O%2C%20E%3E%20+%20%27a%3E">Box&lt;dyn Parser&lt;I, O, E&gt; + &#39;a&gt;</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#trait-implementations">Trait Implementations</a></h3><ul><li><a href="#impl-Parser%3CI%2C%20O%2C%20E%3E-for-Box%3Cdyn%20Parser%3CI%2C%20O%2C%20E%3E%20+%20%27a%3E">Parser&lt;I, O, E&gt;</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#implementors">Implementors</a></h3></div></section><h2 class="location"><a href="index.html">In nom</a></h2></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../nom/index.html"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></a><nav class="sub"><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><button type="button">?</button></div><div id="settings-menu" tabindex="-1"><a href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../wheel.svg"></a></div></div></form></nav></div><section id="main-content" class="content"><div class="main-heading"><h1 class="fqn"><span class="in-band">Trait <a href="index.html">nom</a>::<wbr><a class="trait" href="#">Parser</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../src/nom/internal.rs.html#241-318">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><div class="docblock item-decl"><pre class="rust trait"><code>pub trait Parser&lt;I, O, E&gt; {
fn <a href="#tymethod.parse" class="fnname">parse</a>(&amp;mut self, input: I) -&gt; <a class="type" href="type.IResult.html" title="type nom::IResult">IResult</a>&lt;I, O, E&gt;;
fn <a href="#method.map" class="fnname">map</a>&lt;G, O2&gt;(self, g: G) -&gt; <a class="struct" href="struct.Map.html" title="struct nom::Map">Map</a>&lt;Self, G, O&gt;<br>&nbsp;&nbsp;&nbsp; <span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;G: <a class="trait" href="https://doc.rust-lang.org/1.64.0/core/ops/function/trait.Fn.html" title="trait core::ops::function::Fn">Fn</a>(O) -&gt; O2,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/1.64.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span>,
{ ... }
<span class="item-spacer"></span> fn <a href="#method.flat_map" class="fnname">flat_map</a>&lt;G, H, O2&gt;(self, g: G) -&gt; <a class="struct" href="struct.FlatMap.html" title="struct nom::FlatMap">FlatMap</a>&lt;Self, G, O&gt;<br>&nbsp;&nbsp;&nbsp; <span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;G: <a class="trait" href="https://doc.rust-lang.org/1.64.0/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(O) -&gt; H,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;H: <a class="trait" href="trait.Parser.html" title="trait nom::Parser">Parser</a>&lt;I, O2, E&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/1.64.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span>,
{ ... }
<span class="item-spacer"></span> fn <a href="#method.and_then" class="fnname">and_then</a>&lt;G, O2&gt;(self, g: G) -&gt; <a class="struct" href="struct.AndThen.html" title="struct nom::AndThen">AndThen</a>&lt;Self, G, O&gt;<br>&nbsp;&nbsp;&nbsp; <span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;G: <a class="trait" href="trait.Parser.html" title="trait nom::Parser">Parser</a>&lt;O, O2, E&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/1.64.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span>,
{ ... }
<span class="item-spacer"></span> fn <a href="#method.and" class="fnname">and</a>&lt;G, O2&gt;(self, g: G) -&gt; <a class="struct" href="struct.And.html" title="struct nom::And">And</a>&lt;Self, G&gt;<br>&nbsp;&nbsp;&nbsp; <span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;G: <a class="trait" href="trait.Parser.html" title="trait nom::Parser">Parser</a>&lt;I, O2, E&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/1.64.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span>,
{ ... }
<span class="item-spacer"></span> fn <a href="#method.or" class="fnname">or</a>&lt;G&gt;(self, g: G) -&gt; <a class="struct" href="struct.Or.html" title="struct nom::Or">Or</a>&lt;Self, G&gt;<br>&nbsp;&nbsp;&nbsp; <span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;G: <a class="trait" href="trait.Parser.html" title="trait nom::Parser">Parser</a>&lt;I, O, E&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/1.64.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span>,
{ ... }
<span class="item-spacer"></span> fn <a href="#method.into" class="fnname">into</a>&lt;O2:&nbsp;<a class="trait" href="https://doc.rust-lang.org/1.64.0/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;O&gt;, E2:&nbsp;<a class="trait" href="https://doc.rust-lang.org/1.64.0/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;E&gt;&gt;(self) -&gt; <a class="struct" href="struct.Into.html" title="struct nom::Into">Into</a>&lt;Self, O, O2, E, E2&gt;<br>&nbsp;&nbsp;&nbsp; <span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/1.64.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span>,
{ ... }
}</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>All nom parsers implement this trait</p>
</div></details><h2 id="required-methods" class="small-section-header">Required Methods<a href="#required-methods" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle" open><summary><div id="tymethod.parse" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/nom/internal.rs.html#244">source</a></div><h4 class="code-header">fn <a href="#tymethod.parse" class="fnname">parse</a>(&amp;mut self, input: I) -&gt; <a class="type" href="type.IResult.html" title="type nom::IResult">IResult</a>&lt;I, O, E&gt;</h4></div></summary><div class="docblock"><p>A parser takes in input type, and returns a <code>Result</code> containing
either the remaining input and the output value, or an error</p>
</div></details></div><h2 id="provided-methods" class="small-section-header">Provided Methods<a href="#provided-methods" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle" open><summary><div id="method.map" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/nom/internal.rs.html#247-257">source</a></div><h4 class="code-header">fn <a href="#method.map" class="fnname">map</a>&lt;G, O2&gt;(self, g: G) -&gt; <a class="struct" href="struct.Map.html" title="struct nom::Map">Map</a>&lt;Self, G, O&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;G: <a class="trait" href="https://doc.rust-lang.org/1.64.0/core/ops/function/trait.Fn.html" title="trait core::ops::function::Fn">Fn</a>(O) -&gt; O2,<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/1.64.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h4></div></summary><div class="docblock"><p>Maps a function over the result of a parser</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="method.flat_map" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/nom/internal.rs.html#260-271">source</a></div><h4 class="code-header">fn <a href="#method.flat_map" class="fnname">flat_map</a>&lt;G, H, O2&gt;(self, g: G) -&gt; <a class="struct" href="struct.FlatMap.html" title="struct nom::FlatMap">FlatMap</a>&lt;Self, G, O&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;G: <a class="trait" href="https://doc.rust-lang.org/1.64.0/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(O) -&gt; H,<br>&nbsp;&nbsp;&nbsp;&nbsp;H: <a class="trait" href="trait.Parser.html" title="trait nom::Parser">Parser</a>&lt;I, O2, E&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/1.64.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h4></div></summary><div class="docblock"><p>Creates a second parser from the output of the first one, then apply over the rest of the input</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="method.and_then" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/nom/internal.rs.html#274-284">source</a></div><h4 class="code-header">fn <a href="#method.and_then" class="fnname">and_then</a>&lt;G, O2&gt;(self, g: G) -&gt; <a class="struct" href="struct.AndThen.html" title="struct nom::AndThen">AndThen</a>&lt;Self, G, O&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;G: <a class="trait" href="trait.Parser.html" title="trait nom::Parser">Parser</a>&lt;O, O2, E&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/1.64.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h4></div></summary><div class="docblock"><p>Applies a second parser over the output of the first one</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="method.and" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/nom/internal.rs.html#287-293">source</a></div><h4 class="code-header">fn <a href="#method.and" class="fnname">and</a>&lt;G, O2&gt;(self, g: G) -&gt; <a class="struct" href="struct.And.html" title="struct nom::And">And</a>&lt;Self, G&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;G: <a class="trait" href="trait.Parser.html" title="trait nom::Parser">Parser</a>&lt;I, O2, E&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/1.64.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h4></div></summary><div class="docblock"><p>Applies a second parser after the first one, return their results as a tuple</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="method.or" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/nom/internal.rs.html#296-302">source</a></div><h4 class="code-header">fn <a href="#method.or" class="fnname">or</a>&lt;G&gt;(self, g: G) -&gt; <a class="struct" href="struct.Or.html" title="struct nom::Or">Or</a>&lt;Self, G&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;G: <a class="trait" href="trait.Parser.html" title="trait nom::Parser">Parser</a>&lt;I, O, E&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/1.64.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h4></div></summary><div class="docblock"><p>Applies a second parser over the input if the first one failed</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="method.into" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/nom/internal.rs.html#306-317">source</a></div><h4 class="code-header">fn <a href="#method.into" class="fnname">into</a>&lt;O2:&nbsp;<a class="trait" href="https://doc.rust-lang.org/1.64.0/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;O&gt;, E2:&nbsp;<a class="trait" href="https://doc.rust-lang.org/1.64.0/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;E&gt;&gt;(self) -&gt; <a class="struct" href="struct.Into.html" title="struct nom::Into">Into</a>&lt;Self, O, O2, E, E2&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/1.64.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h4></div></summary><div class="docblock"><p>automatically converts the parsers output and error values to another type, as long as they
implement the <code>From</code> trait</p>
</div></details></div><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Parser%3CI%2C%20O%2C%20E%3E-for-Box%3Cdyn%20Parser%3CI%2C%20O%2C%20E%3E%20+%20%27a%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../src/nom/internal.rs.html#333-337">source</a></span><a href="#impl-Parser%3CI%2C%20O%2C%20E%3E-for-Box%3Cdyn%20Parser%3CI%2C%20O%2C%20E%3E%20+%20%27a%3E" class="anchor"></a><h3 class="code-header in-band">impl&lt;'a, I, O, E&gt; <a class="trait" href="trait.Parser.html" title="trait nom::Parser">Parser</a>&lt;I, O, E&gt; for <a class="struct" href="https://doc.rust-lang.org/1.64.0/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;dyn <a class="trait" href="trait.Parser.html" title="trait nom::Parser">Parser</a>&lt;I, O, E&gt; + 'a&gt;</h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.parse" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../src/nom/internal.rs.html#334-336">source</a></span><a href="#method.parse" class="anchor"></a><h4 class="code-header">fn <a href="trait.Parser.html#tymethod.parse" class="fnname">parse</a>(&amp;mut self, input: I) -&gt; <a class="type" href="type.IResult.html" title="type nom::IResult">IResult</a>&lt;I, O, E&gt;</h4></section></summary><div class='docblock'><p>A parser takes in input type, and returns a <code>Result</code> containing
either the remaining input and the output value, or an error <a href="trait.Parser.html#tymethod.parse">Read more</a></p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.map-1" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../src/nom/internal.rs.html#247-257">source</a></span><a href="#method.map-1" class="anchor"></a><h4 class="code-header">fn <a href="trait.Parser.html#method.map" class="fnname">map</a>&lt;G, O2&gt;(self, g: G) -&gt; <a class="struct" href="struct.Map.html" title="struct nom::Map">Map</a>&lt;Self, G, O&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;G: <a class="trait" href="https://doc.rust-lang.org/1.64.0/core/ops/function/trait.Fn.html" title="trait core::ops::function::Fn">Fn</a>(O) -&gt; O2,<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/1.64.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h4></section></summary><div class='docblock'><p>Maps a function over the result of a parser</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.flat_map-1" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../src/nom/internal.rs.html#260-271">source</a></span><a href="#method.flat_map-1" class="anchor"></a><h4 class="code-header">fn <a href="trait.Parser.html#method.flat_map" class="fnname">flat_map</a>&lt;G, H, O2&gt;(self, g: G) -&gt; <a class="struct" href="struct.FlatMap.html" title="struct nom::FlatMap">FlatMap</a>&lt;Self, G, O&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;G: <a class="trait" href="https://doc.rust-lang.org/1.64.0/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(O) -&gt; H,<br>&nbsp;&nbsp;&nbsp;&nbsp;H: <a class="trait" href="trait.Parser.html" title="trait nom::Parser">Parser</a>&lt;I, O2, E&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/1.64.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h4></section></summary><div class='docblock'><p>Creates a second parser from the output of the first one, then apply over the rest of the input</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.and_then-1" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../src/nom/internal.rs.html#274-284">source</a></span><a href="#method.and_then-1" class="anchor"></a><h4 class="code-header">fn <a href="trait.Parser.html#method.and_then" class="fnname">and_then</a>&lt;G, O2&gt;(self, g: G) -&gt; <a class="struct" href="struct.AndThen.html" title="struct nom::AndThen">AndThen</a>&lt;Self, G, O&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;G: <a class="trait" href="trait.Parser.html" title="trait nom::Parser">Parser</a>&lt;O, O2, E&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/1.64.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h4></section></summary><div class='docblock'><p>Applies a second parser over the output of the first one</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.and-1" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../src/nom/internal.rs.html#287-293">source</a></span><a href="#method.and-1" class="anchor"></a><h4 class="code-header">fn <a href="trait.Parser.html#method.and" class="fnname">and</a>&lt;G, O2&gt;(self, g: G) -&gt; <a class="struct" href="struct.And.html" title="struct nom::And">And</a>&lt;Self, G&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;G: <a class="trait" href="trait.Parser.html" title="trait nom::Parser">Parser</a>&lt;I, O2, E&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/1.64.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h4></section></summary><div class='docblock'><p>Applies a second parser after the first one, return their results as a tuple</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.or-1" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../src/nom/internal.rs.html#296-302">source</a></span><a href="#method.or-1" class="anchor"></a><h4 class="code-header">fn <a href="trait.Parser.html#method.or" class="fnname">or</a>&lt;G&gt;(self, g: G) -&gt; <a class="struct" href="struct.Or.html" title="struct nom::Or">Or</a>&lt;Self, G&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;G: <a class="trait" href="trait.Parser.html" title="trait nom::Parser">Parser</a>&lt;I, O, E&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/1.64.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h4></section></summary><div class='docblock'><p>Applies a second parser over the input if the first one failed</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.into-1" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../src/nom/internal.rs.html#306-317">source</a></span><a href="#method.into-1" class="anchor"></a><h4 class="code-header">fn <a href="trait.Parser.html#method.into" class="fnname">into</a>&lt;O2:&nbsp;<a class="trait" href="https://doc.rust-lang.org/1.64.0/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;O&gt;, E2:&nbsp;<a class="trait" href="https://doc.rust-lang.org/1.64.0/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;E&gt;&gt;(self) -&gt; <a class="struct" href="struct.Into.html" title="struct nom::Into">Into</a>&lt;Self, O, O2, E, E2&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;Self: <a class="trait" href="https://doc.rust-lang.org/1.64.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>,&nbsp;</span></h4></section></summary><div class='docblock'><p>automatically converts the parsers output and error values to another type, as long as they
implement the <code>From</code> trait <a href="trait.Parser.html#method.into">Read more</a></p>
</div></details></div></details></div><h2 id="foreign-impls" class="small-section-header">Implementations on Foreign Types<a href="#foreign-impls" class="anchor"></a></h2><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Parser%3CI%2C%20O%2C%20E%3E-for-Box%3Cdyn%20Parser%3CI%2C%20O%2C%20E%3E%20+%20%27a%3E-1" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../src/nom/internal.rs.html#333-337">source</a></span><a href="#impl-Parser%3CI%2C%20O%2C%20E%3E-for-Box%3Cdyn%20Parser%3CI%2C%20O%2C%20E%3E%20+%20%27a%3E-1" class="anchor"></a><h3 class="code-header in-band">impl&lt;'a, I, O, E&gt; <a class="trait" href="trait.Parser.html" title="trait nom::Parser">Parser</a>&lt;I, O, E&gt; for <a class="struct" href="https://doc.rust-lang.org/1.64.0/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a>&lt;dyn <a class="trait" href="trait.Parser.html" title="trait nom::Parser">Parser</a>&lt;I, O, E&gt; + 'a&gt;</h3></section></summary><div class="impl-items"><section id="method.parse-1" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../src/nom/internal.rs.html#334-336">source</a></span><a href="#method.parse-1" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.parse" class="fnname">parse</a>(&amp;mut self, input: I) -&gt; <a class="type" href="type.IResult.html" title="type nom::IResult">IResult</a>&lt;I, O, E&gt;</h4></section></div></details><h2 id="implementors" class="small-section-header">Implementors<a href="#implementors" class="anchor"></a></h2><div class="item-list" id="implementors-list"><section id="impl-Parser%3CI%2C%20O2%2C%20E%3E-for-FlatMap%3CF%2C%20G%2C%20O1%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../src/nom/internal.rs.html#364-371">source</a></span><a href="#impl-Parser%3CI%2C%20O2%2C%20E%3E-for-FlatMap%3CF%2C%20G%2C%20O1%3E" class="anchor"></a><h3 class="code-header in-band">impl&lt;'a, I, O1, O2, E, F:&nbsp;<a class="trait" href="trait.Parser.html" title="trait nom::Parser">Parser</a>&lt;I, O1, E&gt;, G:&nbsp;<a class="trait" href="https://doc.rust-lang.org/1.64.0/core/ops/function/trait.Fn.html" title="trait core::ops::function::Fn">Fn</a>(O1) -&gt; H, H:&nbsp;<a class="trait" href="trait.Parser.html" title="trait nom::Parser">Parser</a>&lt;I, O2, E&gt;&gt; <a class="trait" href="trait.Parser.html" title="trait nom::Parser">Parser</a>&lt;I, O2, E&gt; for <a class="struct" href="struct.FlatMap.html" title="struct nom::FlatMap">FlatMap</a>&lt;F, G, O1&gt;</h3></section><section id="impl-Parser%3CI%2C%20O2%2C%20E%3E-for-Map%3CF%2C%20G%2C%20O1%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../src/nom/internal.rs.html#347-354">source</a></span><a href="#impl-Parser%3CI%2C%20O2%2C%20E%3E-for-Map%3CF%2C%20G%2C%20O1%3E" class="anchor"></a><h3 class="code-header in-band">impl&lt;'a, I, O1, O2, E, F:&nbsp;<a class="trait" href="trait.Parser.html" title="trait nom::Parser">Parser</a>&lt;I, O1, E&gt;, G:&nbsp;<a class="trait" href="https://doc.rust-lang.org/1.64.0/core/ops/function/trait.Fn.html" title="trait core::ops::function::Fn">Fn</a>(O1) -&gt; O2&gt; <a class="trait" href="trait.Parser.html" title="trait nom::Parser">Parser</a>&lt;I, O2, E&gt; for <a class="struct" href="struct.Map.html" title="struct nom::Map">Map</a>&lt;F, G, O1&gt;</h3></section><section id="impl-Parser%3CI%2C%20(O1%2C%20O2)%2C%20E%3E-for-And%3CF%2C%20G%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../src/nom/internal.rs.html#398-406">source</a></span><a href="#impl-Parser%3CI%2C%20(O1%2C%20O2)%2C%20E%3E-for-And%3CF%2C%20G%3E" class="anchor"></a><h3 class="code-header in-band">impl&lt;'a, I, O1, O2, E, F:&nbsp;<a class="trait" href="trait.Parser.html" title="trait nom::Parser">Parser</a>&lt;I, O1, E&gt;, G:&nbsp;<a class="trait" href="trait.Parser.html" title="trait nom::Parser">Parser</a>&lt;I, O2, E&gt;&gt; <a class="trait" href="trait.Parser.html" title="trait nom::Parser">Parser</a>&lt;I, <a class="primitive" href="https://doc.rust-lang.org/1.64.0/std/primitive.tuple.html">(O1, O2)</a>, E&gt; for <a class="struct" href="struct.And.html" title="struct nom::And">And</a>&lt;F, G&gt;</h3></section><section id="impl-Parser%3CI%2C%20O2%2C%20E%3E-for-AndThen%3CF%2C%20G%2C%20O1%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../src/nom/internal.rs.html#381-389">source</a></span><a href="#impl-Parser%3CI%2C%20O2%2C%20E%3E-for-AndThen%3CF%2C%20G%2C%20O1%3E" class="anchor"></a><h3 class="code-header in-band">impl&lt;'a, I, O1, O2, E, F:&nbsp;<a class="trait" href="trait.Parser.html" title="trait nom::Parser">Parser</a>&lt;I, O1, E&gt;, G:&nbsp;<a class="trait" href="trait.Parser.html" title="trait nom::Parser">Parser</a>&lt;O1, O2, E&gt;&gt; <a class="trait" href="trait.Parser.html" title="trait nom::Parser">Parser</a>&lt;I, O2, E&gt; for <a class="struct" href="struct.AndThen.html" title="struct nom::AndThen">AndThen</a>&lt;F, G, O1&gt;</h3></section><section id="impl-Parser%3CI%2C%20O%2C%20E%3E-for-F" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../src/nom/internal.rs.html#320-327">source</a></span><a href="#impl-Parser%3CI%2C%20O%2C%20E%3E-for-F" class="anchor"></a><h3 class="code-header in-band">impl&lt;'a, I, O, E, F&gt; <a class="trait" href="trait.Parser.html" title="trait nom::Parser">Parser</a>&lt;I, O, E&gt; for F <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/1.64.0/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(I) -&gt; <a class="type" href="type.IResult.html" title="type nom::IResult">IResult</a>&lt;I, O, E&gt; + 'a,&nbsp;</span></h3></section><section id="impl-Parser%3CI%2C%20O2%2C%20E2%3E-for-Into%3CF%2C%20O1%2C%20O2%2C%20E1%2C%20E2%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../src/nom/internal.rs.html#439-457">source</a></span><a href="#impl-Parser%3CI%2C%20O2%2C%20E2%3E-for-Into%3CF%2C%20O1%2C%20O2%2C%20E1%2C%20E2%3E" class="anchor"></a><h3 class="code-header in-band">impl&lt;'a, I:&nbsp;<a class="trait" href="https://doc.rust-lang.org/1.64.0/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, O1, O2:&nbsp;<a class="trait" href="https://doc.rust-lang.org/1.64.0/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;O1&gt;, E1, E2:&nbsp;<a class="trait" href="error/trait.ParseError.html" title="trait nom::error::ParseError">ParseError</a>&lt;I&gt; + <a class="trait" href="https://doc.rust-lang.org/1.64.0/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;E1&gt;, F:&nbsp;<a class="trait" href="trait.Parser.html" title="trait nom::Parser">Parser</a>&lt;I, O1, E1&gt;&gt; <a class="trait" href="trait.Parser.html" title="trait nom::Parser">Parser</a>&lt;I, O2, E2&gt; for <a class="struct" href="struct.Into.html" title="struct nom::Into">Into</a>&lt;F, O1, O2, E1, E2&gt;</h3></section><section id="impl-Parser%3CI%2C%20O%2C%20E%3E-for-Or%3CF%2C%20G%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../src/nom/internal.rs.html#415-427">source</a></span><a href="#impl-Parser%3CI%2C%20O%2C%20E%3E-for-Or%3CF%2C%20G%3E" class="anchor"></a><h3 class="code-header in-band">impl&lt;'a, I:&nbsp;<a class="trait" href="https://doc.rust-lang.org/1.64.0/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, O, E:&nbsp;<a class="trait" href="error/trait.ParseError.html" title="trait nom::error::ParseError">ParseError</a>&lt;I&gt;, F:&nbsp;<a class="trait" href="trait.Parser.html" title="trait nom::Parser">Parser</a>&lt;I, O, E&gt;, G:&nbsp;<a class="trait" href="trait.Parser.html" title="trait nom::Parser">Parser</a>&lt;I, O, E&gt;&gt; <a class="trait" href="trait.Parser.html" title="trait nom::Parser">Parser</a>&lt;I, O, E&gt; for <a class="struct" href="struct.Or.html" title="struct nom::Or">Or</a>&lt;F, G&gt;</h3></section></div><script type="text/javascript" src="../implementors/nom/internal/trait.Parser.js" data-ignore-extern-crates="alloc" async></script></section></div></main><div id="rustdoc-vars" data-root-path="../" data-current-crate="nom" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.64.0 (a55dd71d5 2022-09-19)" ></div></body></html>