pub struct Process {
pub uid: uid_t,
pub gid: gid_t,
pub tasks: HashMap<Pid, Process>,
/* private fields */
}
Expand description
Struct containing information of a process.
iOS
This information cannot be retrieved on iOS due to sandboxing.
Apple app store
If you are building a macOS Apple app store, it won’t be able to retrieve this information.
Fields
uid: uid_t
User id of the process owner.
gid: gid_t
Group id of the process owner.
tasks: HashMap<Pid, Process>
Tasks run by this process.
Trait Implementations
sourceimpl ProcessExt for Process
impl ProcessExt for Process
sourcefn kill_with(&self, signal: Signal) -> Option<bool>
fn kill_with(&self, signal: Signal) -> Option<bool>
Sends the given signal
to the process. If the signal doesn’t exist on this platform,
it’ll do nothing and will return None
. Otherwise it’ll return if the signal was sent
successfully. Read more
sourcefn virtual_memory(&self) -> u64
fn virtual_memory(&self) -> u64
Returns the virtual memory usage (in KB). Read more
sourcefn status(&self) -> ProcessStatus
fn status(&self) -> ProcessStatus
Returns the status of the processus. Read more
sourcefn start_time(&self) -> u64
fn start_time(&self) -> u64
Returns the time where the process was started (in seconds) from epoch. Read more
sourcefn run_time(&self) -> u64
fn run_time(&self) -> u64
Returns for how much time the process has been running (in seconds). Read more
sourcefn cpu_usage(&self) -> f32
fn cpu_usage(&self) -> f32
Returns the total CPU usage (in %). Notice that it might be bigger than 100 if run on a multicore machine. Read more
sourcefn disk_usage(&self) -> DiskUsage
fn disk_usage(&self) -> DiskUsage
Returns number of bytes read and written to disk. Read more
sourcefn kill(&self) -> bool
fn kill(&self) -> bool
Sends Signal::Kill
to the process (which is the only signal supported on all supported
platforms by this crate). Read more
Auto Trait Implementations
impl RefUnwindSafe for Process
impl Send for Process
impl Sync for Process
impl Unpin for Process
impl UnwindSafe for Process
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more