Skip to main content

ProtocolWrite

Trait ProtocolWrite 

Source
pub trait ProtocolWrite: AsyncWrite + Unpin {
    // Provided method
    fn send_message(
        &mut self,
        message: &ProtocolMessage,
    ) -> impl Future<Output = Res<()>> { ... }
}
Expand description

Length-delimited sending of protocol frames over any async writer.

Provided Methods§

Source

fn send_message( &mut self, message: &ProtocolMessage, ) -> impl Future<Output = Res<()>>

Encodes message and writes it as a u32-length-prefixed frame, then flushes.

§Errors

Returns an error if the frame cannot be encoded, exceeds u32 in length, or the write fails.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§