pub struct DriftTimeline { /* private fields */ }Expand description
Ring buffer of recent drift snapshots for sparkline rendering.
Implementations§
Source§impl DriftTimeline
impl DriftTimeline
Sourcepub fn new(capacity: usize) -> Self
pub fn new(capacity: usize) -> Self
Create a new timeline with the given capacity (max frames to retain).
Sourcepub fn push(&mut self, snapshot: DriftSnapshot)
pub fn push(&mut self, snapshot: DriftSnapshot)
Push a new snapshot into the timeline.
Sourcepub fn iter_chronological(&self) -> impl Iterator<Item = &DriftSnapshot>
pub fn iter_chronological(&self) -> impl Iterator<Item = &DriftSnapshot>
Iterate snapshots in chronological order (oldest first).
Sourcepub fn confidence_series(&self, domain: DecisionDomain) -> Vec<f64>
pub fn confidence_series(&self, domain: DecisionDomain) -> Vec<f64>
Extract confidence values for a specific domain in chronological order.
Sourcepub fn last_fallback_trigger(&self, domain: DecisionDomain) -> Option<usize>
pub fn last_fallback_trigger(&self, domain: DecisionDomain) -> Option<usize>
Find the most recent snapshot where a domain transitioned into fallback.
Sourcepub fn latest(&self) -> Option<&DriftSnapshot>
pub fn latest(&self) -> Option<&DriftSnapshot>
Get the latest snapshot, if any.
Trait Implementations§
Source§impl Clone for DriftTimeline
impl Clone for DriftTimeline
Source§fn clone(&self) -> DriftTimeline
fn clone(&self) -> DriftTimeline
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for DriftTimeline
impl RefUnwindSafe for DriftTimeline
impl Send for DriftTimeline
impl Sync for DriftTimeline
impl Unpin for DriftTimeline
impl UnsafeUnpin for DriftTimeline
impl UnwindSafe for DriftTimeline
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