Fields
buffer: &'b [u8]
used_bits: i64
pos: usize
Implementations
sourceimpl<'b> Decoder<'b>
impl<'b> Decoder<'b>
pub fn new(bytes: &'b [u8]) -> Decoder<'_>
sourcepub fn decode<T: Decode<'b>>(&mut self) -> Result<T, Error>
pub fn decode<T: Decode<'b>>(&mut self) -> Result<T, Error>
Encode any type that implements Decode
.
pub fn integer(&mut self) -> Result<isize, Error>
pub fn bool(&mut self) -> Result<bool, Error>
pub fn u8(&mut self) -> Result<u8, Error>
pub fn bytes(&mut self) -> Result<Vec<u8>, Error>
pub fn char(&mut self) -> Result<char, Error>
pub fn string(&mut self) -> Result<String, Error>
pub fn utf8(&mut self) -> Result<String, Error>
pub fn filler(&mut self) -> Result<(), Error>
pub fn word(&mut self) -> Result<usize, Error>
pub fn decode_list_with<T: Decode<'b>>(
&mut self,
decoder_func: for<'r> fn(_: &'r mut Decoder<'_>) -> Result<T, Error>
) -> Result<Vec<T>, Error>
pub fn bits8(&mut self, num_bits: usize) -> Result<u8, Error>
Trait Implementations
Auto Trait Implementations
impl<'b> RefUnwindSafe for Decoder<'b>
impl<'b> Send for Decoder<'b>
impl<'b> Sync for Decoder<'b>
impl<'b> Unpin for Decoder<'b>
impl<'b> UnwindSafe for Decoder<'b>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more