Struct bincode::de::DecoderImpl
source · [−]pub struct DecoderImpl<R, C: Config> { /* private fields */ }
Expand description
A Decoder that reads bytes from a given reader R
.
This struct should rarely be used.
In most cases, prefer any of the decode
functions.
The ByteOrder that is chosen will impact the endianness that is used to read integers out of the reader.
use bincode::de::{DecoderImpl, Decode};
let mut decoder = DecoderImpl::new(some_reader, bincode::config::standard());
// this u32 can be any Decode
let value = u32::decode(&mut decoder).unwrap();
Implementations
Construct a new Decoder
Trait Implementations
type BR = R
type BR = R
The concrete BorrowReader type
Rerturns a mutable reference to the borrow reader
Claim that n
bytes are going to be read from the decoder.
This can be used to validate Configuration::Limit<N>()
. Read more
Notify the decoder that n
bytes are being reclaimed. Read more
Claim that we’re going to read a container which contains len
entries of T
.
This will correctly handle overflowing if len * size_of::<T>() > usize::max_value
Read more