mirror of
https://github.com/quickwit-oss/tantivy.git
synced 2026-01-14 21:12:54 +00:00
183 lines
16 KiB
HTML
183 lines
16 KiB
HTML
<!DOCTYPE html>
|
||
<html lang="en">
|
||
<head>
|
||
<meta charset="utf-8">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||
<meta name="generator" content="rustdoc">
|
||
<meta name="description" content="API documentation for the Rust `MmapView` struct in crate `memmap`.">
|
||
<meta name="keywords" content="rust, rustlang, rust-lang, MmapView">
|
||
|
||
<title>memmap::MmapView - Rust</title>
|
||
|
||
<link rel="stylesheet" type="text/css" href="../normalize.css">
|
||
<link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle">
|
||
|
||
<link rel="stylesheet" type="text/css" href="../dark.css">
|
||
<link rel="stylesheet" type="text/css" href="../main.css" id="themeStyle">
|
||
<script src="../storage.js"></script>
|
||
|
||
|
||
|
||
|
||
</head>
|
||
<body class="rustdoc struct">
|
||
<!--[if lte IE 8]>
|
||
<div class="warning">
|
||
This old browser is unsupported and will most likely display funky
|
||
things.
|
||
</div>
|
||
<![endif]-->
|
||
|
||
|
||
|
||
<nav class="sidebar">
|
||
<div class="sidebar-menu">☰</div>
|
||
|
||
<p class='location'>Struct MmapView</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#methods">Methods</a><div class="sidebar-links"><a href="#method.split_at">split_at</a><a href="#method.restrict">restrict</a><a href="#method.flush">flush</a><a href="#method.flush_async">flush_async</a><a href="#method.len">len</a><a href="#method.ptr">ptr</a><a href="#method.mut_ptr">mut_ptr</a><a href="#method.as_slice">as_slice</a><a href="#method.as_mut_slice">as_mut_slice</a><a href="#method.clone">clone</a></div><a class="sidebar-title" href="#implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Debug">Debug</a></div></div><p class='location'><a href='index.html'>memmap</a></p><script>window.sidebarCurrent = {name: 'MmapView', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div>
|
||
</nav>
|
||
|
||
<div class="theme-picker">
|
||
<button id="theme-picker" aria-label="Pick another theme!">
|
||
<img src="../brush.svg" width="18" alt="Pick another theme!">
|
||
</button>
|
||
<div id="theme-choices"></div>
|
||
</div>
|
||
<script src="../theme.js"></script>
|
||
<nav class="sub">
|
||
<form class="search-form js-only">
|
||
<div class="search-container">
|
||
<input class="search-input" name="search"
|
||
autocomplete="off"
|
||
placeholder="Click or press ‘S’ to search, ‘?’ for more options…"
|
||
type="search">
|
||
</div>
|
||
</form>
|
||
</nav>
|
||
|
||
<section id='main' class="content">
|
||
<h1 class='fqn'><span class='in-band'>Struct <a href='index.html'>memmap</a>::<wbr><a class="struct" href=''>MmapView</a></span><span class='out-of-band'><span id='render-detail'>
|
||
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
|
||
[<span class='inner'>−</span>]
|
||
</a>
|
||
</span><a class='srclink' href='../src/memmap/lib.rs.html#275-279' title='goto source code'>[src]</a></span></h1>
|
||
<pre class='rust struct'>pub struct MmapView { /* fields omitted */ }</pre><div class='docblock'><p>A view of a memory map.</p>
|
||
<p>The view may be split into disjoint ranges, each of which will share the
|
||
underlying memory map.</p>
|
||
</div>
|
||
<h2 id='methods' class='small-section-header'>
|
||
Methods<a href='#methods' class='anchor'></a>
|
||
</h2>
|
||
<h3 id='impl' class='impl'><span class='in-band'><code>impl <a class="struct" href="../memmap/struct.MmapView.html" title="struct memmap::MmapView">MmapView</a></code><a href='#impl' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/memmap/lib.rs.html#281-405' title='goto source code'>[src]</a></span></h3>
|
||
<div class='impl-items'><h4 id='method.split_at' class="method"><span id='split_at.v' class='invisible'><code>pub fn <a href='#method.split_at' class='fnname'>split_at</a>(self, offset: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</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.tuple.html">(</a><a class="struct" href="../memmap/struct.MmapView.html" title="struct memmap::MmapView">MmapView</a>, <a class="struct" href="../memmap/struct.MmapView.html" title="struct memmap::MmapView">MmapView</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/memmap/lib.rs.html#286-298' title='goto source code'>[src]</a></span></h4>
|
||
<div class='docblock'><p>Split the view into disjoint pieces at the specified offset.</p>
|
||
<p>The provided offset must be less than the view's length.</p>
|
||
</div><h4 id='method.restrict' class="method"><span id='restrict.v' class='invisible'><code>pub fn <a href='#method.restrict' class='fnname'>restrict</a>(&mut self, offset: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a>, len: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</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></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/memmap/lib.rs.html#304-313' title='goto source code'>[src]</a></span></h4>
|
||
<div class='docblock'><p>Restricts the range of the view to the provided offset and length.</p>
|
||
<p>The provided range must be a subset of the current range
|
||
(<code>offset + len < view.len()</code>).</p>
|
||
</div><h4 id='method.flush' class="method"><span id='flush.v' class='invisible'><code>pub fn <a href='#method.flush' class='fnname'>flush</a>(&self) -> <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></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/memmap/lib.rs.html#341-343' title='goto source code'>[src]</a></span></h4>
|
||
<div class='docblock'><p>Flushes outstanding view modifications to disk.</p>
|
||
<p>When this returns with a non-error result, all outstanding changes to a
|
||
file-backed memory map view are guaranteed to be durably stored. The
|
||
file's metadata (including last modification timestamp) may not be
|
||
updated.</p>
|
||
</div><h4 id='method.flush_async' class="method"><span id='flush_async.v' class='invisible'><code>pub fn <a href='#method.flush_async' class='fnname'>flush_async</a>(&self) -> <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></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/memmap/lib.rs.html#351-353' title='goto source code'>[src]</a></span></h4>
|
||
<div class='docblock'><p>Asynchronously flushes outstanding memory map view modifications to
|
||
disk.</p>
|
||
<p>This method initiates flushing modified pages to durable storage, but it
|
||
will not wait for the operation to complete before returning. The file's
|
||
metadata (including last modification timestamp) may not be updated.</p>
|
||
</div><h4 id='method.len' class="method"><span id='len.v' class='invisible'><code>pub fn <a href='#method.len' class='fnname'>len</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/memmap/lib.rs.html#356-358' title='goto source code'>[src]</a></span></h4>
|
||
<div class='docblock'><p>Returns the length of the memory map view.</p>
|
||
</div><h4 id='method.ptr' class="method"><span id='ptr.v' class='invisible'><code>pub fn <a href='#method.ptr' class='fnname'>ptr</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.pointer.html">*const </a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/memmap/lib.rs.html#364-366' title='goto source code'>[src]</a></span></h4>
|
||
<div class='docblock'><p>Returns a shared pointer to the mapped memory.</p>
|
||
<p>See <code>Mmap::as_slice</code> for invariants that must hold when dereferencing
|
||
the pointer.</p>
|
||
</div><h4 id='method.mut_ptr' class="method"><span id='mut_ptr.v' class='invisible'><code>pub fn <a href='#method.mut_ptr' class='fnname'>mut_ptr</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.pointer.html">*mut </a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/memmap/lib.rs.html#372-374' title='goto source code'>[src]</a></span></h4>
|
||
<div class='docblock'><p>Returns a mutable pointer to the mapped memory.</p>
|
||
<p>See <code>Mmap::as_mut_slice</code> for invariants that must hold when
|
||
dereferencing the pointer.</p>
|
||
</div><h4 id='method.as_slice' class="method"><span id='as_slice.v' class='invisible'><code>pub unsafe fn <a href='#method.as_slice' class='fnname'>as_slice</a>(&self) -> <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></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/memmap/lib.rs.html#381-383' title='goto source code'>[src]</a></span></h4>
|
||
<div class='docblock'><p>Returns the memory mapped file as an immutable slice.</p>
|
||
<h2 id="unsafety" class="section-header"><a href="#unsafety">Unsafety</a></h2>
|
||
<p>The caller must ensure that the file is not concurrently modified.</p>
|
||
</div><h4 id='method.as_mut_slice' class="method"><span id='as_mut_slice.v' class='invisible'><code>pub unsafe fn <a href='#method.as_mut_slice' class='fnname'>as_mut_slice</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&mut [</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></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/memmap/lib.rs.html#390-392' title='goto source code'>[src]</a></span></h4>
|
||
<div class='docblock'><p>Returns the memory mapped file as a mutable slice.</p>
|
||
<h2 id="unsafety-1" class="section-header"><a href="#unsafety-1">Unsafety</a></h2>
|
||
<p>The caller must ensure that the file is not concurrently accessed.</p>
|
||
</div><h4 id='method.clone' class="method"><span id='clone.v' class='invisible'><code>pub unsafe fn <a href='#method.clone' class='fnname'>clone</a>(&self) -> <a class="struct" href="../memmap/struct.MmapView.html" title="struct memmap::MmapView">MmapView</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/memmap/lib.rs.html#398-404' title='goto source code'>[src]</a></span></h4>
|
||
<div class='docblock'><p>Clones the view of the memory map.</p>
|
||
<p>The underlying memory map is shared, and thus the caller must ensure that the memory
|
||
underlying the view is not illegally aliased.</p>
|
||
</div></div>
|
||
<h2 id='implementations' class='small-section-header'>
|
||
Trait Implementations<a href='#implementations' class='anchor'></a>
|
||
</h2>
|
||
<h3 id='impl-Debug' class='impl'><span class='in-band'><code>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="../memmap/struct.MmapView.html" title="struct memmap::MmapView">MmapView</a></code><a href='#impl-Debug' class='anchor'></a></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/memmap/lib.rs.html#407-412' title='goto source code'>[src]</a></span></h3>
|
||
<div class='impl-items'><h4 id='method.fmt' class="method"><span id='fmt.v' class='invisible'><code>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></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/memmap/lib.rs.html#408-411' title='goto source code'>[src]</a></span></h4>
|
||
<div class='docblock'><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></section>
|
||
<section id='search' class="content hidden"></section>
|
||
|
||
<section class="footer"></section>
|
||
|
||
<aside id="help" class="hidden">
|
||
<div>
|
||
<h1 class="hidden">Help</h1>
|
||
|
||
<div class="shortcuts">
|
||
<h2>Keyboard Shortcuts</h2>
|
||
|
||
<dl>
|
||
<dt><kbd>?</kbd></dt>
|
||
<dd>Show this help dialog</dd>
|
||
<dt><kbd>S</kbd></dt>
|
||
<dd>Focus the search field</dd>
|
||
<dt><kbd>↑</kbd></dt>
|
||
<dd>Move up in search results</dd>
|
||
<dt><kbd>↓</kbd></dt>
|
||
<dd>Move down in search results</dd>
|
||
<dt><kbd>↹</kbd></dt>
|
||
<dd>Switch tab</dd>
|
||
<dt><kbd>⏎</kbd></dt>
|
||
<dd>Go to active search result</dd>
|
||
<dt><kbd>+</kbd></dt>
|
||
<dd>Expand all sections</dd>
|
||
<dt><kbd>-</kbd></dt>
|
||
<dd>Collapse all sections</dd>
|
||
</dl>
|
||
</div>
|
||
|
||
<div class="infos">
|
||
<h2>Search Tricks</h2>
|
||
|
||
<p>
|
||
Prefix searches with a type followed by a colon (e.g.
|
||
<code>fn:</code>) to restrict the search to a given type.
|
||
</p>
|
||
|
||
<p>
|
||
Accepted types are: <code>fn</code>, <code>mod</code>,
|
||
<code>struct</code>, <code>enum</code>,
|
||
<code>trait</code>, <code>type</code>, <code>macro</code>,
|
||
and <code>const</code>.
|
||
</p>
|
||
|
||
<p>
|
||
Search functions by type signature (e.g.
|
||
<code>vec -> usize</code> or <code>* -> vec</code>)
|
||
</p>
|
||
</div>
|
||
</div>
|
||
</aside>
|
||
|
||
|
||
|
||
<script>
|
||
window.rootPath = "../";
|
||
window.currentCrate = "memmap";
|
||
</script>
|
||
<script src="../main.js"></script>
|
||
<script defer src="../search-index.js"></script>
|
||
</body>
|
||
</html> |