Struct tower_memlim::layer::MemoryLimitLayer
source · pub struct MemoryLimitLayer<M>where
M: AvailableMemory,{ /* private fields */ }Expand description
Enforces a limit on the underlying service when a memory Threshold is met.
A common use case is to load shed (reject requests), once the threshold is met. For doing so you must add tower’s load_shed layer.
Otherwise the service enqueues requests until the memory is available again.
Implementations§
source§impl<M> MemoryLimitLayer<M>where
M: AvailableMemory,
impl<M> MemoryLimitLayer<M>where
M: AvailableMemory,
Trait Implementations§
source§impl<M> Clone for MemoryLimitLayer<M>where
M: AvailableMemory + Clone,
impl<M> Clone for MemoryLimitLayer<M>where
M: AvailableMemory + Clone,
source§fn clone(&self) -> MemoryLimitLayer<M>
fn clone(&self) -> MemoryLimitLayer<M>
Returns a copy 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<M> Debug for MemoryLimitLayer<M>where
M: AvailableMemory + Debug,
impl<M> Debug for MemoryLimitLayer<M>where
M: AvailableMemory + Debug,
source§impl<S, M> Layer<S> for MemoryLimitLayer<M>where
M: AvailableMemory,
impl<S, M> Layer<S> for MemoryLimitLayer<M>where
M: AvailableMemory,
Auto Trait Implementations§
impl<M> Freeze for MemoryLimitLayer<M>where
M: Freeze,
impl<M> RefUnwindSafe for MemoryLimitLayer<M>where
M: RefUnwindSafe,
impl<M> Send for MemoryLimitLayer<M>where
M: Send,
impl<M> Sync for MemoryLimitLayer<M>where
M: Sync,
impl<M> Unpin for MemoryLimitLayer<M>where
M: Unpin,
impl<M> UnwindSafe for MemoryLimitLayer<M>where
M: 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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)