bit-buf 0.1.0

I needed this.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate::{BitBuf, StorageMut};

impl<S: StorageMut> BitBuf<S> {
  /// Write a [`u8`] in BE-bit-order at `byte_offset` without performing any bound checks
  ///
  /// # Safety
  ///
  /// This is UB if `byte_offset >= len(storage)`
  #[inline(always)]
  pub unsafe fn write_u8_be_aligned_full_at_unchecked(
    &mut self,
    byte_offset: usize,
    v: u8,
  ) -> &mut Self {
    *unsafe { self.bytes_mut().get_unchecked_mut(byte_offset) } = v;
    self
  }
}