Add the first draft of an event handler system
This commit is contained in:
parent
a6b9d18374
commit
2b87c9c3c3
4 changed files with 95 additions and 13 deletions
|
@ -1,4 +1,5 @@
|
|||
use crate::entry::Entry;
|
||||
use crate::event_handlers::EventHandler;
|
||||
use std::fmt;
|
||||
|
||||
pub struct Error {
|
||||
|
@ -41,3 +42,9 @@ impl From<std::sync::mpsc::SendError<Entry>> for Error {
|
|||
Error::new(&format!("IO error: {}", error))
|
||||
}
|
||||
}
|
||||
|
||||
impl From<std::sync::mpsc::SendError<EventHandler>> for Error {
|
||||
fn from(error: std::sync::mpsc::SendError<EventHandler>) -> Self {
|
||||
Error::new(&format!("IO error: {}", error))
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue