pub struct BitReader<'a> { /* private fields */ }Expand description
A record being read under its layout, with core §7.6’s length and pad checks.
Implementations§
Source§impl<'a> BitReader<'a>
impl<'a> BitReader<'a>
pub fn new(bytes: &'a [u8]) -> Self
Sourcepub fn take(&mut self, width: u32) -> Result<u64, ReadRefusal>
pub fn take(&mut self, width: u32) -> Result<u64, ReadRefusal>
The next width bits, as an unsigned integer: length when the
record ends before them.
§Errors
Sourcepub fn bit(&mut self) -> Result<bool, ReadRefusal>
pub fn bit(&mut self) -> Result<bool, ReadRefusal>
Sourcepub fn later(&self) -> Result<(), ReadRefusal>
pub fn later(&self) -> Result<(), ReadRefusal>
After a marker read as 1 that ends the reader’s layout: the rest is a later revision’s, and holds at least one bit.
§Errors
Trait Implementations§
Auto Trait Implementations§
impl<'a> Forget for BitReader<'a>
impl<'a> Freeze for BitReader<'a>
impl<'a> Move for BitReader<'a>
impl<'a> RefUnwindSafe for BitReader<'a>
impl<'a> Send for BitReader<'a>
impl<'a> Sync for BitReader<'a>
impl<'a> Unpin for BitReader<'a>
impl<'a> UnsafeUnpin for BitReader<'a>where
&'a [u8]: UnsafeUnpin,
impl<'a> UnwindSafe for BitReader<'a>where
&'a [u8]: UnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more