pub struct BatchLayer<Request> {
max_items_weight_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_weight_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> 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
§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§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
Source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
Source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 40 bytes