Struct FramedWrite

struct FramedWrite<T, E> { ... }

A Sink of frames encoded to an AsyncWrite.

For examples of how to use FramedWrite with a codec, see the examples on the codec module.

Cancellation safety

Implementations

impl<T, E> FramedWrite<T, E>

fn new(inner: T, encoder: E) -> FramedWrite<T, E>

Creates a new FramedWrite with the given encoder.

impl<T, E> FramedWrite<T, E>

fn get_ref(self: &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.

fn get_mut(self: &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.

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.

fn into_inner(self: 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.

fn encoder(self: &Self) -> &E

Returns a reference to the underlying encoder.

fn encoder_mut(self: &mut Self) -> &mut E

Returns a mutable reference to the underlying encoder.

fn map_encoder<C, F>(self: Self, map: F) -> FramedWrite<T, C>
where
    F: FnOnce(E) -> C

Maps the encoder E to C, preserving the write buffer wrapped by Framed.

fn encoder_pin_mut(self: Pin<&mut Self>) -> &mut E

Returns a mutable reference to the underlying encoder.

fn write_buffer(self: &Self) -> &BytesMut

Returns a reference to the write buffer.

fn write_buffer_mut(self: &mut Self) -> &mut BytesMut

Returns a mutable reference to the write buffer.

fn backpressure_boundary(self: &Self) -> usize

Returns backpressure boundary

fn set_backpressure_boundary(self: &mut Self, boundary: usize)

Updates backpressure boundary

impl<'__pin, T, E> Unpin for FramedWrite<T, E>

impl<S, T, E> TryStream for FramedWrite<T, E>

fn try_poll_next(self: Pin<&mut S>, cx: &mut Context<'_>) -> Poll<Option<Result<<S as TryStream>::Ok, <S as TryStream>::Error>>>

impl<T> Any for FramedWrite<T, E>

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for FramedWrite<T, E>

fn borrow(self: &Self) -> &T

impl<T> BorrowMut for FramedWrite<T, E>

fn borrow_mut(self: &mut Self) -> &mut T

impl<T> From for FramedWrite<T, E>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T, D> Stream for FramedWrite<T, D>

fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<<Self as >::Item>>

impl<T, E> Freeze for FramedWrite<T, E>

impl<T, E> RefUnwindSafe for FramedWrite<T, E>

impl<T, E> Send for FramedWrite<T, E>

impl<T, E> Sync for FramedWrite<T, E>

impl<T, E> UnsafeUnpin for FramedWrite<T, E>

impl<T, E> UnwindSafe for FramedWrite<T, E>

impl<T, I, E> Sink for FramedWrite<T, E>

fn poll_ready(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<(), <Self as >::Error>>
fn start_send(self: Pin<&mut Self>, item: I) -> Result<(), <Self as >::Error>
fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<(), <Self as >::Error>>
fn poll_close(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<(), <Self as >::Error>>

impl<T, U> Debug for FramedWrite<T, U>

fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result

impl<T, U> Into for FramedWrite<T, E>

fn into(self: Self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom for FramedWrite<T, E>

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

impl<T, U> TryInto for FramedWrite<T, E>

fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>