pub enum PressureZone {
Green,
Yellow,
Orange,
Red,
}Expand description
Pressure zone classification based on memory pressure percentage.
Variants§
Green
0–40 %: cache aggressively.
Yellow
41–70 %: cache normally, evict 10 % cold entries.
Orange
71–90 %: evict 50 %, stop new caching.
Red
91–100 %: flush everything.
Implementations§
Source§impl PressureZone
impl PressureZone
Sourcepub fn from_pressure(pressure: u8) -> Self
pub fn from_pressure(pressure: u8) -> Self
Returns the zone corresponding to the given pressure percentage.
Trait Implementations§
Source§impl Clone for PressureZone
impl Clone for PressureZone
Source§fn clone(&self) -> PressureZone
fn clone(&self) -> PressureZone
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 PressureZone
impl Debug for PressureZone
Source§impl PartialEq for PressureZone
impl PartialEq for PressureZone
Source§fn eq(&self, other: &PressureZone) -> bool
fn eq(&self, other: &PressureZone) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for PressureZone
impl Eq for PressureZone
impl StructuralPartialEq for PressureZone
Auto Trait Implementations§
impl Freeze for PressureZone
impl RefUnwindSafe for PressureZone
impl Send for PressureZone
impl Sync for PressureZone
impl Unpin for PressureZone
impl UnsafeUnpin for PressureZone
impl UnwindSafe for PressureZone
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§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more