#[repr(u32)]pub enum Level {
Normal = 1,
Warning = 2,
Critical = 3,
}
Expand description
Indicates the memory pressure level.
Variants§
Normal = 1
The memory pressure level is healthy.
Registered clients are free to hold on to caches and allocate memory unrestricted.
However, clients should take care to not proactively re-create caches on a transition back to the NORMAL level, causing a memory spike that immediately pushes the level over to WARNING again.
Warning = 2
The memory pressure level is somewhat constrained, and might cross over to the critical pressure range if left unchecked.
Registered clients are expected to optimize their operation to limit memory usage, rather than for best performance, for example, by reducing cache sizes and non-essential memory allocations.
Clients must take care to regulate the amount of work they undertake in order to reclaim memory, and ensure that it does not cause visible performance degradation. There exists some memory pressure, but not enough to justify trading off user responsiveness to reclaim memory.
Critical = 3
The memory pressure level is very constrained.
Registered clients are expected to drop all non-essential memory, and refrain from allocating more memory. Failing to do so might result in the job getting terminated, or the system being rebooted in the case of global memory pressure.
Clients may undertake expensive work to reclaim memory if required, since failing to do so might result in termination. The client might decide that a performance hit is a fair tradeoff in this case.
Implementations§
Source§impl Level
impl Level
pub fn from_primitive(prim: u32) -> Option<Self>
pub const fn into_primitive(self) -> u32
pub fn is_unknown(&self) -> bool
is_unknown
Trait Implementations§
Source§impl<D: ResourceDialect> Decode<Level, D> for Level
impl<D: ResourceDialect> Decode<Level, D> for Level
Source§impl Ord for Level
impl Ord for Level
Source§impl PartialOrd for Level
impl PartialOrd for Level
Source§impl TypeMarker for Level
impl TypeMarker for Level
Source§fn inline_align(_context: Context) -> usize
fn inline_align(_context: Context) -> usize
Source§fn inline_size(_context: Context) -> usize
fn inline_size(_context: Context) -> usize
inline_align
.Source§fn encode_is_copy() -> bool
fn encode_is_copy() -> bool
Self::Owned
matches the FIDL wire
format and encoding requires no validation. When true, we can optimize
encoding arrays and vectors of Self::Owned
to a single memcpy. Read moreSource§fn decode_is_copy() -> bool
fn decode_is_copy() -> bool
Self::Owned
matches the FIDL wire
format and decoding requires no validation. When true, we can optimize
decoding arrays and vectors of Self::Owned
to a single memcpy.Source§impl ValueTypeMarker for Level
impl ValueTypeMarker for Level
impl Copy for Level
impl Eq for Level
impl StructuralPartialEq for Level
Auto Trait Implementations§
impl Freeze for Level
impl RefUnwindSafe for Level
impl Send for Level
impl Sync for Level
impl Unpin for Level
impl UnwindSafe for Level
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
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)
clone_to_uninit
)