From fc27f8cee888acf70683badca9edadb45544822c Mon Sep 17 00:00:00 2001 From: Till Hoeppner Date: Tue, 21 Oct 2014 15:33:17 +0200 Subject: Initial commit. --- src/events.rs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/events.rs (limited to 'src/events.rs') diff --git a/src/events.rs b/src/events.rs new file mode 100644 index 0000000..8c474d7 --- /dev/null +++ b/src/events.rs @@ -0,0 +1,22 @@ +use ident::Ident; + +macro_rules! string_record( + ($name: ident, $( $fields: ident ),*) => ( + #[deriving(Show, Clone)] + pub struct $name { + $(pub $fields: String),* + } + ) +) + +string_record!(Welcome, source, target, msg) +string_record!(YourHost, source, target, msg) +string_record!(Created, source, target, msg) + +#[deriving(Show, Clone)] +pub enum Event { + RplWelcome(Box), + RplYourHost(Box), + RplCreated(Box), + PrivMsg(Ident, String, String) +} -- cgit v1.2.3