[][src]Struct tantivy::directory::MmapDirectory

pub struct MmapDirectory { /* fields omitted */ }

Directory storing data in files, read via mmap.

The Mmap object are cached to limit the system calls.

In the MmapDirectory, locks are implemented using the fs2 crate definition of locks.

On MacOS & linux, it relies on flock (aka BSD Lock). These locks solve most of the problems related to POSIX Locks, but may their contract may not be respected on NFS depending on the implementation.

On Windows the semantics are again different.

Methods

impl MmapDirectory[src]

pub fn create_from_tempdir() -> Result<MmapDirectory, OpenDirectoryError>[src]

Creates a new MmapDirectory in a temporary directory.

This is mostly useful to test the MmapDirectory itself. For your unit tests, prefer the RAMDirectory.

pub fn open<P: AsRef<Path>>(
    directory_path: P
) -> Result<MmapDirectory, OpenDirectoryError>
[src]

Opens a MmapDirectory in a directory.

Returns an error if the directory_path does not exist or if it is not a directory.

pub fn get_cache_info(&self) -> CacheInfo[src]

Returns some statistical information about the Mmap cache.

The MmapDirectory embeds a MmapDirectory to avoid multiplying the mmap system calls.

Trait Implementations

impl Directory for MmapDirectory[src]

fn delete(&self, path: &Path) -> Result<(), DeleteError>[src]

Any entry associated to the path in the mmap will be removed before the file is deleted.

impl Clone for MmapDirectory[src]

impl Debug for MmapDirectory[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Fruit for T where
    T: Send + Downcast
[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Erased for T[src]

impl<T> Downcast for T where
    T: Any
[src]