gadget_sdk::network::messaging

Trait MessageMetadata

Source
pub trait MessageMetadata {
    type JobId: Display + Hash + Eq + Copy + Send + Sync + 'static;
    type PeerId: Display + Hash + Eq + Copy + Send + Sync + 'static;
    type MessageId: Add<usize, Output = Self::MessageId> + Eq + PartialEq + Display + Hash + Ord + PartialOrd + Copy + Send + Sync + 'static;

    // Required methods
    fn job_id(&self) -> Self::JobId;
    fn source_id(&self) -> Self::PeerId;
    fn destination_id(&self) -> Self::PeerId;
    fn message_id(&self) -> Self::MessageId;
    fn contents(&self) -> &[u8] ;
}

Required Associated Types§

Source

type JobId: Display + Hash + Eq + Copy + Send + Sync + 'static

Source

type PeerId: Display + Hash + Eq + Copy + Send + Sync + 'static

Source

type MessageId: Add<usize, Output = Self::MessageId> + Eq + PartialEq + Display + Hash + Ord + PartialOrd + Copy + Send + Sync + 'static

Required Methods§

Source

fn job_id(&self) -> Self::JobId

Source

fn source_id(&self) -> Self::PeerId

Source

fn destination_id(&self) -> Self::PeerId

Source

fn message_id(&self) -> Self::MessageId

Source

fn contents(&self) -> &[u8]

Implementors§