pub trait BatchDelete:
Send
+ Sync
+ Unpin
+ 'static {
// Required methods
fn delete_once(
&self,
path: String,
args: OpDelete,
) -> impl Future<Output = Result<()>> + MaybeSend;
fn delete_batch(
&self,
batch: Vec<(String, OpDelete)>,
) -> impl Future<Output = Result<BatchDeleteResult>> + MaybeSend;
}
Expand description
BatchDelete is used to implement oio::Delete
based on batch delete operation.
OneShotDeleter will perform delete operation while calling flush
.
Required Methods§
Sourcefn delete_once(
&self,
path: String,
args: OpDelete,
) -> impl Future<Output = Result<()>> + MaybeSend
fn delete_once( &self, path: String, args: OpDelete, ) -> impl Future<Output = Result<()>> + MaybeSend
delete_once delete one path at once.
Implementations should make sure that the data is deleted correctly at once.
BatchDeleter may call this method while there are only one path to delete.
Sourcefn delete_batch(
&self,
batch: Vec<(String, OpDelete)>,
) -> impl Future<Output = Result<BatchDeleteResult>> + MaybeSend
fn delete_batch( &self, batch: Vec<(String, OpDelete)>, ) -> impl Future<Output = Result<BatchDeleteResult>> + MaybeSend
delete_batch delete multiple paths at once.
- Implementations should make sure that the length of
batch
equals to the return result’s length. - Implementations should return error no path is deleted.
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.