@@ -14,7 +14,7 @@ use crate::Result;
14
14
/// After a call to `poll` or `ppoll`, the events that occurred can be
15
15
/// retrieved by calling [`revents()`](#method.revents) on the `PollFd`.
16
16
#[ repr( transparent) ]
17
- #[ derive( Clone , Copy , Debug , Eq , Hash , PartialEq ) ]
17
+ #[ derive( Clone , Debug , Eq , Hash , PartialEq ) ]
18
18
pub struct PollFd < ' fd > {
19
19
pollfd : libc:: pollfd ,
20
20
_fd : std:: marker:: PhantomData < BorrowedFd < ' fd > > ,
@@ -61,7 +61,7 @@ impl<'fd> PollFd<'fd> {
61
61
62
62
/// Returns the events that occurred in the last call to `poll` or `ppoll`. Will only return
63
63
/// `None` if the kernel provides status flags that Nix does not know about.
64
- pub fn revents ( self ) -> Option < PollFlags > {
64
+ pub fn revents ( & self ) -> Option < PollFlags > {
65
65
PollFlags :: from_bits ( self . pollfd . revents )
66
66
}
67
67
@@ -71,7 +71,7 @@ impl<'fd> PollFd<'fd> {
71
71
/// Equivalent to `x.revents()? != PollFlags::empty()`.
72
72
///
73
73
/// This is marginally more efficient than [`PollFd::all`].
74
- pub fn any ( self ) -> Option < bool > {
74
+ pub fn any ( & self ) -> Option < bool > {
75
75
Some ( self . revents ( ) ? != PollFlags :: empty ( ) )
76
76
}
77
77
@@ -81,12 +81,12 @@ impl<'fd> PollFd<'fd> {
81
81
/// Equivalent to `x.revents()? & x.events() == x.events()`.
82
82
///
83
83
/// This is marginally less efficient than [`PollFd::any`].
84
- pub fn all ( self ) -> Option < bool > {
84
+ pub fn all ( & self ) -> Option < bool > {
85
85
Some ( self . revents ( ) ? & self . events ( ) == self . events ( ) )
86
86
}
87
87
88
88
/// The events of interest for this `PollFd`.
89
- pub fn events ( self ) -> PollFlags {
89
+ pub fn events ( & self ) -> PollFlags {
90
90
PollFlags :: from_bits ( self . pollfd . events ) . unwrap ( )
91
91
}
92
92
0 commit comments