pub struct SilkroadCodec;Expand description
A codec to read and write SilkroadFrame from/onto a byte stream. This implements Encoder and Decoder to be used in combination with tokio framed read/write. Essentially, this wraps the SilkroadFrame::serialize and SilkroadFrame::parse functions to serialize & deserialize the frames.
Trait Implementations§
Source§impl Decoder for SilkroadCodec
impl Decoder for SilkroadCodec
Source§type Item = SilkroadFrame
type Item = SilkroadFrame
The type of decoded frames.
Source§fn decode(
&mut self,
src: &mut BytesMut,
) -> Result<Option<Self::Item>, Self::Error>
fn decode( &mut self, src: &mut BytesMut, ) -> Result<Option<Self::Item>, Self::Error>
Attempts to decode a frame from the provided buffer of bytes. Read more
Auto Trait Implementations§
impl Freeze for SilkroadCodec
impl RefUnwindSafe for SilkroadCodec
impl Send for SilkroadCodec
impl Sync for SilkroadCodec
impl Unpin for SilkroadCodec
impl UnwindSafe for SilkroadCodec
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