pub trait Message:
Debug
+ Send
+ Unpin
+ 'static {
// Required methods
fn message_id(&self) -> u64;
fn control_code(&self) -> ProtosocketControlCode;
fn set_message_id(&mut self, message_id: u64);
fn cancelled(message_id: u64) -> Self;
fn ended(message_id: u64) -> Self;
}
Expand description
A protosocket message.
Required Methods§
Sourcefn message_id(&self) -> u64
fn message_id(&self) -> u64
This is used to relate requests to responses. An RPC response has the same id as the request that generated it.
Sourcefn control_code(&self) -> ProtosocketControlCode
fn control_code(&self) -> ProtosocketControlCode
Set the protosocket behavior of this message.
Sourcefn set_message_id(&mut self, message_id: u64)
fn set_message_id(&mut self, message_id: u64)
This is used to relate requests to responses. An RPC response has the same id as the request that generated it. When the message is sent, protosocket will set this value.
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.