pub type BitSlice<O = u8> = BitSlice<O, Msb0>;
Aliased Type§
struct BitSlice<O = u8> { /* private fields */ }
Trait Implementations§
Source§impl BitBuf for &BitSlice
impl BitBuf for &BitSlice
Source§fn remaining(&self) -> usize
fn remaining(&self) -> usize
Returns the number of bits between the current position and the end of the buffer. Read more
Source§fn chunk(&self) -> &BitSlice
fn chunk(&self) -> &BitSlice
Returns a
BitSlice
starting at the current position and of length between 0 and
BitBuf::remaining
. Note that this can return a shorter slice.Source§fn chunk_bytes(&self) -> &[u8] ⓘ
fn chunk_bytes(&self) -> &[u8] ⓘ
Returns a slice of bytes starting at the current position and of length between 0 and
BitBuf::remaining_bytes
. Note that this can return a shorter slice.Source§fn byte_aligned(&self) -> bool
fn byte_aligned(&self) -> bool
Returns whether or not this
BitBuf
is fully byte-aligned (beginning and end) with the
underlying storage.Source§fn advance_bytes(&mut self, count: usize)
fn advance_bytes(&mut self, count: usize)
Source§fn remaining_bytes(&self) -> usize
fn remaining_bytes(&self) -> usize
Return the number of full bytes between the current position and the end of the buffer.
Source§fn copy_to_slice(&mut self, dest: &mut BitSlice)
fn copy_to_slice(&mut self, dest: &mut BitSlice)
fn try_copy_to_slice(&mut self, dest: &mut BitSlice) -> Result<()>
Source§fn copy_to_slice_bytes(&mut self, dest: &mut [u8])
fn copy_to_slice_bytes(&mut self, dest: &mut [u8])
Copy bytes from
self
into dest
. Call should call byte_aligned()
beforehand to ensure
buffer is fully byte-aligned before calling, call may panic if buffer isn’t byte-aligned. Read moreSource§fn try_copy_to_slice_bytes(&mut self, dest: &mut [u8]) -> Result<()>
fn try_copy_to_slice_bytes(&mut self, dest: &mut [u8]) -> Result<()>
Try to copy bytes from
self
into dest
. Returns error if self
is not big enough to
fill dest
or if self is not fully byte-aligned (start and end points both falling on byte
boundaries).