Struct libatasmart::Disk
[−]
[src]
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
Methods
impl Disk
[src]
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.
fn get_disk_size(&mut self) -> Result<u64, String>
[src]
Returns a u64 representing the size of the disk in bytes.
fn check_sleep_mode(&mut self) -> Result<bool, String>
[src]
Returns a bool of true if sleep mode is supported, false otherwise.
fn get_power_on(&mut self) -> Result<u64, String>
[src]
Returns a u64 representing the power on time in milliseconds
fn get_power_cycle_count(&mut self) -> Result<u64, String>
[src]
Returns a u64 representing the number of power on cycles
fn get_bad_sectors(&mut self) -> Result<u64, String>
[src]
Returns a u64 representing the number of bad sections on the disk
fn get_temperature(&mut self) -> Result<u64, String>
[src]
Returns a u64 representing the mkelvin of the disk
fn get_smart_status(&mut self) -> Result<bool, String>
[src]
Returns true if the disk passed smart, false otherwise.
fn dump(&mut self) -> Result<(), String>
[src]
This will dump all available information to stdout about the drive
fn identify_is_available(&mut self) -> Result<bool, String>
[src]
fn smart_is_available(&mut self) -> Result<bool, String>
[src]
Query the device and return whether or not smart is supported on it
fn execute_smart_self_test(
&mut self,
test_type: SkSmartSelfTest
) -> Result<(), String>
[src]
&mut self,
test_type: SkSmartSelfTest
) -> Result<(), String>