[−][src]Trait futures_intrusive::buffer::RingBuf
A Ring Buffer of items
Associated Types
type Item
The type of stored items inside the Ring Buffer
Required methods
fn new() -> Self
Creates a new instance of the Ring Buffer
fn with_capacity(cap: usize) -> Self
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.
fn capacity(&self) -> usize
The capacity of the buffer
fn len(&self) -> usize
The amount of stored items in the buffer
fn can_push(&self) -> bool
Returns true if there is enough space in the buffer to store another item.
fn push(&mut self, item: Self::Item)
Stores the item at the end of the buffer. Panics if there is not enough free space.
fn pop(&mut self) -> Self::Item
Returns the oldest item inside the buffer. Panics if there is no available item.
Provided methods
Loading content...Implementors
impl<T> RingBuf for FixedHeapBuf<T>
[src]
type Item = T
fn new() -> Self
[src]
fn with_capacity(cap: usize) -> Self
[src]
fn capacity(&self) -> usize
[src]
fn len(&self) -> usize
[src]
fn can_push(&self) -> bool
[src]
fn push(&mut self, value: Self::Item)
[src]
fn pop(&mut self) -> Self::Item
[src]
impl<T> RingBuf for GrowingHeapBuf<T>
[src]
type Item = T
fn new() -> Self
[src]
fn with_capacity(limit: usize) -> Self
[src]
fn capacity(&self) -> usize
[src]
fn len(&self) -> usize
[src]
fn can_push(&self) -> bool
[src]
fn push(&mut self, value: Self::Item)
[src]
fn pop(&mut self) -> Self::Item
[src]
impl<T, A> RingBuf for ArrayBuf<T, A> where
A: AsMut<[T]> + AsRef<[T]> + RealArray<T>,
[src]
A: AsMut<[T]> + AsRef<[T]> + RealArray<T>,