Trait BlockingDelete

Source
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§

Source

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.
Source

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 deleted
  • Err(err): An error occurred while performing the deletions

Implementations on Foreign Types§

Source§

impl BlockingDelete for ()

Source§

fn delete(&mut self, _: &str, _: OpDelete) -> Result<()>

Source§

fn flush(&mut self) -> Result<usize>

Source§

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.

Source§

fn delete(&mut self, path: &str, args: OpDelete) -> Result<()>

Source§

fn flush(&mut self) -> Result<usize>

Implementors§