Struct history_buffer::HistoryBuffer [−][src]
pub struct HistoryBuffer<T> { /* fields omitted */ }
Expand description
A “history buffer”, similar to a write-only ring buffer of fixed length.
This buffer keeps a fixed number of elements. On write, the oldest element is overwritten. Thus, the buffer is useful to keep a history of values with some desired depth.
Implementations
Get the most recent value written to the buffer.
Write a new value into the buffer, if it overwrites an old value it is returned.
How long was it since the last measurement.
Get the entire buffer as unsorted.
Get the entire in chronological order, starting with the oldest element.