Struct sysinfo::RefreshKind[][src]

pub struct RefreshKind { /* fields omitted */ }

Used to determine what you want to refresh specifically on System type.

use sysinfo::{RefreshKind, System, SystemExt};

// We want everything except disks.
let mut system = System::new_with_specifics(RefreshKind::everything().without_disks_list());

assert_eq!(system.get_disks().len(), 0);
assert!(system.get_processes().len() > 0);

Implementations

impl RefreshKind[src]

pub fn new() -> RefreshKind[src]

Creates a new RefreshKind with every refresh set to false.

use sysinfo::RefreshKind;

let r = RefreshKind::new();

assert_eq!(r.networks(), false);
assert_eq!(r.networks_list(), false);
assert_eq!(r.processes(), false);
assert_eq!(r.disks_list(), false);
assert_eq!(r.disks(), false);
assert_eq!(r.memory(), false);
assert_eq!(r.cpu(), false);
assert_eq!(r.components(), false);
assert_eq!(r.components_list(), false);
assert_eq!(r.users_list(), false);

pub fn everything() -> RefreshKind[src]

Creates a new RefreshKind with every refresh set to true.

use sysinfo::RefreshKind;

let r = RefreshKind::everything();

assert_eq!(r.networks(), true);
assert_eq!(r.networks_list(), true);
assert_eq!(r.processes(), true);
assert_eq!(r.disks_list(), true);
assert_eq!(r.disks(), true);
assert_eq!(r.memory(), true);
assert_eq!(r.cpu(), true);
assert_eq!(r.components(), true);
assert_eq!(r.components_list(), true);
assert_eq!(r.users_list(), true);

pub fn networks(&self) -> bool[src]

Returns the value of the “networks” refresh kind.

use sysinfo::RefreshKind;

let r = RefreshKind::new();
assert_eq!(r.networks(), false);

let r = r.with_networks();
assert_eq!(r.networks(), true);

let r = r.without_networks();
assert_eq!(r.networks(), false);

pub fn with_networks(self) -> RefreshKind[src]

Sets the value of the “networks” refresh kind to true.

use sysinfo::RefreshKind;

let r = RefreshKind::new();
assert_eq!(r.networks(), false);

let r = r.with_networks();
assert_eq!(r.networks(), true);

pub fn without_networks(self) -> RefreshKind[src]

Sets the value of the “networks” refresh kind to false.

use sysinfo::RefreshKind;

let r = RefreshKind::everything();
assert_eq!(r.networks(), true);

let r = r.without_networks();
assert_eq!(r.networks(), false);

pub fn networks_list(&self) -> bool[src]

Returns the value of the “networks_list” refresh kind.

use sysinfo::RefreshKind;

let r = RefreshKind::new();
assert_eq!(r.networks_list(), false);

let r = r.with_networks_list();
assert_eq!(r.networks_list(), true);

let r = r.without_networks_list();
assert_eq!(r.networks_list(), false);

pub fn with_networks_list(self) -> RefreshKind[src]

Sets the value of the “networks_list” refresh kind to true.

use sysinfo::RefreshKind;

let r = RefreshKind::new();
assert_eq!(r.networks_list(), false);

let r = r.with_networks_list();
assert_eq!(r.networks_list(), true);

pub fn without_networks_list(self) -> RefreshKind[src]

Sets the value of the “networks_list” refresh kind to false.

use sysinfo::RefreshKind;

let r = RefreshKind::everything();
assert_eq!(r.networks_list(), true);

let r = r.without_networks_list();
assert_eq!(r.networks_list(), false);

pub fn processes(&self) -> bool[src]

Returns the value of the “processes” refresh kind.

use sysinfo::RefreshKind;

let r = RefreshKind::new();
assert_eq!(r.processes(), false);

let r = r.with_processes();
assert_eq!(r.processes(), true);

let r = r.without_processes();
assert_eq!(r.processes(), false);

pub fn with_processes(self) -> RefreshKind[src]

Sets the value of the “processes” refresh kind to true.

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.

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.

use sysinfo::RefreshKind;

let r = RefreshKind::new();
assert_eq!(r.disks(), false);

let r = r.with_disks();
assert_eq!(r.disks(), true);

let r = r.without_disks();
assert_eq!(r.disks(), false);

pub fn with_disks(self) -> RefreshKind[src]

Sets the value of the “disks” refresh kind to true.

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.

use sysinfo::RefreshKind;

let r = RefreshKind::everything();
assert_eq!(r.disks(), true);

let r = r.without_disks();
assert_eq!(r.disks(), false);

pub fn disks_list(&self) -> bool[src]

Returns the value of the “disks_list” refresh kind.

use sysinfo::RefreshKind;

let r = RefreshKind::new();
assert_eq!(r.disks_list(), false);

let r = r.with_disks_list();
assert_eq!(r.disks_list(), true);

let r = r.without_disks_list();
assert_eq!(r.disks_list(), false);

pub fn with_disks_list(self) -> RefreshKind[src]

Sets the value of the “disks_list” refresh kind to true.

use sysinfo::RefreshKind;

let r = RefreshKind::new();
assert_eq!(r.disks_list(), false);

let r = r.with_disks_list();
assert_eq!(r.disks_list(), true);

pub fn without_disks_list(self) -> RefreshKind[src]

Sets the value of the “disks_list” refresh kind to false.

use sysinfo::RefreshKind;

let r = RefreshKind::everything();
assert_eq!(r.disks_list(), true);

let r = r.without_disks_list();
assert_eq!(r.disks_list(), false);

pub fn memory(&self) -> bool[src]

Returns the value of the “memory” refresh kind.

use sysinfo::RefreshKind;

let r = RefreshKind::new();
assert_eq!(r.memory(), false);

let r = r.with_memory();
assert_eq!(r.memory(), true);

let r = r.without_memory();
assert_eq!(r.memory(), false);

pub fn with_memory(self) -> RefreshKind[src]

Sets the value of the “memory” refresh kind to true.

use sysinfo::RefreshKind;

let r = RefreshKind::new();
assert_eq!(r.memory(), false);

let r = r.with_memory();
assert_eq!(r.memory(), true);

pub fn without_memory(self) -> RefreshKind[src]

Sets the value of the “memory” refresh kind to false.

use sysinfo::RefreshKind;

let r = RefreshKind::everything();
assert_eq!(r.memory(), true);

let r = r.without_memory();
assert_eq!(r.memory(), false);

pub fn cpu(&self) -> bool[src]

Returns the value of the “cpu” refresh kind.

use sysinfo::RefreshKind;

let r = RefreshKind::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);

pub fn with_cpu(self) -> RefreshKind[src]

Sets the value of the “cpu” refresh kind to true.

use sysinfo::RefreshKind;

let r = RefreshKind::new();
assert_eq!(r.cpu(), false);

let r = r.with_cpu();
assert_eq!(r.cpu(), true);

pub fn without_cpu(self) -> RefreshKind[src]

Sets the value of the “cpu” refresh kind to false.

use sysinfo::RefreshKind;

let r = RefreshKind::everything();
assert_eq!(r.cpu(), true);

let r = r.without_cpu();
assert_eq!(r.cpu(), false);

pub fn components(&self) -> bool[src]

Returns the value of the “components” refresh kind.

use sysinfo::RefreshKind;

let r = RefreshKind::new();
assert_eq!(r.components(), false);

let r = r.with_components();
assert_eq!(r.components(), true);

let r = r.without_components();
assert_eq!(r.components(), false);

pub fn with_components(self) -> RefreshKind[src]

Sets the value of the “components” refresh kind to true.

use sysinfo::RefreshKind;

let r = RefreshKind::new();
assert_eq!(r.components(), false);

let r = r.with_components();
assert_eq!(r.components(), true);

pub fn without_components(self) -> RefreshKind[src]

Sets the value of the “components” refresh kind to false.

use sysinfo::RefreshKind;

let r = RefreshKind::everything();
assert_eq!(r.components(), true);

let r = r.without_components();
assert_eq!(r.components(), false);

pub fn components_list(&self) -> bool[src]

Returns the value of the “components_list” refresh kind.

use sysinfo::RefreshKind;

let r = RefreshKind::new();
assert_eq!(r.components_list(), false);

let r = r.with_components_list();
assert_eq!(r.components_list(), true);

let r = r.without_components_list();
assert_eq!(r.components_list(), false);

pub fn with_components_list(self) -> RefreshKind[src]

Sets the value of the “components_list” refresh kind to true.

use sysinfo::RefreshKind;

let r = RefreshKind::new();
assert_eq!(r.components_list(), false);

let r = r.with_components_list();
assert_eq!(r.components_list(), true);

pub fn without_components_list(self) -> RefreshKind[src]

Sets the value of the “components_list” refresh kind to false.

use sysinfo::RefreshKind;

let r = RefreshKind::everything();
assert_eq!(r.components_list(), true);

let r = r.without_components_list();
assert_eq!(r.components_list(), false);

pub fn users_list(&self) -> bool[src]

Returns the value of the “users_list” refresh kind.

use sysinfo::RefreshKind;

let r = RefreshKind::new();
assert_eq!(r.users_list(), false);

let r = r.with_users_list();
assert_eq!(r.users_list(), true);

let r = r.without_users_list();
assert_eq!(r.users_list(), false);

pub fn with_users_list(self) -> RefreshKind[src]

Sets the value of the “users_list” refresh kind to true.

use sysinfo::RefreshKind;

let r = RefreshKind::new();
assert_eq!(r.users_list(), false);

let r = r.with_users_list();
assert_eq!(r.users_list(), true);

pub fn without_users_list(self) -> RefreshKind[src]

Sets the value of the “users_list” refresh kind to false.

use sysinfo::RefreshKind;

let r = RefreshKind::everything();
assert_eq!(r.users_list(), true);

let r = r.without_users_list();
assert_eq!(r.users_list(), false);

Trait Implementations

impl Clone for RefreshKind[src]

impl Copy for RefreshKind[src]

impl Debug for RefreshKind[src]

impl Default for RefreshKind[src]

impl Eq for RefreshKind[src]

impl PartialEq<RefreshKind> for RefreshKind[src]

impl StructuralEq for RefreshKind[src]

impl StructuralPartialEq for RefreshKind[src]

Auto Trait Implementations

impl RefUnwindSafe for RefreshKind

impl Send for RefreshKind

impl Sync for RefreshKind

impl Unpin for RefreshKind

impl UnwindSafe for RefreshKind

Blanket Implementations

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

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

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

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

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

impl<T> Pointable for T[src]

type Init = T

The type for initializers.

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

type Owned = T

The resulting type after obtaining ownership.

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.