pub struct PressureThresholds {
pub medium_watermark: f64,
pub high_watermark: f64,
pub critical_watermark: f64,
}Expand description
Fractional watermarks that define memory pressure level transitions.
All values are in the range [0.0, 1.0] and represent the fraction of
pool buffers that must be in-use to reach that level.
Fields§
§medium_watermark: f64In-use fraction at or above which the level becomes Medium. Default 0.5.
high_watermark: f64In-use fraction at or above which the level becomes High. Default 0.75.
critical_watermark: f64In-use fraction at or above which the level becomes Critical. Default 0.9.
Implementations§
Source§impl PressureThresholds
impl PressureThresholds
Sourcepub fn new(medium: f64, high: f64, critical: f64) -> Self
pub fn new(medium: f64, high: f64, critical: f64) -> Self
Creates custom thresholds. All values must be in [0.0, 1.0] and
medium ≤ high ≤ critical.
§Panics
Panics if values are out of order or outside [0.0, 1.0].
Sourcepub fn level_for_fraction(&self, in_use_fraction: f64) -> MemoryPressureLevel
pub fn level_for_fraction(&self, in_use_fraction: f64) -> MemoryPressureLevel
Maps an in-use fraction to the corresponding MemoryPressureLevel.
Trait Implementations§
Source§impl Clone for PressureThresholds
impl Clone for PressureThresholds
Source§fn clone(&self) -> PressureThresholds
fn clone(&self) -> PressureThresholds
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 Debug for PressureThresholds
impl Debug for PressureThresholds
Source§impl Default for PressureThresholds
impl Default for PressureThresholds
Source§impl PartialEq for PressureThresholds
impl PartialEq for PressureThresholds
impl Copy for PressureThresholds
impl StructuralPartialEq for PressureThresholds
Auto Trait Implementations§
impl Freeze for PressureThresholds
impl RefUnwindSafe for PressureThresholds
impl Send for PressureThresholds
impl Sync for PressureThresholds
impl Unpin for PressureThresholds
impl UnsafeUnpin for PressureThresholds
impl UnwindSafe for PressureThresholds
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