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

Method new

clock-bound/src/daemon/clock_sync_algorithm/ring_buffer.rs:23–29  ·  view source on GitHub ↗

Creates a new ring buffer with the given capacity

(capacity: NonZeroUsize)

Source from the content-addressed store, hash-verified

21impl<T> RingBuffer<T> {
22 /// Creates a new ring buffer with the given capacity
23 pub fn new(capacity: NonZeroUsize) -> Self {
24 let capacity = capacity.get();
25 Self {
26 buffer: VecDeque::with_capacity(capacity),
27 capacity,
28 }
29 }
30
31 /// Pushes a new value into the buffer, overwriting the oldest value if the buffer is full
32 ///

Callers

nothing calls this directly

Calls 1

getMethod · 0.45

Tested by

no test coverage detected