Trait embedded_io::asynch::Read
source · [−]pub trait Read: Io {
type ReadFuture<'a>: Future<Output = Result<usize, Self::Error>>
where
Self: 'a;
fn read<'a>(&'a mut self, buf: &'a mut [u8]) -> Self::ReadFuture<'a>;
fn read_exact<'a>(
&'a mut self,
buf: &'a mut [u8]
) -> impl Future<Output = Result<(), ReadExactError<Self::Error>>> { ... }
}
Available on crate feature
async
only.Expand description
Async reader.
Semantics are the same as std::io::Read
, check its documentation for details.
Required Associated Types
Required Methods
Provided Methods
fn read_exact<'a>(
&'a mut self,
buf: &'a mut [u8]
) -> impl Future<Output = Result<(), ReadExactError<Self::Error>>>
fn read_exact<'a>(
&'a mut self,
buf: &'a mut [u8]
) -> impl Future<Output = Result<(), ReadExactError<Self::Error>>>
Read the exact number of bytes required to fill buf
.
Implementations on Foreign Types
sourceimpl Read for &[u8]
impl Read for &[u8]
Read is implemented for &[u8]
by copying from the slice.
Note that reading updates the slice to point to the yet unread part. The slice will be empty when EOF is reached.
Implementors
sourceimpl<T: AsyncRead + Unpin + ?Sized> Read for FromTokio<T>
Available on crate feature tokio
only.
impl<T: AsyncRead + Unpin + ?Sized> Read for FromTokio<T>
Available on crate feature
tokio
only.sourceimpl<T: AsyncRead + Unpin + ?Sized> Read for FromFutures<T>
Available on crate feature futures
only.
impl<T: AsyncRead + Unpin + ?Sized> Read for FromFutures<T>
Available on crate feature
futures
only.