pub struct ByteVecDecoder { /* private fields */ }Expand description
A decoder that decodes a byte vector.
The encoding is expected to start with the number of encoded bytes (length prefix).
Implementations§
Source§impl ByteVecDecoder
impl ByteVecDecoder
Sourcepub const fn new() -> Self
pub const fn new() -> Self
Constructs a new byte decoder with the default limit of 4,000,000 bytes.
Sourcepub const fn new_with_limit(limit: usize) -> Self
pub const fn new_with_limit(limit: usize) -> Self
Constructs a new byte decoder with a custom limit of bytes.
Trait Implementations§
Source§impl Clone for ByteVecDecoder
impl Clone for ByteVecDecoder
Source§fn clone(&self) -> ByteVecDecoder
fn clone(&self) -> ByteVecDecoder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ByteVecDecoder
impl Debug for ByteVecDecoder
Source§impl Decoder for ByteVecDecoder
Available on crate feature alloc only.
impl Decoder for ByteVecDecoder
Available on crate feature
alloc only.Source§type Error = ByteVecDecoderError
type Error = ByteVecDecoderError
The error type that this decoder can produce.
Source§fn push_bytes(&mut self, bytes: &mut &[u8]) -> Result<bool, Self::Error>
fn push_bytes(&mut self, bytes: &mut &[u8]) -> Result<bool, 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 return 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 Freeze for ByteVecDecoder
impl RefUnwindSafe for ByteVecDecoder
impl Send for ByteVecDecoder
impl Sync for ByteVecDecoder
impl Unpin for ByteVecDecoder
impl UnsafeUnpin for ByteVecDecoder
impl UnwindSafe for ByteVecDecoder
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