Trait tantivy::directory::FileHandle[][src]

pub trait FileHandle: 'static + Send + Sync + HasLen {
    fn read_bytes(&self, from: usize, to: usize) -> Result<OwnedBytes>;
}

Objects that represents files sections in tantivy.

By contract, whatever happens to the directory file, as long as a FileHandle is alive, the data associated with it cannot be altered or destroyed.

The underlying behavior is therefore specific to the Directory that created it. Despite its name, a FileSlice may or may not directly map to an actual file on the filesystem.

Required methods

fn read_bytes(&self, from: usize, to: usize) -> Result<OwnedBytes>[src]

Reads a slice of bytes.

This method may panic if the range requested is invalid.

Loading content...

Implementations on Foreign Types

impl FileHandle for &'static [u8][src]

Loading content...

Implementors

impl FileHandle for FileSlice[src]

impl FileHandle for OwnedBytes[src]

Loading content...