Trait tantivy_common::file_slice::FileHandle
source · pub trait FileHandle: 'static + Send + Sync + HasLen + Debug {
// Required method
fn read_bytes(&self, range: Range<usize>) -> Result<OwnedBytes>;
}
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§
sourcefn read_bytes(&self, range: Range<usize>) -> Result<OwnedBytes>
fn read_bytes(&self, range: Range<usize>) -> Result<OwnedBytes>
Reads a slice of bytes.
This method may panic if the range requested is invalid.