Struct sysinfo::RefreshKind[][src]

pub struct RefreshKind { /* fields omitted */ }
Expand description

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

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);

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);

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);

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);

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);

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);

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);

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);

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);

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);

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);

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);

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);

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);

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);

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);

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);

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);

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);

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);

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);

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);

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);

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);

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);

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);

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);

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);

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);

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);

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);

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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

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

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.