mirror of
https://github.com/quickwit-oss/tantivy.git
synced 2026-01-08 01:52:54 +00:00
Automatic Travis documentation build
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -538,6 +538,37 @@
|
||||
<span id="538">538</span>
|
||||
<span id="539">539</span>
|
||||
<span id="540">540</span>
|
||||
<span id="541">541</span>
|
||||
<span id="542">542</span>
|
||||
<span id="543">543</span>
|
||||
<span id="544">544</span>
|
||||
<span id="545">545</span>
|
||||
<span id="546">546</span>
|
||||
<span id="547">547</span>
|
||||
<span id="548">548</span>
|
||||
<span id="549">549</span>
|
||||
<span id="550">550</span>
|
||||
<span id="551">551</span>
|
||||
<span id="552">552</span>
|
||||
<span id="553">553</span>
|
||||
<span id="554">554</span>
|
||||
<span id="555">555</span>
|
||||
<span id="556">556</span>
|
||||
<span id="557">557</span>
|
||||
<span id="558">558</span>
|
||||
<span id="559">559</span>
|
||||
<span id="560">560</span>
|
||||
<span id="561">561</span>
|
||||
<span id="562">562</span>
|
||||
<span id="563">563</span>
|
||||
<span id="564">564</span>
|
||||
<span id="565">565</span>
|
||||
<span id="566">566</span>
|
||||
<span id="567">567</span>
|
||||
<span id="568">568</span>
|
||||
<span id="569">569</span>
|
||||
<span id="570">570</span>
|
||||
<span id="571">571</span>
|
||||
</pre><div class="example-wrap"><pre class="rust ">
|
||||
<span class="kw">use</span> <span class="kw">super</span>::<span class="ident">segment</span>::<span class="ident">create_segment</span>;
|
||||
<span class="kw">use</span> <span class="kw">super</span>::<span class="ident">segment</span>::<span class="ident">Segment</span>;
|
||||
@@ -1078,6 +1109,37 @@
|
||||
}
|
||||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">count</span>, <span class="number">2</span>);
|
||||
}
|
||||
|
||||
<span class="attribute">#[<span class="ident">test</span>]</span>
|
||||
<span class="kw">fn</span> <span class="ident">garbage_collect_works_as_intended</span>() {
|
||||
<span class="kw">let</span> <span class="ident">directory</span> <span class="op">=</span> <span class="ident">RAMDirectory</span>::<span class="ident">create</span>();
|
||||
<span class="kw">let</span> <span class="ident">schema</span> <span class="op">=</span> <span class="ident">throw_away_schema</span>();
|
||||
<span class="kw">let</span> <span class="ident">field</span> <span class="op">=</span> <span class="ident">schema</span>.<span class="ident">get_field</span>(<span class="string">"num_likes"</span>).<span class="ident">unwrap</span>();
|
||||
<span class="kw">let</span> <span class="ident">index</span> <span class="op">=</span> <span class="ident">Index</span>::<span class="ident">create</span>(<span class="ident">directory</span>.<span class="ident">clone</span>(), <span class="ident">schema</span>).<span class="ident">unwrap</span>();
|
||||
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">writer</span> <span class="op">=</span> <span class="ident">index</span>.<span class="ident">writer_with_num_threads</span>(<span class="number">8</span>, <span class="number">24_000_000</span>).<span class="ident">unwrap</span>();
|
||||
<span class="kw">for</span> <span class="ident">i</span> <span class="kw">in</span> <span class="number">0u64</span>..<span class="number">8_000u64</span> {
|
||||
<span class="ident">writer</span>.<span class="ident">add_document</span>(<span class="macro">doc</span><span class="macro">!</span>(<span class="ident">field</span> <span class="op">=></span> <span class="ident">i</span>));
|
||||
}
|
||||
<span class="ident">writer</span>.<span class="ident">commit</span>().<span class="ident">unwrap</span>();
|
||||
<span class="kw">let</span> <span class="ident">mem_right_after_commit</span> <span class="op">=</span> <span class="ident">directory</span>.<span class="ident">total_mem_usage</span>();
|
||||
<span class="ident">thread</span>::<span class="ident">sleep</span>(<span class="ident">Duration</span>::<span class="ident">from_millis</span>(<span class="number">1_000</span>));
|
||||
<span class="kw">let</span> <span class="ident">reader</span> <span class="op">=</span> <span class="ident">index</span>
|
||||
.<span class="ident">reader_builder</span>()
|
||||
.<span class="ident">reload_policy</span>(<span class="ident">ReloadPolicy</span>::<span class="ident">Manual</span>)
|
||||
.<span class="ident">try_into</span>()
|
||||
.<span class="ident">unwrap</span>();
|
||||
|
||||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">reader</span>.<span class="ident">searcher</span>().<span class="ident">num_docs</span>(), <span class="number">8_000</span>);
|
||||
<span class="ident">writer</span>.<span class="ident">wait_merging_threads</span>().<span class="ident">unwrap</span>();
|
||||
<span class="kw">let</span> <span class="ident">mem_right_after_merge_finished</span> <span class="op">=</span> <span class="ident">directory</span>.<span class="ident">total_mem_usage</span>();
|
||||
|
||||
<span class="ident">reader</span>.<span class="ident">reload</span>().<span class="ident">unwrap</span>();
|
||||
<span class="kw">let</span> <span class="ident">searcher</span> <span class="op">=</span> <span class="ident">reader</span>.<span class="ident">searcher</span>();
|
||||
<span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">searcher</span>.<span class="ident">num_docs</span>(), <span class="number">8_000</span>);
|
||||
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">mem_right_after_merge_finished</span> <span class="op"><</span> <span class="ident">mem_right_after_commit</span>);
|
||||
}
|
||||
|
||||
}
|
||||
</pre></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><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 = "tantivy";</script><script src="../../../aliases.js"></script><script src="../../../main.js"></script><script src="../../../source-script.js"></script><script src="../../../source-files.js"></script><script defer src="../../../search-index.js"></script></body></html>
|
||||
@@ -181,6 +181,16 @@
|
||||
<span id="181">181</span>
|
||||
<span id="182">182</span>
|
||||
<span id="183">183</span>
|
||||
<span id="184">184</span>
|
||||
<span id="185">185</span>
|
||||
<span id="186">186</span>
|
||||
<span id="187">187</span>
|
||||
<span id="188">188</span>
|
||||
<span id="189">189</span>
|
||||
<span id="190">190</span>
|
||||
<span id="191">191</span>
|
||||
<span id="192">192</span>
|
||||
<span id="193">193</span>
|
||||
</pre><div class="example-wrap"><pre class="rust ">
|
||||
<span class="kw">use</span> <span class="ident">core</span>::<span class="ident">META_FILEPATH</span>;
|
||||
<span class="kw">use</span> <span class="ident">directory</span>::<span class="ident">error</span>::{<span class="ident">DeleteError</span>, <span class="ident">OpenReadError</span>, <span class="ident">OpenWriteError</span>};
|
||||
@@ -287,6 +297,10 @@
|
||||
<span class="kw">fn</span> <span class="ident">watch</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>, <span class="ident">watch_handle</span>: <span class="ident">WatchCallback</span>) <span class="op">-></span> <span class="ident">WatchHandle</span> {
|
||||
<span class="self">self</span>.<span class="ident">watch_router</span>.<span class="ident">subscribe</span>(<span class="ident">watch_handle</span>)
|
||||
}
|
||||
|
||||
<span class="kw">fn</span> <span class="ident">total_mem_usage</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-></span> <span class="ident">usize</span> {
|
||||
<span class="self">self</span>.<span class="ident">fs</span>.<span class="ident">values</span>().<span class="ident">map</span>(<span class="op">|</span><span class="ident">f</span><span class="op">|</span> <span class="ident">f</span>.<span class="ident">len</span>()).<span class="ident">sum</span>()
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">impl</span> <span class="ident">fmt</span>::<span class="ident">Debug</span> <span class="kw">for</span> <span class="ident">RAMDirectory</span> {
|
||||
@@ -310,6 +324,12 @@
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">create</span>() <span class="op">-></span> <span class="ident">RAMDirectory</span> {
|
||||
<span class="self">Self</span>::<span class="ident">default</span>()
|
||||
}
|
||||
|
||||
<span class="doccomment">/// Returns the sum of the size of the different files</span>
|
||||
<span class="doccomment">/// in the RAMDirectory.</span>
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">total_mem_usage</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-></span> <span class="ident">usize</span> {
|
||||
<span class="self">self</span>.<span class="ident">fs</span>.<span class="ident">read</span>().<span class="ident">unwrap</span>().<span class="ident">total_mem_usage</span>()
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">impl</span> <span class="ident">Directory</span> <span class="kw">for</span> <span class="ident">RAMDirectory</span> {
|
||||
|
||||
@@ -1239,6 +1239,7 @@
|
||||
<span id="1239">1239</span>
|
||||
<span id="1240">1240</span>
|
||||
<span id="1241">1241</span>
|
||||
<span id="1242">1242</span>
|
||||
</pre><div class="example-wrap"><pre class="rust ">
|
||||
<span class="kw">use</span> <span class="kw">super</span>::<span class="ident">operation</span>::{<span class="ident">AddOperation</span>, <span class="ident">UserOperation</span>};
|
||||
<span class="kw">use</span> <span class="kw">super</span>::<span class="ident">segment_updater</span>::<span class="ident">SegmentUpdater</span>;
|
||||
@@ -1574,7 +1575,8 @@
|
||||
}
|
||||
|
||||
<span class="kw">impl</span> <span class="ident">IndexWriter</span> {
|
||||
<span class="doccomment">/// The index writer</span>
|
||||
<span class="doccomment">/// If there are some merging threads, blocks until they all finish their work and</span>
|
||||
<span class="doccomment">/// then drop the `IndexWriter`.</span>
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">wait_merging_threads</span>(<span class="kw-2">mut</span> <span class="self">self</span>) <span class="op">-></span> <span class="prelude-ty">Result</span><span class="op"><</span>()<span class="op">></span> {
|
||||
<span class="comment">// this will stop the indexing thread,</span>
|
||||
<span class="comment">// dropping the last reference to the segment_updater.</span>
|
||||
@@ -2447,7 +2449,7 @@
|
||||
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">clear_tstamp</span> <span class="op"><</span> <span class="ident">commit_tstamp</span>);
|
||||
|
||||
<span class="comment">// rollback</span>
|
||||
<span class="kw">let</span> <span class="ident">rollback_tstamp</span> <span class="op">=</span> <span class="ident">index_writer</span>.<span class="ident">rollback</span>().<span class="ident">unwrap</span>();
|
||||
<span class="kw">let</span> <span class="ident">_rollback_tstamp</span> <span class="op">=</span> <span class="ident">index_writer</span>.<span class="ident">rollback</span>().<span class="ident">unwrap</span>();
|
||||
<span class="comment">// Find original docs in the index</span>
|
||||
<span class="kw">let</span> <span class="ident">term_a</span> <span class="op">=</span> <span class="ident">Term</span>::<span class="ident">from_field_text</span>(<span class="ident">text_field</span>, <span class="string">"a"</span>);
|
||||
<span class="comment">// expect the document with that term to be in the index</span>
|
||||
|
||||
@@ -684,6 +684,10 @@
|
||||
<span id="684">684</span>
|
||||
<span id="685">685</span>
|
||||
<span id="686">686</span>
|
||||
<span id="687">687</span>
|
||||
<span id="688">688</span>
|
||||
<span id="689">689</span>
|
||||
<span id="690">690</span>
|
||||
</pre><div class="example-wrap"><pre class="rust ">
|
||||
<span class="kw">use</span> <span class="kw">super</span>::<span class="ident">segment_manager</span>::{<span class="ident">get_mergeable_segments</span>, <span class="ident">SegmentManager</span>};
|
||||
<span class="kw">use</span> <span class="ident">core</span>::<span class="ident">Index</span>;
|
||||
@@ -757,6 +761,7 @@
|
||||
<span class="doccomment">///</span>
|
||||
<span class="doccomment">/// This method is not part of tantivy's public API</span>
|
||||
<span class="kw">fn</span> <span class="ident">save_metas</span>(<span class="ident">metas</span>: <span class="kw-2">&</span><span class="ident">IndexMeta</span>, <span class="ident">directory</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">Directory</span>) <span class="op">-></span> <span class="prelude-ty">Result</span><span class="op"><</span>()<span class="op">></span> {
|
||||
<span class="macro">info</span><span class="macro">!</span>(<span class="string">"save metas"</span>);
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">buffer</span> <span class="op">=</span> <span class="ident">serde_json</span>::<span class="ident">to_vec_pretty</span>(<span class="ident">metas</span>)<span class="question-mark">?</span>;
|
||||
<span class="comment">// Just adding a new line at the end of the buffer.</span>
|
||||
<span class="macro">writeln</span><span class="macro">!</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">buffer</span>)<span class="question-mark">?</span>;
|
||||
@@ -1138,38 +1143,41 @@
|
||||
) <span class="op">-></span> <span class="prelude-ty">Result</span><span class="op"><</span>()<span class="op">></span> {
|
||||
<span class="self">self</span>.<span class="ident">run_async</span>(<span class="kw">move</span> <span class="op">|</span><span class="ident">segment_updater</span><span class="op">|</span> {
|
||||
<span class="macro">info</span><span class="macro">!</span>(<span class="string">"End merge {:?}"</span>, <span class="ident">after_merge_segment_entry</span>.<span class="ident">meta</span>());
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">delete_cursor</span> <span class="op">=</span> <span class="ident">after_merge_segment_entry</span>.<span class="ident">delete_cursor</span>().<span class="ident">clone</span>();
|
||||
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">delete_operation</span>) <span class="op">=</span> <span class="ident">delete_cursor</span>.<span class="ident">get</span>() {
|
||||
<span class="kw">let</span> <span class="ident">committed_opstamp</span> <span class="op">=</span> <span class="ident">segment_updater</span>.<span class="ident">load_metas</span>().<span class="ident">opstamp</span>;
|
||||
<span class="kw">if</span> <span class="ident">delete_operation</span>.<span class="ident">opstamp</span> <span class="op"><</span> <span class="ident">committed_opstamp</span> {
|
||||
<span class="kw">let</span> <span class="ident">index</span> <span class="op">=</span> <span class="kw-2">&</span><span class="ident">segment_updater</span>.<span class="number">0</span>.<span class="ident">index</span>;
|
||||
<span class="kw">let</span> <span class="ident">segment</span> <span class="op">=</span> <span class="ident">index</span>.<span class="ident">segment</span>(<span class="ident">after_merge_segment_entry</span>.<span class="ident">meta</span>().<span class="ident">clone</span>());
|
||||
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Err</span>(<span class="ident">e</span>) <span class="op">=</span>
|
||||
<span class="ident">advance_deletes</span>(<span class="ident">segment</span>, <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">after_merge_segment_entry</span>, <span class="ident">committed_opstamp</span>)
|
||||
{
|
||||
<span class="macro">error</span><span class="macro">!</span>(
|
||||
<span class="string">"Merge of {:?} was cancelled (advancing deletes failed): {:?}"</span>,
|
||||
<span class="ident">merge_operation</span>.<span class="ident">segment_ids</span>(),
|
||||
<span class="ident">e</span>
|
||||
);
|
||||
<span class="kw">if</span> <span class="macro">cfg</span><span class="macro">!</span>(<span class="ident">test</span>) {
|
||||
<span class="macro">panic</span><span class="macro">!</span>(<span class="string">"Merge failed."</span>);
|
||||
{
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">delete_cursor</span> <span class="op">=</span> <span class="ident">after_merge_segment_entry</span>.<span class="ident">delete_cursor</span>().<span class="ident">clone</span>();
|
||||
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">delete_operation</span>) <span class="op">=</span> <span class="ident">delete_cursor</span>.<span class="ident">get</span>() {
|
||||
<span class="kw">let</span> <span class="ident">committed_opstamp</span> <span class="op">=</span> <span class="ident">segment_updater</span>.<span class="ident">load_metas</span>().<span class="ident">opstamp</span>;
|
||||
<span class="kw">if</span> <span class="ident">delete_operation</span>.<span class="ident">opstamp</span> <span class="op"><</span> <span class="ident">committed_opstamp</span> {
|
||||
<span class="kw">let</span> <span class="ident">index</span> <span class="op">=</span> <span class="kw-2">&</span><span class="ident">segment_updater</span>.<span class="number">0</span>.<span class="ident">index</span>;
|
||||
<span class="kw">let</span> <span class="ident">segment</span> <span class="op">=</span> <span class="ident">index</span>.<span class="ident">segment</span>(<span class="ident">after_merge_segment_entry</span>.<span class="ident">meta</span>().<span class="ident">clone</span>());
|
||||
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Err</span>(<span class="ident">e</span>) <span class="op">=</span> <span class="ident">advance_deletes</span>(
|
||||
<span class="ident">segment</span>,
|
||||
<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">after_merge_segment_entry</span>,
|
||||
<span class="ident">committed_opstamp</span>,
|
||||
) {
|
||||
<span class="macro">error</span><span class="macro">!</span>(
|
||||
<span class="string">"Merge of {:?} was cancelled (advancing deletes failed): {:?}"</span>,
|
||||
<span class="ident">merge_operation</span>.<span class="ident">segment_ids</span>(),
|
||||
<span class="ident">e</span>
|
||||
);
|
||||
<span class="kw">if</span> <span class="macro">cfg</span><span class="macro">!</span>(<span class="ident">test</span>) {
|
||||
<span class="macro">panic</span><span class="macro">!</span>(<span class="string">"Merge failed."</span>);
|
||||
}
|
||||
<span class="comment">// ... cancel merge</span>
|
||||
<span class="comment">// `merge_operations` are tracked. As it is dropped, the</span>
|
||||
<span class="comment">// the segment_ids will be available again for merge.</span>
|
||||
<span class="kw">return</span>;
|
||||
}
|
||||
<span class="comment">// ... cancel merge</span>
|
||||
<span class="comment">// `merge_operations` are tracked. As it is dropped, the</span>
|
||||
<span class="comment">// the segment_ids will be available again for merge.</span>
|
||||
<span class="kw">return</span>;
|
||||
}
|
||||
}
|
||||
}
|
||||
<span class="ident">segment_updater</span>
|
||||
.<span class="number">0</span>
|
||||
.<span class="ident">segment_manager</span>
|
||||
.<span class="ident">end_merge</span>(<span class="ident">merge_operation</span>.<span class="ident">segment_ids</span>(), <span class="ident">after_merge_segment_entry</span>);
|
||||
<span class="ident">segment_updater</span>.<span class="ident">consider_merge_options</span>();
|
||||
<span class="macro">info</span><span class="macro">!</span>(<span class="string">"save metas"</span>);
|
||||
<span class="kw">let</span> <span class="ident">previous_metas</span> <span class="op">=</span> <span class="ident">segment_updater</span>.<span class="ident">load_metas</span>();
|
||||
<span class="ident">segment_updater</span>.<span class="ident">save_metas</span>(<span class="ident">previous_metas</span>.<span class="ident">opstamp</span>, <span class="ident">previous_metas</span>.<span class="ident">payload</span>.<span class="ident">clone</span>());
|
||||
<span class="kw">let</span> <span class="ident">previous_metas</span> <span class="op">=</span> <span class="ident">segment_updater</span>.<span class="ident">load_metas</span>();
|
||||
<span class="ident">segment_updater</span>
|
||||
.<span class="number">0</span>
|
||||
.<span class="ident">segment_manager</span>
|
||||
.<span class="ident">end_merge</span>(<span class="ident">merge_operation</span>.<span class="ident">segment_ids</span>(), <span class="ident">after_merge_segment_entry</span>);
|
||||
<span class="ident">segment_updater</span>.<span class="ident">consider_merge_options</span>();
|
||||
<span class="ident">segment_updater</span>.<span class="ident">save_metas</span>(<span class="ident">previous_metas</span>.<span class="ident">opstamp</span>, <span class="ident">previous_metas</span>.<span class="ident">payload</span>.<span class="ident">clone</span>());
|
||||
} <span class="comment">// we drop all possible handle to a now useless `SegmentMeta`.</span>
|
||||
<span class="ident">segment_updater</span>.<span class="ident">garbage_collect_files_exec</span>();
|
||||
})
|
||||
.<span class="ident">wait</span>()
|
||||
|
||||
@@ -1,19 +1,21 @@
|
||||
<!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 `RAMDirectory` struct in crate `tantivy`."><meta name="keywords" content="rust, rustlang, rust-lang, RAMDirectory"><title>tantivy::directory::RAMDirectory - 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 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><a href='../../tantivy/index.html'><img src='http://fulmicoton.com/tantivy-logo/tantivy-logo.png' alt='logo' width='100'></a><p class='location'>Struct RAMDirectory</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#methods">Methods</a><div class="sidebar-links"><a href="#method.create">create</a></div><a class="sidebar-title" href="#implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Clone">Clone</a><a href="#impl-Debug">Debug</a><a href="#impl-Default">Default</a><a href="#impl-Directory">Directory</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow">Borrow</a><a href="#impl-BorrowMut">BorrowMut</a><a href="#impl-Downcast">Downcast</a><a href="#impl-Erased">Erased</a><a href="#impl-From">From</a><a href="#impl-Fruit">Fruit</a><a href="#impl-Into">Into</a><a href="#impl-ToOwned">ToOwned</a><a href="#impl-TryFrom">TryFrom</a><a href="#impl-TryInto">TryInto</a></div></div><p class='location'><a href='../index.html'>tantivy</a>::<wbr><a href='index.html'>directory</a></p><script>window.sidebarCurrent = {name: 'RAMDirectory', 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"><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/tantivy/directory/ram_directory.rs.html#120-122' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='../index.html'>tantivy</a>::<wbr><a href='index.html'>directory</a>::<wbr><a class="struct" href=''>RAMDirectory</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'>pub struct RAMDirectory { /* fields omitted */ }</pre></div><div class='docblock'><p>A Directory storing everything in anonymous memory.</p>
|
||||
<!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 `RAMDirectory` struct in crate `tantivy`."><meta name="keywords" content="rust, rustlang, rust-lang, RAMDirectory"><title>tantivy::directory::RAMDirectory - 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 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><a href='../../tantivy/index.html'><img src='http://fulmicoton.com/tantivy-logo/tantivy-logo.png' alt='logo' width='100'></a><p class='location'>Struct RAMDirectory</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#methods">Methods</a><div class="sidebar-links"><a href="#method.create">create</a><a href="#method.total_mem_usage">total_mem_usage</a></div><a class="sidebar-title" href="#implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Clone">Clone</a><a href="#impl-Debug">Debug</a><a href="#impl-Default">Default</a><a href="#impl-Directory">Directory</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow">Borrow</a><a href="#impl-BorrowMut">BorrowMut</a><a href="#impl-Downcast">Downcast</a><a href="#impl-Erased">Erased</a><a href="#impl-From">From</a><a href="#impl-Fruit">Fruit</a><a href="#impl-Into">Into</a><a href="#impl-ToOwned">ToOwned</a><a href="#impl-TryFrom">TryFrom</a><a href="#impl-TryInto">TryInto</a></div></div><p class='location'><a href='../index.html'>tantivy</a>::<wbr><a href='index.html'>directory</a></p><script>window.sidebarCurrent = {name: 'RAMDirectory', 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"><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/tantivy/directory/ram_directory.rs.html#124-126' title='goto source code'>[src]</a></span><span class='in-band'>Struct <a href='../index.html'>tantivy</a>::<wbr><a href='index.html'>directory</a>::<wbr><a class="struct" href=''>RAMDirectory</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class='rust struct'>pub struct RAMDirectory { /* fields omitted */ }</pre></div><div class='docblock'><p>A Directory storing everything in anonymous memory.</p>
|
||||
<p>It is mainly meant for unit testing.
|
||||
Writes are only made visible upon flushing.</p>
|
||||
</div><h2 id='methods' class='small-section-header'>Methods<a href='#methods' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl <a class="struct" href="../../tantivy/directory/struct.RAMDirectory.html" title="struct tantivy::directory::RAMDirectory">RAMDirectory</a></code><a href='#impl' class='anchor'></a><a class='srclink' href='../../src/tantivy/directory/ram_directory.rs.html#124-129' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.create' class="method"><code id='create.v'>pub fn <a href='#method.create' class='fnname'>create</a>() -> <a class="struct" href="../../tantivy/directory/struct.RAMDirectory.html" title="struct tantivy::directory::RAMDirectory">RAMDirectory</a></code><a class='srclink' href='../../src/tantivy/directory/ram_directory.rs.html#126-128' title='goto source code'>[src]</a></h4><div class='docblock'><p>Constructor</p>
|
||||
</div></div><h2 id='implementations' class='small-section-header'>Trait Implementations<a href='#implementations' class='anchor'></a></h2><div id='implementations-list'><h3 id='impl-Directory' class='impl'><code class='in-band'>impl <a class="trait" href="../../tantivy/directory/trait.Directory.html" title="trait tantivy::directory::Directory">Directory</a> for <a class="struct" href="../../tantivy/directory/struct.RAMDirectory.html" title="struct tantivy::directory::RAMDirectory">RAMDirectory</a></code><a href='#impl-Directory' class='anchor'></a><a class='srclink' href='../../src/tantivy/directory/ram_directory.rs.html#131-183' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.open_read' class="method hidden"><code id='open_read.v'>fn <a href='../../tantivy/directory/trait.Directory.html#tymethod.open_read' class='fnname'>open_read</a>(&self, path: &<a class="struct" href="https://doc.rust-lang.org/nightly/std/path/struct.Path.html" title="struct std::path::Path">Path</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="../../tantivy/directory/struct.ReadOnlySource.html" title="struct tantivy::directory::ReadOnlySource">ReadOnlySource</a>, <a class="enum" href="../../tantivy/directory/error/enum.OpenReadError.html" title="enum tantivy::directory::error::OpenReadError">OpenReadError</a>></code><a class='srclink' href='../../src/tantivy/directory/ram_directory.rs.html#132-134' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Opens a virtual file for read. <a href="../../tantivy/directory/trait.Directory.html#tymethod.open_read">Read more</a></p>
|
||||
</div><h4 id='method.delete' class="method hidden"><code id='delete.v'>fn <a href='../../tantivy/directory/trait.Directory.html#tymethod.delete' class='fnname'>delete</a>(&self, path: &<a class="struct" href="https://doc.rust-lang.org/nightly/std/path/struct.Path.html" title="struct std::path::Path">Path</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../tantivy/directory/error/enum.DeleteError.html" title="enum tantivy::directory::error::DeleteError">DeleteError</a>></code><a class='srclink' href='../../src/tantivy/directory/ram_directory.rs.html#136-138' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Removes a file <a href="../../tantivy/directory/trait.Directory.html#tymethod.delete">Read more</a></p>
|
||||
</div><h4 id='method.exists' class="method hidden"><code id='exists.v'>fn <a href='../../tantivy/directory/trait.Directory.html#tymethod.exists' class='fnname'>exists</a>(&self, path: &<a class="struct" href="https://doc.rust-lang.org/nightly/std/path/struct.Path.html" title="struct std::path::Path">Path</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../src/tantivy/directory/ram_directory.rs.html#140-142' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns true iff the file exists</p>
|
||||
</div><h4 id='method.open_write' class="method hidden"><code id='open_write.v'>fn <a href='../../tantivy/directory/trait.Directory.html#tymethod.open_write' class='fnname'>open_write</a>(&mut self, path: &<a class="struct" href="https://doc.rust-lang.org/nightly/std/path/struct.Path.html" title="struct std::path::Path">Path</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="type" href="../../tantivy/directory/type.WritePtr.html" title="type tantivy::directory::WritePtr">WritePtr</a>, <a class="enum" href="../../tantivy/directory/error/enum.OpenWriteError.html" title="enum tantivy::directory::error::OpenWriteError">OpenWriteError</a>></code><a class='srclink' href='../../src/tantivy/directory/ram_directory.rs.html#144-155' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Opens a writer for the virtual file associated with a Path. <a href="../../tantivy/directory/trait.Directory.html#tymethod.open_write">Read more</a></p>
|
||||
</div><h4 id='method.atomic_read' class="method hidden"><code id='atomic_read.v'>fn <a href='../../tantivy/directory/trait.Directory.html#tymethod.atomic_read' class='fnname'>atomic_read</a>(&self, path: &<a class="struct" href="https://doc.rust-lang.org/nightly/std/path/struct.Path.html" title="struct std::path::Path">Path</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>>, <a class="enum" href="../../tantivy/directory/error/enum.OpenReadError.html" title="enum tantivy::directory::error::OpenReadError">OpenReadError</a>></code><a class='srclink' href='../../src/tantivy/directory/ram_directory.rs.html#157-159' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Reads the full content file that has been written using atomic_write. <a href="../../tantivy/directory/trait.Directory.html#tymethod.atomic_read">Read more</a></p>
|
||||
</div><h4 id='method.atomic_write' class="method hidden"><code id='atomic_write.v'>fn <a href='../../tantivy/directory/trait.Directory.html#tymethod.atomic_write' class='fnname'>atomic_write</a>(&mut self, path: &<a class="struct" href="https://doc.rust-lang.org/nightly/std/path/struct.Path.html" title="struct std::path::Path">Path</a>, data: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&[</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="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></code><a class='srclink' href='../../src/tantivy/directory/ram_directory.rs.html#161-178' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Atomically replace the content of a file with data. <a href="../../tantivy/directory/trait.Directory.html#tymethod.atomic_write">Read more</a></p>
|
||||
</div><h4 id='method.watch' class="method hidden"><code id='watch.v'>fn <a href='../../tantivy/directory/trait.Directory.html#tymethod.watch' class='fnname'>watch</a>(&self, watch_callback: <a class="type" href="../../tantivy/directory/type.WatchCallback.html" title="type tantivy::directory::WatchCallback">WatchCallback</a>) -> <a class="struct" href="../../tantivy/directory/struct.WatchHandle.html" title="struct tantivy::directory::WatchHandle">WatchHandle</a></code><a class='srclink' href='../../src/tantivy/directory/ram_directory.rs.html#180-182' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Registers a callback that will be called whenever a change on the <code>meta.json</code> using the <code>atomic_write</code> API is detected. <a href="../../tantivy/directory/trait.Directory.html#tymethod.watch">Read more</a></p>
|
||||
</div><h2 id='methods' class='small-section-header'>Methods<a href='#methods' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl <a class="struct" href="../../tantivy/directory/struct.RAMDirectory.html" title="struct tantivy::directory::RAMDirectory">RAMDirectory</a></code><a href='#impl' class='anchor'></a><a class='srclink' href='../../src/tantivy/directory/ram_directory.rs.html#128-139' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.create' class="method"><code id='create.v'>pub fn <a href='#method.create' class='fnname'>create</a>() -> <a class="struct" href="../../tantivy/directory/struct.RAMDirectory.html" title="struct tantivy::directory::RAMDirectory">RAMDirectory</a></code><a class='srclink' href='../../src/tantivy/directory/ram_directory.rs.html#130-132' title='goto source code'>[src]</a></h4><div class='docblock'><p>Constructor</p>
|
||||
</div><h4 id='method.total_mem_usage' class="method"><code id='total_mem_usage.v'>pub fn <a href='#method.total_mem_usage' class='fnname'>total_mem_usage</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code><a class='srclink' href='../../src/tantivy/directory/ram_directory.rs.html#136-138' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns the sum of the size of the different files
|
||||
in the RAMDirectory.</p>
|
||||
</div></div><h2 id='implementations' class='small-section-header'>Trait Implementations<a href='#implementations' class='anchor'></a></h2><div id='implementations-list'><h3 id='impl-Directory' class='impl'><code class='in-band'>impl <a class="trait" href="../../tantivy/directory/trait.Directory.html" title="trait tantivy::directory::Directory">Directory</a> for <a class="struct" href="../../tantivy/directory/struct.RAMDirectory.html" title="struct tantivy::directory::RAMDirectory">RAMDirectory</a></code><a href='#impl-Directory' class='anchor'></a><a class='srclink' href='../../src/tantivy/directory/ram_directory.rs.html#141-193' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.open_read' class="method hidden"><code id='open_read.v'>fn <a href='../../tantivy/directory/trait.Directory.html#tymethod.open_read' class='fnname'>open_read</a>(&self, path: &<a class="struct" href="https://doc.rust-lang.org/nightly/std/path/struct.Path.html" title="struct std::path::Path">Path</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="../../tantivy/directory/struct.ReadOnlySource.html" title="struct tantivy::directory::ReadOnlySource">ReadOnlySource</a>, <a class="enum" href="../../tantivy/directory/error/enum.OpenReadError.html" title="enum tantivy::directory::error::OpenReadError">OpenReadError</a>></code><a class='srclink' href='../../src/tantivy/directory/ram_directory.rs.html#142-144' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Opens a virtual file for read. <a href="../../tantivy/directory/trait.Directory.html#tymethod.open_read">Read more</a></p>
|
||||
</div><h4 id='method.delete' class="method hidden"><code id='delete.v'>fn <a href='../../tantivy/directory/trait.Directory.html#tymethod.delete' class='fnname'>delete</a>(&self, path: &<a class="struct" href="https://doc.rust-lang.org/nightly/std/path/struct.Path.html" title="struct std::path::Path">Path</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, <a class="enum" href="../../tantivy/directory/error/enum.DeleteError.html" title="enum tantivy::directory::error::DeleteError">DeleteError</a>></code><a class='srclink' href='../../src/tantivy/directory/ram_directory.rs.html#146-148' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Removes a file <a href="../../tantivy/directory/trait.Directory.html#tymethod.delete">Read more</a></p>
|
||||
</div><h4 id='method.exists' class="method hidden"><code id='exists.v'>fn <a href='../../tantivy/directory/trait.Directory.html#tymethod.exists' class='fnname'>exists</a>(&self, path: &<a class="struct" href="https://doc.rust-lang.org/nightly/std/path/struct.Path.html" title="struct std::path::Path">Path</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code><a class='srclink' href='../../src/tantivy/directory/ram_directory.rs.html#150-152' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns true iff the file exists</p>
|
||||
</div><h4 id='method.open_write' class="method hidden"><code id='open_write.v'>fn <a href='../../tantivy/directory/trait.Directory.html#tymethod.open_write' class='fnname'>open_write</a>(&mut self, path: &<a class="struct" href="https://doc.rust-lang.org/nightly/std/path/struct.Path.html" title="struct std::path::Path">Path</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="type" href="../../tantivy/directory/type.WritePtr.html" title="type tantivy::directory::WritePtr">WritePtr</a>, <a class="enum" href="../../tantivy/directory/error/enum.OpenWriteError.html" title="enum tantivy::directory::error::OpenWriteError">OpenWriteError</a>></code><a class='srclink' href='../../src/tantivy/directory/ram_directory.rs.html#154-165' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Opens a writer for the virtual file associated with a Path. <a href="../../tantivy/directory/trait.Directory.html#tymethod.open_write">Read more</a></p>
|
||||
</div><h4 id='method.atomic_read' class="method hidden"><code id='atomic_read.v'>fn <a href='../../tantivy/directory/trait.Directory.html#tymethod.atomic_read' class='fnname'>atomic_read</a>(&self, path: &<a class="struct" href="https://doc.rust-lang.org/nightly/std/path/struct.Path.html" title="struct std::path::Path">Path</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>>, <a class="enum" href="../../tantivy/directory/error/enum.OpenReadError.html" title="enum tantivy::directory::error::OpenReadError">OpenReadError</a>></code><a class='srclink' href='../../src/tantivy/directory/ram_directory.rs.html#167-169' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Reads the full content file that has been written using atomic_write. <a href="../../tantivy/directory/trait.Directory.html#tymethod.atomic_read">Read more</a></p>
|
||||
</div><h4 id='method.atomic_write' class="method hidden"><code id='atomic_write.v'>fn <a href='../../tantivy/directory/trait.Directory.html#tymethod.atomic_write' class='fnname'>atomic_write</a>(&mut self, path: &<a class="struct" href="https://doc.rust-lang.org/nightly/std/path/struct.Path.html" title="struct std::path::Path">Path</a>, data: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&[</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="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></code><a class='srclink' href='../../src/tantivy/directory/ram_directory.rs.html#171-188' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Atomically replace the content of a file with data. <a href="../../tantivy/directory/trait.Directory.html#tymethod.atomic_write">Read more</a></p>
|
||||
</div><h4 id='method.watch' class="method hidden"><code id='watch.v'>fn <a href='../../tantivy/directory/trait.Directory.html#tymethod.watch' class='fnname'>watch</a>(&self, watch_callback: <a class="type" href="../../tantivy/directory/type.WatchCallback.html" title="type tantivy::directory::WatchCallback">WatchCallback</a>) -> <a class="struct" href="../../tantivy/directory/struct.WatchHandle.html" title="struct tantivy::directory::WatchHandle">WatchHandle</a></code><a class='srclink' href='../../src/tantivy/directory/ram_directory.rs.html#190-192' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Registers a callback that will be called whenever a change on the <code>meta.json</code> using the <code>atomic_write</code> API is detected. <a href="../../tantivy/directory/trait.Directory.html#tymethod.watch">Read more</a></p>
|
||||
</div><h4 id='method.acquire_lock' class="method"><code id='acquire_lock.v'>fn <a href='../../tantivy/directory/trait.Directory.html#method.acquire_lock' class='fnname'>acquire_lock</a>(&self, lock: &<a class="struct" href="../../tantivy/directory/struct.Lock.html" title="struct tantivy::directory::Lock">Lock</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="struct" href="../../tantivy/directory/struct.DirectoryLock.html" title="struct tantivy::directory::DirectoryLock">DirectoryLock</a>, <a class="enum" href="../../tantivy/directory/error/enum.LockError.html" title="enum tantivy::directory::error::LockError">LockError</a>></code><a class='srclink' href='../../src/tantivy/directory/directory.rs.html#173-191' title='goto source code'>[src]</a></h4><div class='docblock'><p>Acquire a lock in the given directory. <a href="../../tantivy/directory/trait.Directory.html#method.acquire_lock">Read more</a></p>
|
||||
</div></div><h3 id='impl-Clone' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="../../tantivy/directory/struct.RAMDirectory.html" title="struct tantivy::directory::RAMDirectory">RAMDirectory</a></code><a href='#impl-Clone' class='anchor'></a><a class='srclink' href='../../src/tantivy/directory/ram_directory.rs.html#119' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.clone' class="method hidden"><code id='clone.v'>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&self) -> <a class="struct" href="../../tantivy/directory/struct.RAMDirectory.html" title="struct tantivy::directory::RAMDirectory">RAMDirectory</a></code><a class='srclink' href='../../src/tantivy/directory/ram_directory.rs.html#119' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
|
||||
</div></div><h3 id='impl-Clone' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="../../tantivy/directory/struct.RAMDirectory.html" title="struct tantivy::directory::RAMDirectory">RAMDirectory</a></code><a href='#impl-Clone' class='anchor'></a><a class='srclink' href='../../src/tantivy/directory/ram_directory.rs.html#123' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.clone' class="method hidden"><code id='clone.v'>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&self) -> <a class="struct" href="../../tantivy/directory/struct.RAMDirectory.html" title="struct tantivy::directory::RAMDirectory">RAMDirectory</a></code><a class='srclink' href='../../src/tantivy/directory/ram_directory.rs.html#123' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
|
||||
</div><h4 id='method.clone_from' class="method"><code id='clone_from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>Self)</code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/clone.rs.html#131-133' title='goto source code'>[src]</a></h4><div class='docblock'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
|
||||
</div></div><h3 id='impl-Default' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a> for <a class="struct" href="../../tantivy/directory/struct.RAMDirectory.html" title="struct tantivy::directory::RAMDirectory">RAMDirectory</a></code><a href='#impl-Default' class='anchor'></a><a class='srclink' href='../../src/tantivy/directory/ram_directory.rs.html#119' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.default' class="method hidden"><code id='default.v'>fn <a href='https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default' class='fnname'>default</a>() -> <a class="struct" href="../../tantivy/directory/struct.RAMDirectory.html" title="struct tantivy::directory::RAMDirectory">RAMDirectory</a></code><a class='srclink' href='../../src/tantivy/directory/ram_directory.rs.html#119' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns the "default value" for a type. <a href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default">Read more</a></p>
|
||||
</div></div><h3 id='impl-Debug' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../../tantivy/directory/struct.RAMDirectory.html" title="struct tantivy::directory::RAMDirectory">RAMDirectory</a></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../../src/tantivy/directory/ram_directory.rs.html#108-112' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code id='fmt.v'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../../src/tantivy/directory/ram_directory.rs.html#109-111' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
|
||||
</div></div><h3 id='impl-Default' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a> for <a class="struct" href="../../tantivy/directory/struct.RAMDirectory.html" title="struct tantivy::directory::RAMDirectory">RAMDirectory</a></code><a href='#impl-Default' class='anchor'></a><a class='srclink' href='../../src/tantivy/directory/ram_directory.rs.html#123' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.default' class="method hidden"><code id='default.v'>fn <a href='https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default' class='fnname'>default</a>() -> <a class="struct" href="../../tantivy/directory/struct.RAMDirectory.html" title="struct tantivy::directory::RAMDirectory">RAMDirectory</a></code><a class='srclink' href='../../src/tantivy/directory/ram_directory.rs.html#123' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Returns the "default value" for a type. <a href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default">Read more</a></p>
|
||||
</div></div><h3 id='impl-Debug' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../../tantivy/directory/struct.RAMDirectory.html" title="struct tantivy::directory::RAMDirectory">RAMDirectory</a></code><a href='#impl-Debug' class='anchor'></a><a class='srclink' href='../../src/tantivy/directory/ram_directory.rs.html#112-116' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.fmt' class="method hidden"><code id='fmt.v'>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&self, f: &mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -> <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code><a class='srclink' href='../../src/tantivy/directory/ram_directory.rs.html#113-115' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
|
||||
</div></div></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'><h3 id='impl-Send' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../../tantivy/directory/struct.RAMDirectory.html" title="struct tantivy::directory::RAMDirectory">RAMDirectory</a></code><a href='#impl-Send' class='anchor'></a></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><code class='in-band'>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../../tantivy/directory/struct.RAMDirectory.html" title="struct tantivy::directory::RAMDirectory">RAMDirectory</a></code><a href='#impl-Sync' class='anchor'></a></h3><div class='impl-items'></div></div><h2 id='blanket-implementations' class='small-section-header'>Blanket Implementations<a href='#blanket-implementations' class='anchor'></a></h2><div id='blanket-implementations-list'><h3 id='impl-Fruit' class='impl'><code class='in-band'>impl<T> <a class="trait" href="../../tantivy/collector/trait.Fruit.html" title="trait tantivy::collector::Fruit">Fruit</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + <a class="trait" href="../../downcast_rs/trait.Downcast.html" title="trait downcast_rs::Downcast">Downcast</a>, </span></code><a href='#impl-Fruit' class='anchor'></a><a class='srclink' href='../../src/tantivy/collector/mod.rs.html#116' title='goto source code'>[src]</a></h3><div class='impl-items'></div><h3 id='impl-From' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a> for T</code><a href='#impl-From' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#546-548' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.from' class="method hidden"><code id='from.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(t: T) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#547' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||||
</div></div><h3 id='impl-Into' class='impl'><code class='in-band'>impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></code><a href='#impl-Into' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#537-542' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.into' class="method hidden"><code id='into.v'>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into' class='fnname'>into</a>(self) -> U</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/convert.rs.html#539-541' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Performs the conversion.</p>
|
||||
</div></div><h3 id='impl-ToOwned' class='impl'><code class='in-band'>impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html" title="trait alloc::borrow::ToOwned">ToOwned</a> for T <span class="where fmt-newline">where<br> T: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, </span></code><a href='#impl-ToOwned' class='anchor'></a><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#80-91' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='associatedtype.Owned' class="type"><code id='Owned.t'>type <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#associatedtype.Owned' class="type">Owned</a> = T</code></h4><h4 id='method.to_owned' class="method hidden"><code id='to_owned.v'>fn <a href='https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned' class='fnname'>to_owned</a>(&self) -> T</code><a class='srclink' href='https://doc.rust-lang.org/nightly/src/alloc/borrow.rs.html#84-86' title='goto source code'>[src]</a></h4><div class='docblock hidden'><p>Creates owned data from borrowed data, usually by cloning. <a href="https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned">Read more</a></p>
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -3,18 +3,19 @@
|
||||
indexing queue.
|
||||
Each indexing thread builds its own independent <code>Segment</code>, via
|
||||
a <code>SegmentWriter</code> object.</p>
|
||||
</div><h2 id='methods' class='small-section-header'>Methods<a href='#methods' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl <a class="struct" href="../tantivy/struct.IndexWriter.html" title="struct tantivy::IndexWriter">IndexWriter</a></code><a href='#impl' class='anchor'></a><a class='srclink' href='../src/tantivy/indexer/index_writer.rs.html#334-768' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.wait_merging_threads' class="method"><code id='wait_merging_threads.v'>pub fn <a href='#method.wait_merging_threads' class='fnname'>wait_merging_threads</a>(self) -> <a class="type" href="../tantivy/type.Result.html" title="type tantivy::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></code><a class='srclink' href='../src/tantivy/indexer/index_writer.rs.html#336-362' title='goto source code'>[src]</a></h4><div class='docblock'><p>The index writer</p>
|
||||
</div><h4 id='method.new_segment' class="method"><code id='new_segment.v'>pub fn <a href='#method.new_segment' class='fnname'>new_segment</a>(&self) -> <a class="struct" href="../tantivy/struct.Segment.html" title="struct tantivy::Segment">Segment</a></code><a class='srclink' href='../src/tantivy/indexer/index_writer.rs.html#380-382' title='goto source code'>[src]</a></h4><div class='docblock'><p>Creates a new segment.</p>
|
||||
</div><h2 id='methods' class='small-section-header'>Methods<a href='#methods' class='anchor'></a></h2><h3 id='impl' class='impl'><code class='in-band'>impl <a class="struct" href="../tantivy/struct.IndexWriter.html" title="struct tantivy::IndexWriter">IndexWriter</a></code><a href='#impl' class='anchor'></a><a class='srclink' href='../src/tantivy/indexer/index_writer.rs.html#334-769' title='goto source code'>[src]</a></h3><div class='impl-items'><h4 id='method.wait_merging_threads' class="method"><code id='wait_merging_threads.v'>pub fn <a href='#method.wait_merging_threads' class='fnname'>wait_merging_threads</a>(self) -> <a class="type" href="../tantivy/type.Result.html" title="type tantivy::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></code><a class='srclink' href='../src/tantivy/indexer/index_writer.rs.html#337-363' title='goto source code'>[src]</a></h4><div class='docblock'><p>If there are some merging threads, blocks until they all finish their work and
|
||||
then drop the <code>IndexWriter</code>.</p>
|
||||
</div><h4 id='method.new_segment' class="method"><code id='new_segment.v'>pub fn <a href='#method.new_segment' class='fnname'>new_segment</a>(&self) -> <a class="struct" href="../tantivy/struct.Segment.html" title="struct tantivy::Segment">Segment</a></code><a class='srclink' href='../src/tantivy/indexer/index_writer.rs.html#381-383' title='goto source code'>[src]</a></h4><div class='docblock'><p>Creates a new segment.</p>
|
||||
<p>This method is useful only for users trying to do complex
|
||||
operations, like converting an index format to another.</p>
|
||||
<p>It is safe to start writing file associated to the new <code>Segment</code>.
|
||||
These will not be garbage collected as long as an instance object of
|
||||
<code>SegmentMeta</code> object associated to the new <code>Segment</code> is "alive".</p>
|
||||
</div><h4 id='method.get_merge_policy' class="method"><code id='get_merge_policy.v'>pub fn <a href='#method.get_merge_policy' class='fnname'>get_merge_policy</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><dyn <a class="trait" href="../tantivy/merge_policy/trait.MergePolicy.html" title="trait tantivy::merge_policy::MergePolicy">MergePolicy</a>>></code><a class='srclink' href='../src/tantivy/indexer/index_writer.rs.html#442-444' title='goto source code'>[src]</a></h4><div class='docblock'><p>Accessor to the merge policy.</p>
|
||||
</div><h4 id='method.set_merge_policy' class="method"><code id='set_merge_policy.v'>pub fn <a href='#method.set_merge_policy' class='fnname'>set_merge_policy</a>(&self, merge_policy: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><dyn <a class="trait" href="../tantivy/merge_policy/trait.MergePolicy.html" title="trait tantivy::merge_policy::MergePolicy">MergePolicy</a>>)</code><a class='srclink' href='../src/tantivy/indexer/index_writer.rs.html#447-449' title='goto source code'>[src]</a></h4><div class='docblock'><p>Set the merge policy.</p>
|
||||
</div><h4 id='method.garbage_collect_files' class="method"><code id='garbage_collect_files.v'>pub fn <a href='#method.garbage_collect_files' class='fnname'>garbage_collect_files</a>(&mut self) -> <a class="type" href="../tantivy/type.Result.html" title="type tantivy::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></code><a class='srclink' href='../src/tantivy/indexer/index_writer.rs.html#460-462' title='goto source code'>[src]</a></h4><div class='docblock'><p>Detects and removes the files that
|
||||
</div><h4 id='method.get_merge_policy' class="method"><code id='get_merge_policy.v'>pub fn <a href='#method.get_merge_policy' class='fnname'>get_merge_policy</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><dyn <a class="trait" href="../tantivy/merge_policy/trait.MergePolicy.html" title="trait tantivy::merge_policy::MergePolicy">MergePolicy</a>>></code><a class='srclink' href='../src/tantivy/indexer/index_writer.rs.html#443-445' title='goto source code'>[src]</a></h4><div class='docblock'><p>Accessor to the merge policy.</p>
|
||||
</div><h4 id='method.set_merge_policy' class="method"><code id='set_merge_policy.v'>pub fn <a href='#method.set_merge_policy' class='fnname'>set_merge_policy</a>(&self, merge_policy: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><dyn <a class="trait" href="../tantivy/merge_policy/trait.MergePolicy.html" title="trait tantivy::merge_policy::MergePolicy">MergePolicy</a>>)</code><a class='srclink' href='../src/tantivy/indexer/index_writer.rs.html#448-450' title='goto source code'>[src]</a></h4><div class='docblock'><p>Set the merge policy.</p>
|
||||
</div><h4 id='method.garbage_collect_files' class="method"><code id='garbage_collect_files.v'>pub fn <a href='#method.garbage_collect_files' class='fnname'>garbage_collect_files</a>(&mut self) -> <a class="type" href="../tantivy/type.Result.html" title="type tantivy::Result">Result</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>></code><a class='srclink' href='../src/tantivy/indexer/index_writer.rs.html#461-463' title='goto source code'>[src]</a></h4><div class='docblock'><p>Detects and removes the files that
|
||||
are not used by the index anymore.</p>
|
||||
</div><h4 id='method.delete_all_documents' class="method"><code id='delete_all_documents.v'>pub fn <a href='#method.delete_all_documents' class='fnname'>delete_all_documents</a>(&mut self) -> <a class="type" href="../tantivy/type.Result.html" title="type tantivy::Result">Result</a><<a class="type" href="../tantivy/type.Opstamp.html" title="type tantivy::Opstamp">Opstamp</a>></code><a class='srclink' href='../src/tantivy/indexer/index_writer.rs.html#502-508' title='goto source code'>[src]</a></h4><div class='docblock'><p>Deletes all documents from the index</p>
|
||||
</div><h4 id='method.delete_all_documents' class="method"><code id='delete_all_documents.v'>pub fn <a href='#method.delete_all_documents' class='fnname'>delete_all_documents</a>(&mut self) -> <a class="type" href="../tantivy/type.Result.html" title="type tantivy::Result">Result</a><<a class="type" href="../tantivy/type.Opstamp.html" title="type tantivy::Opstamp">Opstamp</a>></code><a class='srclink' href='../src/tantivy/indexer/index_writer.rs.html#503-509' title='goto source code'>[src]</a></h4><div class='docblock'><p>Deletes all documents from the index</p>
|
||||
<p>Requires <code>commit</code>ing
|
||||
Enables users to rebuild the index,
|
||||
by clearing and resubmitting necessary documents</p>
|
||||
@@ -50,15 +51,15 @@ by clearing and resubmitting necessary documents</p>
|
||||
<span class="macro">assert</span><span class="macro">!</span>(<span class="ident">top_docs_promo</span>.<span class="ident">is_empty</span>());
|
||||
<span class="prelude-val">Ok</span>(())
|
||||
}</pre></div>
|
||||
</div><h4 id='method.merge' class="method"><code id='merge.v'>pub fn <a href='#method.merge' class='fnname'>merge</a>(<br> &mut self, <br> segment_ids: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&[</a><a class="struct" href="../tantivy/struct.SegmentId.html" title="struct tantivy::SegmentId">SegmentId</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a><br>) -> <a class="type" href="../tantivy/type.Result.html" title="type tantivy::Result">Result</a><impl <a class="trait" href="../futures/future/trait.Future.html" title="trait futures::future::Future">Future</a><Item = <a class="struct" href="../tantivy/struct.SegmentMeta.html" title="struct tantivy::SegmentMeta">SegmentMeta</a>, Error = <a class="struct" href="../futures/sync/oneshot/struct.Canceled.html" title="struct futures::sync::oneshot::Canceled">Canceled</a>>></code><a class='srclink' href='../src/tantivy/indexer/index_writer.rs.html#513-518' title='goto source code'>[src]</a></h4><div class='docblock'><p>Merges a given list of segments</p>
|
||||
</div><h4 id='method.merge' class="method"><code id='merge.v'>pub fn <a href='#method.merge' class='fnname'>merge</a>(<br> &mut self, <br> segment_ids: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&[</a><a class="struct" href="../tantivy/struct.SegmentId.html" title="struct tantivy::SegmentId">SegmentId</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a><br>) -> <a class="type" href="../tantivy/type.Result.html" title="type tantivy::Result">Result</a><impl <a class="trait" href="../futures/future/trait.Future.html" title="trait futures::future::Future">Future</a><Item = <a class="struct" href="../tantivy/struct.SegmentMeta.html" title="struct tantivy::SegmentMeta">SegmentMeta</a>, Error = <a class="struct" href="../futures/sync/oneshot/struct.Canceled.html" title="struct futures::sync::oneshot::Canceled">Canceled</a>>></code><a class='srclink' href='../src/tantivy/indexer/index_writer.rs.html#514-519' title='goto source code'>[src]</a></h4><div class='docblock'><p>Merges a given list of segments</p>
|
||||
<p><code>segment_ids</code> is required to be non-empty.</p>
|
||||
</div><h4 id='method.rollback' class="method"><code id='rollback.v'>pub fn <a href='#method.rollback' class='fnname'>rollback</a>(&mut self) -> <a class="type" href="../tantivy/type.Result.html" title="type tantivy::Result">Result</a><<a class="type" href="../tantivy/type.Opstamp.html" title="type tantivy::Opstamp">Opstamp</a>></code><a class='srclink' href='../src/tantivy/indexer/index_writer.rs.html#543-546' title='goto source code'>[src]</a></h4><div class='docblock'><p>Rollback to the last commit</p>
|
||||
</div><h4 id='method.rollback' class="method"><code id='rollback.v'>pub fn <a href='#method.rollback' class='fnname'>rollback</a>(&mut self) -> <a class="type" href="../tantivy/type.Result.html" title="type tantivy::Result">Result</a><<a class="type" href="../tantivy/type.Opstamp.html" title="type tantivy::Opstamp">Opstamp</a>></code><a class='srclink' href='../src/tantivy/indexer/index_writer.rs.html#544-547' title='goto source code'>[src]</a></h4><div class='docblock'><p>Rollback to the last commit</p>
|
||||
<p>This cancels all of the updates that
|
||||
happened after the last commit.
|
||||
After calling rollback, the index is in the same
|
||||
state as it was after the last commit.</p>
|
||||
<p>The opstamp at the last commit is returned.</p>
|
||||
</div><h4 id='method.prepare_commit' class="method"><code id='prepare_commit.v'>pub fn <a href='#method.prepare_commit' class='fnname'>prepare_commit</a>(&mut self) -> <a class="type" href="../tantivy/type.Result.html" title="type tantivy::Result">Result</a><PreparedCommit></code><a class='srclink' href='../src/tantivy/indexer/index_writer.rs.html#605-637' title='goto source code'>[src]</a></h4><div class='docblock'><p>Prepares a commit.</p>
|
||||
</div><h4 id='method.prepare_commit' class="method"><code id='prepare_commit.v'>pub fn <a href='#method.prepare_commit' class='fnname'>prepare_commit</a>(&mut self) -> <a class="type" href="../tantivy/type.Result.html" title="type tantivy::Result">Result</a><PreparedCommit></code><a class='srclink' href='../src/tantivy/indexer/index_writer.rs.html#606-638' title='goto source code'>[src]</a></h4><div class='docblock'><p>Prepares a commit.</p>
|
||||
<p>Calling <code>prepare_commit()</code> will cut the indexing
|
||||
queue. All pending documents will be sent to the
|
||||
indexing workers. They will then terminate, regardless
|
||||
@@ -77,7 +78,7 @@ dropped.</p>
|
||||
<p>It is also possible to add a payload to the <code>commit</code>
|
||||
using this API.
|
||||
See <a href="PreparedCommit.html"><code>PreparedCommit::set_payload()</code></a></p>
|
||||
</div><h4 id='method.commit' class="method"><code id='commit.v'>pub fn <a href='#method.commit' class='fnname'>commit</a>(&mut self) -> <a class="type" href="../tantivy/type.Result.html" title="type tantivy::Result">Result</a><<a class="type" href="../tantivy/type.Opstamp.html" title="type tantivy::Opstamp">Opstamp</a>></code><a class='srclink' href='../src/tantivy/indexer/index_writer.rs.html#653-655' title='goto source code'>[src]</a></h4><div class='docblock'><p>Commits all of the pending changes</p>
|
||||
</div><h4 id='method.commit' class="method"><code id='commit.v'>pub fn <a href='#method.commit' class='fnname'>commit</a>(&mut self) -> <a class="type" href="../tantivy/type.Result.html" title="type tantivy::Result">Result</a><<a class="type" href="../tantivy/type.Opstamp.html" title="type tantivy::Opstamp">Opstamp</a>></code><a class='srclink' href='../src/tantivy/indexer/index_writer.rs.html#654-656' title='goto source code'>[src]</a></h4><div class='docblock'><p>Commits all of the pending changes</p>
|
||||
<p>A call to commit blocks.
|
||||
After it returns, all of the document that
|
||||
were added since the last commit are published
|
||||
@@ -87,25 +88,25 @@ long as the hard disk is spared), it will be possible
|
||||
to resume indexing from this point.</p>
|
||||
<p>Commit returns the <code>opstamp</code> of the last document
|
||||
that made it in the commit.</p>
|
||||
</div><h4 id='method.delete_term' class="method"><code id='delete_term.v'>pub fn <a href='#method.delete_term' class='fnname'>delete_term</a>(&self, term: <a class="struct" href="../tantivy/struct.Term.html" title="struct tantivy::Term">Term</a>) -> <a class="type" href="../tantivy/type.Opstamp.html" title="type tantivy::Opstamp">Opstamp</a></code><a class='srclink' href='../src/tantivy/indexer/index_writer.rs.html#669-674' title='goto source code'>[src]</a></h4><div class='docblock'><p>Delete all documents containing a given term.</p>
|
||||
</div><h4 id='method.delete_term' class="method"><code id='delete_term.v'>pub fn <a href='#method.delete_term' class='fnname'>delete_term</a>(&self, term: <a class="struct" href="../tantivy/struct.Term.html" title="struct tantivy::Term">Term</a>) -> <a class="type" href="../tantivy/type.Opstamp.html" title="type tantivy::Opstamp">Opstamp</a></code><a class='srclink' href='../src/tantivy/indexer/index_writer.rs.html#670-675' title='goto source code'>[src]</a></h4><div class='docblock'><p>Delete all documents containing a given term.</p>
|
||||
<p>Delete operation only affects documents that
|
||||
were added in previous commits, and documents
|
||||
that were added previously in the same commit.</p>
|
||||
<p>Like adds, the deletion itself will be visible
|
||||
only after calling <code>commit()</code>.</p>
|
||||
</div><h4 id='method.commit_opstamp' class="method"><code id='commit_opstamp.v'>pub fn <a href='#method.commit_opstamp' class='fnname'>commit_opstamp</a>(&self) -> <a class="type" href="../tantivy/type.Opstamp.html" title="type tantivy::Opstamp">Opstamp</a></code><a class='srclink' href='../src/tantivy/indexer/index_writer.rs.html#683-685' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns the opstamp of the last successful commit.</p>
|
||||
</div><h4 id='method.commit_opstamp' class="method"><code id='commit_opstamp.v'>pub fn <a href='#method.commit_opstamp' class='fnname'>commit_opstamp</a>(&self) -> <a class="type" href="../tantivy/type.Opstamp.html" title="type tantivy::Opstamp">Opstamp</a></code><a class='srclink' href='../src/tantivy/indexer/index_writer.rs.html#684-686' title='goto source code'>[src]</a></h4><div class='docblock'><p>Returns the opstamp of the last successful commit.</p>
|
||||
<p>This is, for instance, the opstamp the index will
|
||||
rollback to if there is a failure like a power surge.</p>
|
||||
<p>This is also the opstamp of the commit that is currently
|
||||
available for searchers.</p>
|
||||
</div><h4 id='method.add_document' class="method"><code id='add_document.v'>pub fn <a href='#method.add_document' class='fnname'>add_document</a>(&self, document: <a class="struct" href="../tantivy/struct.Document.html" title="struct tantivy::Document">Document</a>) -> <a class="type" href="../tantivy/type.Opstamp.html" title="type tantivy::Opstamp">Opstamp</a></code><a class='srclink' href='../src/tantivy/indexer/index_writer.rs.html#697-705' title='goto source code'>[src]</a></h4><div class='docblock'><p>Adds a document.</p>
|
||||
</div><h4 id='method.add_document' class="method"><code id='add_document.v'>pub fn <a href='#method.add_document' class='fnname'>add_document</a>(&self, document: <a class="struct" href="../tantivy/struct.Document.html" title="struct tantivy::Document">Document</a>) -> <a class="type" href="../tantivy/type.Opstamp.html" title="type tantivy::Opstamp">Opstamp</a></code><a class='srclink' href='../src/tantivy/indexer/index_writer.rs.html#698-706' title='goto source code'>[src]</a></h4><div class='docblock'><p>Adds a document.</p>
|
||||
<p>If the indexing pipeline is full, this call may block.</p>
|
||||
<p>The opstamp is an increasing <code>u64</code> that can
|
||||
be used by the client to align commits with its own
|
||||
document queue.</p>
|
||||
<p>Currently it represents the number of documents that
|
||||
have been added since the creation of the index.</p>
|
||||
</div><h4 id='method.run' class="method"><code id='run.v'>pub fn <a href='#method.run' class='fnname'>run</a>(&self, user_operations: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><UserOperation>) -> <a class="type" href="../tantivy/type.Opstamp.html" title="type tantivy::Opstamp">Opstamp</a></code><a class='srclink' href='../src/tantivy/indexer/index_writer.rs.html#740-767' title='goto source code'>[src]</a></h4><div class='docblock'><p>Runs a group of document operations ensuring that the operations are
|
||||
</div><h4 id='method.run' class="method"><code id='run.v'>pub fn <a href='#method.run' class='fnname'>run</a>(&self, user_operations: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><UserOperation>) -> <a class="type" href="../tantivy/type.Opstamp.html" title="type tantivy::Opstamp">Opstamp</a></code><a class='srclink' href='../src/tantivy/indexer/index_writer.rs.html#741-768' title='goto source code'>[src]</a></h4><div class='docblock'><p>Runs a group of document operations ensuring that the operations are
|
||||
assigned contigous u64 opstamps and that add operations of the same
|
||||
group are flushed into the same segment.</p>
|
||||
<p>If the indexing pipeline is full, this call may block.</p>
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user