Struct libatasmart::Disk

source ·
pub struct Disk {
    pub disk: PathBuf,
    /* private fields */
}
Expand description

Our ata smart disk

Fields§

§disk: PathBuf

The path in the filesystem to the hard drive

Implementations§

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

Refreshes cached SMART attribute values.

SMART attribute values are read once in Disk::new and cached. Methods such as get_temperature use these cached values and do not access the disk. Call this method to refresh the cached values.

Note: calling this method might cause the disk to wake up from sleep. Consider checking if the disk is asleep using check_sleep_mode before calling this method to avoid this.

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

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

Returns a u64 representing the power on time in milliseconds

Returns a u64 representing the number of power on cycles

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

Returns a u64 representing the mkelvin of the disk

Returns true if the disk passed smart, false otherwise.

This will dump all available information to stdout about the drive

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

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

Get the model, firmware, and serial of the disk as a IdentifyParsedDatastruct If Errno::EINVAL gets returned there is a problem with the C string parser

Trait Implementations§

Executes the destructor for this type. Read more

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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

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.