pub trait RingBufferTrait {
type Value;
type Container: IntoIterator;
type Iter<'a>: Iterator<Item = &'a Step<Self::Value>>
where Self: 'a;
type IterMut<'a>: Iterator<Item = &'a mut Step<Self::Value>>
where Self: 'a;
// Required methods
fn new() -> Self;
fn is_empty(&self) -> bool;
fn len(&self) -> usize;
fn get_back(&self) -> Option<&Step<Self::Value>>;
fn get_front(&self) -> Option<&Step<Self::Value>>;
fn pop_front(&mut self) -> Option<Step<Self::Value>>;
fn pop_back(&mut self) -> Option<Step<Self::Value>>;
fn add_step(&mut self, step: Step<Self::Value>);
fn update_step(&mut self, step: Step<Self::Value>) -> bool;
fn prune(&mut self, max_age: Duration);
fn iter<'a>(&'a self) -> Self::Iter<'a>;
}Expand description
Common interface for timestamped ring buffers.
Implementors are expected to maintain steps in ascending timestamp order.
Required Associated Types§
Sourcetype Container: IntoIterator
type Container: IntoIterator
The backing container type that stores steps.
Required Methods§
Sourcefn update_step(&mut self, step: Step<Self::Value>) -> bool
fn update_step(&mut self, step: Step<Self::Value>) -> bool
Replaces a step with matching timestamp.
Returns true if a step was updated, false if no matching timestamp
was found.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.