Function hdd_standby::get_power_state
[−]
[src]
pub fn get_power_state(path: &str) -> Result<PowerState, Error>
Query the power status of the given device
You must have the necessary rights to open the device file in read only
mode, otherwise Error::NoAccess
will be returned.
Example
let status = get_power_state("/dev/sda"); println!("{:?}", status.unwrap_or(PowerState::Unknown));