Struct tabin_plugins::procfs::MemInfo [−][src]
A struct that represents overall memory usage on the system.
All values are in KB.
Fields
total: Option<usize>available: Option<usize>free: Option<usize>cached: Option<usize>Implementations
impl MemInfo[src]
pub fn load() -> MemInfo[src]
Read the data from /proc/meminfo into a MemInfo
pub fn percent_free(&self) -> Result<f64>[src]
Try to figure out how much memory is being used
Since linux kernel 3.16 this just performs
available / total * 100
Before that we approximate available as Free + Cached, even though that is almost certain to be incorrect.
pub fn percent_used(&self) -> Result<f64>[src]
The inverse of MemInfo::percent_free
Trait Implementations
impl Debug for MemInfo[src]
impl Eq for MemInfo[src]
impl FromStr for MemInfo[src]
type Err = ProcFsError
The associated error which can be returned from parsing.
fn from_str(meminfo: &str) -> Result<Self>[src]
Convert the contents of a string like /proc/meminfo into a MemInfo object
impl PartialEq<MemInfo> for MemInfo[src]
impl StructuralEq for MemInfo[src]
impl StructuralPartialEq for MemInfo[src]
Auto Trait Implementations
impl RefUnwindSafe for MemInfo
impl Send for MemInfo
impl Sync for MemInfo
impl Unpin for MemInfo
impl UnwindSafe for MemInfo
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized, [src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
pub fn equivalent(&self, key: &K) -> bool[src]
impl<T> From<T> for T[src]
impl<T> Instrument for T[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>[src]
pub fn in_current_span(self) -> Instrumented<Self>[src]
impl<T> Instrument for T[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>[src]
pub fn in_current_span(self) -> Instrumented<Self>[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,