Struct resol_vbus::LiveDataBuffer
source · pub struct LiveDataBuffer { /* private fields */ }
Expand description
A size-adapting buffer that supports decoding VBus live data. See
BlobBuffer
for details.
Implementations§
source§impl LiveDataBuffer
impl LiveDataBuffer
sourcepub fn new(channel: u8) -> LiveDataBuffer
pub fn new(channel: u8) -> LiveDataBuffer
Constructs a LiveDataReader
.
sourcepub fn extend_from_slice(&mut self, bytes: &[u8])
pub fn extend_from_slice(&mut self, bytes: &[u8])
Write bytes to the internal buffer.
sourcepub fn peek_length(&mut self) -> Option<usize>
pub fn peek_length(&mut self) -> Option<usize>
Try to peek length of valid blob in internal buffer.
sourcepub fn read_bytes(&mut self) -> Option<&[u8]>
pub fn read_bytes(&mut self) -> Option<&[u8]>
Try to read a valid blob of bytes from internal buffer.