Pushes a new value into the buffer, overwriting the oldest value if the buffer is full Returns the value that was overwritten, if any
(&mut self, value: T)
| 222 | /// |
| 223 | /// Returns the value that was overwritten, if any |
| 224 | fn push(&mut self, value: T) { |
| 225 | if self.data.len() == self.capacity { |
| 226 | self.data.pop_front(); |
| 227 | } |
| 228 | self.data.push_back(value); |
| 229 | } |
| 230 | |
| 231 | /// Pops a value from the tail |
| 232 | /// |
no test coverage detected