Trait iroh_io::AsyncStreamWriter
source · pub trait AsyncStreamWriter {
// Required methods
fn write(&mut self, data: &[u8]) -> impl Future<Output = Result<()>>;
fn write_bytes(&mut self, data: Bytes) -> impl Future<Output = Result<()>>;
fn sync(&mut self) -> impl Future<Output = Result<()>>;
}
Expand description
A non seekable writer, e.g. a network socket.
Required Methods§
sourcefn write(&mut self, data: &[u8]) -> impl Future<Output = Result<()>>
fn write(&mut self, data: &[u8]) -> impl Future<Output = Result<()>>
Write the entire slice.
In case of an error, some bytes may have been written.
Object Safety§
This trait is not object safe.