pub struct DiskRefreshKind { /* private fields */ }
Expand description
Used to determine what you want to refresh specifically on the Disk
type.
kind
is about refreshing theDisk::kind
information.storage
is about refreshing theDisk::available_space
andDisk::total_space
information.io_usage
is about refreshing theDisk::usage
information.
use sysinfo::{Disks, DiskRefreshKind};
let mut disks = Disks::new_with_refreshed_list_specifics(DiskRefreshKind::everything());
for disk in disks.list() {
assert!(disk.total_space() != 0);
}
Implementations§
Source§impl DiskRefreshKind
impl DiskRefreshKind
Sourcepub fn nothing() -> Self
pub fn nothing() -> Self
Creates a new DiskRefreshKind
with every refresh set to false.
use sysinfo::DiskRefreshKind;
let r = DiskRefreshKind::nothing();
assert_eq!(r.kind(), false);
assert_eq!(r.storage(), false);
assert_eq!(r.io_usage(), false);
Sourcepub fn everything() -> Self
pub fn everything() -> Self
Creates a new DiskRefreshKind
with every refresh set to true.
use sysinfo::DiskRefreshKind;
let r = DiskRefreshKind::everything();
assert_eq!(r.kind(), true);
assert_eq!(r.storage(), true);
assert_eq!(r.io_usage(), true);
Sourcepub fn kind(&self) -> bool
pub fn kind(&self) -> bool
Returns the value of the “kind” refresh kind.
use sysinfo::DiskRefreshKind;
let r = DiskRefreshKind::nothing();
let r = r.with_kind();
assert_eq!(r.kind(), true);
let r = r.without_kind();
assert_eq!(r.kind(), false);
Sourcepub fn with_kind(self) -> Self
pub fn with_kind(self) -> Self
Sets the value of the “kind” refresh kind to true
.
use sysinfo::DiskRefreshKind;
let r = DiskRefreshKind::nothing();
let r = r.with_kind();
assert_eq!(r.kind(), true);
Sourcepub fn without_kind(self) -> Self
pub fn without_kind(self) -> Self
Sets the value of the “kind” refresh kind to false
.
use sysinfo::DiskRefreshKind;
let r = DiskRefreshKind::everything();
assert_eq!(r.kind(), true);
let r = r.without_kind();
assert_eq!(r.kind(), false);
Sourcepub fn storage(&self) -> bool
pub fn storage(&self) -> bool
Returns the value of the “storage” refresh kind.
use sysinfo::DiskRefreshKind;
let r = DiskRefreshKind::nothing();
let r = r.with_storage();
assert_eq!(r.storage(), true);
let r = r.without_storage();
assert_eq!(r.storage(), false);
Sourcepub fn with_storage(self) -> Self
pub fn with_storage(self) -> Self
Sets the value of the “storage” refresh kind to true
.
use sysinfo::DiskRefreshKind;
let r = DiskRefreshKind::nothing();
let r = r.with_storage();
assert_eq!(r.storage(), true);
Sourcepub fn without_storage(self) -> Self
pub fn without_storage(self) -> Self
Sets the value of the “storage” refresh kind to false
.
use sysinfo::DiskRefreshKind;
let r = DiskRefreshKind::everything();
assert_eq!(r.storage(), true);
let r = r.without_storage();
assert_eq!(r.storage(), false);
Sourcepub fn io_usage(&self) -> bool
pub fn io_usage(&self) -> bool
Returns the value of the “io_usage” refresh kind.
use sysinfo::DiskRefreshKind;
let r = DiskRefreshKind::nothing();
let r = r.with_io_usage();
assert_eq!(r.io_usage(), true);
let r = r.without_io_usage();
assert_eq!(r.io_usage(), false);
Sourcepub fn with_io_usage(self) -> Self
pub fn with_io_usage(self) -> Self
Sets the value of the “io_usage” refresh kind to true
.
use sysinfo::DiskRefreshKind;
let r = DiskRefreshKind::nothing();
let r = r.with_io_usage();
assert_eq!(r.io_usage(), true);
Sourcepub fn without_io_usage(self) -> Self
pub fn without_io_usage(self) -> Self
Sets the value of the “io_usage” refresh kind to false
.
use sysinfo::DiskRefreshKind;
let r = DiskRefreshKind::everything();
assert_eq!(r.io_usage(), true);
let r = r.without_io_usage();
assert_eq!(r.io_usage(), false);
Trait Implementations§
Source§impl Clone for DiskRefreshKind
impl Clone for DiskRefreshKind
Source§fn clone(&self) -> DiskRefreshKind
fn clone(&self) -> DiskRefreshKind
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for DiskRefreshKind
impl Debug for DiskRefreshKind
Source§impl Default for DiskRefreshKind
impl Default for DiskRefreshKind
Source§fn default() -> DiskRefreshKind
fn default() -> DiskRefreshKind
impl Copy for DiskRefreshKind
Auto Trait Implementations§
impl Freeze for DiskRefreshKind
impl RefUnwindSafe for DiskRefreshKind
impl Send for DiskRefreshKind
impl Sync for DiskRefreshKind
impl Unpin for DiskRefreshKind
impl UnwindSafe for DiskRefreshKind
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 3 bytes