1
1
// Take a look at the license at the top of the repository in the LICENSE file.
2
2
3
3
#[ cfg( any( unix, all( feature = "dox" , unix) ) ) ]
4
- use std:: os:: unix:: io:: IntoRawFd ;
4
+ use std:: os:: unix:: io:: { IntoRawFd , OwnedFd } ;
5
5
6
6
#[ cfg( any( unix, feature = "dox" ) ) ]
7
7
#[ cfg( any( unix, feature = "dox" ) ) ]
@@ -20,7 +20,7 @@ impl SubprocessLauncher {
20
20
#[ cfg( any( unix, feature = "dox" ) ) ]
21
21
#[ cfg_attr( feature = "dox" , doc( cfg( unix) ) ) ]
22
22
#[ doc( alias = "g_subprocess_launcher_take_fd" ) ]
23
- pub fn take_fd ( & self , source_fd : impl IntoRawFd , target_fd : impl IntoRawFd ) {
23
+ pub unsafe fn take_fd ( & self , source_fd : impl IntoRawFd , target_fd : impl IntoRawFd ) {
24
24
unsafe {
25
25
ffi:: g_subprocess_launcher_take_fd (
26
26
self . to_glib_none ( ) . 0 ,
@@ -30,30 +30,60 @@ impl SubprocessLauncher {
30
30
}
31
31
}
32
32
33
+ #[ cfg( any( unix, feature = "dox" ) ) ]
34
+ #[ cfg_attr( feature = "dox" , doc( cfg( unix) ) ) ]
35
+ #[ doc( alias = "g_subprocess_launcher_take_fd" ) ]
36
+ pub fn take_owned_fd ( & self , source_fd : OwnedFd , target_fd : OwnedFd ) {
37
+ unsafe { self . take_fd ( source_fd, target_fd) }
38
+ }
39
+
33
40
#[ cfg( any( unix, feature = "dox" ) ) ]
34
41
#[ cfg_attr( feature = "dox" , doc( cfg( unix) ) ) ]
35
42
#[ doc( alias = "g_subprocess_launcher_take_stderr_fd" ) ]
36
- pub fn take_stderr_fd ( & self , fd : impl IntoRawFd ) {
43
+ pub unsafe fn take_stderr_fd ( & self , fd : impl IntoRawFd ) {
37
44
unsafe {
38
45
ffi:: g_subprocess_launcher_take_stderr_fd ( self . to_glib_none ( ) . 0 , fd. into_raw_fd ( ) ) ;
39
46
}
40
47
}
41
48
49
+ #[ cfg( any( unix, feature = "dox" ) ) ]
50
+ #[ cfg_attr( feature = "dox" , doc( cfg( unix) ) ) ]
51
+ #[ doc( alias = "g_subprocess_launcher_take_stderr_fd" ) ]
52
+ pub fn take_stderr_owned_fd ( & self , fd : OwnedFd ) {
53
+ unsafe {
54
+ self . take_stderr_fd ( fd) ;
55
+ }
56
+ }
57
+
42
58
#[ cfg( any( unix, feature = "dox" ) ) ]
43
59
#[ cfg_attr( feature = "dox" , doc( cfg( unix) ) ) ]
44
60
#[ doc( alias = "g_subprocess_launcher_take_stdin_fd" ) ]
45
- pub fn take_stdin_fd ( & self , fd : impl IntoRawFd ) {
61
+ pub unsafe fn take_stdin_fd ( & self , fd : impl IntoRawFd ) {
46
62
unsafe {
47
63
ffi:: g_subprocess_launcher_take_stdin_fd ( self . to_glib_none ( ) . 0 , fd. into_raw_fd ( ) ) ;
48
64
}
49
65
}
50
66
67
+ #[ cfg( any( unix, feature = "dox" ) ) ]
68
+ #[ cfg_attr( feature = "dox" , doc( cfg( unix) ) ) ]
69
+ #[ doc( alias = "g_subprocess_launcher_take_stdin_fd" ) ]
70
+ pub fn take_stdin_owned_fd ( & self , fd : OwnedFd ) {
71
+ unsafe { self . take_stdin_fd ( fd) }
72
+ }
73
+
51
74
#[ cfg( any( unix, feature = "dox" ) ) ]
52
75
#[ cfg_attr( feature = "dox" , doc( cfg( unix) ) ) ]
53
76
#[ doc( alias = "g_subprocess_launcher_take_stdout_fd" ) ]
54
- pub fn take_stdout_fd ( & self , fd : impl IntoRawFd ) {
77
+ pub unsafe fn take_stdout_fd ( & self , fd : impl IntoRawFd ) {
55
78
unsafe {
56
79
ffi:: g_subprocess_launcher_take_stdout_fd ( self . to_glib_none ( ) . 0 , fd. into_raw_fd ( ) ) ;
57
80
}
58
81
}
82
+
83
+ #[ cfg( any( unix, feature = "dox" ) ) ]
84
+ #[ cfg_attr( feature = "dox" , doc( cfg( unix) ) ) ]
85
+ #[ doc( alias = "g_subprocess_launcher_take_stdout_fd" ) ]
86
+ pub fn take_stdout_owned_fd ( & self , fd : OwnedFd ) {
87
+ unsafe { self . take_stdout_fd ( fd) }
88
+ }
59
89
}
0 commit comments