pub struct DebugProxyDirectory { /* private fields */ }Expand description
The debug proxy wraps another directory and simply acts as a proxy recording all of its read operations.
It has two purpose
- It is used when building our hotcache, to identify the file sections that should be in the hotcache.
- It is used in the search-api to provide debugging/performance information.
Implementations§
Source§impl DebugProxyDirectory
impl DebugProxyDirectory
Sourcepub fn wrap(directory: Box<dyn Directory>) -> Self
pub fn wrap(directory: Box<dyn Directory>) -> Self
Wraps another directory to log all of its read operations.
Sourcepub fn drain_read_operations(&self) -> impl Iterator<Item = ReadOperation> + '_
pub fn drain_read_operations(&self) -> impl Iterator<Item = ReadOperation> + '_
Returns all of the existing read operations.
Calling this “drains” the existing queue of operations.
Trait Implementations§
Source§impl Clone for DebugProxyDirectory
impl Clone for DebugProxyDirectory
Source§impl Debug for DebugProxyDirectory
impl Debug for DebugProxyDirectory
Source§impl Directory for DebugProxyDirectory
impl Directory for DebugProxyDirectory
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>
fn 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>
Source§fn atomic_write(&self, _: &Path, _: &[u8]) -> Result<(), Error>
fn atomic_write(&self, _: &Path, _: &[u8]) -> Result<(), Error>
Atomically replace the content of a file with data. Read more
Source§fn watch(&self, _: WatchCallback) -> Result<WatchHandle, TantivyError>
fn watch(&self, _: WatchCallback) -> Result<WatchHandle, TantivyError>
Registers a callback that will be called whenever a change on the
meta.json
using the Directory::atomic_write() API is detected. Read moreAuto Trait Implementations§
impl Freeze for DebugProxyDirectory
impl !RefUnwindSafe for DebugProxyDirectory
impl Send for DebugProxyDirectory
impl Sync for DebugProxyDirectory
impl Unpin for DebugProxyDirectory
impl !UnwindSafe for DebugProxyDirectory
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