Trait xwt_core::stream::Write

source ·
pub trait Write: Send {
    type Error: Error + Send + Sync + 'static;

    // Required method
    fn write(
        &mut self,
        buf: &[u8]
    ) -> impl Future<Output = Result<usize, Self::Error>> + Send;
}
Expand description

Write the data to a stream.

Required Associated Types§

source

type Error: Error + Send + Sync + 'static

An error that can occur while writing to the stream.

Required Methods§

source

fn write( &mut self, buf: &[u8] ) -> impl Future<Output = Result<usize, Self::Error>> + Send

Write the data from the given buffer into the stream, returning the amount of of bytes that were successfully written into the stream. If the returned amount is smaller than the size of the data that was being written, the user should try writing the remainig data again.

Object Safety§

This trait is not object safe.

Implementors§