Struct tokio::io::StreamReader
source · [−]pub struct StreamReader<S, B> { /* private fields */ }
Expand description
Convert a stream of byte chunks into an AsyncRead
.
This type is usually created using the stream_reader
function.
Trait Implementations
sourceimpl<S, B> AsyncBufRead for StreamReader<S, B> where
S: Stream<Item = Result<B, Error>>,
B: Buf,
impl<S, B> AsyncBufRead for StreamReader<S, B> where
S: Stream<Item = Result<B, Error>>,
B: Buf,
sourceimpl<S, B> AsyncRead for StreamReader<S, B> where
S: Stream<Item = Result<B, Error>>,
B: Buf,
impl<S, B> AsyncRead for StreamReader<S, B> where
S: Stream<Item = Result<B, Error>>,
B: Buf,
sourcefn poll_read(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
buf: &mut [u8]
) -> Poll<Result<usize>>
fn poll_read(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
buf: &mut [u8]
) -> Poll<Result<usize>>
Attempts to read from the AsyncRead
into buf
. Read more
sourcefn poll_read_buf<BM: BufMut>(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
buf: &mut BM
) -> Poll<Result<usize>> where
Self: Sized,
fn poll_read_buf<BM: BufMut>(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
buf: &mut BM
) -> Poll<Result<usize>> where
Self: Sized,
Pulls some bytes from this source into the specified BufMut
, returning
how many bytes were read. Read more
sourceunsafe fn prepare_uninitialized_buffer(
&self,
_buf: &mut [MaybeUninit<u8>]
) -> bool
unsafe fn prepare_uninitialized_buffer(
&self,
_buf: &mut [MaybeUninit<u8>]
) -> bool
Prepares an uninitialized buffer to be safe to pass to read
. Returns
true
if the supplied buffer was zeroed out. Read more
sourceimpl<S: Debug, B: Debug> Debug for StreamReader<S, B>
impl<S: Debug, B: Debug> Debug for StreamReader<S, B>
impl<'__pin, S, B> Unpin for StreamReader<S, B> where
__Origin<'__pin, S, B>: Unpin,
Auto Trait Implementations
impl<S, B> RefUnwindSafe for StreamReader<S, B> where
B: RefUnwindSafe,
S: RefUnwindSafe,
impl<S, B> Send for StreamReader<S, B> where
B: Send,
S: Send,
impl<S, B> Sync for StreamReader<S, B> where
B: Sync,
S: Sync,
impl<S, B> UnwindSafe for StreamReader<S, B> where
B: UnwindSafe,
S: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more