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

#[repr(transparent)]
pub struct BorrowedSocket<'socket> { /* 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

Implementations

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

返回一个包含给定原始套接字的 BorrowedSocket

Safety

raw 指向的资源在返回的 BorrowedSocket 期间必须保持打开状态,并且它不能具有值 INVALID_SOCKET

Trait Implementations

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

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

借用套接字。

返回值的副本。 Read more

source 执行复制分配。 Read more

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

Auto Trait Implementations

Blanket Implementations

获取 selfTypeIdRead more

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

从拥有的值中借用。 Read more

执行转换。

执行转换。

获得所有权后的结果类型。

从借用的数据创建拥有的数据,通常是通过克隆。 Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into #41263)

使用借来的数据来替换拥有的数据,通常是通过克隆。 Read more

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

执行转换。

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

执行转换。