Trait std::os::windows::io::FromRawHandle 1.1.0[−][src]
pub trait FromRawHandle {
unsafe fn from_raw_handle(handle: RawHandle) -> Self;
}
This is supported on Windows only.
Expand description
从原始句柄构造 I/O 对象。
Required methods
unsafe fn from_raw_handle(handle: RawHandle) -> Self
unsafe fn from_raw_handle(handle: RawHandle) -> Self
从指定的原始句柄创建一个新的 I/O 对象。
此函数将消耗给定句柄的所有权,将关闭句柄的责任传递给返回的对象。
此函数也是不安全的,因为当前返回的原语具有它们是包装的文件描述符的唯一所有者的约定。 该函数的使用可能会意外地允许违反该契约,这可能会导致依赖该契约的代码的内存不安全。