pub enum ObservableMetric<T> {
Measured(T),
Proxy(T),
Unobservable(&'static str),
}Expand description
Truthful observability wrapper separating directly measured samples, proxy estimates, and explicitly unobservable metrics (never faking zero).
Variants§
Measured(T)
Directly measured from real hardware, compositor, or instrumented runtime counters.
Proxy(T)
Proxy estimate (such as callback or submission timing) rather than compositor proof.
Unobservable(&'static str)
Metric is unavailable on this host/backend and MUST serialize as null with an explicit reason.
Implementations§
Source§impl<T> ObservableMetric<T>
Inspection helpers for ObservableMetric<T>.
impl<T> ObservableMetric<T>
Inspection helpers for ObservableMetric<T>.
Sourcepub const fn is_measured(&self) -> bool
pub const fn is_measured(&self) -> bool
Sourcepub const fn is_unobservable(&self) -> bool
pub const fn is_unobservable(&self) -> bool
Sourcepub const fn status_str(&self) -> &'static str
pub const fn status_str(&self) -> &'static str
Sourcepub const fn measured_ref(&self) -> Option<&T>
pub const fn measured_ref(&self) -> Option<&T>
Trait Implementations§
Source§impl<T: Clone> Clone for ObservableMetric<T>
impl<T: Clone> Clone for ObservableMetric<T>
impl<T: Copy> Copy for ObservableMetric<T>
Source§impl<T: Debug> Debug for ObservableMetric<T>
impl<T: Debug> Debug for ObservableMetric<T>
Source§impl<T> Default for ObservableMetric<T>
Default unobservable state ensuring missing metrics never initialize as fake zero.
impl<T> Default for ObservableMetric<T>
Default unobservable state ensuring missing metrics never initialize as fake zero.
impl<T: Eq> Eq for ObservableMetric<T>
Source§impl<T: Hash> Hash for ObservableMetric<T>
impl<T: Hash> Hash for ObservableMetric<T>
Source§impl<T: PartialEq> PartialEq for ObservableMetric<T>
impl<T: PartialEq> PartialEq for ObservableMetric<T>
Source§impl<T> Serialize for ObservableMetric<T>where
T: Serialize,
Truthful JSON serialization emitting explicit status, value (null when unobservable), and reason.
impl<T> Serialize for ObservableMetric<T>where
T: Serialize,
Truthful JSON serialization emitting explicit status, value (null when unobservable), and reason.
impl<T: PartialEq> StructuralPartialEq for ObservableMetric<T>
Auto Trait Implementations§
impl<T> Forget for ObservableMetric<T>
impl<T> Freeze for ObservableMetric<T>
impl<T> Move for ObservableMetric<T>
impl<T> RefUnwindSafe for ObservableMetric<T>where
T: RefUnwindSafe,
impl<T> Send for ObservableMetric<T>
impl<T> Sync for ObservableMetric<T>where
T: Sync,
impl<T> Unpin for ObservableMetric<T>
impl<T> UnsafeUnpin for ObservableMetric<T>
impl<T> UnwindSafe for ObservableMetric<T>
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