use serde::{Serialize, Deserialize};
#[derive(Debug, PartialEq, Eq, Hash, Clone, Copy, Serialize, Deserialize)]
pub struct CommunicationSetup {
pub sender: bool,
pub process: usize,
pub remote: Option<usize>,
}
#[derive(Debug, PartialEq, Eq, Hash, Clone, Copy, Serialize, Deserialize)]
pub enum CommunicationEvent {
Message(MessageEvent),
State(StateEvent),
}
#[derive(Debug, PartialEq, Eq, Hash, Clone, Copy, Serialize, Deserialize)]
pub struct MessageEvent {
pub is_send: bool,
pub header: crate::networking::MessageHeader,
}
#[derive(Debug, PartialEq, Eq, Hash, Clone, Copy, Serialize, Deserialize)]
pub struct StateEvent {
pub send: bool,
pub process: usize,
pub remote: usize,
pub start: bool,
}
impl From<MessageEvent> for CommunicationEvent {
fn from(v: MessageEvent) -> CommunicationEvent { CommunicationEvent::Message(v) }
}
impl From<StateEvent> for CommunicationEvent {
fn from(v: StateEvent) -> CommunicationEvent { CommunicationEvent::State(v) }
}