pub struct Poller {
epoll_fd: OwnedFd,
notifier: Notifier,
timer_fd: Option<OwnedFd>,
}
Expand description
Interface to epoll.
Fields§
§epoll_fd: OwnedFd
File descriptor for the epoll instance.
notifier: Notifier
Notifier used to wake up epoll.
timer_fd: Option<OwnedFd>
File descriptor for the timerfd that produces timeouts.
Redox does not support timerfd.
Implementations§
source§impl Poller
impl Poller
sourcepub fn supports_level(&self) -> bool
pub fn supports_level(&self) -> bool
Whether this poller supports level-triggered events.
sourcepub fn supports_edge(&self) -> bool
pub fn supports_edge(&self) -> bool
Whether the poller supports edge-triggered events.
sourcepub unsafe fn add(&self, fd: RawFd, ev: Event, mode: PollMode) -> Result<()>
pub unsafe fn add(&self, fd: RawFd, ev: Event, mode: PollMode) -> Result<()>
Adds a new file descriptor.
§Safety
The fd
must be a valid file descriptor. The usual condition of remaining registered in
the Poller
doesn’t apply to epoll
.
sourcepub fn modify(
&self,
fd: BorrowedFd<'_>,
ev: Event,
mode: PollMode,
) -> Result<()>
pub fn modify( &self, fd: BorrowedFd<'_>, ev: Event, mode: PollMode, ) -> Result<()>
Modifies an existing file descriptor.
sourcepub fn delete(&self, fd: BorrowedFd<'_>) -> Result<()>
pub fn delete(&self, fd: BorrowedFd<'_>) -> Result<()>
Deletes a file descriptor.
Trait Implementations§
source§impl AsFd for Poller
impl AsFd for Poller
source§fn as_fd(&self) -> BorrowedFd<'_>
fn as_fd(&self) -> BorrowedFd<'_>
Borrows the file descriptor. Read more
Auto Trait Implementations§
impl Freeze for Poller
impl RefUnwindSafe for Poller
impl Send for Poller
impl Sync for Poller
impl Unpin for Poller
impl UnwindSafe for Poller
Blanket Implementations§
source§impl<T> AsSource for Twhere
T: AsFd,
impl<T> AsSource for Twhere
T: AsFd,
source§fn source(&self) -> BorrowedFd<'_>
fn source(&self) -> BorrowedFd<'_>
Returns the borrowed file descriptor.
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