pub struct DecoderBuffered<C = Config> { /* private fields */ }Expand description
Implementations§
Source§impl<C> DecoderBuffered<C>where
C: Configure,
impl<C> DecoderBuffered<C>where
C: Configure,
Sourcepub fn supply_buffer(&mut self) -> &mut [u8] ⓘ
pub fn supply_buffer(&mut self) -> &mut [u8] ⓘ
Provides a buffer that must be filled before re-attempting to deserialize
the next Message.
DecoderBuffered::supply_buffer is guaranteed to be non-empty.
§Panics
Panics if the last call to DecoderBuffered::parse
returned an Err.
Sourcepub fn parse(&mut self) -> Result<Option<()>, DecodeError>
pub fn parse(&mut self) -> Result<Option<()>, DecodeError>
After filling the buffer provided by DecoderBuffered::supply_buffer,
attempt to read its contents. It returns:
- [
Ok(None)] in case you need to callDecoderBuffered::supply_bufferagain. - [
Ok(Some(()))] in case the internal buffer contains a validMessage, ready to be extracted viaDecoderBuffered::message. Erron decoding errors.
Trait Implementations§
Source§impl<C: Debug> Debug for DecoderBuffered<C>
impl<C: Debug> Debug for DecoderBuffered<C>
Source§impl<C> GetConfig for DecoderBuffered<C>
impl<C> GetConfig for DecoderBuffered<C>
Auto Trait Implementations§
impl<C> Freeze for DecoderBuffered<C>where
C: Freeze,
impl<C = Config> !RefUnwindSafe for DecoderBuffered<C>
impl<C> Send for DecoderBuffered<C>where
C: Send,
impl<C> Sync for DecoderBuffered<C>where
C: Sync,
impl<C> Unpin for DecoderBuffered<C>where
C: Unpin,
impl<C = Config> !UnwindSafe for DecoderBuffered<C>
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