pub struct Codec<Input, Output>(/* private fields */)
where
Input: Decode,
Output: Encode,
AgentError: From<Input::Error>;
Expand description
SSH framing codec.
This codec first reads an u32
which indicates the length of the incoming
message. Then decodes the message using specified Input
type.
The reverse transformation which appends the length of the encoded data
is also implemented for the given Output
type.
Trait Implementations§
Source§impl<Input, Output> Decoder for Codec<Input, Output>
impl<Input, Output> Decoder for Codec<Input, Output>
Source§type Error = AgentError
type Error = AgentError
The type of unrecoverable frame decoding errors. Read more
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<Input, Output> Freeze for Codec<Input, Output>where
AgentError: Sized,
impl<Input, Output> RefUnwindSafe for Codec<Input, Output>
impl<Input, Output> Send for Codec<Input, Output>
impl<Input, Output> Sync for Codec<Input, Output>
impl<Input, Output> Unpin for Codec<Input, Output>
impl<Input, Output> UnwindSafe for Codec<Input, Output>
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