pub trait Delete: Unpin + Send + Sync {
// Required methods
fn delete(&mut self, path: &str, args: OpDelete) -> Result<()>;
fn flush(&mut self) -> impl Future<Output = Result<usize>> + MaybeSend;
}
Expand description
The Delete trait defines interfaces for performing deletion operations.
Required Methods§
sourcefn delete(&mut self, path: &str, args: OpDelete) -> Result<()>
fn delete(&mut self, path: &str, args: OpDelete) -> Result<()>
Requests deletion of a resource at the specified path with optional arguments
§Parameters
path
: The path of the resource to deleteargs
: Additional arguments for the delete operation
§Returns
Ok(())
: The deletion request has been successfully queued (does not guarantee actual deletion)Err(err)
: An error occurred and the deletion request was not queued
§Notes
This method just queue the delete request. The actual deletion will be
performed when flush
is called.
sourcefn flush(&mut self) -> impl Future<Output = Result<usize>> + MaybeSend
fn flush(&mut self) -> impl Future<Output = Result<usize>> + MaybeSend
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
§Notes
- This method is asynchronous and will wait for queued deletions to complete
Object Safety§
This trait is not object safe.