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
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.