pub struct Batcher<E>{ /* private fields */ }
Expand description
A batcher used to batch requests to a BatchExecutor
Implementations§
Source§impl<E> Batcher<E>
impl<E> Batcher<E>
Sourcepub fn new(
executor: E,
batch_size: usize,
concurrency: usize,
delay: Duration,
) -> Self
pub fn new( executor: E, batch_size: usize, concurrency: usize, delay: Duration, ) -> Self
Create a new batcher
Sourcepub const fn builder() -> BatcherBuilder<E>
pub const fn builder() -> BatcherBuilder<E>
Create a builder for a Batcher
Sourcepub async fn execute_many<I>(&self, items: I) -> Vec<Option<E::Response>>where
I: IntoIterator<Item = E::Request>,
pub async fn execute_many<I>(&self, items: I) -> Vec<Option<E::Response>>where
I: IntoIterator<Item = E::Request>,
Execute many requests
Auto Trait Implementations§
impl<E> Freeze for Batcher<E>
impl<E> !RefUnwindSafe for Batcher<E>
impl<E> Send for Batcher<E>
impl<E> Sync for Batcher<E>
impl<E> Unpin for Batcher<E>
impl<E> !UnwindSafe for Batcher<E>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more