Type Alias BitSlice

Source
pub type BitSlice<O = u8> = BitSlice<O, Msb0>;

Aliased Type§

struct BitSlice<O = u8> { /* private fields */ }

Trait Implementations§

Source§

impl BitBuf for &BitSlice

Source§

fn advance(&mut self, count: usize)

Advance the internal cursor of the BitBuf by count bits. Read more
Source§

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

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]

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

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)

Advance the internal cursor of the BitBuf by count bytes. Read more
Source§

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)

Copy bits from self into dest. Read more
Source§

fn try_copy_to_slice(&mut self, dest: &mut BitSlice) -> Result<()>

Source§

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 more
Source§

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).
Source§

fn take(self, limit: usize) -> Take<Self>
where Self: Sized,

Source§

fn take_bytes(self, limit: usize) -> Take<Self>
where Self: Sized,

Source§

impl BitRead for &BitSlice

Source§

fn read_bits<O: BitStore>(&mut self, dest: &mut BitSlice<O>) -> Result<usize>

Pull some bits from this source into the specified buffer, returning how many bits were read.
Source§

fn read_bits_exact<O: BitStore>(&mut self, dest: &mut BitSlice<O>) -> Result<()>

Read the exact number of bits required to fill buf.
Source§

impl<S: BitStore> BitWrite for &mut BitSlice<S>

Source§

fn write_bits<O: BitStore>(&mut self, source: &BitSlice<O>) -> Result<usize>

Write a buffer into this writer, returning how many bytes were written.
Source§

fn write_all_bits<O: BitStore>(&mut self, source: &BitSlice<O>) -> Result<()>

Write the entirety buf into self.