#[repr(C)]pub struct PollFd<'fd> { /* private fields */ }
Expand description
struct pollfd
—File descriptor and flags for use with poll
.
Implementations
sourceimpl<'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
sourceimpl<'fd> AsFd for PollFd<'fd>
impl<'fd> AsFd for PollFd<'fd>
sourcefn 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
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> 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> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more