Struct tokio_util::codec::FramedWrite
source · [−]pub struct FramedWrite<T, E> { /* private fields */ }
Expand description
A Sink
of frames encoded to an AsyncWrite
.
Implementations
sourceimpl<T, E> FramedWrite<T, E> where
T: AsyncWrite,
impl<T, E> FramedWrite<T, E> where
T: AsyncWrite,
sourcepub fn new(inner: T, encoder: E) -> FramedWrite<T, E>
pub fn new(inner: T, encoder: E) -> FramedWrite<T, E>
Creates a new FramedWrite
with the given encoder
.
sourceimpl<T, E> FramedWrite<T, E>
impl<T, E> FramedWrite<T, E>
sourcepub fn get_ref(&self) -> &T
pub fn get_ref(&self) -> &T
Returns a reference to the underlying I/O stream wrapped by
FramedWrite
.
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
FramedWrite
.
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_pin_mut(self: Pin<&mut Self>) -> Pin<&mut T>
pub fn get_pin_mut(self: Pin<&mut Self>) -> Pin<&mut T>
Returns a pinned mutable reference to the underlying I/O stream wrapped by
FramedWrite
.
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 FramedWrite
, 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 encoder_mut(&mut self) -> &mut E
pub fn encoder_mut(&mut self) -> &mut E
Returns a mutable reference to the underlying encoder.
sourcepub fn write_buffer(&self) -> &BytesMut
pub fn write_buffer(&self) -> &BytesMut
Returns a reference to the write buffer.
sourcepub fn write_buffer_mut(&mut self) -> &mut BytesMut
pub fn write_buffer_mut(&mut self) -> &mut BytesMut
Returns a mutable reference to the write buffer.
Trait Implementations
sourceimpl<T, U> Debug for FramedWrite<T, U> where
T: Debug,
U: Debug,
impl<T, U> Debug for FramedWrite<T, U> where
T: Debug,
U: Debug,
sourceimpl<T, I, E> Sink<I> for FramedWrite<T, E> where
T: AsyncWrite,
E: Encoder<I>,
E::Error: From<Error>,
impl<T, I, E> Sink<I> for FramedWrite<T, E> where
T: AsyncWrite,
E: Encoder<I>,
E::Error: From<Error>,
sourcefn 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>>
Attempts to prepare the Sink
to receive a value. Read more
sourcefn start_send(self: Pin<&mut Self>, item: I) -> Result<(), Self::Error>
fn start_send(self: Pin<&mut Self>, item: I) -> Result<(), Self::Error>
Begin the process of sending a value to the sink.
Each call to this function must be preceded by a successful call to
poll_ready
which returned Poll::Ready(Ok(()))
. Read more
sourceimpl<T, D> Stream for FramedWrite<T, D> where
T: Stream,
impl<T, D> Stream for FramedWrite<T, D> where
T: Stream,
impl<'__pin, T, E> Unpin for FramedWrite<T, E> where
__Origin<'__pin, T, E>: Unpin,
Auto Trait Implementations
impl<T, E> RefUnwindSafe for FramedWrite<T, E> where
E: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, E> Send for FramedWrite<T, E> where
E: Send,
T: Send,
impl<T, E> Sync for FramedWrite<T, E> where
E: Sync,
T: Sync,
impl<T, E> UnwindSafe for FramedWrite<T, E> where
E: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more