Struct tower_batch_control::layer::BatchLayer
source · pub struct BatchLayer<Request> {
max_items_in_batch: usize,
max_batches: Option<usize>,
max_latency: Duration,
_handles_requests: PhantomData<fn(_: Request)>,
}
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.
Fields§
§max_items_in_batch: usize
§max_batches: Option<usize>
§max_latency: Duration
§_handles_requests: PhantomData<fn(_: Request)>
Implementations§
source§impl<Request> BatchLayer<Request>
impl<Request> BatchLayer<Request>
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more