Trait iroh_io::AsyncStreamReader
source · pub trait AsyncStreamReader {
type ReadFuture<'a>: Future<Output = Result<Bytes>> + 'a
where Self: 'a;
// Required method
fn read(&mut self, len: usize) -> Self::ReadFuture<'_>;
}Expand description
A non seekable reader, e.g. a network socket.
Required Associated Types§
sourcetype ReadFuture<'a>: Future<Output = Result<Bytes>> + 'a
where
Self: 'a
type ReadFuture<'a>: Future<Output = Result<Bytes>> + 'a where Self: 'a
Future returned by read
Required Methods§
sourcefn read(&mut self, len: usize) -> Self::ReadFuture<'_>
fn read(&mut self, len: usize) -> Self::ReadFuture<'_>
Read at most len bytes. To read to the end, pass u64::MAX.
returns an empty buffer to indicate EOF.
Object Safety§
This trait is not object safe.