Struct std::os::windows::io::OwnedSocket[−][src]

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

一个拥有所有权的套接字。

这将丢弃时关闭套接字。

这使用 repr(transparent) 并具有主机套接字的表示形式,因此它可以在 FFI 中将套接字作为消耗参数传递或作为拥有值返回的地方使用,并且它永远不会具有值 INVALID_SOCKET。

Trait Implementations

从此对象中提取底层原始套接字。

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

借用套接字。

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

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

执行转换。

执行转换。

执行转换。

执行转换。

执行转换。

执行转换。

从给定的原始套接字构造 Self 的新实例。

Safety

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

消耗此对象,返回原始底层套接字。 Read more

Auto Trait Implementations

Blanket Implementations

获取 self 的 TypeId。 Read more

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

从拥有的值中借用。 Read more

执行转换。

执行转换。

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

执行转换。

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

执行转换。