Trait DynWrite

Source
pub trait DynWrite: MaybeSend {
    // Required methods
    fn write_all(
        &mut self,
        buf: Buf,
    ) -> Pin<Box<dyn MaybeSendFuture<Output = (Result<(), BoxedError>, Buf)> + '_>>;
    fn flush(
        &mut self,
    ) -> Pin<Box<dyn MaybeSendFuture<Output = Result<(), BoxedError>> + '_>>;
    fn close(
        &mut self,
    ) -> Pin<Box<dyn MaybeSendFuture<Output = Result<(), BoxedError>> + '_>>;
}
Expand description

Dyn compatible(object safety) version of Write. All implementations of Write has already implemented this trait. Also, all implementations of DynWrite has already implemented Write. User should not use this trait directly.

Required Methods§

Source

fn write_all( &mut self, buf: Buf, ) -> Pin<Box<dyn MaybeSendFuture<Output = (Result<(), BoxedError>, Buf)> + '_>>

Source

fn flush( &mut self, ) -> Pin<Box<dyn MaybeSendFuture<Output = Result<(), BoxedError>> + '_>>

Source

fn close( &mut self, ) -> Pin<Box<dyn MaybeSendFuture<Output = Result<(), BoxedError>> + '_>>

Trait Implementations§

Source§

impl<'write> Write for Box<dyn DynWrite + 'write>

Source§

type Error = Error

Source§

async fn write_all<B: IoBuf>(&mut self, buf: B) -> (Result<(), Self::Error>, B)

Source§

async fn flush(&mut self) -> Result<(), Self::Error>

Source§

async fn close(&mut self) -> Result<(), Self::Error>

Implementors§

Source§

impl<W: Write> DynWrite for W