pub struct ExactVecDecoderWith<D: Decoder + Default> { /* private fields */ }Expand description
A decoder for a vector of exactly count items, where the count is known at construction.
Use this when the item count is determined by context (e.g. from a previously decoded
transaction) rather than from a length prefix in the byte stream. For the length-prefixed
case, use VecDecoderWith.
Implementations§
Trait Implementations§
Source§impl<D: Decoder + Default + Clone> Clone for ExactVecDecoderWith<D>
Available on crate feature alloc only.
impl<D: Decoder + Default + Clone> Clone for ExactVecDecoderWith<D>
Available on crate feature
alloc only.Source§impl<D: Decoder + Default + Debug> Debug for ExactVecDecoderWith<D>
Available on crate feature alloc only.
impl<D: Decoder + Default + Debug> Debug for ExactVecDecoderWith<D>
Available on crate feature
alloc only.Source§impl<D: Decoder + Default> Decoder for ExactVecDecoderWith<D>
Available on crate feature alloc only.
impl<D: Decoder + Default> Decoder for ExactVecDecoderWith<D>
Available on crate feature
alloc only.Source§type Output = Vec<<D as Decoder>::Output>
type Output = Vec<<D as Decoder>::Output>
The type that this decoder produces when decoding is complete.
Source§type Error = VecDecoderError<<D as Decoder>::Error>
type Error = VecDecoderError<<D as Decoder>::Error>
The error type that this decoder can produce.
Source§fn push_bytes(
&mut self,
bytes: &mut &[u8],
) -> Result<DecoderStatus, Self::Error>
fn push_bytes( &mut self, bytes: &mut &[u8], ) -> Result<DecoderStatus, Self::Error>
Pushes bytes into the decoder, consuming as much as possible. Read more
Source§fn end(self) -> Result<Self::Output, Self::Error>
fn end(self) -> Result<Self::Output, Self::Error>
Completes the decoding process and returns the final result. Read more
Source§fn read_limit(&self) -> usize
fn read_limit(&self) -> usize
Returns the maximum number of bytes this decoder can consume without over-reading. Read more
Auto Trait Implementations§
impl<D> Freeze for ExactVecDecoderWith<D>where
D: Freeze,
impl<D> RefUnwindSafe for ExactVecDecoderWith<D>
impl<D> Send for ExactVecDecoderWith<D>
impl<D> Sync for ExactVecDecoderWith<D>
impl<D> Unpin for ExactVecDecoderWith<D>
impl<D> UnsafeUnpin for ExactVecDecoderWith<D>where
D: UnsafeUnpin,
impl<D> UnwindSafe for ExactVecDecoderWith<D>
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