Type Alias ringbuf::wrap::direct::Prod

source ·
pub type Prod<R> = Direct<R, true, false>;
Expand description

Producer of a ring buffer.

Aliased Type§

struct Prod<R> { /* private fields */ }

Trait Implementations§

source§

impl<R: RbRef> Producer for Prod<R>

source§

unsafe fn set_write_index(&self, value: usize)

Set read index. Read more
source§

unsafe fn advance_write_index(&self, count: usize)

Moves write pointer by count places forward. Read more
source§

fn vacant_slices( &self ) -> (&[MaybeUninit<Self::Item>], &[MaybeUninit<Self::Item>])

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

fn vacant_slices_mut( &mut self ) -> (&mut [MaybeUninit<Self::Item>], &mut [MaybeUninit<Self::Item>])

Mutable version of Self::vacant_slices. Read more
source§

fn try_push(&mut self, elem: Self::Item) -> Result<(), Self::Item>

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

fn push_iter<I: Iterator<Item = Self::Item>>(&mut self, iter: I) -> usize

Appends items from an iterator to the ring buffer. Elements that haven’t been added to the ring buffer remain in the iterator. Read more
source§

impl<R: RbRef> Write for Prod<R>
where Self: Producer<Item = u8>,

source§

fn write(&mut self, buf: &[u8]) -> Result<usize>

Write a buffer into this writer, returning how many bytes were written. Read more
source§

fn flush(&mut self) -> Result<()>

Flush this output stream, ensuring that all intermediately buffered contents reach their destination. Read more
1.36.0 · source§

fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> Result<usize, Error>

Like write, except that it writes from a slice of buffers. Read more
source§

fn is_write_vectored(&self) -> bool

🔬This is a nightly-only experimental API. (can_vector)
Determines if this Writer has an efficient write_vectored implementation. Read more
1.0.0 · source§

fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>

Attempts to write an entire buffer into this writer. Read more
source§

fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>

🔬This is a nightly-only experimental API. (write_all_vectored)
Attempts to write multiple buffers into this writer. Read more
1.0.0 · source§

fn write_fmt(&mut self, fmt: Arguments<'_>) -> Result<(), Error>

Writes a formatted string into this writer, returning any error encountered. Read more
1.0.0 · source§

fn by_ref(&mut self) -> &mut Self
where Self: Sized,

Creates a “by reference” adapter for this instance of Write. Read more
source§

impl<R: RbRef> Write for Prod<R>
where Self: Producer<Item = u8>,

source§

fn write_str(&mut self, s: &str) -> Result

Writes a string slice into this writer, returning whether the write succeeded. Read more
1.1.0 · source§

fn write_char(&mut self, c: char) -> Result<(), Error>

Writes a char into this writer, returning whether the write succeeded. Read more
1.0.0 · source§

fn write_fmt(&mut self, args: Arguments<'_>) -> Result<(), Error>

Glue for usage of the write! macro with implementors of this trait. Read more