pub struct ArrayBuf<const N: usize, T> { /* private fields */ }Expand description
A fixed-size array buffer that can be allocated on the stack and used as a backing store for channels.
Implementations§
Trait Implementations§
Source§impl<const N: usize, T> RingBuf for ArrayBuf<N, T>
impl<const N: usize, T> RingBuf for ArrayBuf<N, T>
Source§fn enqueue(&mut self, item: T) -> Result<(), T>
fn enqueue(&mut self, item: T) -> Result<(), T>
Places an item into the buffer, returning an
Ok result if successful
and the item wrapped in an Err result if the buffer is full.Source§fn dequeue(&mut self) -> Option<T>
fn dequeue(&mut self) -> Option<T>
Extracts an item from the buffer, returning
None if the buffer is
empty.Auto Trait Implementations§
impl<const N: usize, T> Freeze for ArrayBuf<N, T>where
T: Freeze,
impl<const N: usize, T> RefUnwindSafe for ArrayBuf<N, T>where
T: RefUnwindSafe,
impl<const N: usize, T> Send for ArrayBuf<N, T>where
T: Send,
impl<const N: usize, T> Sync for ArrayBuf<N, T>where
T: Sync,
impl<const N: usize, T> Unpin for ArrayBuf<N, T>where
T: Unpin,
impl<const N: usize, T> UnwindSafe for ArrayBuf<N, T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more