Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing documentation for returned value of Process::kill and add extra explanations #1408

Merged
merged 1 commit into from
Dec 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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(bool)`. The boolean
/// value will depend on whether or not 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
Loading