pub struct GrowingHeapBuf<T> { /* private fields */ }
Expand description

A Ring Buffer which stores all items on the heap but grows dynamically.

A GrowingHeapBuf does not allocate the capacity ahead of time, as opposed to the FixedHeapBuf. This makes it a good fit when you have unpredictable latency between two components, when you want to amortize your allocation costs or when you are using an external back-pressure mechanism.

Trait Implementations

Formats the value using the given formatter. Read more
The type of stored items inside the Ring Buffer
Creates a new instance of the Ring Buffer
Creates a new instance of the Ring Buffer with the given capacity. RingBuf implementations are allowed to ignore the capacity hint and utilize their default capacity. Read more
The capacity of the buffer
The amount of stored items in the buffer
Returns true if there is enough space in the buffer to store another item. Read more
Stores the item at the end of the buffer. Panics if there is not enough free space. Read more
Returns the oldest item inside the buffer. Panics if there is no available item. Read more
Returns true if no item is stored inside the buffer.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.