mirror of
https://github.com/quickwit-oss/tantivy.git
synced 2026-05-20 18:20:41 +00:00
210 lines
22 KiB
HTML
210 lines
22 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 `OpBuilder` struct in crate `fst`.">
|
||
<meta name="keywords" content="rust, rustlang, rust-lang, OpBuilder">
|
||
|
||
<title>fst::raw::OpBuilder - 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="../../main.css" id="themeStyle">
|
||
<script src="../../storage.js"></script>
|
||
|
||
|
||
|
||
|
||
</head>
|
||
<body class="rustdoc struct">
|
||
<!--[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>
|
||
|
||
<p class='location'>Struct OpBuilder</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#methods">Methods</a><div class="sidebar-links"><a href="#method.new">new</a><a href="#method.add">add</a><a href="#method.push">push</a><a href="#method.union">union</a><a href="#method.intersection">intersection</a><a href="#method.difference">difference</a><a href="#method.symmetric_difference">symmetric_difference</a></div><a class="sidebar-title" href="#implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Extend%3CI%3E">Extend<I></a><a href="#impl-FromIterator%3CI%3E">FromIterator<I></a></div></div><p class='location'><a href='../index.html'>fst</a>::<wbr><a href='index.html'>raw</a></p><script>window.sidebarCurrent = {name: 'OpBuilder', ty: 'struct', 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">
|
||
<input class="search-input" name="search"
|
||
autocomplete="off"
|
||
placeholder="Click or press ‘S’ to search, ‘?’ for more options…"
|
||
type="search">
|
||
</div>
|
||
</form>
|
||
</nav>
|
||
|
||
<section id='main' class="content">
|
||
<h1 class='fqn'><span class='in-band'>Struct <a href='../index.html'>fst</a>::<wbr><a href='index.html'>raw</a>::<wbr><a class="struct" href=''>OpBuilder</a></span><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/fst/raw/ops.rs.html#43-45' title='goto source code'>[src]</a></span></h1>
|
||
<pre class='rust struct'>pub struct OpBuilder<'f> { /* fields omitted */ }</pre><div class='docblock'><p>A builder for collecting fst streams on which to perform set operations
|
||
on the keys of fsts.</p>
|
||
<p>Set operations include intersection, union, difference and symmetric
|
||
difference. The result of each set operation is itself a stream that emits
|
||
pairs of keys and a sequence of each occurrence of that key in the
|
||
participating streams. This information allows one to perform set
|
||
operations on fsts and customize how conflicting output values are handled.</p>
|
||
<p>All set operations work efficiently on an arbitrary number of
|
||
streams with memory proportional to the number of streams.</p>
|
||
<p>The algorithmic complexity of all set operations is <code>O(n1 + n2 + n3 + ...)</code>
|
||
where <code>n1, n2, n3, ...</code> correspond to the number of elements in each
|
||
stream.</p>
|
||
<p>The <code>'f</code> lifetime parameter refers to the lifetime of the underlying set.</p>
|
||
</div>
|
||
<h2 id='methods' class='small-section-header'>
|
||
Methods<a href='#methods' class='anchor'></a>
|
||
</h2>
|
||
<h3 id='impl' class='impl'><span class='in-band'><code>impl<'f> <a class="struct" href="../../fst/raw/struct.OpBuilder.html" title="struct fst::raw::OpBuilder">OpBuilder</a><'f></code><a href='#impl' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/fst/raw/ops.rs.html#47-155' title='goto source code'>[src]</a></span></h3>
|
||
<div class='impl-items'><h4 id='method.new' class="method"><span id='new.v' class='invisible'><code>pub fn <a href='#method.new' class='fnname'>new</a>() -> Self</code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/fst/raw/ops.rs.html#49-51' title='goto source code'>[src]</a></span></h4>
|
||
<div class='docblock'><p>Create a new set operation builder.</p>
|
||
</div><h4 id='method.add' class="method"><span id='add.v' class='invisible'><code>pub fn <a href='#method.add' class='fnname'>add</a><I, S>(self, stream: I) -> Self <span class="where fmt-newline">where<br> I: for<'a> <a class="trait" href="../../fst/trait.IntoStreamer.html" title="trait fst::IntoStreamer">IntoStreamer</a><'a, Into = S, Item = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&'a [</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>, <a class="struct" href="../../fst/raw/struct.Output.html" title="struct fst::raw::Output">Output</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>>,<br> S: 'f + for<'a> <a class="trait" href="../../fst/trait.Streamer.html" title="trait fst::Streamer">Streamer</a><'a, Item = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&'a [</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>, <a class="struct" href="../../fst/raw/struct.Output.html" title="struct fst::raw::Output">Output</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>>, </span></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/fst/raw/ops.rs.html#60-65' title='goto source code'>[src]</a></span></h4>
|
||
<div class='docblock'><p>Add a stream to this set operation.</p>
|
||
<p>This is useful for a chaining style pattern, e.g.,
|
||
<code>builder.add(stream1).add(stream2).union()</code>.</p>
|
||
<p>The stream must emit a lexicographically ordered sequence of key-value
|
||
pairs.</p>
|
||
</div><h4 id='method.push' class="method"><span id='push.v' class='invisible'><code>pub fn <a href='#method.push' class='fnname'>push</a><I, S>(&mut self, stream: I) <span class="where fmt-newline">where<br> I: for<'a> <a class="trait" href="../../fst/trait.IntoStreamer.html" title="trait fst::IntoStreamer">IntoStreamer</a><'a, Into = S, Item = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&'a [</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>, <a class="struct" href="../../fst/raw/struct.Output.html" title="struct fst::raw::Output">Output</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>>,<br> S: 'f + for<'a> <a class="trait" href="../../fst/trait.Streamer.html" title="trait fst::Streamer">Streamer</a><'a, Item = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&'a [</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>, <a class="struct" href="../../fst/raw/struct.Output.html" title="struct fst::raw::Output">Output</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>>, </span></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/fst/raw/ops.rs.html#71-75' title='goto source code'>[src]</a></span></h4>
|
||
<div class='docblock'><p>Add a stream to this set operation.</p>
|
||
<p>The stream must emit a lexicographically ordered sequence of key-value
|
||
pairs.</p>
|
||
</div><h4 id='method.union' class="method"><span id='union.v' class='invisible'><code>pub fn <a href='#method.union' class='fnname'>union</a>(self) -> <a class="struct" href="../../fst/raw/struct.Union.html" title="struct fst::raw::Union">Union</a><'f></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/fst/raw/ops.rs.html#86-92' title='goto source code'>[src]</a></span></h4>
|
||
<div class='docblock'><p>Performs a union operation on all streams that have been added.</p>
|
||
<p>Note that this returns a stream of <code>(&[u8], &[IndexedValue])</code>. The
|
||
first element of the tuple is the byte string key. The second element
|
||
of the tuple is a list of all occurrences of that key in participating
|
||
streams. The <code>IndexedValue</code> contains an index and the value associated
|
||
with that key in that stream. The index uniquely identifies each
|
||
stream, which is an integer that is auto-incremented when a stream
|
||
is added to this operation (starting at <code>0</code>).</p>
|
||
</div><h4 id='method.intersection' class="method"><span id='intersection.v' class='invisible'><code>pub fn <a href='#method.intersection' class='fnname'>intersection</a>(self) -> <a class="struct" href="../../fst/raw/struct.Intersection.html" title="struct fst::raw::Intersection">Intersection</a><'f></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/fst/raw/ops.rs.html#103-109' title='goto source code'>[src]</a></span></h4>
|
||
<div class='docblock'><p>Performs an intersection operation on all streams that have been added.</p>
|
||
<p>Note that this returns a stream of <code>(&[u8], &[IndexedValue])</code>. The
|
||
first element of the tuple is the byte string key. The second element
|
||
of the tuple is a list of all occurrences of that key in participating
|
||
streams. The <code>IndexedValue</code> contains an index and the value associated
|
||
with that key in that stream. The index uniquely identifies each
|
||
stream, which is an integer that is auto-incremented when a stream
|
||
is added to this operation (starting at <code>0</code>).</p>
|
||
</div><h4 id='method.difference' class="method"><span id='difference.v' class='invisible'><code>pub fn <a href='#method.difference' class='fnname'>difference</a>(self) -> <a class="struct" href="../../fst/raw/struct.Difference.html" title="struct fst::raw::Difference">Difference</a><'f></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/fst/raw/ops.rs.html#122-130' title='goto source code'>[src]</a></span></h4>
|
||
<div class='docblock'><p>Performs a difference operation with respect to the first stream added.
|
||
That is, this returns a stream of all elements in the first stream
|
||
that don't exist in any other stream that has been added.</p>
|
||
<p>Note that this returns a stream of <code>(&[u8], &[IndexedValue])</code>. The
|
||
first element of the tuple is the byte string key. The second element
|
||
of the tuple is a list of all occurrences of that key in participating
|
||
streams. The <code>IndexedValue</code> contains an index and the value associated
|
||
with that key in that stream. The index uniquely identifies each
|
||
stream, which is an integer that is auto-incremented when a stream
|
||
is added to this operation (starting at <code>0</code>).</p>
|
||
</div><h4 id='method.symmetric_difference' class="method"><span id='symmetric_difference.v' class='invisible'><code>pub fn <a href='#method.symmetric_difference' class='fnname'>symmetric_difference</a>(self) -> <a class="struct" href="../../fst/raw/struct.SymmetricDifference.html" title="struct fst::raw::SymmetricDifference">SymmetricDifference</a><'f></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/fst/raw/ops.rs.html#148-154' title='goto source code'>[src]</a></span></h4>
|
||
<div class='docblock'><p>Performs a symmetric difference operation on all of the streams that
|
||
have been added.</p>
|
||
<p>When there are only two streams, then the keys returned correspond to
|
||
keys that are in either stream but <em>not</em> in both streams.</p>
|
||
<p>More generally, for any number of streams, keys that occur in an odd
|
||
number of streams are returned.</p>
|
||
<p>Note that this returns a stream of <code>(&[u8], &[IndexedValue])</code>. The
|
||
first element of the tuple is the byte string key. The second element
|
||
of the tuple is a list of all occurrences of that key in participating
|
||
streams. The <code>IndexedValue</code> contains an index and the value associated
|
||
with that key in that stream. The index uniquely identifies each
|
||
stream, which is an integer that is auto-incremented when a stream
|
||
is added to this operation (starting at <code>0</code>).</p>
|
||
</div></div>
|
||
<h2 id='implementations' class='small-section-header'>
|
||
Trait Implementations<a href='#implementations' class='anchor'></a>
|
||
</h2>
|
||
<h3 id='impl-Extend%3CI%3E' class='impl'><span class='in-band'><code>impl<'f, I, S> <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/trait.Extend.html" title="trait core::iter::traits::Extend">Extend</a><I> for <a class="struct" href="../../fst/raw/struct.OpBuilder.html" title="struct fst::raw::OpBuilder">OpBuilder</a><'f> <span class="where fmt-newline">where<br> I: for<'a> <a class="trait" href="../../fst/trait.IntoStreamer.html" title="trait fst::IntoStreamer">IntoStreamer</a><'a, Into = S, Item = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&'a [</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>, <a class="struct" href="../../fst/raw/struct.Output.html" title="struct fst::raw::Output">Output</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>>,<br> S: 'f + for<'a> <a class="trait" href="../../fst/trait.Streamer.html" title="trait fst::Streamer">Streamer</a><'a, Item = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&'a [</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>, <a class="struct" href="../../fst/raw/struct.Output.html" title="struct fst::raw::Output">Output</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>>, </span></code><a href='#impl-Extend%3CI%3E' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/fst/raw/ops.rs.html#157-165' title='goto source code'>[src]</a></span></h3>
|
||
<div class='impl-items'><h4 id='method.extend' class="method"><span id='extend.v' class='invisible'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/traits/trait.Extend.html#tymethod.extend' class='fnname'>extend</a><T>(&mut self, it: T) <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/trait.IntoIterator.html" title="trait core::iter::traits::IntoIterator">IntoIterator</a><Item = I>, </span></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/fst/raw/ops.rs.html#160-164' title='goto source code'>[src]</a></span></h4>
|
||
<div class='docblock'><p>Extends a collection with the contents of an iterator. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/trait.Extend.html#tymethod.extend">Read more</a></p>
|
||
</div></div><h3 id='impl-FromIterator%3CI%3E' class='impl'><span class='in-band'><code>impl<'f, I, S> <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/trait.FromIterator.html" title="trait core::iter::traits::FromIterator">FromIterator</a><I> for <a class="struct" href="../../fst/raw/struct.OpBuilder.html" title="struct fst::raw::OpBuilder">OpBuilder</a><'f> <span class="where fmt-newline">where<br> I: for<'a> <a class="trait" href="../../fst/trait.IntoStreamer.html" title="trait fst::IntoStreamer">IntoStreamer</a><'a, Into = S, Item = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&'a [</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>, <a class="struct" href="../../fst/raw/struct.Output.html" title="struct fst::raw::Output">Output</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>>,<br> S: 'f + for<'a> <a class="trait" href="../../fst/trait.Streamer.html" title="trait fst::Streamer">Streamer</a><'a, Item = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&'a [</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>, <a class="struct" href="../../fst/raw/struct.Output.html" title="struct fst::raw::Output">Output</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>>, </span></code><a href='#impl-FromIterator%3CI%3E' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/fst/raw/ops.rs.html#167-175' title='goto source code'>[src]</a></span></h3>
|
||
<div class='impl-items'><h4 id='method.from_iter' class="method"><span id='from_iter.v' class='invisible'><code>fn <a href='https://doc.rust-lang.org/nightly/core/iter/traits/trait.FromIterator.html#tymethod.from_iter' class='fnname'>from_iter</a><T>(it: T) -> Self <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/iter/traits/trait.IntoIterator.html" title="trait core::iter::traits::IntoIterator">IntoIterator</a><Item = I>, </span></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/fst/raw/ops.rs.html#170-174' title='goto source code'>[src]</a></span></h4>
|
||
<div class='docblock'><p>Creates a value from an iterator. <a href="https://doc.rust-lang.org/nightly/core/iter/traits/trait.FromIterator.html#tymethod.from_iter">Read more</a></p>
|
||
</div></div></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>
|
||
</div>
|
||
</div>
|
||
</aside>
|
||
|
||
|
||
|
||
<script>
|
||
window.rootPath = "../../";
|
||
window.currentCrate = "fst";
|
||
</script>
|
||
<script src="../../main.js"></script>
|
||
<script defer src="../../search-index.js"></script>
|
||
</body>
|
||
</html> |