File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -142,6 +142,21 @@ their I/O safety invariants automatically.
142142
143143For Windows, similar types, but in ` Handle ` and ` Socket ` forms.
144144
145+ These types play a role for I/O which is analogous to what existing types
146+ in Rust play for memory:
147+
148+ | Type | Analogous to |
149+ | ---------------- | ------------ |
150+ | ` OwnedFd ` | ` Box<_> ` |
151+ | ` BorrowedFd<'a> ` | ` &'a _ ` |
152+ | ` RawFd ` | ` *const _ ` |
153+
154+ One difference is that I/O types don't make a distinction between mutable
155+ and immutable. OS resources can be shared in a variety of ways outside of
156+ Rust's control, so I/O can be thought of as using [ interior mutability] .
157+
158+ [ interior mutability ] : https://doc.rust-lang.org/reference/interior-mutability.html
159+
145160## ` AsFd ` , ` IntoFd ` , and ` FromFd `
146161
147162These three traits are conceptual replacements for ` AsRawFd ` , ` IntoRawFd ` , and
You can’t perform that action at this time.
0 commit comments