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

11 lines
7.2 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="Holds the result of parsing functions"><meta name="keywords" content="rust, rustlang, rust-lang, IResult"><title>IResult 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 type"><!--[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="#">IResult</a></h2><div class="sidebar-elems"><section><div class="block"><h3 class="sidebar-title"><a href="#trait-implementations">Trait Implementations</a></h3><ul><li><a href="#impl-Finish%3CI%2C%20O%2C%20E%3E-for-IResult%3CI%2C%20O%2C%20E%3E">Finish&lt;I, O, E&gt;</a></li></ul></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">Type Definition <a href="index.html">nom</a>::<wbr><a class="type" href="#">IResult</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#18">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 typedef"><code>pub type IResult&lt;I, O, E&nbsp;=&nbsp;<a class="struct" href="error/struct.Error.html" title="struct nom::error::Error">Error</a>&lt;I&gt;&gt; = <a class="enum" href="https://doc.rust-lang.org/1.64.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.64.0/std/primitive.tuple.html">(I, O)</a>, <a class="enum" href="enum.Err.html" title="enum nom::Err">Err</a>&lt;E&gt;&gt;;</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Holds the result of parsing functions</p>
<p>It depends on the input type <code>I</code>, the output type <code>O</code>, and the error type <code>E</code>
(by default <code>(I, nom::ErrorKind)</code>)</p>
<p>The <code>Ok</code> side is a pair containing the remainder of the input (the part of the data that
was not parsed) and the produced value. The <code>Err</code> side contains an instance of <code>nom::Err</code>.</p>
<p>Outside of the parsing code, you can use the <a href="trait.Finish.html#tymethod.finish" title="Finish::finish">Finish::finish</a> method to convert
it to a more common result type</p>
</div></details><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-Finish%3CI%2C%20O%2C%20E%3E-for-IResult%3CI%2C%20O%2C%20E%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../src/nom/internal.rs.html#35-45">source</a></span><a href="#impl-Finish%3CI%2C%20O%2C%20E%3E-for-IResult%3CI%2C%20O%2C%20E%3E" class="anchor"></a><h3 class="code-header in-band">impl&lt;I, O, E&gt; <a class="trait" href="trait.Finish.html" title="trait nom::Finish">Finish</a>&lt;I, O, E&gt; for <a class="type" href="type.IResult.html" title="type nom::IResult">IResult</a>&lt;I, O, E&gt;</h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.finish" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../src/nom/internal.rs.html#36-44">source</a></span><a href="#method.finish" class="anchor"></a><h4 class="code-header">fn <a href="trait.Finish.html#tymethod.finish" class="fnname">finish</a>(self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.64.0/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.64.0/std/primitive.tuple.html">(I, O)</a>, E&gt;</h4></section></summary><div class='docblock'><p>converts the parsers result to a type that is more consumable by error
management libraries. It keeps the same <code>Ok</code> branch, and merges <code>Err::Error</code>
and <code>Err::Failure</code> into the <code>Err</code> side. <a href="trait.Finish.html#tymethod.finish">Read more</a></p>
</div></details></div></details></div></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>