Skip to content

Commit 6854c4d

Browse files
committed
Move View and from_into_fd into the Future Possibilities section.
1 parent 429c646 commit 6854c4d

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

text/0000-io-safety.md

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -229,17 +229,7 @@ types.
229229
## `AsFd`, `IntoFd`, and `FromFd`
230230

231231
These types provide `as_fd`, `into_fd`, and `from_fd` functions similar to
232-
their `Raw` counterparts, but with the benefit of a safe interface, it's safe
233-
to provide a few simple conveniences which make the API much more flexible:
234-
235-
- A `from_into_fd` function which takes a `IntoFd` and converts it into a
236-
`FromFd`, allowing users to perform this common sequence in a single
237-
step, and without having to use `unsafe`.
238-
239-
- A `as_filelike_view::<T>()` function returns a `View`, which contains a
240-
temporary `ManuallyDrop` instance of T constructed from the contained
241-
file descriptor, allowing users to "view" a raw file descriptor as a
242-
`File`, `TcpStream`, and so on.
232+
their `Raw` counterparts.
243233

244234
## Prototype implementation
245235

@@ -387,8 +377,15 @@ Some possible future ideas that could build on this RFC include:
387377
that, with this new guarantee, the high-level wrappers around raw handles
388378
are unforgeable in safe Rust.
389379

390-
[`from_filelike`]: https://docs.rs/unsafe-io/0.6.2/unsafe_io/trait.FromUnsafeFile.html#method.from_filelike
391-
[this wrapper around `posix_fadvise`]: https://docs.rs/posish/0.6.1/posish/fs/fn.fadvise.html
380+
- There are a few convenience features which can be implemented on top
381+
of the basic `As`/`Into`/`From` traits:
382+
- A `from_into_fd` function which takes a `IntoFd` and converts it into a
383+
`FromFd`, allowing users to perform this common sequence in a single
384+
step.
385+
- A `as_filelike_view::<T>()` function returns a `View`, which contains a
386+
temporary instance of T constructed from the contained file descriptor,
387+
allowing users to "view" a raw file descriptor as a `File`, `TcpStream`,
388+
and so on.
392389

393390
# Thanks
394391
[thanks]: #thanks

0 commit comments

Comments
 (0)