Trait iroh_io::AsyncStreamWriter
source · pub trait AsyncStreamWriter {
type WriteFuture<'a>: Future<Output = Result<()>> + 'a
where Self: 'a;
type WriteBytesFuture<'a>: Future<Output = Result<()>> + 'a
where Self: 'a;
type SyncFuture<'a>: Future<Output = Result<()>> + 'a
where Self: 'a;
// Required methods
fn write<'a>(&'a mut self, data: &'a [u8]) -> Self::WriteFuture<'a>;
fn write_bytes(&mut self, data: Bytes) -> Self::WriteBytesFuture<'_>;
fn sync(&mut self) -> Self::SyncFuture<'_>;
}Expand description
A non seekable writer, e.g. a network socket.
Required Associated Types§
sourcetype WriteFuture<'a>: Future<Output = Result<()>> + 'a
where
Self: 'a
type WriteFuture<'a>: Future<Output = Result<()>> + 'a where Self: 'a
Future returned by write
sourcetype WriteBytesFuture<'a>: Future<Output = Result<()>> + 'a
where
Self: 'a
type WriteBytesFuture<'a>: Future<Output = Result<()>> + 'a where Self: 'a
Future returned by write
sourcetype SyncFuture<'a>: Future<Output = Result<()>> + 'a
where
Self: 'a
type SyncFuture<'a>: Future<Output = Result<()>> + 'a where Self: 'a
Future returned by sync
Required Methods§
sourcefn write<'a>(&'a mut self, data: &'a [u8]) -> Self::WriteFuture<'a>
fn write<'a>(&'a mut self, data: &'a [u8]) -> Self::WriteFuture<'a>
Write the entire slice.
In case of an error, some bytes may have been written.
sourcefn write_bytes(&mut self, data: Bytes) -> Self::WriteBytesFuture<'_>
fn write_bytes(&mut self, data: Bytes) -> Self::WriteBytesFuture<'_>
Write the entire bytes.
In case of an error, some bytes may have been written.
sourcefn sync(&mut self) -> Self::SyncFuture<'_>
fn sync(&mut self) -> Self::SyncFuture<'_>
Sync any buffers to the underlying storage.
Object Safety§
This trait is not object safe.