Type Alias BitSlice

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

Aliased Type§

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

Trait Implementations§

Source§

impl BitBuf for &BitSlice

Source§

fn advance_bits(&mut self, count: usize)

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

fn remaining_bits(&self) -> usize

Returns the number of bits between the current position and the end of the buffer. Read more
Source§

fn chunk_bits(&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 has_remaining_bits(&self) -> bool

Returns true if there are any more bits to consume. Read more
Source§

fn has_remaining_bytes(&self) -> bool

Returns true if there are any more cmplete bytes to consume. Read more
Source§

fn chain<U: BitBuf>(self, next: U) -> Chain<Self, U>
where Self: Sized,

Creates an adaptor which will chain this buffer to another. Read more
Source§

fn copy_to_bit_slice(&mut self, dest: &mut BitSlice)

Copy bits from self into dest. Read more
Source§

fn try_copy_to_bit_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_bits(self, limit: usize) -> Take<Self>
where Self: Sized,

Create an adaptor which can read at most limit bits from self.
Source§

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

Create an adaptor which can read at most limit bytes from self.
Source§

impl BitBufMut for &mut BitSlice

Source§

fn advance_mut_bits(&mut self, count: usize)

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

fn chunk_mut_bits(&mut self) -> &mut BitSlice

Returns a mutable BitSlice starting at the current BitBufMut position and of length between 0 and BitBufMut::remaining_mut(). Note that this can be shorter than the whole remainder of the buffer (this allows non-continuous implementation). Read more
Source§

fn chunk_mut_bytes(&mut self) -> &mut UninitSlice

Returns a mutable UninitSlice starting at the current BitBufMut position and of length between 0 and BitBufMut::remaining_mut(). Note that this can be shorter than the whole remainder of the buffer (this allows non-continuous implementation). This BitBufMut must be fully byte-aligned for this to work: caller should check byte_aligned before calling. Read more
Source§

fn remaining_mut_bits(&self) -> usize

Returns the number of bits that can be written from the current position until the end of the buffer is reached. Note that the returned value may under-represent the remainin amount: we are returning the value in bits but if the underlying storage is in bytes then the result here will be under-represented by a factor of 8. remaining_mut_bytes will give a more accurate view of how much space (in bytes) is remaining. Read more
Source§

fn byte_aligned_mut(&self) -> bool

Returns whether or not this BitBufMut is fully byte-aligned (beginning and end) with the underlying storage.
Source§

fn advance_mut_bytes(&mut self, count: usize)

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

fn limit_bits(self, limit: usize) -> Limit<Self>
where Self: Sized,

Creates an adaptor which can write at most limit bits to self
Source§

fn limit_bytes(self, limit: usize) -> Limit<Self>
where Self: Sized,

Creates an adaptor which can write at most limit bytes to self
Source§

fn has_remaining_mut_bits(&self) -> bool

Returns true if there is space in self for more bits. Read more
Source§

fn remaining_mut_bytes(&self) -> usize

Returns the number of full bytes that can be written from the current position until the end of the buffer is reached. Read more
Source§

fn has_reminaing_mut_bytes(&self) -> bool

Returns true if there is space in self for more bytes. Read more
Source§

fn chain_mut<U: BitBufMut>(self, next: U) -> Chain<Self, U>
where Self: Sized,

Creates an adaptor which will chain this buffer to another. Read more
Source§

fn put_bit_slice(&mut self, src: &BitSlice)

Transfer bits into self from src and advance the cursor by the number of bits written. Read more
Source§

fn try_put_bit_slice(&mut self, src: &BitSlice) -> Result<()>

Try to transfer bits info self from src and advance the cursor by the number of bits written. Read more
Source§

fn try_put_slice_bytes(&mut self, src: &[u8]) -> Result<()>

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.