pub struct BatchLayer<Request> { /* private fields */ }
Expand description
Adds a layer performing batch processing of requests.
The default Tokio executor is used to run the given service, which means that this layer can only be used on the Tokio runtime.
See the module documentation for more details.
Implementations§
Source§impl<Request> BatchLayer<Request>
impl<Request> BatchLayer<Request>
Sourcepub fn new(size: usize, time: Duration) -> Self
pub fn new(size: usize, time: Duration) -> Self
Creates a new BatchLayer
.
The wrapper is responsible for telling the inner service when to flush a batch of requests. Two parameters control this policy:
size
gives the maximum number of items per batch.time
gives the maximum duration before a batch is flushed.
Trait Implementations§
Source§impl<Request> Debug for BatchLayer<Request>
impl<Request> Debug for BatchLayer<Request>
Source§impl<S, Request> Layer<S> for BatchLayer<Request>
impl<S, Request> Layer<S> for BatchLayer<Request>
Auto Trait Implementations§
impl<Request> Freeze for BatchLayer<Request>
impl<Request> RefUnwindSafe for BatchLayer<Request>
impl<Request> Send for BatchLayer<Request>
impl<Request> Sync for BatchLayer<Request>
impl<Request> Unpin for BatchLayer<Request>
impl<Request> UnwindSafe for BatchLayer<Request>
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