blob: 2669e537eadeaaffa2e96eecf7d4bdbba159072a [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="Various combinators which do not fit anywhere else."><meta name="keywords" content="rust, rustlang, rust-lang, combinator"><title>combine::parser::combinator - 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="../../../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 mod"><!--[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="#">Module combinator</a></h2><div class="sidebar-elems"><section><ul class="block"><li><a href="#structs">Structs</a></li><li><a href="#enums">Enums</a></li><li><a href="#traits">Traits</a></li><li><a href="#functions">Functions</a></li><li><a href="#types">Type Definitions</a></li></ul></section></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">Module <a href="../../index.html">combine</a>::<wbr><a href="../index.html">parser</a>::<wbr><a class="mod" href="#">combinator</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/parser/combinator.rs.html#1-1562">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Various combinators which do not fit anywhere else.</p>
</div></details><h2 id="structs" class="small-section-header"><a href="#structs">Structs</a></h2><div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.AndThen.html" title="combine::parser::combinator::AndThen struct">AndThen</a></div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.Factory.html" title="combine::parser::combinator::Factory struct">Factory</a></div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.FlatMap.html" title="combine::parser::combinator::FlatMap struct">FlatMap</a></div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.FromStr.html" title="combine::parser::combinator::FromStr struct">FromStr</a></div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.Ignore.html" title="combine::parser::combinator::Ignore struct">Ignore</a></div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.InputConverter.html" title="combine::parser::combinator::InputConverter struct">InputConverter</a></div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.Lazy.html" title="combine::parser::combinator::Lazy struct">Lazy</a></div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.LookAhead.html" title="combine::parser::combinator::LookAhead struct">LookAhead</a></div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.Map.html" title="combine::parser::combinator::Map struct">Map</a></div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.MapInput.html" title="combine::parser::combinator::MapInput struct">MapInput</a></div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.NoPartial.html" title="combine::parser::combinator::NoPartial struct">NoPartial</a></div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.NotFollowedBy.html" title="combine::parser::combinator::NotFollowedBy struct">NotFollowedBy</a></div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.Opaque.html" title="combine::parser::combinator::Opaque struct">Opaque</a></div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.Recognize.html" title="combine::parser::combinator::Recognize struct">Recognize</a></div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.Spanned.html" title="combine::parser::combinator::Spanned struct">Spanned</a></div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.Try.html" title="combine::parser::combinator::Try struct">Try</a></div></div></div><h2 id="enums" class="small-section-header"><a href="#enums">Enums</a></h2><div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="enum" href="enum.Either.html" title="combine::parser::combinator::Either enum">Either</a></div></div></div><h2 id="traits" class="small-section-header"><a href="#traits">Traits</a></h2><div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="trait" href="trait.Converter.html" title="combine::parser::combinator::Converter trait">Converter</a></div></div><div class="item-row"><div class="item-left module-item"><a class="trait" href="trait.StrLike.html" title="combine::parser::combinator::StrLike trait">StrLike</a></div></div></div><h2 id="functions" class="small-section-header"><a href="#functions">Functions</a></h2><div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="fn" href="fn.and_then.html" title="combine::parser::combinator::and_then fn">and_then</a></div><div class="item-right docblock-short">Equivalent to <a href="../trait.Parser.html#method.and_then"><code>p.and_then(f)</code></a>.</div></div><div class="item-row"><div class="item-left module-item"><a class="fn" href="fn.attempt.html" title="combine::parser::combinator::attempt fn">attempt</a></div><div class="item-right docblock-short"><code>attempt(p)</code> behaves as <code>p</code> except it always acts as <code>p</code> peeked instead of committed on its
parse.</div></div><div class="item-row"><div class="item-left module-item"><a class="fn" href="fn.factory.html" title="combine::parser::combinator::factory fn">factory</a></div><div class="item-right docblock-short">Constructs the parser lazily on each <code>parse_*</code> call. This is similar to <a href="fn.lazy.html"><code>lazy</code></a> but it
takes <code>Input</code> as an argument and allows different parsers to be returned on each call to
<code>p</code> while still reporting the correct errors.</div></div><div class="item-row"><div class="item-left module-item"><a class="fn" href="fn.flat_map.html" title="combine::parser::combinator::flat_map fn">flat_map</a></div><div class="item-right docblock-short">Equivalent to <a href="../trait.Parser.html#method.flat_map"><code>p.flat_map(f)</code></a>.</div></div><div class="item-row"><div class="item-left module-item"><a class="fn" href="fn.from_str.html" title="combine::parser::combinator::from_str fn">from_str</a></div><div class="item-right docblock-short">Takes a parser that outputs a string like value (<code>&amp;str</code>, <code>String</code>, <code>&amp;[u8]</code> or <code>Vec&lt;u8&gt;</code>) and parses it
using <code>std::str::FromStr</code>. Errors if the output of <code>parser</code> is not UTF-8 or if
<code>FromStr::from_str</code> returns an error.</div></div><div class="item-row"><div class="item-left module-item"><a class="fn" href="fn.input_converter.html" title="combine::parser::combinator::input_converter fn">input_converter</a></div></div><div class="item-row"><div class="item-left module-item"><a class="fn" href="fn.lazy.html" title="combine::parser::combinator::lazy fn">lazy</a></div><div class="item-right docblock-short">Constructs the parser lazily on each <code>parse_*</code> call. Can be used to effectively reduce the
size of deeply nested parsers as only the function producing the parser is stored.</div></div><div class="item-row"><div class="item-left module-item"><a class="fn" href="fn.look_ahead.html" title="combine::parser::combinator::look_ahead fn">look_ahead</a></div><div class="item-right docblock-short"><code>look_ahead(p)</code> acts as <code>p</code> but doesn’t consume input on success.</div></div><div class="item-row"><div class="item-left module-item"><a class="fn" href="fn.map.html" title="combine::parser::combinator::map fn">map</a></div><div class="item-right docblock-short">Equivalent to <a href="../trait.Parser.html#method.map"><code>p.map(f)</code></a>.</div></div><div class="item-row"><div class="item-left module-item"><a class="fn" href="fn.map_input.html" title="combine::parser::combinator::map_input fn">map_input</a></div><div class="item-right docblock-short">Equivalent to <a href="../trait.Parser.html#method.map_input"><code>p.map_input(f)</code></a>.</div></div><div class="item-row"><div class="item-left module-item"><a class="fn" href="fn.no_partial.html" title="combine::parser::combinator::no_partial fn">no_partial</a></div></div><div class="item-row"><div class="item-left module-item"><a class="fn" href="fn.not_followed_by.html" title="combine::parser::combinator::not_followed_by fn">not_followed_by</a></div><div class="item-right docblock-short">Succeeds only if <code>parser</code> fails.
Never consumes any input.</div></div><div class="item-row"><div class="item-left module-item"><a class="fn" href="fn.opaque.html" title="combine::parser::combinator::opaque fn">opaque</a></div><div class="item-right docblock-short">Creates a parser from a function which takes a function that are given the actual parser.
Though convoluted this makes it possible to hide the concrete parser type without <code>Box</code> or
losing the full information about the parser as is the case of <a href="../function/fn.parser.html"><code>parser</code></a>.</div></div><div class="item-row"><div class="item-left module-item"><a class="fn" href="fn.recognize.html" title="combine::parser::combinator::recognize fn">recognize</a></div><div class="item-right docblock-short">Constructs a parser which returns the tokens parsed by <code>parser</code> accumulated in
<code>F: Extend&lt;Input::Token&gt;</code> instead of <code>P::Output</code>.</div></div><div class="item-row"><div class="item-left module-item"><a class="fn" href="fn.spanned.html" title="combine::parser::combinator::spanned fn">spanned</a></div><div class="item-right docblock-short">Equivalent to <a href="../trait.Parser.html#method.spanned"><code>p.spanned()</code></a>.</div></div></div><h2 id="types" class="small-section-header"><a href="#types">Type Definitions</a></h2><div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="type" href="type.FnOpaque.html" title="combine::parser::combinator::FnOpaque type">FnOpaque</a></div><div class="item-right docblock-short">Alias over <code>Opaque</code> where the function can be a plain function pointer (does not need to
capture any values)</div></div></div></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>