MCPcopy Create free account
hub / github.com/aws/clock-bound / push

Method push

clock-bound/src/daemon/async_ring_buffer.rs:224–229  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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 ///

Callers 2

sendMethod · 0.45
concurrent_send_receiveFunction · 0.45

Calls 1

lenMethod · 0.45

Tested by

no test coverage detected