pub struct FrameCodec { /* private fields */ }Expand description
Streaming codec for Serial API frames.
Bytes that cannot start a frame are skipped. A data frame whose length
byte is below the minimum is skipped as noise. A frame that is still
incomplete is kept until more bytes arrive; the caller’s read timeout
decides when a partial frame is abandoned (see FrameCodec::reset).
Implementations§
Trait Implementations§
Source§impl Clone for FrameCodec
impl Clone for FrameCodec
Source§impl Debug for FrameCodec
impl Debug for FrameCodec
Source§impl Decoder for FrameCodec
impl Decoder for FrameCodec
Source§fn decode(&mut self, buf: &mut BytesMut) -> Result<Option<Frame>, Error>
fn decode(&mut self, buf: &mut BytesMut) -> Result<Option<Frame>, Error>
Attempts to decode a frame from the provided buffer of bytes. Read more
§fn decode_eof(
&mut self,
buf: &mut BytesMut,
) -> Result<Option<Self::Item>, Self::Error>
fn decode_eof( &mut self, buf: &mut BytesMut, ) -> Result<Option<Self::Item>, Self::Error>
A default method available to be called when there are no more bytes
available to be read from the underlying I/O. Read more
Source§impl Default for FrameCodec
impl Default for FrameCodec
Auto Trait Implementations§
impl Freeze for FrameCodec
impl RefUnwindSafe for FrameCodec
impl Send for FrameCodec
impl Sync for FrameCodec
impl Unpin for FrameCodec
impl UnsafeUnpin for FrameCodec
impl UnwindSafe for FrameCodec
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