pub trait BitReaderExt<'de>: BitReader<'de> {
// Provided methods
fn is_empty(&self) -> bool { ... }
fn read_bytes_into(
&mut self,
dst: impl AsMut<[u8]>,
) -> Result<usize, Self::Error> { ... }
fn read_bytes_array<const N: usize>(
&mut self,
) -> Result<[u8; N], Self::Error> { ... }
fn unpack<T>(
&mut self,
args: <T as BitUnpack<'de>>::Args,
) -> Result<T, Self::Error>
where T: BitUnpack<'de> { ... }
fn unpack_iter<'a, T>(
&'a mut self,
args: <T as BitUnpack<'de>>::Args,
) -> impl Iterator<Item = Result<T, Self::Error>> + 'a
where T: BitUnpack<'de>,
<T as BitUnpack<'de>>::Args: Clone + 'a { ... }
fn unpack_as<T, As>(
&mut self,
args: <As as BitUnpackAs<'de, T>>::Args,
) -> Result<T, Self::Error>
where As: BitUnpackAs<'de, T> + ?Sized { ... }
fn unpack_iter_as<'a, T, As>(
&'a mut self,
args: <As as BitUnpackAs<'de, T>>::Args,
) -> impl Iterator<Item = Result<T, Self::Error>> + 'a
where As: BitUnpackAs<'de, T> + ?Sized,
<As as BitUnpackAs<'de, T>>::Args: Clone + 'a { ... }
fn as_mut(&mut self) -> &mut Self { ... }
fn map_err<F>(self, f: F) -> MapErr<Self, F>
where Self: Sized { ... }
fn tee<W>(self, writer: W) -> Tee<Self, W>
where Self: Sized,
W: BitWriter { ... }
fn checkpoint(self) -> Checkpoint<Self>
where Self: Sized { ... }
fn join<R>(self, next: R) -> Join<Self, R>
where Self: Sized,
R: BitReader<'de> { ... }
}Expand description
Extension helper for BitReader.
Provided Methods§
Sourcefn read_bytes_into(
&mut self,
dst: impl AsMut<[u8]>,
) -> Result<usize, Self::Error>
fn read_bytes_into( &mut self, dst: impl AsMut<[u8]>, ) -> Result<usize, Self::Error>
Reads dst.len() bytes into given byte slice
Sourcefn read_bytes_array<const N: usize>(&mut self) -> Result<[u8; N], Self::Error>
fn read_bytes_array<const N: usize>(&mut self) -> Result<[u8; N], Self::Error>
Read N bytes and return array
Sourcefn unpack<T>(
&mut self,
args: <T as BitUnpack<'de>>::Args,
) -> Result<T, Self::Error>where
T: BitUnpack<'de>,
fn unpack<T>(
&mut self,
args: <T as BitUnpack<'de>>::Args,
) -> Result<T, Self::Error>where
T: BitUnpack<'de>,
Unpack value witg args using its BitUnpack implementation
Sourcefn unpack_iter<'a, T>(
&'a mut self,
args: <T as BitUnpack<'de>>::Args,
) -> impl Iterator<Item = Result<T, Self::Error>> + 'a
fn unpack_iter<'a, T>( &'a mut self, args: <T as BitUnpack<'de>>::Args, ) -> impl Iterator<Item = Result<T, Self::Error>> + 'a
Return iterator that unpacks values with args using BitUnpack implementation
Sourcefn unpack_as<T, As>(
&mut self,
args: <As as BitUnpackAs<'de, T>>::Args,
) -> Result<T, Self::Error>where
As: BitUnpackAs<'de, T> + ?Sized,
fn unpack_as<T, As>(
&mut self,
args: <As as BitUnpackAs<'de, T>>::Args,
) -> Result<T, Self::Error>where
As: BitUnpackAs<'de, T> + ?Sized,
Unpack value with args using an adapter.
This approach is heavily inspired by serde_with. Please, read their docs for more usage examples.
Sourcefn unpack_iter_as<'a, T, As>(
&'a mut self,
args: <As as BitUnpackAs<'de, T>>::Args,
) -> impl Iterator<Item = Result<T, Self::Error>> + 'a
fn unpack_iter_as<'a, T, As>( &'a mut self, args: <As as BitUnpackAs<'de, T>>::Args, ) -> impl Iterator<Item = Result<T, Self::Error>> + 'a
Returns iterator that unpacks values with args using an adapter.
This approach is heavily inspired by serde_with. Please, read their docs for more usage examples.
fn checkpoint(self) -> Checkpoint<Self>where
Self: Sized,
fn join<R>(self, next: R) -> Join<Self, R>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".