[][src]Struct libatasmart::Disk

pub struct Disk {
    pub disk: PathBuf,
    // some fields omitted
}

Our ata smart disk

Fields

disk: PathBuf

The path in the filesystem to the hard drive

Implementations

impl Disk[src]

pub fn new(disk_path: &Path) -> Result<Disk, String>[src]

This will initialize a new Disk by asking libatasmart to open it. Note that this requires root permissions usually to succeed.

pub fn get_disk_size(&mut self) -> Result<u64, String>[src]

Returns a u64 representing the size of the disk in bytes.

pub fn check_sleep_mode(&mut self) -> Result<bool, String>[src]

Returns a bool of true if sleep mode is supported, false otherwise.

pub fn get_power_on(&mut self) -> Result<u64, String>[src]

Returns a u64 representing the power on time in milliseconds

pub fn get_power_cycle_count(&mut self) -> Result<u64, String>[src]

Returns a u64 representing the number of power on cycles

pub fn get_bad_sectors(&mut self) -> Result<u64, String>[src]

Returns a u64 representing the number of bad sections on the disk

pub fn get_temperature(&mut self) -> Result<u64, String>[src]

Returns a u64 representing the mkelvin of the disk

pub fn get_smart_status(&mut self) -> Result<bool, String>[src]

Returns true if the disk passed smart, false otherwise.

pub fn dump(&mut self) -> Result<(), String>[src]

This will dump all available information to stdout about the drive

pub fn identify_is_available(&mut self) -> Result<bool, String>[src]

pub fn smart_is_available(&mut self) -> Result<bool, String>[src]

Query the device and return whether or not smart is supported on it

pub fn execute_smart_self_test(
    &mut self,
    test_type: SkSmartSelfTest
) -> Result<(), String>
[src]

pub fn smart_get_overall(&mut self) -> Result<SkSmartOverall, String>[src]

Trait Implementations

impl Drop for Disk[src]

Auto Trait Implementations

impl RefUnwindSafe for Disk

impl !Send for Disk

impl !Sync for Disk

impl Unpin for Disk

impl UnwindSafe for Disk

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, 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.