Struct tokio_codec::FramedRead
source · pub struct FramedRead<T, D> { /* private fields */ }
Expand description
A Stream
of messages decoded from an AsyncRead
.
Implementations§
source§impl<T, D> FramedRead<T, D>
impl<T, D> FramedRead<T, D>
sourcepub fn new(inner: T, decoder: D) -> FramedRead<T, D>
pub fn new(inner: T, decoder: D) -> FramedRead<T, D>
Creates a new FramedRead
with the given decoder
.
source§impl<T, D> FramedRead<T, D>
impl<T, D> FramedRead<T, D>
sourcepub fn get_ref(&self) -> &T
pub fn get_ref(&self) -> &T
Returns a reference to the underlying I/O stream wrapped by
FramedRead
.
Note that care should be taken to not tamper with the underlying stream of data coming in as it may corrupt the stream of frames otherwise being worked with.
sourcepub fn get_mut(&mut self) -> &mut T
pub fn get_mut(&mut self) -> &mut T
Returns a mutable reference to the underlying I/O stream wrapped by
FramedRead
.
Note that care should be taken to not tamper with the underlying stream of data coming in as it may corrupt the stream of frames otherwise being worked with.
sourcepub fn into_inner(self) -> T
pub fn into_inner(self) -> T
Consumes the FramedRead
, returning its underlying I/O stream.
Note that care should be taken to not tamper with the underlying stream of data coming in as it may corrupt the stream of frames otherwise being worked with.
sourcepub fn decoder_mut(&mut self) -> &mut D
pub fn decoder_mut(&mut self) -> &mut D
Returns a mutable reference to the underlying decoder.
Trait Implementations§
source§impl<T, D> Debug for FramedRead<T, D>
impl<T, D> Debug for FramedRead<T, D>
source§impl<T, I, D> Sink<I> for FramedRead<T, D>
impl<T, I, D> Sink<I> for FramedRead<T, D>
source§fn poll_ready(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
) -> Poll<Result<(), Self::Error>>
fn poll_ready( self: Pin<&mut Self>, cx: &mut Context<'_>, ) -> Poll<Result<(), Self::Error>>
Sink
to receive a value. Read moresource§fn start_send(self: Pin<&mut Self>, item: I) -> Result<(), Self::Error>
fn start_send(self: Pin<&mut Self>, item: I) -> Result<(), Self::Error>
poll_ready
which returned Poll::Ready(Ok(()))
. Read more