Trait DynWrite

Source
pub unsafe trait DynWrite: MaybeSend + Sealed {
    // Required methods
    fn write_all(
        &mut self,
        buf: Buf,
    ) -> Pin<Box<dyn MaybeSendFuture<Output = (Result<(), Error>, Buf)> + '_>>;
    fn flush(
        &mut self,
    ) -> Pin<Box<dyn MaybeSendFuture<Output = Result<(), Error>> + '_>>;
    fn close(
        &mut self,
    ) -> Pin<Box<dyn MaybeSendFuture<Output = Result<(), Error>> + '_>>;
}
Available on crate feature alloc only.
Expand description

Dyn compatible (object safe) version of Write.

All implementations of Write automatically implement this trait. Also, all implementations of DynWrite automatically implement Write. Users should not use this trait directly.

§Safety

Do not implement this trait directly. All implementations of Write automatically implement this trait.

Required Methods§

Source

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

Source

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

Source

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

Trait Implementations§

Source§

impl Write for Box<dyn DynWrite + '_>

Source§

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

Source§

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

Source§

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

Implementors§

Source§

impl<W: Write> DynWrite for W