pub struct Ring { /* private fields */ }Implementations§
Source§impl Ring
impl Ring
pub fn new(cap: usize) -> Ring
pub fn push(&mut self, point: Point)
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn last(&self) -> Option<Point>
Sourcepub fn window(&self, now: u64, window_ms: u64) -> Vec<Point>
pub fn window(&self, now: u64, window_ms: u64) -> Vec<Point>
The points of the window_ms that ends at now, oldest first (a frozen chart passes the instant it froze).
Sourcepub fn collected_ms(&self, now: u64) -> u64
pub fn collected_ms(&self, now: u64) -> u64
How long ago the oldest sample was taken (what the chart can honestly claim to show).
Trait Implementations§
impl StructuralPartialEq for Ring
Auto Trait Implementations§
impl Freeze for Ring
impl RefUnwindSafe for Ring
impl Send for Ring
impl Sync for Ring
impl Unpin for Ring
impl UnsafeUnpin for Ring
impl UnwindSafe for Ring
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more