Trait tantivy::directory::FileHandle

source ·
pub trait FileHandle: 'static + Send + Sync + HasLen + Debug {
    // Required method
    fn read_bytes(&self, range: Range<usize>) -> Result<OwnedBytes, Error>;
}
Expand description

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§

source

fn read_bytes(&self, range: Range<usize>) -> Result<OwnedBytes, Error>

Reads a slice of bytes.

This method may panic if the range requested is invalid.

Implementations on Foreign Types§

source§

impl FileHandle for &'static [u8]

Implementors§