Struct sysinfo::ProcessRefreshKind [−][src]
pub struct ProcessRefreshKind { /* fields omitted */ }
Expand description
Used to determine what you want to refresh specifically on the Process
type.
use sysinfo::{ProcessExt, ProcessRefreshKind, System, SystemExt};
let mut system = System::new();
// We don't want to update the CPU information.
system.refresh_processes_specifics(ProcessRefreshKind::everything().without_cpu());
for (_, proc_) in system.processes() {
// We use a `==` comparison on float only because we know it's set to 0 here.
assert_eq!(proc_.cpu_usage(), 0.);
}
Implementations
Creates a new ProcessRefreshKind
with every refresh set to false
.
use sysinfo::ProcessRefreshKind;
let r = ProcessRefreshKind::new();
assert_eq!(r.cpu(), false);
assert_eq!(r.disk_usage(), false);
Creates a new ProcessRefreshKind
with every refresh set to true
.
use sysinfo::ProcessRefreshKind;
let r = ProcessRefreshKind::everything();
assert_eq!(r.cpu(), true);
assert_eq!(r.disk_usage(), true);
Returns the value of the “cpu” refresh kind.
use sysinfo::ProcessRefreshKind;
let r = ProcessRefreshKind::new();
assert_eq!(r.cpu(), false);
let r = r.with_cpu();
assert_eq!(r.cpu(), true);
let r = r.without_cpu();
assert_eq!(r.cpu(), false);
Sets the value of the “cpu” refresh kind to true
.
use sysinfo::ProcessRefreshKind;
let r = ProcessRefreshKind::new();
assert_eq!(r.cpu(), false);
let r = r.with_cpu();
assert_eq!(r.cpu(), true);
Sets the value of the “cpu” refresh kind to false
.
use sysinfo::ProcessRefreshKind;
let r = ProcessRefreshKind::everything();
assert_eq!(r.cpu(), true);
let r = r.without_cpu();
assert_eq!(r.cpu(), false);
Returns the value of the “disk_usage” refresh kind.
use sysinfo::ProcessRefreshKind;
let r = ProcessRefreshKind::new();
assert_eq!(r.disk_usage(), false);
let r = r.with_disk_usage();
assert_eq!(r.disk_usage(), true);
let r = r.without_disk_usage();
assert_eq!(r.disk_usage(), false);
Sets the value of the “disk_usage” refresh kind to true
.
use sysinfo::ProcessRefreshKind;
let r = ProcessRefreshKind::new();
assert_eq!(r.disk_usage(), false);
let r = r.with_disk_usage();
assert_eq!(r.disk_usage(), true);
Sets the value of the “disk_usage” refresh kind to false
.
use sysinfo::ProcessRefreshKind;
let r = ProcessRefreshKind::everything();
assert_eq!(r.disk_usage(), true);
let r = r.without_disk_usage();
assert_eq!(r.disk_usage(), false);
Trait Implementations
Returns the “default value” for a type. Read more
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
impl RefUnwindSafe for ProcessRefreshKind
impl Send for ProcessRefreshKind
impl Sync for ProcessRefreshKind
impl Unpin for ProcessRefreshKind
impl UnwindSafe for ProcessRefreshKind
Blanket Implementations
Mutably borrows from an owned value. Read more