pub struct MemoryAvailability { /* private fields */ }Expand description
Provenance-preserving memory availability for the current process.
A finite cgroup-v1 or cgroup-v2 ceiling admits exactly min(host available, reclaim-aware cgroup available). A v2 literal memory.max = max remains
typed as unbounded and therefore defers to the host; v1’s numeric unlimited
sentinel participates exactly and likewise loses to a tighter host value.
If an active controller cannot be parsed exactly, admission fails closed
with zero bytes while retaining the typed probe failure; it never silently
inherits host capacity.
Implementations§
Source§impl MemoryAvailability
impl MemoryAvailability
pub const fn host_available_bytes(&self) -> u64
pub const fn cgroup(&self) -> &CgroupMemoryObservation
pub const fn available_bytes(&self) -> u64
pub fn available_bytes_usize(&self) -> usize
pub const fn limiting_source(&self) -> MemoryAvailabilitySource
Trait Implementations§
Source§impl Clone for MemoryAvailability
impl Clone for MemoryAvailability
Source§fn clone(&self) -> MemoryAvailability
fn clone(&self) -> MemoryAvailability
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 MemoryAvailability
impl Debug for MemoryAvailability
Source§impl Display for MemoryAvailability
impl Display for MemoryAvailability
impl Eq for MemoryAvailability
Source§impl PartialEq for MemoryAvailability
impl PartialEq for MemoryAvailability
impl StructuralPartialEq for MemoryAvailability
Auto Trait Implementations§
impl Freeze for MemoryAvailability
impl RefUnwindSafe for MemoryAvailability
impl Send for MemoryAvailability
impl Sync for MemoryAvailability
impl Unpin for MemoryAvailability
impl UnsafeUnpin for MemoryAvailability
impl UnwindSafe for MemoryAvailability
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<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