pub struct Decoder { /* private fields */ }
Expand description
A streaming Msgp decoder.
Implementations§
Source§impl Decoder
impl Decoder
pub fn new() -> Self
pub fn feed(&mut self, buf: &[u8]) -> Result<usize>
Sourcepub fn read(&mut self) -> Option<Vec<u8>>
pub fn read(&mut self) -> Option<Vec<u8>>
Reads a decoded massage buffer, will return None
if no buffer decoded.
Sourcepub fn buffer_len(&self) -> usize
pub fn buffer_len(&self) -> usize
Returns the buffer’s length that wait for decoding. It usually is 0
. Non-zero means that
decoder need more buffer.
Sourcepub fn result_len(&self) -> usize
pub fn result_len(&self) -> usize
Returns decoded massages count. The decoded messages will be hold by decoder, until you read them.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Decoder
impl RefUnwindSafe for Decoder
impl Send for Decoder
impl Sync for Decoder
impl Unpin for Decoder
impl UnwindSafe for Decoder
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