1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
#[derive(Clone, Debug, Eq, PartialEq)] pub enum Event { Read, Write, Both } impl Event { pub fn readable(&self) -> bool { match *self { Event::Read | Event::Both => true, _ => false } } pub fn writable(&self) -> bool { match *self { Event::Write | Event::Both => true, _ => false } } }