File tree Expand file tree Collapse file tree 6 files changed +34
-3
lines changed Expand file tree Collapse file tree 6 files changed +34
-3
lines changed Original file line number Diff line number Diff line change @@ -64,6 +64,12 @@ impl AsFd for PtyMaster {
6464 }
6565}
6666
67+ impl From < PtyMaster > for OwnedFd {
68+ fn from ( value : PtyMaster ) -> Self {
69+ value. 0
70+ }
71+ }
72+
6773impl IntoRawFd for PtyMaster {
6874 fn into_raw_fd ( self ) -> RawFd {
6975 let fd = self . 0 ;
Original file line number Diff line number Diff line change @@ -101,8 +101,9 @@ impl AsRawFd for EventFd {
101101 self . 0 . as_raw_fd ( )
102102 }
103103}
104+
104105impl From < EventFd > for OwnedFd {
105- fn from ( x : EventFd ) -> OwnedFd {
106- x . 0
106+ fn from ( value : EventFd ) -> Self {
107+ value . 0
107108 }
108- }
109+ }
Original file line number Diff line number Diff line change @@ -418,3 +418,9 @@ impl AsFd for Fanotify {
418418 self . fd . as_fd ( )
419419 }
420420}
421+
422+ impl From < Fanotify > for OwnedFd {
423+ fn from ( value : Fanotify ) -> Self {
424+ value. fd
425+ }
426+ }
Original file line number Diff line number Diff line change @@ -254,3 +254,9 @@ impl AsFd for Inotify {
254254 self . fd . as_fd ( )
255255 }
256256}
257+
258+ impl From < Inotify > for OwnedFd {
259+ fn from ( value : Inotify ) -> Self {
260+ value. fd
261+ }
262+ }
Original file line number Diff line number Diff line change @@ -147,6 +147,12 @@ impl AsRawFd for SignalFd {
147147 }
148148}
149149
150+ impl From < SignalFd > for OwnedFd {
151+ fn from ( value : SignalFd ) -> Self {
152+ value. 0
153+ }
154+ }
155+
150156impl Iterator for SignalFd {
151157 type Item = siginfo ;
152158
Original file line number Diff line number Diff line change @@ -58,6 +58,12 @@ impl FromRawFd for TimerFd {
5858 }
5959}
6060
61+ impl From < TimerFd > for OwnedFd {
62+ fn from ( value : TimerFd ) -> Self {
63+ value. fd
64+ }
65+ }
66+
6167libc_enum ! {
6268 /// The type of the clock used to mark the progress of the timer. For more
6369 /// details on each kind of clock, please refer to [timerfd_create(2)](https://man7.org/linux/man-pages/man2/timerfd_create.2.html).
You can’t perform that action at this time.
0 commit comments