Struct scroll_ring::Buffer
source · 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).