diff --git a/src/sys/epoll.rs b/src/sys/epoll.rs index 2cdc663859..51f789a243 100644 --- a/src/sys/epoll.rs +++ b/src/sys/epoll.rs @@ -38,9 +38,17 @@ pub struct EpollEvent { } impl EpollEvent { - fn new(events: EpollEventKind, data: u64) -> EpollEvent { + pub fn new(events: EpollEventKind, data: u64) -> EpollEvent { EpollEvent { event: libc::epoll_event { events: events.bits(), u64: data } } } + + pub fn events(&self) -> EpollEventKind { + EpollEventKind::from_bits(self.event.events).unwrap() + } + + pub fn data(&self) -> u64 { + self.event.u64 + } } #[inline]