Struct CpuTime

Source
pub struct CpuTime {
    pub user: f64,
    pub system: f64,
    pub idle: f64,
    pub nice: Option<f64>,
    pub iowait: Option<f64>,
    pub irq: Option<f64>,
    pub softirq: Option<f64>,
    pub steal: Option<f64>,
    pub guest: Option<f64>,
    pub guest_nice: Option<f64>,
}
Expand description

Struct to represent CPU times. All values are in seconds.

Fields§

§user: f64

Time spent in user mode.

Linux: also includes guest time.

§system: f64

Time spent in system mode.

§idle: f64

Time spent in the idle task.

§nice: Option<f64>

Time spent in user mode with low priority (nice).

Linux: also includes guest_nice time.

Available: Linux

§iowait: Option<f64>

Time spent waiting for I/O to complete.

Available: Linux

§irq: Option<f64>

Time spent for servicing hardware interrupts.

Available: Linux

§softirq: Option<f64>

Time spent for servicing software interrupts.

Available: Linux

§steal: Option<f64>

Time spent by other operating systems running in a virtualized environment.

Available: Linux 2.6.11+

§guest: Option<f64>

Time spent running a virtual CPU for guest operating systems under the control of the Linux kernel.

Available: Linux 2.6.24+

§guest_nice: Option<f64>

Time spent running a niced guest (virtual CPU for guest operating systems under the control of the Linux kernel).

Available: Linux 3.2.0+

Trait Implementations§

Source§

impl Debug for CpuTime

Source§

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

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

impl Default for CpuTime

Source§

fn default() -> CpuTime

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

Auto Trait Implementations§

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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.