pub struct Consumer<'a, const N: usize> { /* private fields */ }Expand description
A handle for reading from the buffer.
Implementations§
Source§impl<'a, const N: usize> Consumer<'a, N>
impl<'a, const N: usize> Consumer<'a, N>
Sourcepub fn bytes_available(&self) -> usize
pub fn bytes_available(&self) -> usize
Returns the number of bytes available to read.
Sourcepub fn readable_bytes(&mut self) -> ReadableBytes<'_, N>
pub fn readable_bytes(&mut self) -> ReadableBytes<'_, N>
Returns a ReadableBytes handle granting access to the next contiguous slice of data.
This may not return all available bytes if the data wraps around the end of the buffer. In that case, you will need to consume the returned bytes and call this again to get the rest.
Sourcepub fn discard_all(&mut self)
pub fn discard_all(&mut self)
Discards all currently available data in the buffer.
Trait Implementations§
Auto Trait Implementations§
impl<'a, const N: usize> Freeze for Consumer<'a, N>
impl<'a, const N: usize> !RefUnwindSafe for Consumer<'a, N>
impl<'a, const N: usize> Send for Consumer<'a, N>
impl<'a, const N: usize> Sync for Consumer<'a, N>
impl<'a, const N: usize> Unpin for Consumer<'a, N>
impl<'a, const N: usize> !UnwindSafe for Consumer<'a, N>
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