pub struct Buffer<const N: usize> { /* private fields */ }
Expand description
A very simple implementation of the infinilog buffer.
See module level documentation on its general properties.
Implementations§
Source§impl<const N: usize> Buffer<N>
impl<const N: usize> Buffer<N>
Sourcepub fn read_earliest(
&self,
outbuf: &mut [u8],
) -> Result<(Wrapping<u32>, usize), BufferUnavailable>
pub fn read_earliest( &self, outbuf: &mut [u8], ) -> Result<(Wrapping<u32>, usize), BufferUnavailable>
Read the earliest available data into outbuf. On success, returns the cursor position corresponding to the start of outbuf, and the number of bytes available (which is the number of bytes copied into outbuf unless it exceeds its size).
pub fn read_from_cursor( &self, cursor: Wrapping<u32>, outbuf: &mut [u8], ) -> Result<usize, ReadErr>
pub fn write(&self, data: &[u8])
Trait Implementations§
Auto Trait Implementations§
impl<const N: usize> !Freeze for Buffer<N>
impl<const N: usize> !RefUnwindSafe for Buffer<N>
impl<const N: usize> Send for Buffer<N>
impl<const N: usize> Sync for Buffer<N>
impl<const N: usize> Unpin for Buffer<N>
impl<const N: usize> UnwindSafe for Buffer<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