Skip to content

Commit

Permalink
Add missing documentation for returned value of Process::kill and a…
Browse files Browse the repository at this point in the history
…dd extra explanations
  • Loading branch information
GuillaumeGomez committed Dec 1, 2024
1 parent c361f34 commit 06f472a
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/common/system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1093,6 +1093,14 @@ impl Process {
/// Sends [`Signal::Kill`] to the process (which is the only signal supported on all supported
/// platforms by this crate).
///
/// Returns `true` if the signal was sent successfully.
///
/// ⚠️ Even if this function returns `true`, it doesn't necessarily mean that the process will
/// be killed. It just means that the signal was sent successfully.
///
/// ⚠️ Please note that some processes might not be "killable", like if they run with higher
/// levels than the current process for example.
///
/// If you want to send another signal, take a look at [`Process::kill_with`].
///
/// To get the list of the supported signals on this system, use
Expand All @@ -1111,11 +1119,14 @@ impl Process {
}

/// 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.
/// it'll do nothing and will return `None`. Otherwise it'll return `Some(true)` if the signal
/// was sent successfully.
///
/// If you just want to kill the process, use [`Process::kill`] directly.
///
/// ⚠️ Please note that some processes might not be "killable", like if they run with higher
/// levels than the current process for example.
///
/// To get the list of the supported signals on this system, use
/// [`SUPPORTED_SIGNALS`][crate::SUPPORTED_SIGNALS].
///
Expand Down

0 comments on commit 06f472a

Please sign in to comment.