Struct std::os::windows::io::OwnedHandle[][src]

pub struct OwnedHandle { /* fields omitted */ }
🔬 This is a nightly-only experimental API. (io_safety #87074)
This is supported on Windows only.
Expand description

拥有所有权的句柄。

这将会丢弃时关闭句柄。

请注意,它可能具有值 INVALID_HANDLE_VALUE (-1),有时这是一个有效的句柄值。有关完整故事,请参见 这个

并且,它可能具有值 NULL (0),当控制台与进程分离或使用 windows_subsystem 时,可能会发生这种情况。

OwnedHandle 使用 CloseHandle 在关闭时丢弃其句柄。 因此,它不能与句柄一起使用来打开需要用 RegCloseKey 关闭的注册表项。

Trait Implementations

🔬 This is a nightly-only experimental API. (io_safety #87074)

借用句柄。 Read more

提取原始句柄,无需任何所有权。

使用给定的格式化程序格式化该值。 Read more

执行此类型的析构函数。 Read more

执行转换。

执行转换。

执行转换。

执行转换。

执行转换。

执行转换。

执行转换。

执行转换。

从给定的原始句柄构造 Self 的新实例。

Safety

handle 指向的资源必须是开放的并且适合承担所有权。 除了 CloseHandle 之外,资源不得需要任何清理。

特别是,它不能与句柄一起使用来打开需要用 RegCloseKey 关闭的注册表项。

请注意,它可能具有值 INVALID_HANDLE_VALUE (-1),有时这是一个有效的句柄值。 有关完整故事,请参见 这个

消耗此对象,返回原始底层句柄。 Read more

发生转换错误时返回的类型。

执行转换。

发生转换错误时返回的类型。

执行转换。

Auto Trait Implementations

Blanket Implementations

获取 selfTypeIdRead more

从拥有的值中一成不变地借用。 Read more

从拥有的值中借用。 Read more

执行转换。

执行转换。

发生转换错误时返回的类型。

执行转换。

发生转换错误时返回的类型。

执行转换。