AsyncWriteMsg

Trait AsyncWriteMsg 

Source
pub trait AsyncWriteMsg {
    // Required method
    fn write_msg<M: Message>(
        &mut self,
        msg: M,
    ) -> impl Future<Output = Result<()>> + Send + Sync;
}
Available on crate feature async only.
Expand description

Write the given Protobuf message to the underlying I/O object (async).

Required Methods§

Source

fn write_msg<M: Message>( &mut self, msg: M, ) -> impl Future<Output = Result<()>> + Send + Sync

Encode the given Protobuf as bytes, encrypted it, and write the ciphertext to the underlying I/O object.

Deliberately takes ownership of the message to send to simplify writing async code.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§