pub struct EpollDriver { /* private fields */ }
Implementations§
Source§impl EpollDriver
impl EpollDriver
Sourcepub fn register(
&self,
fd: RawFd,
identifier: u64,
mask: EpollEventMask,
) -> Result<()>
pub fn register( &self, fd: RawFd, identifier: u64, mask: EpollEventMask, ) -> Result<()>
Registers a new entry into the EpollDriver
’s underlying kernel state.
The identifier is any u64 which the user can use to tell ready fds apart or indeed
store any data they’d like.
§Errors
OS errors registering the fd, such as a nonsensical mask, or a bad provided fd
Sourcepub fn unregister(&self, fd: RawFd) -> Result<()>
pub fn unregister(&self, fd: RawFd) -> Result<()>
Unregisters an fd
from the EpollDriver
’s underlying kernel state.
§Errors
OS errors unregistering the fd, such as a bad provided fd
Sourcepub fn modify(
&self,
fd: RawFd,
identifier: u64,
mask: EpollEventMask,
) -> Result<()>
pub fn modify( &self, fd: RawFd, identifier: u64, mask: EpollEventMask, ) -> Result<()>
Replaces the previous registration for the provided fd with a new one.
§Errors
OS errors modifying the fd, such as a bad provided fd
or a nonsensical mask
.
Sourcepub fn wait(
&self,
event_buf: &mut [EpollEvent],
timeout: EpollTimeout,
) -> Result<usize>
pub fn wait( &self, event_buf: &mut [EpollEvent], timeout: EpollTimeout, ) -> Result<usize>
Waits for any registered fd
to become ready.
The timeout
can at most be i32::MAX
milliseconds
§Errors
Os errors occurring during wait, or a timeout that is too long
Auto Trait Implementations§
impl Freeze for EpollDriver
impl RefUnwindSafe for EpollDriver
impl Send for EpollDriver
impl Sync for EpollDriver
impl Unpin for EpollDriver
impl UnwindSafe for EpollDriver
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more