1 // Take a look at the license at the top of the repository in the LICENSE file.
3 use crate::{DiskUsage, Gid, Pid, ProcessExt, ProcessStatus, Signal, Uid}
;
8 impl fmt
::Display
for ProcessStatus
{
9 fn fmt(&self, f
: &mut fmt
::Formatter
) -> fmt
::Result
{
10 f
.write_str("Unknown")
14 #[doc = include_str!("../../md_doc/process.md")]
20 impl ProcessExt
for Process
{
21 fn kill_with(&self, _signal
: Signal
) -> Option
<bool
> {
25 fn name(&self) -> &str {
29 fn cmd(&self) -> &[String
] {
33 fn exe(&self) -> &Path
{
37 fn pid(&self) -> Pid
{
41 fn environ(&self) -> &[String
] {
45 fn cwd(&self) -> &Path
{
49 fn root(&self) -> &Path
{
53 fn memory(&self) -> u64 {
57 fn virtual_memory(&self) -> u64 {
61 fn parent(&self) -> Option
<Pid
> {
65 fn status(&self) -> ProcessStatus
{
66 ProcessStatus
::Unknown(0)
69 fn start_time(&self) -> u64 {
73 fn run_time(&self) -> u64 {
77 fn cpu_usage(&self) -> f32 {
81 fn disk_usage(&self) -> DiskUsage
{
85 fn user_id(&self) -> Option
<&Uid
> {
89 fn group_id(&self) -> Option
<Gid
> {