19 lines
13 KiB
HTML
19 lines
13 KiB
HTML
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="This trait must be implemented by the error type of a nom parser."><meta name="keywords" content="rust, rustlang, rust-lang, ParseError"><title>ParseError in nom::error - 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">☰</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="#">ParseError</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.append">append</a></li><li><a href="#tymethod.from_error_kind">from_error_kind</a></li></ul></div><div class="block"><h3 class="sidebar-title"><a href="#provided-methods">Provided Methods</a></h3><ul><li><a href="#method.from_char">from_char</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-ParseError%3CI%3E-for-()">()</a></li><li><a href="#impl-ParseError%3CI%3E-for-(I%2C%20ErrorKind)">(I, ErrorKind)</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::error</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 href="index.html">error</a>::<wbr><a class="trait" href="#">ParseError</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/error.rs.html#16-35">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="docblock item-decl"><pre class="rust trait"><code>pub trait ParseError<I>: <a class="trait" href="https://doc.rust-lang.org/1.64.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> {
|
||
fn <a href="#tymethod.from_error_kind" class="fnname">from_error_kind</a>(input: I, kind: <a class="enum" href="enum.ErrorKind.html" title="enum nom::error::ErrorKind">ErrorKind</a>) -> Self;
|
||
<span class="item-spacer"></span> fn <a href="#tymethod.append" class="fnname">append</a>(input: I, kind: <a class="enum" href="enum.ErrorKind.html" title="enum nom::error::ErrorKind">ErrorKind</a>, other: Self) -> Self;
|
||
|
||
fn <a href="#method.from_char" class="fnname">from_char</a>(input: I, _: <a class="primitive" href="https://doc.rust-lang.org/1.64.0/std/primitive.char.html">char</a>) -> Self { ... }
|
||
<span class="item-spacer"></span> fn <a href="#method.or" class="fnname">or</a>(self, other: Self) -> Self { ... }
|
||
}</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>This trait must be implemented by the error type of a nom parser.</p>
|
||
<p>There are already implementations of it for <code>(Input, ErrorKind)</code>
|
||
and <code>VerboseError<Input></code>.</p>
|
||
<p>It provides methods to create an error from some combinators,
|
||
and combine existing errors in combinators like <code>alt</code>.</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.from_error_kind" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/nom/error.rs.html#18">source</a></div><h4 class="code-header">fn <a href="#tymethod.from_error_kind" class="fnname">from_error_kind</a>(input: I, kind: <a class="enum" href="enum.ErrorKind.html" title="enum nom::error::ErrorKind">ErrorKind</a>) -> Self</h4></div></summary><div class="docblock"><p>Creates an error from the input position and an <a href="enum.ErrorKind.html" title="ErrorKind">ErrorKind</a></p>
|
||
</div></details><details class="rustdoc-toggle" open><summary><div id="tymethod.append" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/nom/error.rs.html#23">source</a></div><h4 class="code-header">fn <a href="#tymethod.append" class="fnname">append</a>(input: I, kind: <a class="enum" href="enum.ErrorKind.html" title="enum nom::error::ErrorKind">ErrorKind</a>, other: Self) -> Self</h4></div></summary><div class="docblock"><p>Combines an existing error with a new one created from the input
|
||
position and an <a href="enum.ErrorKind.html" title="ErrorKind">ErrorKind</a>. This is useful when backtracking
|
||
through a parse tree, accumulating error context on the way</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.from_char" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../src/nom/error.rs.html#26-28">source</a></div><h4 class="code-header">fn <a href="#method.from_char" class="fnname">from_char</a>(input: I, _: <a class="primitive" href="https://doc.rust-lang.org/1.64.0/std/primitive.char.html">char</a>) -> Self</h4></div></summary><div class="docblock"><p>Creates an error from an input position and an expected character</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/error.rs.html#32-34">source</a></div><h4 class="code-header">fn <a href="#method.or" class="fnname">or</a>(self, other: Self) -> Self</h4></div></summary><div class="docblock"><p>Combines two existing errors. This function is used to compare errors
|
||
generated in various branches of <code>alt</code>.</p>
|
||
</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-ParseError%3CI%3E-for-(I%2C%20ErrorKind)" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../../src/nom/error.rs.html#103-111">source</a></span><a href="#impl-ParseError%3CI%3E-for-(I%2C%20ErrorKind)" class="anchor"></a><h3 class="code-header in-band">impl<I> <a class="trait" href="trait.ParseError.html" title="trait nom::error::ParseError">ParseError</a><I> for (I, <a class="enum" href="enum.ErrorKind.html" title="enum nom::error::ErrorKind">ErrorKind</a>)</h3></section></summary><div class="impl-items"><section id="method.from_error_kind" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../../src/nom/error.rs.html#104-106">source</a></span><a href="#method.from_error_kind" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.from_error_kind" class="fnname">from_error_kind</a>(input: I, kind: <a class="enum" href="enum.ErrorKind.html" title="enum nom::error::ErrorKind">ErrorKind</a>) -> Self</h4></section><section id="method.append" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../../src/nom/error.rs.html#108-110">source</a></span><a href="#method.append" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.append" class="fnname">append</a>(_: I, _: <a class="enum" href="enum.ErrorKind.html" title="enum nom::error::ErrorKind">ErrorKind</a>, other: Self) -> Self</h4></section></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-ParseError%3CI%3E-for-()" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../../src/nom/error.rs.html#121-125">source</a></span><a href="#impl-ParseError%3CI%3E-for-()" class="anchor"></a><h3 class="code-header in-band">impl<I> <a class="trait" href="trait.ParseError.html" title="trait nom::error::ParseError">ParseError</a><I> for <a class="primitive" href="https://doc.rust-lang.org/1.64.0/std/primitive.unit.html">()</a></h3></section></summary><div class="impl-items"><section id="method.from_error_kind-1" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../../src/nom/error.rs.html#122">source</a></span><a href="#method.from_error_kind-1" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.from_error_kind" class="fnname">from_error_kind</a>(_: I, _: <a class="enum" href="enum.ErrorKind.html" title="enum nom::error::ErrorKind">ErrorKind</a>) -> Self</h4></section><section id="method.append-1" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../../src/nom/error.rs.html#124">source</a></span><a href="#method.append-1" class="anchor"></a><h4 class="code-header">fn <a href="#tymethod.append" class="fnname">append</a>(_: I, _: <a class="enum" href="enum.ErrorKind.html" title="enum nom::error::ErrorKind">ErrorKind</a>, _: Self) -> Self</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-ParseError%3CI%3E-for-Error%3CI%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../../src/nom/error.rs.html#72-80">source</a></span><a href="#impl-ParseError%3CI%3E-for-Error%3CI%3E" class="anchor"></a><h3 class="code-header in-band">impl<I> <a class="trait" href="trait.ParseError.html" title="trait nom::error::ParseError">ParseError</a><I> for <a class="struct" href="struct.Error.html" title="struct nom::error::Error">Error</a><I></h3></section><section id="impl-ParseError%3CI%3E-for-VerboseError%3CI%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../../src/nom/error.rs.html#172-189">source</a></span><a href="#impl-ParseError%3CI%3E-for-VerboseError%3CI%3E" class="anchor"></a><h3 class="code-header in-band">impl<I> <a class="trait" href="trait.ParseError.html" title="trait nom::error::ParseError">ParseError</a><I> for <a class="struct" href="struct.VerboseError.html" title="struct nom::error::VerboseError">VerboseError</a><I></h3></section></div><script type="text/javascript" src="../../implementors/nom/error/trait.ParseError.js" data-ignore-extern-crates="std" 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> |