use crate::graph::middleware::dot::Dot;
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct Message {
pub dot: Dot,
pub payload: Vec<u8>,
pub context: Vec<Dot>,
}
impl Message {
pub fn empty() -> Self {
Self {
dot: Dot::new(0, 0),
payload: Vec::new(),
context: Vec::new(),
}
}
pub fn new(payload: Vec<u8>, dot: Dot, context: Vec<Dot>) -> Self {
Self {
payload,
dot,
context,
}
}
}