[−][src]Struct sysinfo::RefreshKind
Used to determine what you want to refresh specifically on [System
] type.
Example
use sysinfo::{RefreshKind, System, SystemExt}; // We want everything except disks. let mut system = System::new_with_specifics(RefreshKind::everything().without_disk_list()); assert_eq!(system.get_disks().len(), 0); assert!(system.get_process_list().len() > 0);
Methods
impl RefreshKind
[src]
pub fn new() -> RefreshKind
[src]
Creates a new RefreshKind
with every refresh set to false
.
Examples
use sysinfo::RefreshKind; let r = RefreshKind::new(); assert_eq!(r.system(), false); assert_eq!(r.network(), false); assert_eq!(r.processes(), false); assert_eq!(r.disk_list(), false); assert_eq!(r.disks(), false);
pub fn everything() -> RefreshKind
[src]
Creates a new RefreshKind
with every refresh set to true
.
Examples
use sysinfo::RefreshKind; let r = RefreshKind::everything(); assert_eq!(r.system(), true); assert_eq!(r.network(), true); assert_eq!(r.processes(), true); assert_eq!(r.disk_list(), true); assert_eq!(r.disks(), true);
pub fn system(&self) -> bool
[src]
Returns the value of the "system" refresh kind.
Examples
use sysinfo::RefreshKind; let r = RefreshKind::new(); assert_eq!(r.system(), false); let r = r.with_system(); assert_eq!(r.system(), true);
pub fn with_system(self) -> RefreshKind
[src]
Sets the value of the "system" refresh kind to true
.
Examples
use sysinfo::RefreshKind; let r = RefreshKind::new(); assert_eq!(r.system(), false); let r = r.with_system(); assert_eq!(r.system(), true);
pub fn without_system(self) -> RefreshKind
[src]
Sets the value of the "system" refresh kind to false
.
Examples
use sysinfo::RefreshKind; let r = RefreshKind::everything(); assert_eq!(r.system(), true); let r = r.without_system(); assert_eq!(r.system(), false);
pub fn network(&self) -> bool
[src]
Returns the value of the "network" refresh kind.
Examples
use sysinfo::RefreshKind; let r = RefreshKind::new(); assert_eq!(r.network(), false); let r = r.with_network(); assert_eq!(r.network(), true);
pub fn with_network(self) -> RefreshKind
[src]
Sets the value of the "network" refresh kind to true
.
Examples
use sysinfo::RefreshKind; let r = RefreshKind::new(); assert_eq!(r.network(), false); let r = r.with_network(); assert_eq!(r.network(), true);
pub fn without_network(self) -> RefreshKind
[src]
Sets the value of the "network" refresh kind to false
.
Examples
use sysinfo::RefreshKind; let r = RefreshKind::everything(); assert_eq!(r.network(), true); let r = r.without_network(); assert_eq!(r.network(), false);
pub fn processes(&self) -> bool
[src]
Returns the value of the "processes" refresh kind.
Examples
use sysinfo::RefreshKind; let r = RefreshKind::new(); assert_eq!(r.processes(), false); let r = r.with_processes(); assert_eq!(r.processes(), true);
pub fn with_processes(self) -> RefreshKind
[src]
Sets the value of the "processes" refresh kind to true
.
Examples
use sysinfo::RefreshKind; let r = RefreshKind::new(); assert_eq!(r.processes(), false); let r = r.with_processes(); assert_eq!(r.processes(), true);
pub fn without_processes(self) -> RefreshKind
[src]
Sets the value of the "processes" refresh kind to false
.
Examples
use sysinfo::RefreshKind; let r = RefreshKind::everything(); assert_eq!(r.processes(), true); let r = r.without_processes(); assert_eq!(r.processes(), false);
pub fn disks(&self) -> bool
[src]
Returns the value of the "disks" refresh kind.
Examples
use sysinfo::RefreshKind; let r = RefreshKind::new(); assert_eq!(r.disks(), false); let r = r.with_disks(); assert_eq!(r.disks(), true);
pub fn with_disks(self) -> RefreshKind
[src]
Sets the value of the "disks" refresh kind to true
.
Examples
use sysinfo::RefreshKind; let r = RefreshKind::new(); assert_eq!(r.disks(), false); let r = r.with_disks(); assert_eq!(r.disks(), true);
pub fn without_disks(self) -> RefreshKind
[src]
Sets the value of the "disks" refresh kind to false
.
Examples
use sysinfo::RefreshKind; let r = RefreshKind::everything(); assert_eq!(r.disks(), true); let r = r.without_disks(); assert_eq!(r.disks(), false);
pub fn disk_list(&self) -> bool
[src]
Returns the value of the "disk_list" refresh kind.
Examples
use sysinfo::RefreshKind; let r = RefreshKind::new(); assert_eq!(r.disk_list(), false); let r = r.with_disk_list(); assert_eq!(r.disk_list(), true);
pub fn with_disk_list(self) -> RefreshKind
[src]
Sets the value of the "disk_list" refresh kind to true
.
Examples
use sysinfo::RefreshKind; let r = RefreshKind::new(); assert_eq!(r.disk_list(), false); let r = r.with_disk_list(); assert_eq!(r.disk_list(), true);
pub fn without_disk_list(self) -> RefreshKind
[src]
Sets the value of the "disk_list" refresh kind to false
.
Examples
use sysinfo::RefreshKind; let r = RefreshKind::everything(); assert_eq!(r.disk_list(), true); let r = r.without_disk_list(); assert_eq!(r.disk_list(), false);
Trait Implementations
impl Clone for RefreshKind
[src]
fn clone(&self) -> RefreshKind
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for RefreshKind
[src]
impl Eq for RefreshKind
[src]
impl PartialEq<RefreshKind> for RefreshKind
[src]
fn eq(&self, other: &RefreshKind) -> bool
[src]
fn ne(&self, other: &RefreshKind) -> bool
[src]
impl Debug for RefreshKind
[src]
impl StructuralPartialEq for RefreshKind
[src]
impl StructuralEq for RefreshKind
[src]
Auto Trait Implementations
impl Send for RefreshKind
impl Sync for RefreshKind
impl Unpin for RefreshKind
impl UnwindSafe for RefreshKind
impl RefUnwindSafe for RefreshKind
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,