pub trait MessageMetadata:
Debug
+ Send
+ Sync
+ 'static {
type PeerId: Default + Display + Debug + Hash + Eq + Copy + Ord + Serialize + DeserializeOwned + Send + Sync + 'static;
type MessageId: Num + NumOps + Eq + Default + PartialEq + Display + Debug + Hash + Ord + PartialOrd + Copy + Serialize + DeserializeOwned + Send + Sync + 'static;
type Contents: Send + Sync + 'static;
// Required methods
fn source_id(&self) -> Self::PeerId;
fn destination_id(&self) -> Self::PeerId;
fn message_id(&self) -> Self::MessageId;
fn contents(&self) -> &Self::Contents;
fn construct_from_parts(
source_id: Self::PeerId,
destination_id: Self::PeerId,
message_id: Self::MessageId,
contents: impl Into<Self::Contents>,
) -> Self;
}
Required Associated Types§
type PeerId: Default + Display + Debug + Hash + Eq + Copy + Ord + Serialize + DeserializeOwned + Send + Sync + 'static
type MessageId: Num + NumOps + Eq + Default + PartialEq + Display + Debug + Hash + Ord + PartialOrd + Copy + Serialize + DeserializeOwned + Send + Sync + 'static
type Contents: Send + Sync + 'static
Required Methods§
fn source_id(&self) -> Self::PeerId
fn destination_id(&self) -> Self::PeerId
fn message_id(&self) -> Self::MessageId
fn contents(&self) -> &Self::Contents
fn construct_from_parts( source_id: Self::PeerId, destination_id: Self::PeerId, message_id: Self::MessageId, contents: impl Into<Self::Contents>, ) -> Self
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.