1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
//! [`MemberInfo`] — an enriched, point-in-time snapshot of one process in a
//! [`ProcessGroup`](crate::ProcessGroup)'s tree.
/// An enriched snapshot of one member of a [`ProcessGroup`](crate::ProcessGroup)
/// — its pid plus best-effort metadata (parent pid, image name, start time).
///
/// Produced by [`ProcessGroup::members_info`](crate::ProcessGroup::members_info),
/// the metadata-carrying companion to
/// [`members`](crate::ProcessGroup::members) (which returns bare pids). *Which*
/// processes appear follows the **same** platform matrix as `members` — the whole
/// tree on Windows and Linux-cgroup, the tracked group *leaders* on the POSIX
/// process-group fallback (macOS/BSD and Linux without a usable cgroup). The
/// enriching fields beyond [`pid`](Self::pid) are each independently `Option` and
/// are `None` wherever the platform can't report them — never a fabricated value.
///
/// # Field availability by platform
///
/// | field | Windows | Linux (cgroup / fallback) | macOS | the BSDs |
/// |------------------------------|---------|---------------------------|--------|----------|
/// | [`pid`](Self::pid) | yes | yes | yes | yes |
/// | [`ppid`](Self::ppid) | yes | yes | yes | `None` |
/// | [`exe_name`](Self::exe_name) | yes | yes | yes | `None` |
/// | [`start_time`](Self::start_time) | yes | yes | yes | `None` |
///
/// On the "bare" BSDs the crate wires up no per-process introspection (see the
/// note on [`start_time`](Self::start_time) for why), so every enriching field is
/// honestly `None` while the pid is still reported — that is a correct result, not
/// an error.
///
/// # No command line
///
/// The raw argv / environment of a member is **deliberately never** included, on
/// any platform: a command line routinely carries secrets, and redaction or
/// hashing is a policy the *consumer* must own — the same "never log argv/env"
/// stance the crate takes in its `tracing` output. This will not change.
///
/// # Racing a member that exits
///
/// The list is a point-in-time snapshot taken per pid: if a process exits between
/// when its pid is enumerated and when its metadata is read, that pid is simply
/// **omitted** from the returned `Vec` — a vanished member is never reported with
/// fabricated fields, and its disappearance never fails the whole call. See
/// [`ProcessGroup::members_info`](crate::ProcessGroup::members_info) for the exact
/// error contract.
///
/// Non-exhaustive and accessor-only: a read-only snapshot the crate produces, so
/// new metadata can be added without a breaking change, and each field is exposed
/// through a method — documenting its own platform caveats — rather than a public
/// struct field.