diff options
| author | Dan Gohman <dev@sunfishcode.online> | 2021-07-27 16:59:46 -0700 |
|---|---|---|
| committer | Dan Gohman <dev@sunfishcode.online> | 2021-08-19 12:02:39 -0700 |
| commit | 31f7bf82711a1d971e9d786a40c01f8d7088cd52 (patch) | |
| tree | 1c7cbbead5d3574f3b526728f3007833e858c62b /library/std/src/os | |
| parent | 6b4dbdbf47a73de688df06d50dada7ba80df9458 (diff) | |
| download | rust-31f7bf82711a1d971e9d786a40c01f8d7088cd52.tar.gz rust-31f7bf82711a1d971e9d786a40c01f8d7088cd52.zip | |
Add a comment about `OptionFileHandle`.
Diffstat (limited to 'library/std/src/os')
| -rw-r--r-- | library/std/src/os/windows/io/handle.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/library/std/src/os/windows/io/handle.rs b/library/std/src/os/windows/io/handle.rs index 3f9a146786c..2d561ad476a 100644 --- a/library/std/src/os/windows/io/handle.rs +++ b/library/std/src/os/windows/io/handle.rs @@ -58,6 +58,10 @@ pub struct OwnedHandle { /// where `INVALID_HANDLE_VALUE` is used as the sentry value, and null values /// are not used at all, such as in the return value of `CreateFileW`. /// +/// The main thing you can do with an `OptionFileHandle` is to convert it into +/// an `OwnedHandle` using its [`TryFrom`] implementation, and this conversion +/// takes care of the check for `INVALID_HANDLE_VALUE`. +/// /// If this holds an owned handle, it closes the handle on drop. /// /// This uses `repr(transparent)` and has the representation of a host handle, |
