Skip to content

Commit

Permalink
Improve documentation for ProcessRefreshKind
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Nov 14, 2023
1 parent 7ccbb7c commit f447b0e
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,9 @@ impl System {
/// It is the same as calling:
///
/// ```no_run
/// # use sysinfo::{ProcessRefreshKind, System};
/// # use sysinfo::{Pid, ProcessRefreshKind, System};
/// # let mut system = System::new();
/// # let pid = Pid::from(0);
/// system.refresh_process_specifics(
/// pid,
/// ProcessRefreshKind::new()
Expand Down Expand Up @@ -1420,6 +1421,12 @@ assert_eq!(r.", stringify!($name), "().is_some(), false);

/// Used to determine what you want to refresh specifically on the [`Process`] type.
///
/// When all refresh are ruled out, a [`Process`] will still retrieve the following information:
/// * Process ID ([`Pid`])
/// * Parent process ID
/// * Process name
/// * Start time
///
/// ⚠️ Just like all other refresh types, ruling out a refresh doesn't assure you that
/// the information won't be retrieved if the information is accessible without needing
/// extra computation.
Expand Down Expand Up @@ -1498,7 +1505,19 @@ impl ProcessRefreshKind {
with_disk_usage,
without_disk_usage
);
impl_get_set!(ProcessRefreshKind, user, with_user, without_user);
impl_get_set!(
ProcessRefreshKind,
user,
with_user,
without_user,
"\
It will retrieve the following information:
* user ID
* user effective ID (if available on the platform)
* user group ID (if available on the platform)
* user effective ID (if available on the platform)"
);
impl_get_set!(ProcessRefreshKind, memory, with_memory, without_memory);
impl_get_set!(ProcessRefreshKind, cwd, with_cwd, without_cwd);
impl_get_set!(ProcessRefreshKind, root, with_root, without_root);
Expand Down

0 comments on commit f447b0e

Please sign in to comment.