@@ -32,12 +32,12 @@ Please [report] any bugs you might come across!
32
32
33
33
Previously, Rust code working with platform APIs taking raw file descriptors (on
34
34
unix-style platforms) or handles (on Windows) would typically work directly with
35
- a platform-specific representation of the descriptor (for example, a ` c_int ` ).
35
+ a platform-specific representation of the descriptor (for example, a ` c_int ` , or the alias ` RawFd ` ).
36
36
For Rust bindings to such native APIs, the type system then failed to encode
37
37
whether the API would take ownership of the file descriptor (e.g., ` close ` ) or
38
38
merely borrow it (e.g., ` dup ` ).
39
39
40
- Now, Rust provides wrapper types such as [ ` BorrowedFd ` ] , which are marked as
40
+ Now, Rust provides wrapper types such as [ ` BorrowedFd ` ] and [ ` OwnedFd ` ] , which are marked as
41
41
` #[repr(transparent)] ` , meaning that ` extern "C" ` bindings can directly take
42
42
these types to encode the ownership semantics. See the stabilized APIs section
43
43
for the full list of wrapper types stabilized in 1.63, currently, they are
@@ -48,6 +48,7 @@ We recommend that new APIs use these types instead of the previous type aliases
48
48
49
49
[ `RawFd` ] : https://doc.rust-lang.org/stable/std/os/unix/io/type.RawFd.html
50
50
[ `BorrowedFd` ] : https://doc.rust-lang.org/stable/std/os/unix/io/struct.BorrowedFd.html
51
+ [ `OwnedFd` ] : https://doc.rust-lang.org/stable/std/os/unix/io/struct.OwnedFd.html
51
52
52
53
### Turbofish for generics in functions with ` impl Trait `
53
54
0 commit comments