pub struct FrameDecoder { /* private fields */ }Expand description
Incremental decoder for an SCCP byte stream.
The decoder retains an incomplete trailing frame between calls. Complete frames are returned in stream order, including when a chunk contains more than one frame.
Implementations§
Source§impl FrameDecoder
impl FrameDecoder
pub fn new() -> Self
Sourcepub fn push(&mut self, bytes: &[u8]) -> Result<Vec<Frame>, CodecError>
pub fn push(&mut self, bytes: &[u8]) -> Result<Vec<Frame>, CodecError>
Appends a stream chunk and returns every newly completed frame.
An empty vector means the buffered bytes do not yet complete a frame. Framing errors are terminal for the current buffered stream; callers should discard the decoder with the connection.
pub fn buffered_len(&self) -> usize
Trait Implementations§
Source§impl Debug for FrameDecoder
impl Debug for FrameDecoder
Source§impl Default for FrameDecoder
impl Default for FrameDecoder
Source§fn default() -> FrameDecoder
fn default() -> FrameDecoder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for FrameDecoder
impl RefUnwindSafe for FrameDecoder
impl Send for FrameDecoder
impl Sync for FrameDecoder
impl Unpin for FrameDecoder
impl UnsafeUnpin for FrameDecoder
impl UnwindSafe for FrameDecoder
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