1
- #[ cfg( any( doc, target_os = "android" , target_os = "linux" ) ) ]
2
- use super :: { recv_vectored_with_ancillary_from, send_vectored_with_ancillary_to, SocketAncillary } ;
3
- use super :: { sockaddr_un, SocketAddr } ;
4
- use crate :: fmt;
5
- use crate :: io:: { self , IoSlice , IoSliceMut } ;
6
- use crate :: net:: Shutdown ;
7
- use crate :: os:: unix:: io:: { AsFd , AsRawFd , BorrowedFd , FromRawFd , IntoRawFd , OwnedFd , RawFd } ;
8
1
#[ cfg( any(
9
2
target_os = "android" ,
10
3
target_os = "linux" ,
@@ -17,28 +10,20 @@ use crate::os::unix::io::{AsFd, AsRawFd, BorrowedFd, FromRawFd, IntoRawFd, Owned
17
10
target_os = "netbsd" ,
18
11
target_os = "openbsd"
19
12
) ) ]
20
- use crate :: os:: unix:: ucred;
13
+ use super :: { peer_cred, UCred } ;
14
+ #[ cfg( any( doc, target_os = "android" , target_os = "linux" ) ) ]
15
+ use super :: { recv_vectored_with_ancillary_from, send_vectored_with_ancillary_to, SocketAncillary } ;
16
+ use super :: { sockaddr_un, SocketAddr } ;
17
+ use crate :: fmt;
18
+ use crate :: io:: { self , IoSlice , IoSliceMut } ;
19
+ use crate :: net:: Shutdown ;
20
+ use crate :: os:: unix:: io:: { AsFd , AsRawFd , BorrowedFd , FromRawFd , IntoRawFd , OwnedFd , RawFd } ;
21
21
use crate :: path:: Path ;
22
22
use crate :: sys:: cvt;
23
23
use crate :: sys:: net:: Socket ;
24
24
use crate :: sys_common:: { AsInner , FromInner } ;
25
25
use crate :: time:: Duration ;
26
26
27
- #[ unstable( feature = "peer_credentials_unix_socket" , issue = "42839" , reason = "unstable" ) ]
28
- #[ cfg( any(
29
- target_os = "android" ,
30
- target_os = "linux" ,
31
- target_os = "dragonfly" ,
32
- target_os = "freebsd" ,
33
- target_os = "ios" ,
34
- target_os = "tvos" ,
35
- target_os = "macos" ,
36
- target_os = "watchos" ,
37
- target_os = "netbsd" ,
38
- target_os = "openbsd"
39
- ) ) ]
40
- pub use ucred:: UCred ;
41
-
42
27
/// A Unix stream socket.
43
28
///
44
29
/// # Examples
@@ -247,7 +232,7 @@ impl UnixStream {
247
232
target_os = "openbsd"
248
233
) ) ]
249
234
pub fn peer_cred ( & self ) -> io:: Result < UCred > {
250
- ucred :: peer_cred ( self )
235
+ peer_cred ( self )
251
236
}
252
237
253
238
/// Sets the read timeout for the socket.
0 commit comments