pub struct TokioStreamReader<T>(pub T);
Expand description
Utility to convert a tokio::io::AsyncRead into an AsyncStreamReader.
Tuple Fields§
§0: T
Implementations§
Source§impl<T> TokioStreamReader<T>
impl<T> TokioStreamReader<T>
Sourcepub fn into_inner(self) -> T
pub fn into_inner(self) -> T
Return the inner reader
Trait Implementations§
Source§impl<T: AsyncRead + Unpin> AsyncStreamReader for TokioStreamReader<T>
impl<T: AsyncRead + Unpin> AsyncStreamReader for TokioStreamReader<T>
Source§async fn read_bytes(&mut self, len: usize) -> Result<Bytes>
async fn read_bytes(&mut self, len: usize) -> Result<Bytes>
Read at most
len
bytes. To read to the end, pass u64::MAX. Read moreSource§async fn read<const L: usize>(&mut self) -> Result<[u8; L]>
async fn read<const L: usize>(&mut self) -> Result<[u8; L]>
Read a fixed size buffer. Read more
Source§impl<T: Clone> Clone for TokioStreamReader<T>
impl<T: Clone> Clone for TokioStreamReader<T>
Source§fn clone(&self) -> TokioStreamReader<T>
fn clone(&self) -> TokioStreamReader<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl<T> Freeze for TokioStreamReader<T>where
T: Freeze,
impl<T> RefUnwindSafe for TokioStreamReader<T>where
T: RefUnwindSafe,
impl<T> Send for TokioStreamReader<T>where
T: Send,
impl<T> Sync for TokioStreamReader<T>where
T: Sync,
impl<T> Unpin for TokioStreamReader<T>where
T: Unpin,
impl<T> UnwindSafe for TokioStreamReader<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more