pub struct StaticResourceMonitor { /* private fields */ }Expand description
A static resource monitor that always reports the same pressure level.
Useful for testing and for nodes where resource monitoring is delegated to an external system.
Implementations§
Source§impl StaticResourceMonitor
impl StaticResourceMonitor
Sourcepub fn new(level: PressureLevel) -> Self
pub fn new(level: PressureLevel) -> Self
Create a monitor that always reports level.
Trait Implementations§
Source§impl ResourceMonitor for StaticResourceMonitor
impl ResourceMonitor for StaticResourceMonitor
Source§fn current_pressure(&self) -> PressureLevel
fn current_pressure(&self) -> PressureLevel
Return the current resource pressure level.
Auto Trait Implementations§
impl Freeze for StaticResourceMonitor
impl RefUnwindSafe for StaticResourceMonitor
impl Send for StaticResourceMonitor
impl Sync for StaticResourceMonitor
impl Unpin for StaticResourceMonitor
impl UnsafeUnpin for StaticResourceMonitor
impl UnwindSafe for StaticResourceMonitor
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