pub trait BincodeSend: Unpin + Sized {
// Required methods
fn push<T>(&mut self, message: T) -> impl Future<Output = Void>
where T: Encode;
fn close(&mut self) -> impl Future<Output = Void>;
}Expand description
A trait for sending protocol messages over a stream.
This impl is designed to ensure that the push method can only be used to send
ProtocolMessage messages. This restriction is important for type safety
and to ensure that all messages sent through the stream follow the protocol
format and are properly encrypted if necessary.
Required Methods§
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.