Document the valid values for HandleOrNull
and HandleOrInvalid
.
This commit is contained in:
parent
e102c2a3f2
commit
5d79870aec
@ -68,6 +68,10 @@ pub struct OwnedHandle {
|
||||
/// `NULL`. This ensures that such FFI calls cannot start using the handle without
|
||||
/// checking for `NULL` first.
|
||||
///
|
||||
/// This type concerns any value other than `NULL` to be valid, including `INVALID_HANDLE_VALUE`.
|
||||
/// This is because APIs that use `NULL` as their sentry value don't treat `INVALID_HANDLE_VALUE`
|
||||
/// as special.
|
||||
///
|
||||
/// If this holds a valid handle, it will close the handle on drop.
|
||||
#[repr(transparent)]
|
||||
#[unstable(feature = "io_safety", issue = "87074")]
|
||||
@ -84,6 +88,10 @@ pub struct OwnedHandle {
|
||||
/// `INVALID_HANDLE_VALUE`. This ensures that such FFI calls cannot start using the handle without
|
||||
/// checking for `INVALID_HANDLE_VALUE` first.
|
||||
///
|
||||
/// This type concerns any value other than `INVALID_HANDLE_VALUE` to be valid, including `NULL`.
|
||||
/// This is because APIs that use `INVALID_HANDLE_VALUE` as their sentry value may return `NULL`
|
||||
/// under `windows_subsystem = "windows"` or other situations where I/O devices are detached.
|
||||
///
|
||||
/// If this holds a valid handle, it will close the handle on drop.
|
||||
#[repr(transparent)]
|
||||
#[unstable(feature = "io_safety", issue = "87074")]
|
||||
|
Loading…
Reference in New Issue
Block a user