Struct FramedRead
struct FramedRead<T, D> { ... }
A Stream of messages decoded from an AsyncRead.
For examples of how to use FramedRead with a codec, see the
examples on the codec module.
Cancellation safety
tokio_stream::StreamExt::next: This method is cancel safe. The returned future only holds onto a reference to the underlying stream, so dropping it will never lose a value.
Implementations
impl<T, D> FramedRead<T, D>
fn new(inner: T, decoder: D) -> FramedRead<T, D>Creates a new
FramedReadwith the givendecoder.fn with_capacity(inner: T, decoder: D, capacity: usize) -> FramedRead<T, D>Creates a new
FramedReadwith the givendecoderand a buffer ofcapacityinitial size.
impl<T, D> FramedRead<T, D>
fn get_ref(self: &Self) -> &TReturns 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.
fn get_mut(self: &mut Self) -> &mut TReturns 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.
fn get_pin_mut(self: Pin<&mut Self>) -> Pin<&mut T>Returns a pinned 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.
fn into_inner(self: Self) -> TConsumes 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.
fn decoder(self: &Self) -> &DReturns a reference to the underlying decoder.
fn decoder_mut(self: &mut Self) -> &mut DReturns a mutable reference to the underlying decoder.
fn map_decoder<C, F>(self: Self, map: F) -> FramedRead<T, C> where F: FnOnce(D) -> CMaps the decoder
DtoC, preserving the read buffer wrapped byFramed.fn decoder_pin_mut(self: Pin<&mut Self>) -> &mut DReturns a mutable reference to the underlying decoder.
fn read_buffer(self: &Self) -> &BytesMutReturns a reference to the read buffer.
fn read_buffer_mut(self: &mut Self) -> &mut BytesMutReturns a mutable reference to the read buffer.
impl<'__pin, T, D> Unpin for FramedRead<T, D>
impl<S, T, E> TryStream for FramedRead<T, D>
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 FramedRead<T, D>
fn type_id(self: &Self) -> TypeId
impl<T> Borrow for FramedRead<T, D>
fn borrow(self: &Self) -> &T
impl<T> BorrowMut for FramedRead<T, D>
fn borrow_mut(self: &mut Self) -> &mut T
impl<T> From for FramedRead<T, D>
fn from(t: T) -> TReturns the argument unchanged.
impl<T, D> Debug for FramedRead<T, D>
fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result
impl<T, D> Freeze for FramedRead<T, D>
impl<T, D> RefUnwindSafe for FramedRead<T, D>
impl<T, D> Send for FramedRead<T, D>
impl<T, D> Stream for FramedRead<T, D>
fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<<Self as >::Item>>
impl<T, D> Sync for FramedRead<T, D>
impl<T, D> UnsafeUnpin for FramedRead<T, D>
impl<T, D> UnwindSafe for FramedRead<T, D>
impl<T, I, D> Sink for FramedRead<T, D>
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> Into for FramedRead<T, D>
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 FramedRead<T, D>
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto for FramedRead<T, D>
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>