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<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>
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>
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