pub struct BitBuf { /* private fields */ }
Implementations§
Source§impl BitBuf
impl BitBuf
Sourcepub fn with_len(len: usize) -> BitBuf
pub fn with_len(len: usize) -> BitBuf
Creates a new BitBuf, initializing a new Vec
Sourcepub fn bit_size(&self) -> usize
pub fn bit_size(&self) -> usize
Returns a slice into the underlying Vec
Sourcepub fn bit_pos(&self) -> usize
pub fn bit_pos(&self) -> usize
The current position of the cursor. The BitBuf does not insert, and will overwrite any data currently at the cursor position during writing.
pub fn can_write_bits(&self, bit_size: usize) -> bool
pub fn can_read_bits(&self, bit_size: usize) -> bool
pub fn write_bool(&mut self, value: bool)
pub fn read_bool(&mut self) -> bool
pub fn write_i8(&mut self, value: i8)
pub fn read_i8(&mut self) -> i8
pub fn write_u8(&mut self, value: u8)
pub fn read_u8(&mut self) -> u8
pub fn write_u8_part(&mut self, value: u8, bits: u8)
pub fn read_u8_part(&mut self, bits: u8) -> u8
pub fn write_u16(&mut self, value: u16)
pub fn read_u16(&mut self) -> u16
pub fn write_u16_part(&mut self, value: u16, bits: u8)
pub fn read_u16_part(&mut self, bits: u8) -> u16
pub fn write_i16(&mut self, value: i16)
pub fn read_i16(&mut self) -> i16
pub fn write_u32(&mut self, value: u32)
pub fn read_u32(&mut self) -> u32
pub fn write_u32_part(&mut self, value: u32, bits: u8)
pub fn read_u32_part(&mut self, bits: u8) -> u32
pub fn read_i32(&mut self) -> i32
pub fn write_i32(&mut self, value: i32)
pub fn write_u64(&mut self, value: u64)
pub fn read_u64(&mut self) -> u64
pub fn write_u64_part(&mut self, value: u64, bits: u8)
pub fn read_u64_part(&mut self, bits: u8) -> u64
pub fn write_i64(&mut self, value: i64)
pub fn read_i64(&mut self) -> i64
pub fn write_f32(&mut self, value: f32)
pub fn read_f32(&mut self) -> f32
pub fn write_f64(&mut self, value: f64)
pub fn read_f64(&mut self) -> f64
pub fn write_u8_slice(&mut self, value: &[u8])
pub fn read_vec_u8(&mut self, length: usize) -> Vec<u8> ⓘ
pub fn write_string(&mut self, value: &str)
pub fn read_string(&mut self) -> String
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BitBuf
impl RefUnwindSafe for BitBuf
impl Send for BitBuf
impl Sync for BitBuf
impl Unpin for BitBuf
impl UnwindSafe for BitBuf
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more