pub struct AsyncRb<T, B: Rb<T>> { /* private fields */ }

Implementations§

source§

impl<T, B: Rb<T>> AsyncRb<T, B>

source

pub fn from_base(base: B) -> Self

source

pub fn into_base(self) -> B

source

pub fn split_ref( &mut self ) -> (AsyncProducer<T, &Self>, AsyncConsumer<T, &Self>)

source§

impl<T, C: Container<T>> AsyncRb<T, LocalRb<T, C>>

source

pub fn split(self) -> (AsyncProducer<T, Rc<Self>>, AsyncConsumer<T, Rc<Self>>)

source§

impl<T, C: Container<T>> AsyncRb<T, SharedRb<T, C>>

source

pub fn split(self) -> (AsyncProducer<T, Arc<Self>>, AsyncConsumer<T, Arc<Self>>)

source§

impl<T> AsyncRb<T, HeapRb<T>>

source

pub fn new(capacity: usize) -> Self

Trait Implementations§

source§

impl<T, B: Rb<T>> AsyncRbBase<T> for AsyncRb<T, B>

source§

fn is_closed(&self) -> bool

source§

impl<T, B: Rb<T>> AsyncRbRead<T> for AsyncRb<T, B>

source§

unsafe fn register_tail_waker(&self, waker: &Waker)

source§

unsafe fn close_head(&self)

source§

impl<T, B: Rb<T>> AsyncRbWrite<T> for AsyncRb<T, B>

source§

unsafe fn register_head_waker(&self, waker: &Waker)

source§

unsafe fn close_tail(&self)

source§

impl<T, B: Rb<T>> Rb<T> for AsyncRb<T, B>

source§

fn capacity(&self) -> usize

Returns capacity of the ring buffer. Read more
source§

fn len(&self) -> usize

The number of items stored in the ring buffer.
source§

fn free_len(&self) -> usize

The number of remaining free places in the buffer.
source§

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])

Returns a pair of mutable slices which contain, in order, the contents of the ring buffer.
source§

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>>

Returns an iterator that removes items one by one from the ring buffer.
source§

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>>

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

Removes exactly n items from the buffer and safely drops them. Read more
source§

fn clear(&mut self) -> usize

Removes all items from the buffer and safely drops them. Read more
source§

fn push(&mut self, elem: T) -> Result<(), T>

Appends an item to the ring buffer. Read more
source§

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>,

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>,

Appends items from an iterator to the ring buffer. Read more
source§

impl<T, B: Rb<T>> RbBase<T> for AsyncRb<T, B>

source§

unsafe fn slices( &self, head: usize, tail: usize ) -> (&mut [MaybeUninit<T>], &mut [MaybeUninit<T>])

Returns part of underlying raw ring buffer memory as slices. Read more
source§

fn capacity_nonzero(&self) -> NonZeroUsize

Capacity of the ring buffer. Read more
source§

fn head(&self) -> usize

Head position.
source§

fn tail(&self) -> usize

Tail position.
source§

fn modulus(&self) -> NonZeroUsize

Modulus for head and tail values. Read more
source§

fn occupied_len(&self) -> usize

The number of items stored in the buffer at the moment.
source§

fn vacant_len(&self) -> usize

The number of vacant places in the buffer at the moment.
source§

fn is_empty(&self) -> bool

Checks if the occupied range is empty.
source§

fn is_full(&self) -> bool

Checks if the vacant range is empty.
source§

impl<T, B: Rb<T>> RbRead<T> for AsyncRb<T, B>

source§

unsafe fn set_head(&self, value: usize)

Sets the new head position. Read more
source§

unsafe fn advance_head(&self, count: usize)

Move head position by count items forward. Read more
source§

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>])

Provides a direct mutable access to the ring buffer occupied memory. Read more
source§

unsafe fn skip_internal(&self, count_or_all: Option<usize>) -> usize

Removes items from the head of ring buffer and drops them. Read more
source§

impl<T, B: Rb<T>> RbWrite<T> for AsyncRb<T, B>

source§

unsafe fn set_tail(&self, value: usize)

Sets the new tail position. Read more
source§

unsafe fn advance_tail(&self, count: usize)

Move tail position by count items forward. Read more
source§

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>])

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

Auto Trait Implementations§

§

impl<T, B> !RefUnwindSafe for AsyncRb<T, B>

§

impl<T, B> Send for AsyncRb<T, B>where B: Send, T: Send,

§

impl<T, B> Sync for AsyncRb<T, B>where B: Sync, T: Sync,

§

impl<T, B> Unpin for AsyncRb<T, B>where B: Unpin, T: Unpin,

§

impl<T, B> UnwindSafe for AsyncRb<T, B>where B: UnwindSafe, T: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.