pub struct BatchLayer<Request> { /* private fields */ }Expand description
A Layer that wraps an inner service with Batch.
The background worker is spawned on the default Tokio executor, so this layer can only be used on the Tokio runtime.
See the module documentation for the full lifecycle and error semantics.
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.
size– the maximum number of items per batch.time– 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> UnsafeUnpin 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