pub trait MessageSpecifier<T>: Sealed {
type Output: MessageReply + Send;
type Payload: Send + 'static;
// Required methods
fn into_payload(msg: T) -> (Self::Payload, Self::Output);
fn from_payload(payload: Self::Payload) -> T;
}Expand description
A trait for types that can be used to specify the kind of a Message.
This trait is sealed and cannot be implemented outside of this crate.
Use Request<T> or FireAndForget to specify the kind of a Message.
Required Associated Types§
Sourcetype Output: MessageReply + Send
type Output: MessageReply + Send
The output type of the message.
This must implement MessageReply, and is either Rx<T> for request
messages, or () for fire-and-forget messages.
Required Methods§
Sourcefn into_payload(msg: T) -> (Self::Payload, Self::Output)
fn into_payload(msg: T) -> (Self::Payload, Self::Output)
Convert a message into its payload and output.
Sourcefn from_payload(payload: Self::Payload) -> T
fn from_payload(payload: Self::Payload) -> T
Convert a payload back into the message.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".