blob: ff74e5dd4e9155cce0955537568cc0d9e6a7576e [file] [log] [blame]
<!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="`StreamError` represents a single error returned from a `Stream` or a `Parser`."><meta name="keywords" content="rust, rustlang, rust-lang, StreamError"><title>StreamError in combine::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" href="../../normalize.css"><link rel="stylesheet" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" href="../../ayu.css" disabled><link rel="stylesheet" href="../../dark.css" disabled><link rel="stylesheet" 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="../../combine/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div></a><h2></h2></nav><nav class="sidebar"><a class="sidebar-logo" href="../../combine/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div></a><h2 class="location"><a href="#">StreamError</a></h2><div class="sidebar-elems"><section><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.expected_format">expected_format</a></li><li><a href="#tymethod.expected_range">expected_range</a></li><li><a href="#tymethod.expected_token">expected_token</a></li><li><a href="#tymethod.into_other">into_other</a></li><li><a href="#tymethod.is_unexpected_end_of_input">is_unexpected_end_of_input</a></li><li><a href="#tymethod.message_format">message_format</a></li><li><a href="#tymethod.message_range">message_range</a></li><li><a href="#tymethod.message_token">message_token</a></li><li><a href="#tymethod.unexpected_format">unexpected_format</a></li><li><a href="#tymethod.unexpected_range">unexpected_range</a></li><li><a href="#tymethod.unexpected_token">unexpected_token</a></li></ul><h3><a href="#provided-methods">Provided Methods</a></h3><ul class="block"><li><a href="#method.end_of_input">end_of_input</a></li><li><a href="#method.expected">expected</a></li><li><a href="#method.expected_static_message">expected_static_message</a></li><li><a href="#method.message">message</a></li><li><a href="#method.message_static_message">message_static_message</a></li><li><a href="#method.unexpected">unexpected</a></li><li><a href="#method.unexpected_static_message">unexpected_static_message</a></li></ul><h3><a href="#implementors">Implementors</a></h3></section><h2><a href="index.html">In combine::error</a></h2></div></nav><main><div class="width-limiter"><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"><a href="../../help.html">?</a></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><section id="main-content" class="content"><div class="main-heading"><h1 class="fqn">Trait <a href="../index.html">combine</a>::<wbr><a href="index.html">error</a>::<wbr><a class="trait" href="#">StreamError</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></h1><span class="out-of-band"><a class="srclink" href="../../src/combine/error.rs.html#367-450">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="item-decl"><pre class="rust trait"><code>pub trait StreamError&lt;Item, Range&gt;: Sized {
<details class="rustdoc-toggle type-contents-toggle"><summary class="hideme"><span>Show 18 methods</span></summary> fn <a href="#tymethod.unexpected_token" class="fnname">unexpected_token</a>(token: Item) -&gt; Self;
<span class="item-spacer"></span> fn <a href="#tymethod.unexpected_range" class="fnname">unexpected_range</a>(token: Range) -&gt; Self;
<span class="item-spacer"></span> fn <a href="#tymethod.unexpected_format" class="fnname">unexpected_format</a>&lt;T&gt;(msg: T) -&gt; Self<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;T: Display</span>;
<span class="item-spacer"></span> fn <a href="#tymethod.expected_token" class="fnname">expected_token</a>(token: Item) -&gt; Self;
<span class="item-spacer"></span> fn <a href="#tymethod.expected_range" class="fnname">expected_range</a>(token: Range) -&gt; Self;
<span class="item-spacer"></span> fn <a href="#tymethod.expected_format" class="fnname">expected_format</a>&lt;T&gt;(msg: T) -&gt; Self<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;T: Display</span>;
<span class="item-spacer"></span> fn <a href="#tymethod.message_token" class="fnname">message_token</a>(token: Item) -&gt; Self;
<span class="item-spacer"></span> fn <a href="#tymethod.message_range" class="fnname">message_range</a>(token: Range) -&gt; Self;
<span class="item-spacer"></span> fn <a href="#tymethod.message_format" class="fnname">message_format</a>&lt;T&gt;(msg: T) -&gt; Self<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;T: Display</span>;
<span class="item-spacer"></span> fn <a href="#tymethod.is_unexpected_end_of_input" class="fnname">is_unexpected_end_of_input</a>(&amp;self) -&gt; bool;
<span class="item-spacer"></span> fn <a href="#tymethod.into_other" class="fnname">into_other</a>&lt;T&gt;(self) -&gt; T<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="trait.StreamError.html" title="trait combine::error::StreamError">StreamError</a>&lt;Item, Range&gt;</span>;
fn <a href="#method.unexpected" class="fnname">unexpected</a>&lt;E&gt;(info: E) -&gt; Self<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;E: for&lt;'s&gt; <a class="trait" href="trait.ErrorInfo.html" title="trait combine::error::ErrorInfo">ErrorInfo</a>&lt;'s, Item, Range&gt;</span>,
{ ... }
<span class="item-spacer"></span> fn <a href="#method.unexpected_static_message" class="fnname">unexpected_static_message</a>(msg: &amp;'static str) -&gt; Self { ... }
<span class="item-spacer"></span> fn <a href="#method.expected" class="fnname">expected</a>&lt;E&gt;(info: E) -&gt; Self<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;E: for&lt;'s&gt; <a class="trait" href="trait.ErrorInfo.html" title="trait combine::error::ErrorInfo">ErrorInfo</a>&lt;'s, Item, Range&gt;</span>,
{ ... }
<span class="item-spacer"></span> fn <a href="#method.expected_static_message" class="fnname">expected_static_message</a>(msg: &amp;'static str) -&gt; Self { ... }
<span class="item-spacer"></span> fn <a href="#method.message_static_message" class="fnname">message_static_message</a>(msg: &amp;'static str) -&gt; Self { ... }
<span class="item-spacer"></span> fn <a href="#method.message" class="fnname">message</a>&lt;E&gt;(info: E) -&gt; Self<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="where">where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;E: for&lt;'s&gt; <a class="trait" href="trait.ErrorInfo.html" title="trait combine::error::ErrorInfo">ErrorInfo</a>&lt;'s, Item, Range&gt;</span>,
{ ... }
<span class="item-spacer"></span> fn <a href="#method.end_of_input" class="fnname">end_of_input</a>() -&gt; Self { ... }
</details>}</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p><code>StreamError</code> represents a single error returned from a <code>Stream</code> or a <code>Parser</code>.</p>
<p>Usually multiple instances of <code>StreamError</code> is composed into a <code>ParseError</code> to build the final
error value.</p>
</div></details><h2 id="required-methods" class="small-section-header">Required Methods<a href="#required-methods" class="anchor"></a></h2><div class="methods"><section id="tymethod.unexpected_token" class="method has-srclink"><a class="srclink rightside" href="../../src/combine/error.rs.html#368">source</a><h4 class="code-header">fn <a href="#tymethod.unexpected_token" class="fnname">unexpected_token</a>(token: Item) -&gt; Self</h4></section><section id="tymethod.unexpected_range" class="method has-srclink"><a class="srclink rightside" href="../../src/combine/error.rs.html#369">source</a><h4 class="code-header">fn <a href="#tymethod.unexpected_range" class="fnname">unexpected_range</a>(token: Range) -&gt; Self</h4></section><section id="tymethod.unexpected_format" class="method has-srclink"><a class="srclink rightside" href="../../src/combine/error.rs.html#370-372">source</a><h4 class="code-header">fn <a href="#tymethod.unexpected_format" class="fnname">unexpected_format</a>&lt;T&gt;(msg: T) -&gt; Self<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: Display,</span></h4></section><section id="tymethod.expected_token" class="method has-srclink"><a class="srclink rightside" href="../../src/combine/error.rs.html#388">source</a><h4 class="code-header">fn <a href="#tymethod.expected_token" class="fnname">expected_token</a>(token: Item) -&gt; Self</h4></section><section id="tymethod.expected_range" class="method has-srclink"><a class="srclink rightside" href="../../src/combine/error.rs.html#389">source</a><h4 class="code-header">fn <a href="#tymethod.expected_range" class="fnname">expected_range</a>(token: Range) -&gt; Self</h4></section><section id="tymethod.expected_format" class="method has-srclink"><a class="srclink rightside" href="../../src/combine/error.rs.html#390-392">source</a><h4 class="code-header">fn <a href="#tymethod.expected_format" class="fnname">expected_format</a>&lt;T&gt;(msg: T) -&gt; Self<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: Display,</span></h4></section><section id="tymethod.message_token" class="method has-srclink"><a class="srclink rightside" href="../../src/combine/error.rs.html#408">source</a><h4 class="code-header">fn <a href="#tymethod.message_token" class="fnname">message_token</a>(token: Item) -&gt; Self</h4></section><section id="tymethod.message_range" class="method has-srclink"><a class="srclink rightside" href="../../src/combine/error.rs.html#409">source</a><h4 class="code-header">fn <a href="#tymethod.message_range" class="fnname">message_range</a>(token: Range) -&gt; Self</h4></section><section id="tymethod.message_format" class="method has-srclink"><a class="srclink rightside" href="../../src/combine/error.rs.html#410-412">source</a><h4 class="code-header">fn <a href="#tymethod.message_format" class="fnname">message_format</a>&lt;T&gt;(msg: T) -&gt; Self<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: Display,</span></h4></section><section id="tymethod.is_unexpected_end_of_input" class="method has-srclink"><a class="srclink rightside" href="../../src/combine/error.rs.html#440">source</a><h4 class="code-header">fn <a href="#tymethod.is_unexpected_end_of_input" class="fnname">is_unexpected_end_of_input</a>(&amp;self) -&gt; bool</h4></section><details class="rustdoc-toggle method-toggle" open><summary><section id="tymethod.into_other" class="method has-srclink"><a class="srclink rightside" href="../../src/combine/error.rs.html#447-449">source</a><h4 class="code-header">fn <a href="#tymethod.into_other" class="fnname">into_other</a>&lt;T&gt;(self) -&gt; T<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="trait.StreamError.html" title="trait combine::error::StreamError">StreamError</a>&lt;Item, Range&gt;,</span></h4></section></summary><div class="docblock"><p>Converts <code>self</code> into a different <code>StreamError</code> type.</p>
<p>This should aim to preserve as much information as possible into the returned <code>T</code> value but
if <code>Self</code> ignores some information passed to it using one of the constructors that
information is naturally lost.</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"><section id="method.unexpected" class="method has-srclink"><a class="srclink rightside" href="../../src/combine/error.rs.html#373-383">source</a><h4 class="code-header">fn <a href="#method.unexpected" class="fnname">unexpected</a>&lt;E&gt;(info: E) -&gt; Self<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;E: for&lt;'s&gt; <a class="trait" href="trait.ErrorInfo.html" title="trait combine::error::ErrorInfo">ErrorInfo</a>&lt;'s, Item, Range&gt;,</span></h4></section><section id="method.unexpected_static_message" class="method has-srclink"><a class="srclink rightside" href="../../src/combine/error.rs.html#384-386">source</a><h4 class="code-header">fn <a href="#method.unexpected_static_message" class="fnname">unexpected_static_message</a>(msg: &amp;'static str) -&gt; Self</h4></section><section id="method.expected" class="method has-srclink"><a class="srclink rightside" href="../../src/combine/error.rs.html#393-403">source</a><h4 class="code-header">fn <a href="#method.expected" class="fnname">expected</a>&lt;E&gt;(info: E) -&gt; Self<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;E: for&lt;'s&gt; <a class="trait" href="trait.ErrorInfo.html" title="trait combine::error::ErrorInfo">ErrorInfo</a>&lt;'s, Item, Range&gt;,</span></h4></section><section id="method.expected_static_message" class="method has-srclink"><a class="srclink rightside" href="../../src/combine/error.rs.html#404-406">source</a><h4 class="code-header">fn <a href="#method.expected_static_message" class="fnname">expected_static_message</a>(msg: &amp;'static str) -&gt; Self</h4></section><section id="method.message_static_message" class="method has-srclink"><a class="srclink rightside" href="../../src/combine/error.rs.html#413-415">source</a><h4 class="code-header">fn <a href="#method.message_static_message" class="fnname">message_static_message</a>(msg: &amp;'static str) -&gt; Self</h4></section><section id="method.message" class="method has-srclink"><a class="srclink rightside" href="../../src/combine/error.rs.html#416-426">source</a><h4 class="code-header">fn <a href="#method.message" class="fnname">message</a>&lt;E&gt;(info: E) -&gt; Self<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;E: for&lt;'s&gt; <a class="trait" href="trait.ErrorInfo.html" title="trait combine::error::ErrorInfo">ErrorInfo</a>&lt;'s, Item, Range&gt;,</span></h4></section><section id="method.end_of_input" class="method has-srclink"><a class="srclink rightside" href="../../src/combine/error.rs.html#436-438">source</a><h4 class="code-header">fn <a href="#method.end_of_input" class="fnname">end_of_input</a>() -&gt; Self</h4></section></div><h2 id="implementors" class="small-section-header">Implementors<a href="#implementors" class="anchor"></a></h2><div id="implementors-list"><section id="impl-StreamError%3CItem%2C%20Range%3E-for-StringStreamError" class="impl has-srclink"><a class="srclink rightside" href="../../src/combine/error.rs.html#767-841">source</a><a href="#impl-StreamError%3CItem%2C%20Range%3E-for-StringStreamError" class="anchor"></a><h3 class="code-header">impl&lt;Item, Range&gt; <a class="trait" href="trait.StreamError.html" title="trait combine::error::StreamError">StreamError</a>&lt;Item, Range&gt; for <a class="enum" href="enum.StringStreamError.html" title="enum combine::error::StringStreamError">StringStreamError</a></h3></section><section id="impl-StreamError%3CItem%2C%20Range%3E-for-UnexpectedParse" class="impl has-srclink"><a class="srclink rightside" href="../../src/combine/error.rs.html#583-651">source</a><a href="#impl-StreamError%3CItem%2C%20Range%3E-for-UnexpectedParse" class="anchor"></a><h3 class="code-header">impl&lt;Item, Range&gt; <a class="trait" href="trait.StreamError.html" title="trait combine::error::StreamError">StreamError</a>&lt;Item, Range&gt; for <a class="enum" href="enum.UnexpectedParse.html" title="enum combine::error::UnexpectedParse">UnexpectedParse</a></h3></section></div><script src="../../implementors/combine/error/trait.StreamError.js" async></script></section></div></main><div id="rustdoc-vars" data-root-path="../../" data-current-crate="combine" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.66.0-nightly (5c8bff74b 2022-10-21)" ></div></body></html>