File tree Expand file tree Collapse file tree 2 files changed +2
-26
lines changed Expand file tree Collapse file tree 2 files changed +2
-26
lines changed Original file line number Diff line number Diff line change @@ -13,25 +13,13 @@ impl UnixInputStream {
1313 // rustdoc-stripper-ignore-next
1414 /// Creates a new [`Self`] that takes ownership of the passed in fd.
1515 #[ doc( alias = "g_unix_input_stream_new" ) ]
16- pub fn take_fd ( fd : OwnedFd ) -> UnixInputStream {
16+ pub fn from_fd ( fd : OwnedFd ) -> UnixInputStream {
1717 let fd = fd. into_raw_fd ( ) ;
1818 let close_fd = true . into_glib ( ) ;
1919 unsafe {
2020 InputStream :: from_glib_full ( ffi:: g_unix_input_stream_new ( fd, close_fd) ) . unsafe_cast ( )
2121 }
2222 }
23-
24- // rustdoc-stripper-ignore-next
25- /// Creates a new [`Self`] that does not take ownership of the passed in fd.
26- ///
27- /// # Safety
28- /// You may only close the fd if all references to this stream have been dropped.
29- #[ doc( alias = "g_unix_input_stream_new" ) ]
30- pub unsafe fn with_fd < T : AsRawFd > ( fd : T ) -> UnixInputStream {
31- let fd = fd. as_raw_fd ( ) ;
32- let close_fd = false . into_glib ( ) ;
33- InputStream :: from_glib_full ( ffi:: g_unix_input_stream_new ( fd, close_fd) ) . unsafe_cast ( )
34- }
3523}
3624
3725impl AsRawFd for UnixInputStream {
Original file line number Diff line number Diff line change @@ -13,25 +13,13 @@ impl UnixOutputStream {
1313 // rustdoc-stripper-ignore-next
1414 /// Creates a new [`Self`] that takes ownership of the passed in fd.
1515 #[ doc( alias = "g_unix_output_stream_new" ) ]
16- pub fn take_fd ( fd : OwnedFd ) -> UnixOutputStream {
16+ pub fn from_fd ( fd : OwnedFd ) -> UnixOutputStream {
1717 let fd = fd. into_raw_fd ( ) ;
1818 let close_fd = true . into_glib ( ) ;
1919 unsafe {
2020 OutputStream :: from_glib_full ( ffi:: g_unix_output_stream_new ( fd, close_fd) ) . unsafe_cast ( )
2121 }
2222 }
23-
24- // rustdoc-stripper-ignore-next
25- /// Creates a new [`Self`] that does not take ownership of the passed in fd.
26- ///
27- /// # Safety
28- /// You may only close the fd if all references to this stream have been dropped.
29- #[ doc( alias = "g_unix_output_stream_new" ) ]
30- pub unsafe fn with_fd < T : AsRawFd > ( fd : T ) -> UnixOutputStream {
31- let fd = fd. as_raw_fd ( ) ;
32- let close_fd = false . into_glib ( ) ;
33- OutputStream :: from_glib_full ( ffi:: g_unix_output_stream_new ( fd, close_fd) ) . unsafe_cast ( )
34- }
3523}
3624
3725impl AsRawFd for UnixOutputStream {
You can’t perform that action at this time.
0 commit comments