Trait tikv_util::sys::DiskExt[][src]

pub trait DiskExt: Debug {
    pub fn get_type(&self) -> DiskType;
pub fn get_name(&self) -> &OsStr;
pub fn get_file_system(&self) -> &[u8]

Notable traits for &'_ [u8]

impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
;
pub fn get_mount_point(&self) -> &Path;
pub fn get_total_space(&self) -> u64;
pub fn get_available_space(&self) -> u64;
pub fn refresh(&mut self) -> bool; }

Contains all the methods of the Disk struct.

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

let s = System::new();
for disk in s.get_disks() {
    println!("{:?}: {:?}", disk.get_name(), disk.get_type());
}

Required methods

pub fn get_type(&self) -> DiskType[src]

Returns the disk type.

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

let s = System::new();
for disk in s.get_disks() {
    println!("{:?}", disk.get_type());
}

pub fn get_name(&self) -> &OsStr[src]

Returns the disk name.

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

let s = System::new();
for disk in s.get_disks() {
    println!("{:?}", disk.get_name());
}

pub fn get_file_system(&self) -> &[u8]

Notable traits for &'_ [u8]

impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
[src]

Returns the file system used on this disk (so for example: EXT4, NTFS, etc…).

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

let s = System::new();
for disk in s.get_disks() {
    println!("{:?}", disk.get_file_system());
}

pub fn get_mount_point(&self) -> &Path[src]

Returns the mount point of the disk (/ for example).

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

let s = System::new();
for disk in s.get_disks() {
    println!("{:?}", disk.get_mount_point());
}

pub fn get_total_space(&self) -> u64[src]

Returns the total disk size, in bytes.

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

let s = System::new();
for disk in s.get_disks() {
    println!("{}", disk.get_total_space());
}

pub fn get_available_space(&self) -> u64[src]

Returns the available disk size, in bytes.

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

let s = System::new();
for disk in s.get_disks() {
    println!("{}", disk.get_available_space());
}

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

Updates the disk’ information.

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

let mut s = System::new_all();
for disk in s.get_disks_mut() {
    disk.refresh();
}
Loading content...

Implementations on Foreign Types

impl DiskExt for Disk[src]

Loading content...

Implementors

Loading content...