]> git.proxmox.com Git - rustc.git/blob - vendor/sysinfo/src/unknown/process.rs
New upstream version 1.63.0+dfsg1
[rustc.git] / vendor / sysinfo / src / unknown / process.rs
1 // Take a look at the license at the top of the repository in the LICENSE file.
2
3 use crate::{DiskUsage, Gid, Pid, ProcessExt, ProcessStatus, Signal, Uid};
4
5 use std::fmt;
6 use std::path::Path;
7
8 impl fmt::Display for ProcessStatus {
9 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
10 f.write_str("Unknown")
11 }
12 }
13
14 #[doc = include_str!("../../md_doc/process.md")]
15 pub struct Process {
16 pid: Pid,
17 parent: Option<Pid>,
18 }
19
20 impl ProcessExt for Process {
21 fn kill_with(&self, _signal: Signal) -> Option<bool> {
22 None
23 }
24
25 fn name(&self) -> &str {
26 ""
27 }
28
29 fn cmd(&self) -> &[String] {
30 &[]
31 }
32
33 fn exe(&self) -> &Path {
34 Path::new("")
35 }
36
37 fn pid(&self) -> Pid {
38 self.pid
39 }
40
41 fn environ(&self) -> &[String] {
42 &[]
43 }
44
45 fn cwd(&self) -> &Path {
46 Path::new("")
47 }
48
49 fn root(&self) -> &Path {
50 Path::new("")
51 }
52
53 fn memory(&self) -> u64 {
54 0
55 }
56
57 fn virtual_memory(&self) -> u64 {
58 0
59 }
60
61 fn parent(&self) -> Option<Pid> {
62 self.parent
63 }
64
65 fn status(&self) -> ProcessStatus {
66 ProcessStatus::Unknown(0)
67 }
68
69 fn start_time(&self) -> u64 {
70 0
71 }
72
73 fn run_time(&self) -> u64 {
74 0
75 }
76
77 fn cpu_usage(&self) -> f32 {
78 0.0
79 }
80
81 fn disk_usage(&self) -> DiskUsage {
82 DiskUsage::default()
83 }
84
85 fn user_id(&self) -> Option<&Uid> {
86 None
87 }
88
89 fn group_id(&self) -> Option<Gid> {
90 None
91 }
92 }