pub trait MessageRecv: MessageBody {
type DecodeError: Error + Send + Sync + 'static;
// Required method
fn decode(bytes: &[u8]) -> Result<Self, Self::DecodeError>
where Self: Sized;
}Expand description
Trait describing a Message that can be received.
This trait is used both as a marker and to define how a Message can be decoded.
Note that for convenience this trait is automatically implemented for any type that implements
both MessageBody and bitcode’s DecodeOwned trait.
Required Associated Types§
Sourcetype DecodeError: Error + Send + Sync + 'static
type DecodeError: Error + Send + Sync + 'static
Error tyep that may occur while decoding.
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".