pub struct Epoll<Context: Context> { /* private fields */ }Expand description
An “epoll”, an interface to an OS object allowing one to repeatedly wait for events from a set of file descriptors efficiently.
Implementations
sourceimpl<Context: Context> Epoll<Context>
 
impl<Context: Context> Epoll<Context>
sourcepub fn new(flags: CreateFlags, context: Context) -> Result<Self>
 
pub fn new(flags: CreateFlags, context: Context) -> Result<Self>
epoll_create1(flags)—Creates a new Epoll.
Use the CreateFlags::CLOEXEC flag to prevent the resulting file
descriptor from being implicitly passed across exec boundaries.
sourcepub fn add(
    &self,
    data: Context::Data,
    event_flags: EventFlags
) -> Result<Ref<'_, Context::Target>>
 
pub fn add(
    &self,
    data: Context::Data,
    event_flags: EventFlags
) -> Result<Ref<'_, Context::Target>>
epoll_ctl(self, EPOLL_CTL_ADD, data, event)—Adds an element to an
Epoll.
This registers interest in any of the events set in events occurring
on the file descriptor associated with data.
sourcepub fn mod_(
    &self,
    target: Ref<'_, Context::Target>,
    event_flags: EventFlags
) -> Result<()>
 
pub fn mod_(
    &self,
    target: Ref<'_, Context::Target>,
    event_flags: EventFlags
) -> Result<()>
epoll_ctl(self, EPOLL_CTL_MOD, target, event)—Modifies an element in
this Epoll.
This sets the events of interest with target to events.
sourcepub fn del(&self, target: Ref<'_, Context::Target>) -> Result<Context::Data>
 
pub fn del(&self, target: Ref<'_, Context::Target>) -> Result<Context::Data>
epoll_ctl(self, EPOLL_CTL_DEL, target, NULL)—Removes an element in
this Epoll.
This also returns the owning Data.
sourcepub fn wait<'context>(
    &'context self,
    event_list: &mut EventVec<'context, Context>,
    timeout: c_int
) -> Result<()>
 
pub fn wait<'context>(
    &'context self,
    event_list: &mut EventVec<'context, Context>,
    timeout: c_int
) -> Result<()>
epoll_wait(self, events, timeout)—Waits for registered events of
interest.
For each event of interest, an element is written to events. On
success, this returns the number of written elements.
Trait Implementations
sourceimpl<'context, T: AsFd + Into<OwnedFd> + From<OwnedFd>> AsFd for Epoll<Owning<'context, T>>
 
impl<'context, T: AsFd + Into<OwnedFd> + From<OwnedFd>> AsFd for Epoll<Owning<'context, T>>
sourcefn as_fd(&self) -> BorrowedFd<'_>
 
fn as_fd(&self) -> BorrowedFd<'_>
Borrows the file descriptor. Read more
sourceimpl<'context, T: AsFd + Into<OwnedFd> + From<OwnedFd>> AsRawFd for Epoll<Owning<'context, T>>
 
impl<'context, T: AsFd + Into<OwnedFd> + From<OwnedFd>> AsRawFd for Epoll<Owning<'context, T>>
sourceimpl<'context, T: AsFd + Into<OwnedFd> + From<OwnedFd>> From<Epoll<Owning<'context, T>>> for OwnedFd
 
impl<'context, T: AsFd + Into<OwnedFd> + From<OwnedFd>> From<Epoll<Owning<'context, T>>> for OwnedFd
sourceimpl<'context, T: AsFd + Into<OwnedFd> + From<OwnedFd>> From<OwnedFd> for Epoll<Owning<'context, T>>
 
impl<'context, T: AsFd + Into<OwnedFd> + From<OwnedFd>> From<OwnedFd> for Epoll<Owning<'context, T>>
Auto Trait Implementations
impl<Context> RefUnwindSafe for Epoll<Context> where
    Context: RefUnwindSafe, 
impl<Context> Send for Epoll<Context> where
    Context: Send, 
impl<Context> Sync for Epoll<Context> where
    Context: Sync, 
impl<Context> Unpin for Epoll<Context> where
    Context: Unpin, 
impl<Context> UnwindSafe for Epoll<Context> where
    Context: UnwindSafe, 
Blanket Implementations
sourceimpl<T> AsFilelike for T where
    T: AsFd, 
 
impl<T> AsFilelike for T where
    T: AsFd, 
sourcefn as_filelike(&self) -> BorrowedFd<'_>
 
fn as_filelike(&self) -> BorrowedFd<'_>
Borrows the reference. Read more
sourcefn as_filelike_view<Target>(&self) -> FilelikeView<'_, Target> where
    Target: FilelikeViewType, 
 
fn as_filelike_view<Target>(&self) -> FilelikeView<'_, Target> where
    Target: FilelikeViewType, 
Return a borrowing view of a resource which dereferences to a &Target. Read more
sourceimpl<T> AsRawFilelike for T where
    T: AsRawFd, 
 
impl<T> AsRawFilelike for T where
    T: AsRawFd, 
sourcefn as_raw_filelike(&self) -> i32
 
fn as_raw_filelike(&self) -> i32
Returns the raw value.
sourceimpl<T> AsRawSocketlike for T where
    T: AsRawFd, 
 
impl<T> AsRawSocketlike for T where
    T: AsRawFd, 
sourcefn as_raw_socketlike(&self) -> i32
 
fn as_raw_socketlike(&self) -> i32
Returns the raw value.
sourceimpl<T> AsSocketlike for T where
    T: AsFd, 
 
impl<T> AsSocketlike for T where
    T: AsFd, 
sourcefn as_socketlike(&self) -> BorrowedFd<'_>
 
fn as_socketlike(&self) -> BorrowedFd<'_>
Borrows the reference.
sourcefn as_socketlike_view<Target>(&self) -> SocketlikeView<'_, Target> where
    Target: SocketlikeViewType, 
 
fn as_socketlike_view<Target>(&self) -> SocketlikeView<'_, Target> where
    Target: SocketlikeViewType, 
Return a borrowing view of a resource which dereferences to a &Target. Read more
sourceimpl<T> BorrowMut<T> for T where
    T: ?Sized, 
 
impl<T> BorrowMut<T> for T where
    T: ?Sized, 
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
 
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> FromFd for T where
    T: From<OwnedFd>, 
 
impl<T> FromFd for T where
    T: From<OwnedFd>, 
sourceimpl<T> FromFilelike for T where
    T: From<OwnedFd>, 
 
impl<T> FromFilelike for T where
    T: From<OwnedFd>, 
sourcefn from_filelike(owned: OwnedFd) -> T
 
fn from_filelike(owned: OwnedFd) -> T
Constructs a new instance of Self from the given filelike object. Read more
sourcefn from_into_filelike<Owned>(owned: Owned) -> T where
    Owned: IntoFilelike, 
 
fn from_into_filelike<Owned>(owned: Owned) -> T where
    Owned: IntoFilelike, 
Constructs a new instance of Self from the given filelike object
converted from into_owned. Read more
sourceimpl<T> FromRawFilelike for T where
    T: FromRawFd, 
 
impl<T> FromRawFilelike for T where
    T: FromRawFd, 
sourceunsafe fn from_raw_filelike(raw: i32) -> T
 
unsafe fn from_raw_filelike(raw: i32) -> T
Constructs Self from the raw value. Read more
sourceimpl<T> FromRawSocketlike for T where
    T: FromRawFd, 
 
impl<T> FromRawSocketlike for T where
    T: FromRawFd, 
sourceunsafe fn from_raw_socketlike(raw: i32) -> T
 
unsafe fn from_raw_socketlike(raw: i32) -> T
Constructs Self from the raw value. Read more
sourceimpl<T> FromSocketlike for T where
    T: From<OwnedFd>, 
 
impl<T> FromSocketlike for T where
    T: From<OwnedFd>, 
sourcefn from_socketlike(owned: OwnedFd) -> T
 
fn from_socketlike(owned: OwnedFd) -> T
Constructs a new instance of Self from the given socketlike object.
sourcefn from_into_socketlike<Owned>(owned: Owned) -> T where
    Owned: IntoSocketlike, 
 
fn from_into_socketlike<Owned>(owned: Owned) -> T where
    Owned: IntoSocketlike, 
Constructs a new instance of Self from the given socketlike object
converted from into_owned. Read more
sourceimpl<T> IntoFilelike for T where
    T: Into<OwnedFd>, 
 
impl<T> IntoFilelike for T where
    T: Into<OwnedFd>, 
sourcefn into_filelike(self) -> OwnedFd
 
fn into_filelike(self) -> OwnedFd
Consumes this object, returning the underlying filelike object. Read more
sourceimpl<T> IntoRawFilelike for T where
    T: IntoRawFd, 
 
impl<T> IntoRawFilelike for T where
    T: IntoRawFd, 
sourcefn into_raw_filelike(self) -> i32
 
fn into_raw_filelike(self) -> i32
Returns the raw value.
sourceimpl<T> IntoRawSocketlike for T where
    T: IntoRawFd, 
 
impl<T> IntoRawSocketlike for T where
    T: IntoRawFd, 
sourcefn into_raw_socketlike(self) -> i32
 
fn into_raw_socketlike(self) -> i32
Returns the raw value.
sourceimpl<T> IntoSocketlike for T where
    T: Into<OwnedFd>, 
 
impl<T> IntoSocketlike for T where
    T: Into<OwnedFd>, 
sourcefn into_socketlike(self) -> OwnedFd
 
fn into_socketlike(self) -> OwnedFd
Consumes this object, returning the underlying socketlike object.