Struct futures_intrusive::buffer::FixedHeapBuf
source · pub struct FixedHeapBuf<T> { /* private fields */ }
Expand description
A Ring Buffer which stores all items on the heap.
The FixedHeapBuf
will allocate its capacity ahead of time. This is good
fit when you have a constant latency between two components.
Trait Implementations
sourceimpl<T> Debug for FixedHeapBuf<T>
impl<T> Debug for FixedHeapBuf<T>
sourceimpl<T> RingBuf for FixedHeapBuf<T>
impl<T> RingBuf for FixedHeapBuf<T>
type Item = T
type Item = T
The type of stored items inside the Ring Buffer
sourcefn with_capacity(cap: usize) -> Self
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. Read moresourcefn can_push(&self) -> bool
fn can_push(&self) -> bool
Returns true if there is enough space in the buffer to
store another item. Read more
sourcefn push(&mut self, value: Self::Item)
fn push(&mut self, value: Self::Item)
Stores the item at the end of the buffer.
Panics if there is not enough free space. Read more
Auto Trait Implementations
impl<T> RefUnwindSafe for FixedHeapBuf<T>where
T: RefUnwindSafe,
impl<T> Send for FixedHeapBuf<T>where
T: Send,
impl<T> Sync for FixedHeapBuf<T>where
T: Sync,
impl<T> Unpin for FixedHeapBuf<T>where
T: Unpin,
impl<T> UnwindSafe for FixedHeapBuf<T>where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more