pub struct Framed<U> { /* private fields */ }
Expand description
A unified interface to an underlying I/O object, using
the Encoder
and Decoder
traits to encode and decode frames.
Framed
is heavily optimized for streaming io.
Implementations§
source§impl<U> Framed<U>
impl<U> Framed<U>
sourcepub fn new<Io>(io: Io, codec: U) -> Framed<U>where
IoBoxed: From<Io>,
pub fn new<Io>(io: Io, codec: U) -> Framed<U>where
IoBoxed: From<Io>,
Provides an interface for reading and writing to
Io
object, using Decode
and Encode
traits of codec.
sourcepub fn get_io(&self) -> &IoBoxed
pub fn get_io(&self) -> &IoBoxed
Returns a reference to the underlying I/O stream wrapped by Framed
.
sourcepub fn into_inner(self) -> (IoBoxed, U)
pub fn into_inner(self) -> (IoBoxed, U)
Return inner types of framed object