Struct async_ringbuf::ring_buffer::AsyncRb
source · pub struct AsyncRb<T, B: Rb<T>> { /* private fields */ }
Implementations§
source§impl<T, B: Rb<T>> AsyncRb<T, B>
impl<T, B: Rb<T>> AsyncRb<T, B>
pub fn from_base(base: B) -> Self
pub fn into_base(self) -> B
pub fn split_ref(
&mut self
) -> (AsyncProducer<T, &Self>, AsyncConsumer<T, &Self>)
source§impl<T, C: Container<T>> AsyncRb<T, LocalRb<T, C>>
impl<T, C: Container<T>> AsyncRb<T, LocalRb<T, C>>
pub fn split(self) -> (AsyncProducer<T, Rc<Self>>, AsyncConsumer<T, Rc<Self>>)
pub fn split(self) -> (AsyncProducer<T, Arc<Self>>, AsyncConsumer<T, Arc<Self>>)
Trait Implementations§
source§impl<T, B: Rb<T>> AsyncRbRead<T> for AsyncRb<T, B>
impl<T, B: Rb<T>> AsyncRbRead<T> for AsyncRb<T, B>
unsafe fn register_tail_waker(&self, waker: &Waker)
unsafe fn close_head(&self)
source§impl<T, B: Rb<T>> AsyncRbWrite<T> for AsyncRb<T, B>
impl<T, B: Rb<T>> AsyncRbWrite<T> for AsyncRb<T, B>
unsafe fn register_head_waker(&self, waker: &Waker)
unsafe fn close_tail(&self)
source§impl<T, B: Rb<T>> Rb<T> for AsyncRb<T, B>
impl<T, B: Rb<T>> Rb<T> for AsyncRb<T, B>
source§fn as_slices(&self) -> (&[T], &[T])
fn as_slices(&self) -> (&[T], &[T])
Returns a pair of slices which contain, in order, the contents of the ring buffer.
source§fn as_mut_slices(&mut self) -> (&mut [T], &mut [T])
fn as_mut_slices(&mut self) -> (&mut [T], &mut [T])
Returns a pair of mutable slices which contain, in order, the contents of the ring buffer.
source§fn pop(&mut self) -> Option<T>
fn pop(&mut self) -> Option<T>
Removes latest item from the ring buffer and returns it. Read more
source§fn pop_iter(&mut self) -> PopIterator<'_, T, RbWrap<Self>>
fn pop_iter(&mut self) -> PopIterator<'_, T, RbWrap<Self>>
Returns an iterator that removes items one by one from the ring buffer.
source§fn iter(&self) -> Chain<Iter<'_, T>, Iter<'_, T>>
fn iter(&self) -> Chain<Iter<'_, T>, Iter<'_, T>>
Returns a front-to-back iterator containing references to items in the ring buffer. Read more
source§fn iter_mut(&mut self) -> Chain<IterMut<'_, T>, IterMut<'_, T>>
fn iter_mut(&mut self) -> Chain<IterMut<'_, T>, IterMut<'_, T>>
Returns a front-to-back iterator that returns mutable references to items in the ring buffer. Read more
source§fn skip(&mut self, count: usize) -> usize
fn skip(&mut self, count: usize) -> usize
Removes exactly
n
items from the buffer and safely drops them. Read moresource§fn clear(&mut self) -> usize
fn clear(&mut self) -> usize
Removes all items from the buffer and safely drops them. Read more
source§fn push_overwrite(&mut self, elem: T) -> Option<T>
fn push_overwrite(&mut self, elem: T) -> Option<T>
Pushes an item to the ring buffer overwriting the latest item if the buffer is full. Read more
source§fn push_iter<I>(&mut self, iter: &mut I)where
I: Iterator<Item = T>,
fn push_iter<I>(&mut self, iter: &mut I)where
I: Iterator<Item = T>,
Appends items from an iterator to the ring buffer.
Elements that haven’t been added to the ring buffer remain in the iterator.
source§fn push_iter_overwrite<I>(&mut self, iter: I)where
I: Iterator<Item = T>,
fn push_iter_overwrite<I>(&mut self, iter: I)where
I: Iterator<Item = T>,
Appends items from an iterator to the ring buffer. Read more
source§impl<T, B: Rb<T>> RbBase<T> for AsyncRb<T, B>
impl<T, B: Rb<T>> RbBase<T> for AsyncRb<T, B>
source§unsafe fn data(&self) -> &mut [MaybeUninit<T>]
unsafe fn data(&self) -> &mut [MaybeUninit<T>]
Returns underlying raw ring buffer memory as slice. Read more
source§fn capacity_nonzero(&self) -> NonZeroUsize
fn capacity_nonzero(&self) -> NonZeroUsize
Capacity of the ring buffer. Read more
source§fn modulus(&self) -> NonZeroUsize
fn modulus(&self) -> NonZeroUsize
source§fn occupied_len(&self) -> usize
fn occupied_len(&self) -> usize
The number of items stored in the buffer at the moment.
source§fn vacant_len(&self) -> usize
fn vacant_len(&self) -> usize
The number of vacant places in the buffer at the moment.
source§impl<T, B: Rb<T>> RbRead<T> for AsyncRb<T, B>
impl<T, B: Rb<T>> RbRead<T> for AsyncRb<T, B>
source§unsafe fn advance_head(&self, count: usize)
unsafe fn advance_head(&self, count: usize)
Move head position by
count
items forward. Read moresource§fn occupied_ranges(&self) -> (Range<usize>, Range<usize>)
fn occupied_ranges(&self) -> (Range<usize>, Range<usize>)
Returns a pair of ranges of
Self::occupied_slices
location in underlying container.source§unsafe fn occupied_slices(
&self
) -> (&mut [MaybeUninit<T>], &mut [MaybeUninit<T>])
unsafe fn occupied_slices(
&self
) -> (&mut [MaybeUninit<T>], &mut [MaybeUninit<T>])
Provides a direct mutable access to the ring buffer occupied memory. Read more
source§impl<T, B: Rb<T>> RbWrite<T> for AsyncRb<T, B>
impl<T, B: Rb<T>> RbWrite<T> for AsyncRb<T, B>
source§unsafe fn advance_tail(&self, count: usize)
unsafe fn advance_tail(&self, count: usize)
Move tail position by
count
items forward. Read moresource§fn vacant_ranges(&self) -> (Range<usize>, Range<usize>)
fn vacant_ranges(&self) -> (Range<usize>, Range<usize>)
Returns a pair of ranges of
Self::vacant_slices
location in underlying container.source§unsafe fn vacant_slices(&self) -> (&mut [MaybeUninit<T>], &mut [MaybeUninit<T>])
unsafe fn vacant_slices(&self) -> (&mut [MaybeUninit<T>], &mut [MaybeUninit<T>])
Provides a direct access to the ring buffer vacant memory.
Returns a pair of slices of uninitialized memory, the second one may be empty. Read more