Struct SysInfo

#[repr(transparent)]
pub struct SysInfo(/* private field */);

System info structure returned by sysinfo.

Implementations

impl SysInfo

fn load_average(&self) -> (f64, f64, f64)

Returns the load average tuple.

The returned values represent the load average over time intervals of 1, 5, and 15 minutes, respectively.

fn uptime(&self) -> Duration

Returns the time since system boot.

fn process_count(&self) -> u16

Current number of processes.

fn swap_total(&self) -> u64

Returns the amount of swap memory in Bytes.

fn swap_free(&self) -> u64

Returns the amount of unused swap memory in Bytes.

fn ram_total(&self) -> u64

Returns the total amount of installed RAM in Bytes.

fn ram_unused(&self) -> u64

Returns the amount of completely unused RAM in Bytes.

"Unused" in this context means that the RAM in neither actively used by programs, nor by the operating system as disk cache or buffer. It is "wasted" RAM since it currently serves no purpose.

Trait Implementations

impl Clone for SysInfo

fn clone(&self) -> Self

impl Copy for SysInfo

impl Debug for SysInfo

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

impl Eq for SysInfo

impl Hash for SysInfo

fn hash<__H: Hasher>(&self, state: &mut __H)

impl PartialEq for SysInfo

fn eq(&self, other: &Self) -> bool

impl StructuralPartialEq for SysInfo

Auto Trait Implementations

impl Freeze for SysInfo

impl RefUnwindSafe for SysInfo

impl Send for SysInfo

impl Sync for SysInfo

impl Unpin for SysInfo

impl UnsafeUnpin for SysInfo

impl UnwindSafe for SysInfo

Blanket Implementations

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

fn type_id(&self) -> TypeId

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

fn borrow(&self) -> &T

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

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

impl<T> CloneToUninit for SysInfo where T: Clone,

unsafe fn clone_to_uninit(&self, dest: *mut u8)

impl<T> From<T> for SysInfo

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> ToOwned for SysInfo where T: Clone,

type Owned = T;
fn to_owned(&self) -> T
fn clone_into(&self, target: &mut T)

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

fn into(self) -> U

Calls U::from(self).

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

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

type Error = never;
fn try_from(value: U) -> Result<T, never>

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

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