pub struct HotDirectory { /* private fields */ }Expand description
The hot directory accelerates a given directory, by placing a static cache in front of a directory.
The HotDirectory does not implement write operations. It has been
designed for quickwit in order to regroup all of the small random
read operations required to open an index.
All of these operations are gather into a single file called the
hotcache.
Implementations§
Source§impl HotDirectory
impl HotDirectory
Sourcepub fn open(
underlying: Box<dyn Directory>,
static_cache: StaticDirectoryCache,
) -> Result<HotDirectory>
pub fn open( underlying: Box<dyn Directory>, static_cache: StaticDirectoryCache, ) -> Result<HotDirectory>
Wraps an index, with a static cache serialized into hot_cache_bytes.
Trait Implementations§
Source§impl Clone for HotDirectory
impl Clone for HotDirectory
Source§fn clone(&self) -> HotDirectory
fn clone(&self) -> HotDirectory
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for HotDirectory
impl Debug for HotDirectory
Source§impl Directory for HotDirectory
impl Directory for HotDirectory
Source§fn get_file_handle(
&self,
path: &Path,
) -> Result<Arc<dyn FileHandle>, OpenReadError>
fn get_file_handle( &self, path: &Path, ) -> Result<Arc<dyn FileHandle>, OpenReadError>
Opens a file and returns a boxed
FileHandle. Read moreSource§fn exists(&self, path: &Path) -> Result<bool, OpenReadError>
fn exists(&self, path: &Path) -> Result<bool, OpenReadError>
Returns true if and only if the file exists
Source§fn atomic_read(&self, path: &Path) -> Result<Vec<u8>, OpenReadError>
fn atomic_read(&self, path: &Path) -> Result<Vec<u8>, OpenReadError>
Reads the full content file that has been written using
Directory::atomic_write(). Read moreSource§fn atomic_read_async<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 Path,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, OpenReadError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn atomic_read_async<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 Path,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, OpenReadError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Reads asynchronously the full content file that has been written using
Directory::atomic_write(). Read moreSource§fn acquire_lock(&self, lock: &Lock) -> Result<DirectoryLock, LockError>
fn acquire_lock(&self, lock: &Lock) -> Result<DirectoryLock, LockError>
Source§fn watch(&self, watch_callback: WatchCallback) -> Result<WatchHandle>
fn watch(&self, watch_callback: WatchCallback) -> Result<WatchHandle>
Registers a callback that will be called whenever a change on the
meta.json
using the Directory::atomic_write() API is detected. Read morefn as_any(&self) -> &dyn Any
fn underlying_directory(&self) -> Option<&dyn Directory>
fn real_directory(&self) -> &dyn Directory
Source§fn open_read(&self, path: &Path) -> Result<FileSlice, OpenReadError>
fn open_read(&self, path: &Path) -> Result<FileSlice, OpenReadError>
Once a virtual file is open, its data may not
change. Read more
fn open_read_async<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 Path,
) -> Pin<Box<dyn Future<Output = Result<FileSlice, OpenReadError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn delete_async<'life0, 'life1, 'async_trait>(
&'life0 self,
_: &'life1 Path,
) -> Pin<Box<dyn Future<Output = Result<(), DeleteError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Source§fn open_write(
&self,
_: &Path,
) -> Result<BufWriter<Box<dyn TerminatingWrite>>, OpenWriteError>
fn open_write( &self, _: &Path, ) -> Result<BufWriter<Box<dyn TerminatingWrite>>, OpenWriteError>
Auto Trait Implementations§
impl Freeze for HotDirectory
impl !RefUnwindSafe for HotDirectory
impl Send for HotDirectory
impl Sync for HotDirectory
impl Unpin for HotDirectory
impl !UnwindSafe for HotDirectory
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DirectoryClone for T
impl<T> DirectoryClone for T
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more