pub struct PollFd { /* private fields */ }
Expand description
Implementations§
Source§impl PollFd
impl PollFd
Sourcepub const fn new(fd: RawFd, events: PollFlags) -> PollFd
pub const fn new(fd: RawFd, events: PollFlags) -> PollFd
Creates a new PollFd
specifying the events of interest
for a given file descriptor.
Sourcepub fn revents(self) -> Option<PollFlags>
pub fn revents(self) -> Option<PollFlags>
Returns the events that occurred in the last call to poll
or ppoll
. Will only return
None
if the kernel provides status flags that Nix does not know about.
Sourcepub fn any(self) -> Option<bool>
pub fn any(self) -> Option<bool>
Returns if any of the events of interest occured in the last call to poll
or ppoll
. Will
only return None
if the kernel provides status flags that Nix does not know about.
Equivalent to x.revents()? != PollFlags::empty()
.
This is marginally more efficient than PollFd::all
.
Sourcepub fn all(self) -> Option<bool>
pub fn all(self) -> Option<bool>
Returns if all the events of interest occured in the last call to poll
or ppoll
. Will
only return None
if the kernel provides status flags that Nix does not know about.
Equivalent to x.revents()? & x.events() == x.events()
.
This is marginally less efficient than PollFd::any
.
Sourcepub fn set_events(&mut self, events: PollFlags)
pub fn set_events(&mut self, events: PollFlags)
Modify the events of interest for this PollFd
.
Trait Implementations§
impl Copy for PollFd
impl Eq for PollFd
impl StructuralPartialEq for PollFd
Auto Trait Implementations§
impl Freeze for PollFd
impl RefUnwindSafe for PollFd
impl Send for PollFd
impl Sync for PollFd
impl Unpin for PollFd
impl UnwindSafe for PollFd
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)