[][src]Struct sysinfo::RefreshKind

pub struct RefreshKind { /* fields omitted */ }

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_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl PartialEq<RefreshKind> for RefreshKind[src]

impl Copy for RefreshKind[src]

impl Eq for RefreshKind[src]

impl Debug for RefreshKind[src]

Auto Trait Implementations

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]