Struct futures_intrusive::buffer::GrowingHeapBuf
source · 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
sourceimpl<T> Debug for GrowingHeapBuf<T>
impl<T> Debug for GrowingHeapBuf<T>
sourceimpl<T> RingBuf for GrowingHeapBuf<T>
impl<T> RingBuf for GrowingHeapBuf<T>
type Item = T
type Item = T
The type of stored items inside the Ring Buffer
sourcefn with_capacity(limit: usize) -> Self
fn with_capacity(limit: 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 GrowingHeapBuf<T>where
T: RefUnwindSafe,
impl<T> Send for GrowingHeapBuf<T>where
T: Send,
impl<T> Sync for GrowingHeapBuf<T>where
T: Sync,
impl<T> Unpin for GrowingHeapBuf<T>where
T: Unpin,
impl<T> UnwindSafe for GrowingHeapBuf<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