Struct tower_memlim::service::MemoryLimit
source · pub struct MemoryLimit<T, M>where
M: AvailableMemory,{ /* private fields */ }Expand description
Enforces a limit on the underlying service when a memory threshold is met.
Implementations§
source§impl<T, M> MemoryLimit<T, M>where
M: AvailableMemory,
impl<T, M> MemoryLimit<T, M>where
M: AvailableMemory,
sourcepub fn new(inner: T, threshold: Threshold, mem_checker: M) -> Self
pub fn new(inner: T, threshold: Threshold, mem_checker: M) -> Self
Create a new memory limiter.
sourcepub fn into_inner(self) -> T
pub fn into_inner(self) -> T
Consume self, returning the inner service
Trait Implementations§
source§impl<S: Clone, M> Clone for MemoryLimit<S, M>where
M: AvailableMemory,
impl<S: Clone, M> Clone for MemoryLimit<S, M>where
M: AvailableMemory,
source§impl<T: Debug, M> Debug for MemoryLimit<T, M>where
M: AvailableMemory + Debug,
impl<T: Debug, M> Debug for MemoryLimit<T, M>where
M: AvailableMemory + Debug,
Auto Trait Implementations§
impl<T, M> Freeze for MemoryLimit<T, M>
impl<T, M> RefUnwindSafe for MemoryLimit<T, M>where
T: RefUnwindSafe,
M: RefUnwindSafe,
impl<T, M> Send for MemoryLimit<T, M>
impl<T, M> Sync for MemoryLimit<T, M>
impl<T, M> Unpin for MemoryLimit<T, M>
impl<T, M> UnwindSafe for MemoryLimit<T, M>where
T: UnwindSafe,
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)