rmp_ipc/events/
error_event.rs1use serde::{Deserialize, Serialize};
2use std::error::Error;
3use std::fmt::{Display, Formatter};
4
5pub static ERROR_EVENT_NAME: &str = "error";
6
7#[derive(Clone, Deserialize, Serialize, Debug)]
12pub struct ErrorEventData {
13 pub code: u16,
14 pub message: String,
15}
16
17impl Error for ErrorEventData {}
18
19impl Display for ErrorEventData {
20 fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
21 write!(f, "IPC Code {}: '{}'", self.code, self.message)
22 }
23}