Trait tokio_interval_buffer::Insertable
source · [−]pub trait Insertable<T>: Sized {
fn insert(&mut self, t: T);
fn return_content_and_clear(&mut self) -> Option<Self>;
}
Expand description
A generic component used for the container for the IntervalBuffer.
This can be implemented for any type, and is only implemented for Vec
For performance-specific implementations this should be replaced for whatever works for your situation.
Required methods
fn return_content_and_clear(&mut self) -> Option<Self>
fn return_content_and_clear(&mut self) -> Option<Self>
Return the current content of the buffer, and clear itself.
If the container is empty, you can return None.
For Vecstd::mem::replace(self, Vec::new())