Struct epoll::EpollInstance
[−]
[src]
pub struct EpollInstance { // some fields omitted }
Thread safe abstraction around the returned fd
from libc::epoll_create(1)
Methods
impl EpollInstance
[src]
fn new() -> Result<EpollInstance>
fn add_interest(&mut self, interest: Interest) -> Result<()>
Register an initial Interest
with this instance.
Panics
Panics if the interior Mutex has been poisoned.
fn mod_interest(&mut self, interest: &Interest) -> Result<()>
Modify the original Interest
, identified by its RawFd
, to the passed
interest's events and data fields.
Panics
Panics if the interior Mutex has been poisoned.
fn del_interest(&mut self, interest: &Interest) -> Result<()>
Remove the passed Interest
, identified by its RawFd
, from this instance.
Panics
Panics if the interior Mutex has been poisoned.
fn wait(&mut self, timeout: i32, max_returned: usize) -> Result<Vec<Interest>>
Waits for events on this instance for at most timeout
milliseconds and returns at most
max_returned
Interests
.
Notes
- If
timeout
is negative, it will block until an event is received. max_returned
must be greater than zero.
Panics
Panics if the interior Mutex has been poisoned.
fn events(&self) -> u64
Returns the total number of events reported.
fn wait_time(&self) -> Duration
Returns the total time spent in a blocked, waiting state.