about summary refs log tree commit diff
path: root/library/std/src/os/fd/raw.rs
AgeCommit message (Collapse)AuthorLines
2023-03-15Bump version placeholdersMark Rousskov-1/+1
2023-02-24avoid the usage of libc during the creation of documentationStefan Lankes-9/+7
2023-02-24remove code duplicationsStefan Lankes-6/+18
2023-01-26Implement `AsFd` and `AsRawFd` for `Rc`Ian Douglas Scott-0/+8
Fixes https://github.com/rust-lang/rust/issues/105931.
2022-09-02Fix compilation of the doc tests on Windows.Dan Gohman-0/+3
2022-08-29Make `std::os::fd` public.Dan Gohman-12/+3
`std::os::fd` defines types like `OwnedFd` and `RawFd` and is common between Unix and non-Unix platforms that share a basic file-descriptor concept. Rust currently uses this internally to simplify its own code, but it would be useful for external users in the same way, so make it public. This means that `OwnedFd` etc. will all appear in three places, for example on unix platforms: - `std::os::fd::OwnedFd` - `std::os::unix::io::OwnedFd` - `std::os::unix::prelude::OwnedFd`
2022-08-12Adjust cfgsMark Rousskov-4/+4
2022-07-27Allow using stable os::fd::raw items through unstable os::wasi modulebstrie-0/+4
This fixes a regression from stable to nightly. Closes #99502.
2022-07-06Fix typo in file descriptor docsFlorian Spieß-1/+1
2022-06-21`impl<T: AsFd> AsFd for {Arc,Box}<T>`Joshua Nelson-3/+2
2022-06-21`impl<T: AsRawFd> for {Arc,Box}<T>`Joshua Nelson-0/+32
This allows implementing traits that require a raw FD on Arc and Box. Previously, you'd have to add the function to the trait itself: ```rust trait MyTrait { fn as_raw_fd(&self) -> RawFd; } impl<T: MyTrait> MyTrait for Arc<T> { fn as_raw_fd(&self) -> RawFd { (**self).as_raw_fd() } } ```
2022-04-11Fix documentation for wasm32-unknown-unknownO01eg-1/+1
2022-03-02Fix a broken doc link on Windows.Dan Gohman-3/+1
2022-02-01x.py fmtDan Gohman-2/+2
2022-02-01Use `From`/`Into` rather than the traits they replaced.Dan Gohman-6/+8
2022-02-01Fix errors.Dan Gohman-2/+2
2022-02-01Fix unresolved doc links.Dan Gohman-0/+4
2022-02-01Fix two copy+pastos.Dan Gohman-1/+1
2022-02-01Update the documentation for `{As,Into,From}Raw{Fd,Handle,Socket}`.Dan Gohman-14/+24
This change weakens the descriptions of the `{as,into,from}_raw_{fd,handle,socket}` descriptions from saying that they *do* express ownership relations to say that they are *typically used* in ways that express ownership relations. This needed needed since, for example, std's own [`RawFd`] implements `{As,From,Into}Fd` without any of the ownership relationships. This adds proper `# Safety` comments to `from_raw_{fd,handle,socket}`, adds the requirement that raw handles be not opened with the `FILE_FLAG_OVERLAPPED` flag, and merges the `OwnedHandle::from_raw_handle` comment into the main `FromRawHandle::from_raw_handle` comment. And, this changes `HandleOrNull` and `HandleOrInvalid` to not implement `FromRawHandle`, since they are intended for limited use in FFI situations, and not for generic use, and they have constraints that are stronger than the those of `FromRawHandle`. [`RawFd`]: https://doc.rust-lang.org/stable/std/os/unix/io/type.RawFd.html
2021-08-19Fix doc test failures on Windows.Dan Gohman-0/+4
2021-08-19Factor out a common `RawFd`/`AsRawFd`/etc for Unix and WASI.Dan Gohman-0/+206