pub struct SmartAttribute {
pub id: u8,
pub name: String,
pub flags: u16,
pub normalized: i32,
pub worst: i32,
pub threshold: i32,
pub pretty: Option<PrettyValue>,
}Expand description
A S.M.A.R.T. attribute.
Fields§
§id: u8Attribute Identifier
name: StringThe identifier as a string.
flags: u1616-bit attribute flags (bit 0 is prefail/oldage, bit 1 is online/offline).
normalized: i32The current value or -1 if unknown.
worst: i32The worst value of -1 if unknown.
threshold: i32The threshold or -1 if unknown.
pretty: Option<PrettyValue>An interpretation of the value
Implementations§
Source§impl SmartAttribute
impl SmartAttribute
Sourcepub fn pre_fail(&self) -> bool
pub fn pre_fail(&self) -> bool
Whether this attribute determines if the drive is failing (true) or old (false).
From SFF 8035i Revision 2 page 19:
Bit 0 (pre-failure/advisory bit) - If the value of this bit equals zero, an attribute value less than or equal to its corresponding attribute threshold indicates an advisory condition where the usage or age of the device has exceeded its intended design life period. If the value of this bit equals one, an attribute value less than or equal to its corresponding attribute threshold indicates a prefailure condition where imminent loss of data is being predicted.
From SMART Attribute Overview:
0: Advisory: The usage of age of the device has exceeded its intended design life period
1: Pre-failure notification: Failure is predicted within 24 hours
Sourcepub fn online(&self) -> bool
pub fn online(&self) -> bool
From SFF 8035i Revision 2 page 19:
Bit 1 (on-line data collection bit) - If the value of this bit equals zero, then the attribute value is updated only during off-line data collection activities. If the value of this bit equals one, then the attribute value is updated during normal operation of the device or during both normal operation and off-line testing.
Sourcepub fn performance(&self) -> bool
pub fn performance(&self) -> bool
true: speed/performance
pub fn error_rate(&self) -> bool
pub fn event_count(&self) -> bool
pub fn self_preserving(&self) -> bool
Sourcepub fn assessment(&self) -> SmartAssessment
pub fn assessment(&self) -> SmartAssessment
Assess the disk’s state.
From https://github.com/GNOME/gnome-disk-utility/blob/5baa52eff3036fc59648bc2e10c4d4ec69dec50b/src/disks/gduatasmartdialog.c#L678
Trait Implementations§
Source§impl Clone for SmartAttribute
impl Clone for SmartAttribute
Source§fn clone(&self) -> SmartAttribute
fn clone(&self) -> SmartAttribute
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more