Struct PidStatus

Source
pub struct PidStatus {
Show 18 fields pub ppid: i32, pub euid: i32, pub cmd_long: Vec<String>, pub name: String, pub cmd_short: String, pub tracerpid: i32, pub fdsize: u32, pub state: String, pub vmpeak: Option<u64>, pub vmsize: Option<u64>, pub rss_pages: i64, pub rss_bytes: i64, pub rsslim_bytes: u64, pub processor_last_executed: Option<i32>, pub utime: u64, pub stime: u64, pub user_cpu_usage: f64, pub sys_cpu_usage: f64,
}
Expand description

PidStatus is the struct that holds the data that we store for each process’ status. In this crate, we create a Vec<HashMap<i32, PidStatus>> which is a mapping of pid to its status.

Fields§

§ppid: i32

Parent pid

§euid: i32

Effective uid

§cmd_long: Vec<String>

The complete path to cmd_long if available.

§name: String

Command run by this process.

§cmd_short: String

The filename of the executable, in parentheses.

This is visible whether or not the executable is swapped out.

§tracerpid: i32

PID of process tracing this process (0 if not being traced).

§fdsize: u32

Number of file descriptor slots currently allocated.

§state: String

Current state of the process.

§vmpeak: Option<u64>

Peak virtual memory size by kB.

§vmsize: Option<u64>

Virtual memory size by kB.

§rss_pages: i64

Resident Set Size: number of pages the process has in real memory.

This is just the pages which count toward text, data, or stack space. This does not include pages which have not been demand-loaded in, or which are swapped out.

§rss_bytes: i64

Gets the Resident Set Size (in bytes)

§rsslim_bytes: u64

Current soft limit in bytes on the rss of the process; see the description of RLIMIT_RSS in getrlimit(2).

§processor_last_executed: Option<i32>

CPU number last executed on.

(since Linux 2.2.8)

§utime: u64

(divide by [ticks_per_second()].

This includes guest time, guest_time (time spent running a virtual CPU, see below), so that applications that are not aware of the guest time field do not lose that time from their calculations.

§stime: u64

Amount of time that this process has been scheduled in kernel mode, measured in clock ticks (divide by [ticks_per_second()]).

§user_cpu_usage: f64

Holds the user CPU usage by that process.

§sys_cpu_usage: f64

Holds the sys CPU usage by that process.

Trait Implementations§

Source§

impl Clone for PidStatus

Source§

fn clone(&self) -> PidStatus

Returns a duplicate 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 PidStatus

Source§

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

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

impl<'de> Deserialize<'de> for PidStatus

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for PidStatus

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for PidStatus

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for PidStatus

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.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,