pub struct MessageDecoder { /* private fields */ }Expand description
Incremental framed-CBOR decoder: feed bytes, get protocol messages.
Implementations§
Source§impl MessageDecoder
impl MessageDecoder
pub fn new(max_frame_length: usize, cbor_options: CborOptions) -> Self
pub fn with_defaults() -> Self
Sourcepub fn push(&mut self, chunk: &[u8]) -> Result<Vec<Value>, ProtocolError>
pub fn push(&mut self, chunk: &[u8]) -> Result<Vec<Value>, ProtocolError>
Feed a chunk; returns any complete protocol messages it produced.
Sourcepub fn end(&mut self) -> Result<(), ProtocolError>
pub fn end(&mut self) -> Result<(), ProtocolError>
Signal end of stream (errors if a partial frame is buffered).
Auto Trait Implementations§
impl Forget for MessageDecoder
impl Freeze for MessageDecoder
impl Move for MessageDecoder
impl RefUnwindSafe for MessageDecoder
impl Send for MessageDecoderwhere
RawVecInner: Send,
impl Sync for MessageDecoderwhere
RawVecInner: Sync,
impl Unpin for MessageDecoder
impl UnsafeUnpin for MessageDecoder
impl UnwindSafe for MessageDecoderwhere
RawVecInner: UnwindSafe,
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