MCPcopy Index your code
hub / github.com/aws/clock-bound / push

Method push

clock-bound/src/daemon/clock_sync_algorithm/ring_buffer.rs:34–42  ·  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

32 ///
33 /// Returns the value that was overwritten, if any
34 pub fn push(&mut self, value: T) -> Option<T> {
35 let popped = if self.is_full() {
36 self.buffer.pop_front()
37 } else {
38 None
39 };
40 self.buffer.push_back(value);
41 popped
42 }
43
44 /// Pops a value from the tail
45 ///

Callers 15

get_aggregate_streamMethod · 0.45
get_network_interfacesFunction · 0.45
push_and_peekFunction · 0.45
buffer_overflowFunction · 0.45
wrapFunction · 0.45
head_and_tailFunction · 0.45
clearFunction · 0.45
iterFunction · 0.45
various_capacitiesFunction · 0.45

Calls 1

is_fullMethod · 0.80

Tested by 14

push_and_peekFunction · 0.36
buffer_overflowFunction · 0.36
wrapFunction · 0.36
head_and_tailFunction · 0.36
clearFunction · 0.36
iterFunction · 0.36
popFunction · 0.36
min_rttFunction · 0.36
purge_earlier_thanFunction · 0.36