Struct TaskStats

Source
pub struct TaskStats {
    pub tid: u32,
    pub cpu: Cpu,
    pub memory: Memory,
    pub io: Io,
    pub blkio: BlkIo,
    pub ctx_switches: ContextSwitches,
    pub delays: Delays,
    /* private fields */
}
Expand description

The taskstats representation for a task. This struct remaps commonly used struct taskstats fields for primarily:

  • Access values with rust’s primitive types
  • Better structured organization of group of fields
  • Support serialization

There are more (but may not much interested) fields in the original struct taskstats and they are accessible through obtaining the original struct by TaskStats#inner().

Fields§

§tid: u32

The target task ID

§cpu: Cpu

Staticstics related to CPU time

§memory: Memory

Statistics related to memory, vm

§io: Io

Staticstics related to I/O at syscall surface

§blkio: BlkIo

Statistics related to I/O at block device level

§ctx_switches: ContextSwitches

Statistics related to context switches

§delays: Delays

Statistics related to scheduling delay (delay accounting)

Implementations§

Source§

impl TaskStats

Source

pub fn inner(&self) -> &taskstats

Return inner representation of taskstats.

The returned value is an instance of struct taskstats that was received from kernel. TaskStats remaps most of its fields into rust-friendly types and structure, so this inner object should be referred only when the user wants to access more information than available in remapped fields.

Trait Implementations§

Source§

impl Clone for TaskStats

Source§

fn clone(&self) -> TaskStats

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for TaskStats

Source§

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

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

impl From<&[u8]> for TaskStats

Source§

fn from(buf: &[u8]) -> Self

Converts to this type from the input type.
Source§

impl Copy for TaskStats

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> CloneToUninit for T
where T: Clone,

Source§

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

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.