aboutsummaryrefslogtreecommitdiff
path: root/src/events.rs
blob: 8c474d7ddd668552d7736f69d237b6ef9d6721d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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<Welcome>),
    RplYourHost(Box<YourHost>),
    RplCreated(Box<Created>),
    PrivMsg(Ident, String, String)
}