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

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]

fn clone(&self) -> RefreshKind[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for RefreshKind[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl Default for RefreshKind[src]

fn default() -> RefreshKind[src]

Returns the “default value” for a type. Read more

impl PartialEq<RefreshKind> for RefreshKind[src]

fn eq(&self, other: &RefreshKind) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, other: &RefreshKind) -> bool[src]

This method tests for !=.

impl Copy for RefreshKind[src]

impl Eq for RefreshKind[src]

impl StructuralEq for RefreshKind[src]

impl StructuralPartialEq for RefreshKind[src]

Auto Trait Implementations

Blanket Implementations

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> Pointable for T

pub const ALIGN: usize

The alignment of pointer.

type Init = T

The type for initializers.

pub unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more

pub unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more

pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more

pub unsafe fn drop(ptr: usize)

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

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

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

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

pub fn clone_into(&self, target: &mut T)[src]

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

recently added

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

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.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.