Skip to main content

CgroupMemoryWatch

Struct CgroupMemoryWatch 

Source
pub struct CgroupMemoryWatch { /* private fields */ }
Expand description

Reads CgroupMemory repeatedly for a watch, finding the lowest limit’s level again after a failed read. Below Self::STAT_FROM_PERCENT of the limit the working set is the charge.

Implementations§

Source§

impl CgroupMemoryWatch

Source

pub const STAT_FROM_PERCENT: u64 = 90

Below this share of the limit the page cache is not worth parsing.

Source

pub fn new() -> Self

A watch of this process’s cgroup path.

Source

pub fn at(root: &Path) -> Self

A watch with root standing in for /.

Source

pub fn read(&mut self) -> Option<CgroupMemory>

None without a limit, or when the level just stopped answering.

Trait Implementations§

Source§

impl Debug for CgroupMemoryWatch

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for CgroupMemoryWatch

Available on Android or Linux only.
Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Forget for CgroupMemoryWatch

§

impl Freeze for CgroupMemoryWatch
where *const u8 is !null: Freeze, PhantomData<u8>: Freeze, &'static str: Freeze,

§

impl Move for CgroupMemoryWatch

§

impl RefUnwindSafe for CgroupMemoryWatch

§

impl Send for CgroupMemoryWatch
where RawVecInner: Send, &'static str: Send,

§

impl Sync for CgroupMemoryWatch
where RawVecInner: Sync,

§

impl Unpin for CgroupMemoryWatch
where *const u8 is !null: Unpin, &'static str: Unpin,

§

impl UnsafeUnpin for CgroupMemoryWatch

§

impl UnwindSafe for CgroupMemoryWatch
where RawVecInner: UnwindSafe, &'static str: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.