mirror of
https://github.com/quickwit-oss/tantivy.git
synced 2026-05-26 13:10:41 +00:00
35 lines
13 KiB
HTML
35 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="API documentation for the Rust `combinator` mod in crate `combine`."><meta name="keywords" content="rust, rustlang, rust-lang, combinator"><title>combine::parser::combinator - Rust</title><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="../../../dark.css"><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="shortcut icon" href="../../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../combine/index.html'><img src='../../../rust-logo.png' alt='logo' width='100'></a><p class='location'>Module combinator</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</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></div><p class='location'><a href='../../index.html'>combine</a>::<wbr><a href='../index.html'>parser</a></p><script>window.sidebarCurrent = {name: 'combinator', ty: 'mod', relpath: '../'};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../../theme.js"></script><nav class="sub"><form class="search-form js-only"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../../src/combine/parser/combinator.rs.html#1-1289' title='goto source code'>[src]</a></span><span class='in-band'>Module <a href='../../index.html'>combine</a>::<wbr><a href='../index.html'>parser</a>::<wbr><a class="mod" href=''>combinator</a></span></h1><div class='docblock'><p>Various combinators which do not fit anywhere else.</p>
|
||
</div><h2 id='structs' class='section-header'><a href="#structs">Structs</a></h2>
|
||
<table><tr class='module-item'><td><a class="struct" href="struct.AndThen.html" title='combine::parser::combinator::AndThen struct'>AndThen</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.AnyPartialState.html" title='combine::parser::combinator::AnyPartialState struct'>AnyPartialState</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.AnyPartialStateParser.html" title='combine::parser::combinator::AnyPartialStateParser struct'>AnyPartialStateParser</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.AnySendPartialState.html" title='combine::parser::combinator::AnySendPartialState struct'>AnySendPartialState</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.AnySendPartialStateParser.html" title='combine::parser::combinator::AnySendPartialStateParser struct'>AnySendPartialStateParser</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.Factory.html" title='combine::parser::combinator::Factory struct'>Factory</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.FlatMap.html" title='combine::parser::combinator::FlatMap struct'>FlatMap</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.FromStr.html" title='combine::parser::combinator::FromStr struct'>FromStr</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.Ignore.html" title='combine::parser::combinator::Ignore struct'>Ignore</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.Lazy.html" title='combine::parser::combinator::Lazy struct'>Lazy</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.LookAhead.html" title='combine::parser::combinator::LookAhead struct'>LookAhead</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.Map.html" title='combine::parser::combinator::Map struct'>Map</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.NoPartial.html" title='combine::parser::combinator::NoPartial struct'>NoPartial</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.NotFollowedBy.html" title='combine::parser::combinator::NotFollowedBy struct'>NotFollowedBy</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.Opaque.html" title='combine::parser::combinator::Opaque struct'>Opaque</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.Recognize.html" title='combine::parser::combinator::Recognize struct'>Recognize</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="struct" href="struct.Try.html" title='combine::parser::combinator::Try struct'>Try</a></td><td class='docblock-short'></td></tr></table><h2 id='traits' class='section-header'><a href="#traits">Traits</a></h2>
|
||
<table><tr class='module-item'><td><a class="trait" href="trait.StrLike.html" title='combine::parser::combinator::StrLike trait'>StrLike</a></td><td class='docblock-short'></td></tr></table><h2 id='functions' class='section-header'><a href="#functions">Functions</a></h2>
|
||
<table><tr class='module-item'><td><a class="fn" href="fn.and_then.html" title='combine::parser::combinator::and_then fn'>and_then</a></td><td class='docblock-short'><p>Equivalent to <a href="../parser/trait.Parser.html#method.and_then"><code>p.and_then(f)</code></a>.</p>
|
||
</td></tr><tr class='module-item'><td><a class="fn" href="fn.any_partial_state.html" title='combine::parser::combinator::any_partial_state fn'>any_partial_state</a></td><td class='docblock-short'><p>Returns a parser where <code>P::PartialState</code> is boxed. Useful as a way to avoid writing the type
|
||
since it can get very large after combining a few parsers.</p>
|
||
</td></tr><tr class='module-item'><td><a class="fn" href="fn.any_send_partial_state.html" title='combine::parser::combinator::any_send_partial_state fn'>any_send_partial_state</a></td><td class='docblock-short'><p>Returns a parser where <code>P::PartialState</code> is boxed. Useful as a way to avoid writing the type
|
||
since it can get very large after combining a few parsers.</p>
|
||
</td></tr><tr class='module-item'><td><a class="fn" href="fn.attempt.html" title='combine::parser::combinator::attempt fn'>attempt</a></td><td class='docblock-short'><p><code>attempt(p)</code> behaves as <code>p</code> except it acts as if the parser hadn't consumed any input if <code>p</code> fails
|
||
after consuming input. (alias for <a href="fn.try.html"><code>try</code></a>)</p>
|
||
</td></tr><tr class='module-item'><td><a class="fn" href="fn.factory.html" title='combine::parser::combinator::factory fn'>factory</a></td><td class='docblock-short'><p>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
|
||
allows different parsers to be returned on each call to <code>p</code> while still reporting the correct
|
||
errors.</p>
|
||
</td></tr><tr class='module-item'><td><a class="fn" href="fn.flat_map.html" title='combine::parser::combinator::flat_map fn'>flat_map</a></td><td class='docblock-short'><p>Equivalent to <a href="../parser/trait.Parser.html#method.flat_map"><code>p.flat_map(f)</code></a>.</p>
|
||
</td></tr><tr class='module-item'><td><a class="fn" href="fn.from_str.html" title='combine::parser::combinator::from_str fn'>from_str</a></td><td class='docblock-short'><p>Takes a parser that outputs a string like value (<code>&str</code>, <code>String</code>, <code>&[u8]</code> or <code>Vec<u8></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.</p>
|
||
</td></tr><tr class='module-item'><td><a class="fn" href="fn.lazy.html" title='combine::parser::combinator::lazy fn'>lazy</a></td><td class='docblock-short'><p>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.</p>
|
||
</td></tr><tr class='module-item'><td><a class="fn" href="fn.look_ahead.html" title='combine::parser::combinator::look_ahead fn'>look_ahead</a></td><td class='docblock-short'><p><code>look_ahead(p)</code> acts as <code>p</code> but doesn't consume input on success.</p>
|
||
</td></tr><tr class='module-item'><td><a class="fn" href="fn.map.html" title='combine::parser::combinator::map fn'>map</a></td><td class='docblock-short'><p>Equivalent to <a href="../parser/trait.Parser.html#method.map"><code>p.map(f)</code></a>.</p>
|
||
</td></tr><tr class='module-item'><td><a class="fn" href="fn.no_partial.html" title='combine::parser::combinator::no_partial fn'>no_partial</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="fn" href="fn.not_followed_by.html" title='combine::parser::combinator::not_followed_by fn'>not_followed_by</a></td><td class='docblock-short'><p>Succeeds only if <code>parser</code> fails.
|
||
Never consumes any input.</p>
|
||
</td></tr><tr class='module-item'><td><a class="fn" href="fn.opaque.html" title='combine::parser::combinator::opaque fn'>opaque</a></td><td class='docblock-short'><p>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>.</p>
|
||
</td></tr><tr class='module-item'><td><a class="fn" href="fn.recognize.html" title='combine::parser::combinator::recognize fn'>recognize</a></td><td class='docblock-short'><p>Constructs a parser which returns the tokens parsed by <code>parser</code> accumulated in
|
||
<code>F: Extend<P::Input::Item></code> instead of <code>P::Output</code>.</p>
|
||
</td></tr><tr class='module-item'><td><a class="fn" href="fn.try.html" title='combine::parser::combinator::try fn'>try</a></td><td class='docblock-short'><span class="stab deprecated">Deprecated</span><p><code>try(p)</code> behaves as <code>p</code> except it acts as if the parser hadn't consumed any input if <code>p</code> fails
|
||
after consuming input.</p>
|
||
</td></tr></table><h2 id='types' class='section-header'><a href="#types">Type Definitions</a></h2>
|
||
<table><tr class='module-item'><td><a class="type" href="type.FnOpaque.html" title='combine::parser::combinator::FnOpaque type'>FnOpaque</a></td><td class='docblock-short'><p>Alias over <code>Opaque</code> where the function can be a plain function pointer (does not need to
|
||
capture any values)</p>
|
||
</td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><aside id="help" class="hidden"><div><h1 class="hidden">Help</h1><div class="shortcuts"><h2>Keyboard Shortcuts</h2><dl><dt><kbd>?</kbd></dt><dd>Show this help dialog</dd><dt><kbd>S</kbd></dt><dd>Focus the search field</dd><dt><kbd>↑</kbd></dt><dd>Move up in search results</dd><dt><kbd>↓</kbd></dt><dd>Move down in search results</dd><dt><kbd>↹</kbd></dt><dd>Switch tab</dd><dt><kbd>⏎</kbd></dt><dd>Go to active search result</dd><dt><kbd>+</kbd></dt><dd>Expand all sections</dd><dt><kbd>-</kbd></dt><dd>Collapse all sections</dd></dl></div><div class="infos"><h2>Search Tricks</h2><p>Prefix searches with a type followed by a colon (e.g., <code>fn:</code>) to restrict the search to a given type.</p><p>Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>.</p><p>Search functions by type signature (e.g., <code>vec -> usize</code> or <code>* -> vec</code>)</p><p>Search multiple things at once by splitting your query with comma (e.g., <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../../../";window.currentCrate = "combine";</script><script src="../../../aliases.js"></script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html> |