File tree Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,16 @@ pub struct SockAddr {
24
24
25
25
#[ allow( clippy:: len_without_is_empty) ]
26
26
impl SockAddr {
27
+ /// Constructs a `SockAddr` with the family `AF_UNIX` and the provided path.
28
+ ///
29
+ /// Returns an error if the path is longer than `SUN_LEN`.
30
+ pub fn unix < P > ( path : P ) -> io:: Result < SockAddr >
31
+ where
32
+ P : AsRef < Path > ,
33
+ {
34
+ crate :: sys:: unix_sockaddr ( path. as_ref ( ) )
35
+ }
36
+
27
37
/// Create a `SockAddr` from the underlying storage and its length.
28
38
///
29
39
/// # Safety
@@ -228,16 +238,6 @@ impl SockAddr {
228
238
_ => None ,
229
239
}
230
240
}
231
-
232
- /// Constructs a `SockAddr` with the family `AF_UNIX` and the provided path.
233
- ///
234
- /// Returns an error if the path is longer than `SUN_LEN`.
235
- pub fn unix < P > ( path : P ) -> io:: Result < SockAddr >
236
- where
237
- P : AsRef < Path > ,
238
- {
239
- crate :: sys:: unix_sockaddr ( path. as_ref ( ) )
240
- }
241
241
}
242
242
243
243
impl From < SocketAddr > for SockAddr {
You can’t perform that action at this time.
0 commit comments