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 {
13
13
// rustdoc-stripper-ignore-next
14
14
/// Creates a new [`Self`] that takes ownership of the passed in fd.
15
15
#[ doc( alias = "g_unix_input_stream_new" ) ]
16
- pub fn take_fd ( fd : OwnedFd ) -> UnixInputStream {
16
+ pub fn from_fd ( fd : OwnedFd ) -> UnixInputStream {
17
17
let fd = fd. into_raw_fd ( ) ;
18
18
let close_fd = true . into_glib ( ) ;
19
19
unsafe {
20
20
InputStream :: from_glib_full ( ffi:: g_unix_input_stream_new ( fd, close_fd) ) . unsafe_cast ( )
21
21
}
22
22
}
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
- }
35
23
}
36
24
37
25
impl AsRawFd for UnixInputStream {
Original file line number Diff line number Diff line change @@ -13,25 +13,13 @@ impl UnixOutputStream {
13
13
// rustdoc-stripper-ignore-next
14
14
/// Creates a new [`Self`] that takes ownership of the passed in fd.
15
15
#[ doc( alias = "g_unix_output_stream_new" ) ]
16
- pub fn take_fd ( fd : OwnedFd ) -> UnixOutputStream {
16
+ pub fn from_fd ( fd : OwnedFd ) -> UnixOutputStream {
17
17
let fd = fd. into_raw_fd ( ) ;
18
18
let close_fd = true . into_glib ( ) ;
19
19
unsafe {
20
20
OutputStream :: from_glib_full ( ffi:: g_unix_output_stream_new ( fd, close_fd) ) . unsafe_cast ( )
21
21
}
22
22
}
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
- }
35
23
}
36
24
37
25
impl AsRawFd for UnixOutputStream {
You can’t perform that action at this time.
0 commit comments