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
futures_util::sink::SinkExt::send: if send is used as the event in atokio::select!statement and some other branch completes first, then it is guaranteed that the message was not sent, but the message itself is lost.
Implementations
impl<T, E> FramedWrite<T, E>
fn new(inner: T, encoder: E) -> FramedWrite<T, E>Creates a new
FramedWritewith the givenencoder.
impl<T, E> FramedWrite<T, E>
fn get_ref(self: &Self) -> &TReturns 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 TReturns 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) -> TConsumes 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) -> &EReturns a reference to the underlying encoder.
fn encoder_mut(self: &mut Self) -> &mut EReturns a mutable reference to the underlying encoder.
fn map_encoder<C, F>(self: Self, map: F) -> FramedWrite<T, C> where F: FnOnce(E) -> CMaps the encoder
EtoC, preserving the write buffer wrapped byFramed.fn encoder_pin_mut(self: Pin<&mut Self>) -> &mut EReturns a mutable reference to the underlying encoder.
fn write_buffer(self: &Self) -> &BytesMutReturns a reference to the write buffer.
fn write_buffer_mut(self: &mut Self) -> &mut BytesMutReturns a mutable reference to the write buffer.
fn backpressure_boundary(self: &Self) -> usizeReturns 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) -> TReturns 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) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses 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>