#[non_exhaustive]pub struct Memory {
pub total: Bytes,
pub used: Bytes,
pub free: Bytes,
pub host_total: Bytes,
pub host_free: Bytes,
pub unused: Option<Bytes>,
pub cached: Option<Bytes>,
pub limit: Option<MemoryLimit>,
pub swap: Swap,
pub source: MemorySource,
}Expand description
Every memory value from one set of reads; see snapshot.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.total: BytesWhat this process may use: the host’s memory, or the container’s limit when that is smaller.
used: BytesIn use, counted against total.
free: BytesAvailable to new allocations without swapping (reclaimable cache counts
as available). used + free == total always holds.
host_total: BytesThe machine’s memory, ignoring any limit.
host_free: BytesAvailable on the machine, ignoring any limit.
unused: Option<Bytes>Pages doing nothing at all (the kernel’s MemFree), when reported.
cached: Option<Bytes>File cache that can be reclaimed, when reported.
limit: Option<MemoryLimit>The limit applied to total, when there is one.
swap: SwapSwap space (all zero when there is none).
source: MemorySourceWhere total and used came from.
Implementations§
Source§impl Memory
impl Memory
Sourcepub fn used_percent(&self) -> Percent
pub fn used_percent(&self) -> Percent
used as a share of total.
Sourcepub fn free_percent(&self) -> Percent
pub fn free_percent(&self) -> Percent
free as a share of total.
Trait Implementations§
Auto Trait Implementations§
impl Forget for Memory
impl Freeze for Memory
impl RefUnwindSafe for Memory
impl Send for Memory
impl Sync for Memory
impl Unpin for Memory
impl UnsafeUnpin for Memory
impl UnwindSafe for Memory
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