@@ -59,10 +59,31 @@ pub fn get_available_max_process_id() -> u32 {
59
59
/// };
60
60
///
61
61
/// fn main() -> Result<()> {
62
- /// let _ = kill_tree(get_available_max_process_id())?;
62
+ /// let _ = kill_tree(get_available_max_process_id()).await ?;
63
63
/// Ok(())
64
64
/// }
65
65
/// ```
66
+ ///
67
+ /// # Errors
68
+ ///
69
+ /// ## `InvalidProcessId`
70
+ /// Returns the process ID of the kernel or system, or if greater than the available maximum process ID.
71
+ ///
72
+ /// ## `InvalidCast`
73
+ /// Returned internally when an invalid type conversion occurs during a system API call.
74
+ /// This is an error that should not occur under normal circumstances.
75
+ ///
76
+ /// ## `InvalidProcEntry`
77
+ /// Returned when inquiry, or parsing within the Linux `/proc/` path fails.
78
+ ///
79
+ /// ## `Io`
80
+ /// Returned when access within the Linux `/proc/` path fails.
81
+ ///
82
+ /// ## `Windows`
83
+ /// Returned when the `Win32` API used internally fails.
84
+ ///
85
+ /// ## `Unix`
86
+ /// Returned when the `libc` API used internally fails.
66
87
pub async fn kill_tree ( process_id : ProcessId ) -> Result < Outputs > {
67
88
kill_tree_with_config ( process_id, & Config :: default ( ) ) . await
68
89
}
@@ -111,6 +132,27 @@ pub async fn kill_tree(process_id: ProcessId) -> Result<Outputs> {
111
132
/// Ok(())
112
133
/// }
113
134
/// ```
135
+ ///
136
+ /// # Errors
137
+ ///
138
+ /// ## `InvalidProcessId`
139
+ /// Returns the process ID of the kernel or system, or if greater than the available maximum process ID.
140
+ ///
141
+ /// ## `InvalidCast`
142
+ /// Returned internally when an invalid type conversion occurs during a system API call.
143
+ /// This is an error that should not occur under normal circumstances.
144
+ ///
145
+ /// ## `InvalidProcEntry`
146
+ /// Returned when inquiry, or parsing within the Linux `/proc/` path fails.
147
+ ///
148
+ /// ## `Io`
149
+ /// Returned when access within the Linux `/proc/` path fails.
150
+ ///
151
+ /// ## `Windows`
152
+ /// Returned when the `Win32` API used internally fails.
153
+ ///
154
+ /// ## `Unix`
155
+ /// Returned when the `libc` API used internally fails.
114
156
pub async fn kill_tree_with_config ( process_id : ProcessId , config : & Config ) -> Result < Outputs > {
115
157
imp:: validate_process_id ( process_id) ?;
116
158
let process_infos_provider = imp:: tokio:: ProcessInfosProvider { } ;
0 commit comments