pub struct EnergyRing { /* private fields */ }Expand description
2026-09-26: The sampled (time, energy, tokens) series. push assumes one
writer (the sampler thread); any number of readers read without a lock.
Implementations§
Source§impl EnergyRing
impl EnergyRing
pub fn with_capacity(slots: usize) -> Self
pub fn push(&self, p: EnergyPoint)
Sourcepub fn back(&self, back: u64) -> Option<EnergyPoint>
pub fn back(&self, back: u64) -> Option<EnergyPoint>
2026-09-26: The point back samples before the newest (0 = the newest).
Sourcepub fn at_or_before(&self, t_ns: u64) -> Option<EnergyPoint>
pub fn at_or_before(&self, t_ns: u64) -> Option<EnergyPoint>
2026-09-26: The newest point at or before t_ns; the oldest point when
every live point is later; None for an empty ring.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for EnergyRing
impl RefUnwindSafe for EnergyRing
impl Send for EnergyRing
impl Sync for EnergyRing
impl Unpin for EnergyRing
impl UnwindSafe for EnergyRing
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