pub trait BlockingDelete:
Send
+ Sync
+ 'static {
// Required methods
fn delete(&mut self, path: &str, args: OpDelete) -> Result<()>;
fn flush(&mut self) -> Result<usize>;
}
Expand description
BlockingDelete is the trait to perform delete operations.
Required Methods§
Sourcefn delete(&mut self, path: &str, args: OpDelete) -> Result<()>
fn delete(&mut self, path: &str, args: OpDelete) -> Result<()>
Delete given path with optional arguments.
§Behavior
Ok(())
means the path has been queued for deletion.Err(err)
means error happens and no deletion has been queued.
Sourcefn flush(&mut self) -> Result<usize>
fn flush(&mut self) -> Result<usize>
Flushes the deletion queue to ensure queued deletions are executed
§Returns
Ok(0)
: All queued deletions have been processed or the queue is empty.Ok(count)
: The number of resources successfully deleted. Implementations should return an error if the queue is non-empty but no resources were deletedErr(err)
: An error occurred while performing the deletions
Implementations on Foreign Types§
Source§impl BlockingDelete for ()
impl BlockingDelete for ()
Source§impl<T: BlockingDelete + ?Sized> BlockingDelete for Box<T>
Box<dyn BlockingDelete>
won’t implement BlockingDelete
automatically.
impl<T: BlockingDelete + ?Sized> BlockingDelete for Box<T>
Box<dyn BlockingDelete>
won’t implement BlockingDelete
automatically.
To make BlockingWriter work as expected, we must add this impl.