pub trait BitRead<'a>: BitReadInternal + Copy {
// Required methods
fn new(_: &'a [u8]) -> Self;
fn consumed(&self) -> usize;
fn available(&self) -> usize;
fn skip_bits(&mut self, size: usize);
// Provided methods
fn get_bit(&mut self) -> bool { ... }
fn get_bits_64(&mut self, n: usize) -> u64 { ... }
fn get_bits_32(&mut self, n: usize) -> u32 { ... }
fn peek_bit(&mut self) -> bool { ... }
fn peek_bits_32(&mut self, n: usize) -> u32 { ... }
fn peek_bits_64(&self, n: usize) -> u64 { ... }
fn align_bits(&mut self) { ... }
}Expand description
Used to define a bitreader.
Required Methods§
Provided Methods§
Sourcefn get_bits_64(&mut self, n: usize) -> u64
fn get_bits_64(&mut self, n: usize) -> u64
Returns n bits from the internal buffer as a 64-bit sequence.
Sourcefn get_bits_32(&mut self, n: usize) -> u32
fn get_bits_32(&mut self, n: usize) -> u32
Returns n bits from the internal buffer as a 32-bit sequence.
Sourcefn peek_bits_32(&mut self, n: usize) -> u32
fn peek_bits_32(&mut self, n: usize) -> u32
Peeks the next 32-bit sequence present in the internal buffer.
Sourcefn peek_bits_64(&self, n: usize) -> u64
fn peek_bits_64(&self, n: usize) -> u64
Peeks the next 64-bit sequence present in the internal buffer.
Sourcefn align_bits(&mut self)
fn align_bits(&mut self)
Aligns the bits present in the internal buffer.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.