#[repr(transparent)]pub struct PollFd<'fd> { /* private fields */ }
Expand description
struct pollfd
—File descriptor and flags for use with poll
.
Implementations§
source§impl<'fd> PollFd<'fd>
impl<'fd> PollFd<'fd>
sourcepub fn new<Fd: AsFd>(fd: &'fd Fd, events: PollFlags) -> Self
pub fn new<Fd: AsFd>(fd: &'fd Fd, events: PollFlags) -> Self
Constructs a new PollFd
holding fd
and events
.
sourcepub fn clear_revents(&mut self)
pub fn clear_revents(&mut self)
Clears the ready events.
sourcepub fn from_borrowed_fd(fd: BorrowedFd<'fd>, events: PollFlags) -> Self
pub fn from_borrowed_fd(fd: BorrowedFd<'fd>, events: PollFlags) -> Self
Constructs a new PollFd
holding fd
and events
.
This is the same as new
, but can be used to avoid borrowing the
BorrowedFd
, which can be tricky in situations where the BorrowedFd
is a temporary.
Trait Implementations§
source§impl<'fd> AsFd for PollFd<'fd>
impl<'fd> AsFd for PollFd<'fd>
source§fn as_fd(&self) -> BorrowedFd<'_>
fn as_fd(&self) -> BorrowedFd<'_>
Borrows the file descriptor. Read more
Auto Trait Implementations§
impl<'fd> RefUnwindSafe for PollFd<'fd>
impl<'fd> Send for PollFd<'fd>
impl<'fd> Sync for PollFd<'fd>
impl<'fd> Unpin for PollFd<'fd>
impl<'fd> UnwindSafe for PollFd<'fd>
Blanket Implementations§
source§impl<T> AsFilelike for Twhere
T: AsFd,
impl<T> AsFilelike for Twhere T: AsFd,
source§fn as_filelike(&self) -> BorrowedFd<'_>
fn as_filelike(&self) -> BorrowedFd<'_>
Borrows the reference. Read more
source§fn 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 moresource§impl<T> AsSocketlike for Twhere
T: AsFd,
impl<T> AsSocketlike for Twhere T: AsFd,
source§fn as_socketlike(&self) -> BorrowedFd<'_>
fn as_socketlike(&self) -> BorrowedFd<'_>
Borrows the reference.
source§fn 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 moresource§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