1
2
3
4
5
6
7
8
9
10
11
12
13
14
#[derive(Default)]
pub struct Events {
    queue: Vec<(String, String)>,
}

impl Events {
    pub fn new() -> Self {
        Self::default()
    }

    pub fn dispatch(&mut self, name: &str, payload: serde_json::Value) {
        self.queue.push((name.to_owned(), payload.to_string()))
    }
}