Trait WriteAsync

Source
pub trait WriteAsync<'a, T, FWrite, FWriteExact>
where FWrite: Future<Output = Result<usize, Error>> + 'a,
{ // Required methods fn write(&'a mut self, bytes: &'a [u8]) -> FWrite; fn write_exact(&'a mut self, bytes: &'a [u8]) -> FWriteExact; }
Expand description

Trait that adds async variants of some std::io::Write functions.

Required Methods§

Source

fn write(&'a mut self, bytes: &'a [u8]) -> FWrite

Async equivalent to std::io::Write::write.

Source

fn write_exact(&'a mut self, bytes: &'a [u8]) -> FWriteExact

Async equivalent to std::io::Write::write_exact. When using UDP, this may send multiple packets.

Implementors§

Source§

impl<'a, T> WriteAsync<'a, usize, WriteFuture<'a, T>, WriteExactFuture<'a, T>> for T
where WriteFuture<'a, T>: Future<Output = Result<usize, Error>> + 'a, WriteExactFuture<'a, T>: Future<Output = Result<(), Error>> + 'a,