pub enum Quality {
Exact,
Estimate,
Unavailable(Text),
}Expand description
How much a measured value can be trusted.
Variants§
Exact
Read directly from an authoritative OS source.
Estimate
Derived, interpolated between expensive reads, or a heuristic / lower bound.
Not available; the string says why (e.g. “needs root”, “not supported on this OS”).
Implementations§
Source§impl Quality
impl Quality
Sourcepub fn rank(&self) -> u8
pub fn rank(&self) -> u8
Severity order used when combining values: exact < estimate < unavailable.
pub fn is_available(&self) -> bool
Sourcepub fn worst(self, other: Quality) -> Quality
pub fn worst(self, other: Quality) -> Quality
The weaker of two qualities (estimate beats exact; unavailable beats both).
Sourcepub fn short_label(&self) -> &'static str
pub fn short_label(&self) -> &'static str
Short label for UI/exports: “exact”, “est.”, “n/a”.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Quality
impl<'de> Deserialize<'de> for Quality
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Quality
impl StructuralPartialEq for Quality
Auto Trait Implementations§
impl Forget for Quality
impl Freeze for Quality
impl Move for Quality
impl RefUnwindSafe for Qualitywhere
String: RefUnwindSafe,
impl Send for Quality
impl Sync for Quality
impl Unpin for Quality
impl UnsafeUnpin for Quality
impl UnwindSafe for Quality
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more