blob: 087bf775609b1273a1964e272b4c3be968d1ddc3 [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="A builder for creating a map."><meta name="keywords" content="rust, rustlang, rust-lang, MapBuilder"><title>MapBuilder in tantivy_fst - 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 struct"><!--[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="../tantivy_fst/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="../tantivy_fst/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.svg" alt="logo"></div></a><h2 class="location"><a href="#">MapBuilder</a></h2><div class="sidebar-elems"><section><h3><a href="#implementations">Methods</a></h3><ul class="block"><li><a href="#method.bytes_written">bytes_written</a></li><li><a href="#method.extend_iter">extend_iter</a></li><li><a href="#method.extend_stream">extend_stream</a></li><li><a href="#method.finish">finish</a></li><li><a href="#method.get_ref">get_ref</a></li><li><a href="#method.insert">insert</a></li><li><a href="#method.into_inner">into_inner</a></li><li><a href="#method.memory">memory</a></li><li><a href="#method.new">new</a></li></ul><h3><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><ul class="block"><li><a href="#impl-RefUnwindSafe-for-MapBuilder%3CW%3E">RefUnwindSafe</a></li><li><a href="#impl-Send-for-MapBuilder%3CW%3E">Send</a></li><li><a href="#impl-Sync-for-MapBuilder%3CW%3E">Sync</a></li><li><a href="#impl-Unpin-for-MapBuilder%3CW%3E">Unpin</a></li><li><a href="#impl-UnwindSafe-for-MapBuilder%3CW%3E">UnwindSafe</a></li></ul><h3><a href="#blanket-implementations">Blanket Implementations</a></h3><ul class="block"><li><a href="#impl-Any-for-MapBuilder%3CW%3E">Any</a></li><li><a href="#impl-Borrow%3CT%3E-for-MapBuilder%3CW%3E">Borrow&lt;T&gt;</a></li><li><a href="#impl-BorrowMut%3CT%3E-for-MapBuilder%3CW%3E">BorrowMut&lt;T&gt;</a></li><li><a href="#impl-From%3CT%3E-for-MapBuilder%3CW%3E">From&lt;T&gt;</a></li><li><a href="#impl-Into%3CU%3E-for-MapBuilder%3CW%3E">Into&lt;U&gt;</a></li><li><a href="#impl-TryFrom%3CU%3E-for-MapBuilder%3CW%3E">TryFrom&lt;U&gt;</a></li><li><a href="#impl-TryInto%3CU%3E-for-MapBuilder%3CW%3E">TryInto&lt;U&gt;</a></li></ul></section><h2><a href="index.html">In tantivy_fst</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">Struct <a href="index.html">tantivy_fst</a>::<wbr><a class="struct" href="#">MapBuilder</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/tantivy_fst/map.rs.html#461">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 struct"><code>pub struct MapBuilder&lt;W&gt;(_);</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A builder for creating a map.</p>
<p>This is not your average everyday builder. It has two important qualities
that make it a bit unique from what you might expect:</p>
<ol>
<li>All keys must be added in lexicographic order. Adding a key out of order
will result in an error. Additionally, adding a duplicate key will also
result in an error. That is, once a key is associated with a value,
that association can never be modified or deleted.</li>
<li>The representation of a map is streamed to <em>any</em> <code>io::Write</code> as it is
built. For an in memory representation, this can be a <code>Vec&lt;u8&gt;</code>.</li>
</ol>
<p>Point (2) is especially important because it means that a map can be
constructed <em>without storing the entire map in memory</em>. Namely, since it
works with any <code>io::Write</code>, it can be streamed directly to a file.</p>
<p>With that said, the builder does use memory, but <strong>memory usage is bounded
to a constant size</strong>. The amount of memory used trades off with the
compression ratio. Currently, the implementation hard codes this trade off
which can result in about 5-20MB of heap usage during construction. (N.B.
Guaranteeing a maximal compression ratio requires memory proportional to
the size of the map, which defeats some of the benefit of streaming
it to disk. In practice, a small bounded amount of memory achieves
close-to-minimal compression ratios.)</p>
<p>The algorithmic complexity of map construction is <code>O(n)</code> where <code>n</code> is the
number of elements added to the map.</p>
<h2 id="example-build-in-memory"><a href="#example-build-in-memory">Example: build in memory</a></h2>
<p>This shows how to use the builder to construct a map in memory. Note that
<code>Map::from_iter</code> provides a convenience function that achieves this same
goal without needing to explicitly use <code>MapBuilder</code>.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>tantivy_fst::{IntoStreamer, Streamer, Map, MapBuilder};
<span class="kw">let </span><span class="kw-2">mut </span>build = MapBuilder::memory();
build.insert(<span class="string">&quot;bruce&quot;</span>, <span class="number">1</span>).unwrap();
build.insert(<span class="string">&quot;clarence&quot;</span>, <span class="number">2</span>).unwrap();
build.insert(<span class="string">&quot;stevie&quot;</span>, <span class="number">3</span>).unwrap();
<span class="comment">// You could also call `finish()` here, but since we&#39;re building the map in
// memory, there would be no way to get the `Vec&lt;u8&gt;` back.
</span><span class="kw">let </span>bytes = build.into_inner().unwrap();
<span class="comment">// At this point, the map has been constructed, but here&#39;s how to read it.
</span><span class="kw">let </span>map = Map::from_bytes(bytes).unwrap();
<span class="kw">let </span><span class="kw-2">mut </span>stream = map.into_stream();
<span class="kw">let </span><span class="kw-2">mut </span>kvs = <span class="macro">vec!</span>[];
<span class="kw">while let </span><span class="prelude-val">Some</span>((k, v)) = stream.next() {
kvs.push((k.to_vec(), v));
}
<span class="macro">assert_eq!</span>(kvs, <span class="macro">vec!</span>[
(<span class="string">b&quot;bruce&quot;</span>.to_vec(), <span class="number">1</span>),
(<span class="string">b&quot;clarence&quot;</span>.to_vec(), <span class="number">2</span>),
(<span class="string">b&quot;stevie&quot;</span>.to_vec(), <span class="number">3</span>),
]);</code></pre></div>
</div></details><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><div id="implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-MapBuilder%3CVec%3Cu8%3E%3E" class="impl has-srclink"><a class="srclink rightside" href="../src/tantivy_fst/map.rs.html#463-469">source</a><a href="#impl-MapBuilder%3CVec%3Cu8%3E%3E" class="anchor"></a><h3 class="code-header">impl <a class="struct" href="map/struct.MapBuilder.html" title="struct tantivy_fst::map::MapBuilder">MapBuilder</a>&lt;Vec&lt;u8&gt;&gt;</h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.memory" class="method has-srclink"><a class="srclink rightside" href="../src/tantivy_fst/map.rs.html#466-468">source</a><h4 class="code-header">pub fn <a href="#method.memory" class="fnname">memory</a>() -&gt; Self</h4></section></summary><div class="docblock"><p>Create a builder that builds a map in memory.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-MapBuilder%3CW%3E" class="impl has-srclink"><a class="srclink rightside" href="../src/tantivy_fst/map.rs.html#471-546">source</a><a href="#impl-MapBuilder%3CW%3E" class="anchor"></a><h3 class="code-header">impl&lt;W:&nbsp;Write&gt; <a class="struct" href="map/struct.MapBuilder.html" title="struct tantivy_fst::map::MapBuilder">MapBuilder</a>&lt;W&gt;</h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.new" class="method has-srclink"><a class="srclink rightside" href="../src/tantivy_fst/map.rs.html#474-476">source</a><h4 class="code-header">pub fn <a href="#method.new" class="fnname">new</a>(wtr: W) -&gt; <a class="type" href="type.Result.html" title="type tantivy_fst::Result">Result</a>&lt;<a class="struct" href="map/struct.MapBuilder.html" title="struct tantivy_fst::map::MapBuilder">MapBuilder</a>&lt;W&gt;&gt;</h4></section></summary><div class="docblock"><p>Create a builder that builds a map by writing it to <code>wtr</code> in a
streaming fashion.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.insert" class="method has-srclink"><a class="srclink rightside" href="../src/tantivy_fst/map.rs.html#487-489">source</a><h4 class="code-header">pub fn <a href="#method.insert" class="fnname">insert</a>&lt;K:&nbsp;AsRef&lt;[u8]&gt;&gt;(&amp;mut self, key: K, val: u64) -&gt; <a class="type" href="type.Result.html" title="type tantivy_fst::Result">Result</a>&lt;()&gt;</h4></section></summary><div class="docblock"><p>Insert a new key-value pair into the map.</p>
<p>Keys must be convertible to byte strings. Values must be a <code>u64</code>, which
is a restriction of the current implementation of finite state
transducers. (Values may one day be expanded to other types.)</p>
<p>If a key is inserted that is less than or equal to any previous key
added, then an error is returned. Similarly, if there was a problem
writing to the underlying writer, an error is returned.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.extend_iter" class="method has-srclink"><a class="srclink rightside" href="../src/tantivy_fst/map.rs.html#499-506">source</a><h4 class="code-header">pub fn <a href="#method.extend_iter" class="fnname">extend_iter</a>&lt;K, I&gt;(&amp;mut self, iter: I) -&gt; <a class="type" href="type.Result.html" title="type tantivy_fst::Result">Result</a>&lt;()&gt;<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;K: AsRef&lt;[u8]&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;I: IntoIterator&lt;Item = (K, u64)&gt;,</span></h4></section></summary><div class="docblock"><p>Calls insert on each item in the iterator.</p>
<p>If an error occurred while adding an element, processing is stopped
and the error is returned.</p>
<p>If a key is inserted that is less than or equal to any previous key
added, then an error is returned. Similarly, if there was a problem
writing to the underlying writer, an error is returned.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.extend_stream" class="method has-srclink"><a class="srclink rightside" href="../src/tantivy_fst/map.rs.html#516-522">source</a><h4 class="code-header">pub fn <a href="#method.extend_stream" class="fnname">extend_stream</a>&lt;'f, I, S&gt;(&amp;mut self, stream: I) -&gt; <a class="type" href="type.Result.html" title="type tantivy_fst::Result">Result</a>&lt;()&gt;<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;I: for&lt;'a&gt; <a class="trait" href="trait.IntoStreamer.html" title="trait tantivy_fst::IntoStreamer">IntoStreamer</a>&lt;'a, Into = S, Item = (&amp;'a [u8], u64)&gt;,<br>&nbsp;&nbsp;&nbsp;&nbsp;S: 'f + for&lt;'a&gt; <a class="trait" href="trait.Streamer.html" title="trait tantivy_fst::Streamer">Streamer</a>&lt;'a, Item = (&amp;'a [u8], u64)&gt;,</span></h4></section></summary><div class="docblock"><p>Calls insert on each item in the stream.</p>
<p>Note that unlike <code>extend_iter</code>, this is not generic on the items in
the stream.</p>
<p>If a key is inserted that is less than or equal to any previous key
added, then an error is returned. Similarly, if there was a problem
writing to the underlying writer, an error is returned.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.finish" class="method has-srclink"><a class="srclink rightside" href="../src/tantivy_fst/map.rs.html#527-529">source</a><h4 class="code-header">pub fn <a href="#method.finish" class="fnname">finish</a>(self) -&gt; <a class="type" href="type.Result.html" title="type tantivy_fst::Result">Result</a>&lt;()&gt;</h4></section></summary><div class="docblock"><p>Finishes the construction of the map and flushes the underlying
writer. After completion, the data written to <code>W</code> may be read using
one of <code>Map</code>’s constructor methods.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.into_inner" class="method has-srclink"><a class="srclink rightside" href="../src/tantivy_fst/map.rs.html#533-535">source</a><h4 class="code-header">pub fn <a href="#method.into_inner" class="fnname">into_inner</a>(self) -&gt; <a class="type" href="type.Result.html" title="type tantivy_fst::Result">Result</a>&lt;W&gt;</h4></section></summary><div class="docblock"><p>Just like <code>finish</code>, except it returns the underlying writer after
flushing it.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.get_ref" class="method has-srclink"><a class="srclink rightside" href="../src/tantivy_fst/map.rs.html#538-540">source</a><h4 class="code-header">pub fn <a href="#method.get_ref" class="fnname">get_ref</a>(&amp;self) -&gt; &amp;W</h4></section></summary><div class="docblock"><p>Gets a reference to the underlying writer.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.bytes_written" class="method has-srclink"><a class="srclink rightside" href="../src/tantivy_fst/map.rs.html#543-545">source</a><h4 class="code-header">pub fn <a href="#method.bytes_written" class="fnname">bytes_written</a>(&amp;self) -&gt; u64</h4></section></summary><div class="docblock"><p>Returns the number of bytes written to the underlying writer</p>
</div></details></div></details></div><h2 id="synthetic-implementations" class="small-section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor"></a></h2><div id="synthetic-implementations-list"><section id="impl-RefUnwindSafe-for-MapBuilder%3CW%3E" class="impl has-srclink"><a href="#impl-RefUnwindSafe-for-MapBuilder%3CW%3E" class="anchor"></a><h3 class="code-header">impl&lt;W&gt; RefUnwindSafe for <a class="struct" href="map/struct.MapBuilder.html" title="struct tantivy_fst::map::MapBuilder">MapBuilder</a>&lt;W&gt;<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;W: RefUnwindSafe,</span></h3></section><section id="impl-Send-for-MapBuilder%3CW%3E" class="impl has-srclink"><a href="#impl-Send-for-MapBuilder%3CW%3E" class="anchor"></a><h3 class="code-header">impl&lt;W&gt; Send for <a class="struct" href="map/struct.MapBuilder.html" title="struct tantivy_fst::map::MapBuilder">MapBuilder</a>&lt;W&gt;<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;W: Send,</span></h3></section><section id="impl-Sync-for-MapBuilder%3CW%3E" class="impl has-srclink"><a href="#impl-Sync-for-MapBuilder%3CW%3E" class="anchor"></a><h3 class="code-header">impl&lt;W&gt; Sync for <a class="struct" href="map/struct.MapBuilder.html" title="struct tantivy_fst::map::MapBuilder">MapBuilder</a>&lt;W&gt;<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;W: Sync,</span></h3></section><section id="impl-Unpin-for-MapBuilder%3CW%3E" class="impl has-srclink"><a href="#impl-Unpin-for-MapBuilder%3CW%3E" class="anchor"></a><h3 class="code-header">impl&lt;W&gt; Unpin for <a class="struct" href="map/struct.MapBuilder.html" title="struct tantivy_fst::map::MapBuilder">MapBuilder</a>&lt;W&gt;<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;W: Unpin,</span></h3></section><section id="impl-UnwindSafe-for-MapBuilder%3CW%3E" class="impl has-srclink"><a href="#impl-UnwindSafe-for-MapBuilder%3CW%3E" class="anchor"></a><h3 class="code-header">impl&lt;W&gt; UnwindSafe for <a class="struct" href="map/struct.MapBuilder.html" title="struct tantivy_fst::map::MapBuilder">MapBuilder</a>&lt;W&gt;<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;W: UnwindSafe,</span></h3></section></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Any-for-MapBuilder%3CW%3E" class="impl has-srclink"><a href="#impl-Any-for-MapBuilder%3CW%3E" class="anchor"></a><h3 class="code-header">impl&lt;T&gt; Any for T<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'static + ?Sized,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.type_id" class="method trait-impl has-srclink"><a href="#method.type_id" class="anchor"></a><h4 class="code-header">fn <a class="fnname">type_id</a>(&amp;self) -&gt; TypeId</h4></section></summary><div class='docblock'>Gets the <code>TypeId</code> of <code>self</code>. <a>Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Borrow%3CT%3E-for-MapBuilder%3CW%3E" class="impl has-srclink"><a href="#impl-Borrow%3CT%3E-for-MapBuilder%3CW%3E" class="anchor"></a><h3 class="code-header">impl&lt;T&gt; Borrow&lt;T&gt; for T<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?Sized,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.borrow" class="method trait-impl has-srclink"><span class="since rightside" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/91522" title="Tracking issue for const_borrow">unstable</a></span><a href="#method.borrow" class="anchor"></a><h4 class="code-header">fn <a class="fnname">borrow</a>(&amp;self) -&gt; &amp;T</h4></section></summary><div class='docblock'>Immutably borrows from an owned value. <a>Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-BorrowMut%3CT%3E-for-MapBuilder%3CW%3E" class="impl has-srclink"><a href="#impl-BorrowMut%3CT%3E-for-MapBuilder%3CW%3E" class="anchor"></a><h3 class="code-header">impl&lt;T&gt; BorrowMut&lt;T&gt; for T<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?Sized,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.borrow_mut" class="method trait-impl has-srclink"><span class="since rightside" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/91522" title="Tracking issue for const_borrow">unstable</a></span><a href="#method.borrow_mut" class="anchor"></a><h4 class="code-header">fn <a class="fnname">borrow_mut</a>(&amp;mut self) -&gt; &amp;mut T</h4></section></summary><div class='docblock'>Mutably borrows from an owned value. <a>Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-From%3CT%3E-for-MapBuilder%3CW%3E" class="impl has-srclink"><a href="#impl-From%3CT%3E-for-MapBuilder%3CW%3E" class="anchor"></a><h3 class="code-header">impl&lt;T&gt; From&lt;T&gt; for T</h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.from" class="method trait-impl has-srclink"><span class="since rightside" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span><a href="#method.from" class="anchor"></a><h4 class="code-header">fn <a class="fnname">from</a>(t: T) -&gt; T</h4></section></summary><div class="docblock"><p>Returns the argument unchanged.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Into%3CU%3E-for-MapBuilder%3CW%3E" class="impl has-srclink"><a href="#impl-Into%3CU%3E-for-MapBuilder%3CW%3E" class="anchor"></a><h3 class="code-header">impl&lt;T, U&gt; Into&lt;U&gt; for T<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: From&lt;T&gt;,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.into" class="method trait-impl has-srclink"><span class="since rightside" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span><a href="#method.into" class="anchor"></a><h4 class="code-header">fn <a class="fnname">into</a>(self) -&gt; U</h4></section></summary><div class="docblock"><p>Calls <code>U::from(self)</code>.</p>
<p>That is, this conversion is whatever the implementation of
<code>[From]&lt;T&gt; for U</code> chooses to do.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-TryFrom%3CU%3E-for-MapBuilder%3CW%3E" class="impl has-srclink"><a href="#impl-TryFrom%3CU%3E-for-MapBuilder%3CW%3E" class="anchor"></a><h3 class="code-header">impl&lt;T, U&gt; TryFrom&lt;U&gt; for T<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: Into&lt;T&gt;,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Error-1" class="associatedtype trait-impl has-srclink"><a href="#associatedtype.Error-1" class="anchor"></a><h4 class="code-header">type <a class="associatedtype">Error</a> = Infallible</h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.try_from" class="method trait-impl has-srclink"><span class="since rightside" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span><a href="#method.try_from" class="anchor"></a><h4 class="code-header">fn <a class="fnname">try_from</a>(value: U) -&gt; Result&lt;T, &lt;T as TryFrom&lt;U&gt;&gt;::Error&gt;</h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-TryInto%3CU%3E-for-MapBuilder%3CW%3E" class="impl has-srclink"><a href="#impl-TryInto%3CU%3E-for-MapBuilder%3CW%3E" class="anchor"></a><h3 class="code-header">impl&lt;T, U&gt; TryInto&lt;U&gt; for T<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: TryFrom&lt;T&gt;,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Error" class="associatedtype trait-impl has-srclink"><a href="#associatedtype.Error" class="anchor"></a><h4 class="code-header">type <a class="associatedtype">Error</a> = &lt;U as TryFrom&lt;T&gt;&gt;::Error</h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.try_into" class="method trait-impl has-srclink"><span class="since rightside" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span><a href="#method.try_into" class="anchor"></a><h4 class="code-header">fn <a class="fnname">try_into</a>(self) -&gt; Result&lt;U, &lt;U as TryFrom&lt;T&gt;&gt;::Error&gt;</h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details></div></section></div></main><div id="rustdoc-vars" data-root-path="../" data-current-crate="tantivy_fst" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.66.0-nightly (5c8bff74b 2022-10-21)" ></div></body></html>