Struct opendal::BatchOperator
source · pub struct BatchOperator { /* private fields */ }
Expand description
BatchOperator is used to take batch operations like walk_dir and remove_all, should
be constructed by Operator::batch()
.
TODO
We will support batch operators between two different operators like copy and move.
Implementations§
source§impl BatchOperator
impl BatchOperator
sourcepub fn with_limit(self, limit: usize) -> Self
pub fn with_limit(self, limit: usize) -> Self
Specify the batch limit.
Default: 1000
sourcepub async fn remove_via(
&self,
input: impl Stream<Item = String> + Unpin
) -> Result<()>
pub async fn remove_via( &self, input: impl Stream<Item = String> + Unpin ) -> Result<()>
remove_via will remove objects via given stream.
We will delete by chunks with given batch limit on the stream.
Notes
If underlying services support delete in batch, we will use batch delete instead.
Examples
use futures::stream;
let stream = stream::iter(vec!["abc".to_string(), "def".to_string()]);
op.batch().remove_via(stream).await?;
Trait Implementations§
source§impl Clone for BatchOperator
impl Clone for BatchOperator
source§fn clone(&self) -> BatchOperator
fn clone(&self) -> BatchOperator
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more