use std::fmt::Debug; use serde::{Serialize, Deserialize}; use pid::Pid; use correlation_id::CorrelationId; use msg::Msg; /// Envelopes are routable to processes on all nodes and threads running on the same node as this /// process. #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] pub struct Envelope { pub to: Pid, pub from: Pid, pub msg: Msg, pub correlation_id: Option } impl<'de, T: Serialize + Deserialize<'de> + Debug + Clone> Envelope { pub fn new(to: Pid, from: Pid, msg: Msg, c_id: Option) -> Envelope { Envelope { to: to, from: from, msg: msg, correlation_id: c_id } } }