Struct sinfo::Memory

source ·
pub struct Memory {
    pub ram: f32,
    pub swap: f32,
    /* private fields */
}
Expand description

Used for storing total or available RAM and Swap.

Fields§

§ram: f32§swap: f32

Implementations§

Returns available RAM and free Swap

Returns Memory instance storing total RAM and total Swap

Returns argument, given in kb, formatted to suitable unit.

Formats RAM and Swap to suitable units, saving the result to struct’s fields for cheaper usage

Returns the RAM with unit as a &str

Returns the Swap with unit as a &str

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.