Skip to content

Commit 31f7bf8

Browse files
committed
Add a comment about OptionFileHandle.
1 parent 6b4dbdb commit 31f7bf8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

library/std/src/os/windows/io/handle.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ pub struct OwnedHandle {
5858
/// where `INVALID_HANDLE_VALUE` is used as the sentry value, and null values
5959
/// are not used at all, such as in the return value of `CreateFileW`.
6060
///
61+
/// The main thing you can do with an `OptionFileHandle` is to convert it into
62+
/// an `OwnedHandle` using its [`TryFrom`] implementation, and this conversion
63+
/// takes care of the check for `INVALID_HANDLE_VALUE`.
64+
///
6165
/// If this holds an owned handle, it closes the handle on drop.
6266
///
6367
/// This uses `repr(transparent)` and has the representation of a host handle,

0 commit comments

Comments
 (0)