pub struct ConcurrencyLimitLayer<A, C = DefaultClassifier> { /* private fields */ }Expand description
A Layer that wraps services with an adaptive ConcurrencyLimit.
§Example
use tower::ServiceBuilder;
use tower_acc::{ConcurrencyLimitLayer, Vegas};
let service = ServiceBuilder::new()
.layer(ConcurrencyLimitLayer::new(Vegas::default()))
.service(my_service);Implementations§
Source§impl<A> ConcurrencyLimitLayer<A>
impl<A> ConcurrencyLimitLayer<A>
Source§impl<A, C> ConcurrencyLimitLayer<A, C>
impl<A, C> ConcurrencyLimitLayer<A, C>
Sourcepub fn with_classifier(algorithm: A, classifier: C) -> Self
pub fn with_classifier(algorithm: A, classifier: C) -> Self
Creates a new ConcurrencyLimitLayer with the given algorithm and
Classifier.
Trait Implementations§
Source§impl<A: Clone, C: Clone> Clone for ConcurrencyLimitLayer<A, C>
impl<A: Clone, C: Clone> Clone for ConcurrencyLimitLayer<A, C>
Source§fn clone(&self) -> ConcurrencyLimitLayer<A, C>
fn clone(&self) -> ConcurrencyLimitLayer<A, C>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<S, A, C> Layer<S> for ConcurrencyLimitLayer<A, C>
impl<S, A, C> Layer<S> for ConcurrencyLimitLayer<A, C>
Auto Trait Implementations§
impl<A, C> Freeze for ConcurrencyLimitLayer<A, C>
impl<A, C> RefUnwindSafe for ConcurrencyLimitLayer<A, C>where
A: RefUnwindSafe,
C: RefUnwindSafe,
impl<A, C> Send for ConcurrencyLimitLayer<A, C>
impl<A, C> Sync for ConcurrencyLimitLayer<A, C>
impl<A, C> Unpin for ConcurrencyLimitLayer<A, C>
impl<A, C> UnsafeUnpin for ConcurrencyLimitLayer<A, C>where
A: UnsafeUnpin,
C: UnsafeUnpin,
impl<A, C> UnwindSafe for ConcurrencyLimitLayer<A, C>where
A: UnwindSafe,
C: UnwindSafe,
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