#[repr(transparent)]
pub struct OwnedFd { /* fields omitted */ }
🔬 This is a nightly-only experimental API. (
io_safety
#87074)
This is supported on WASI only.
Expand description
拥有所有权的文件描述符。
这将在关闭文件描述符时丢弃。
这使用 repr(transparent)
并具有主机文件描述符的表示,因此它可以在 FFI 中的文件描述符作为消耗参数传递或作为拥有值返回的地方使用,并且它永远不会有值 -1
。
🔬 This is a nightly-only experimental API. (
io_safety
#87074)
This is supported on Unix only.
This is supported on Unix only.
This is supported on Unix only.
This is supported on Unix only.
This is supported on Unix only.
This is supported on Unix only.
This is supported on Unix only.
This is supported on Unix only.
This is supported on Unix only.
This is supported on Linux only.
This is supported on Linux only.
This is supported on Unix only.
This is supported on Unix only.
This is supported on Unix only.
This is supported on Unix only.
根据给定的原始文件描述符构造 Self
的新实例。
fd
指向的资源必须是开放的并且适合承担所有权。
除了 close
之外,资源不得需要任何清理。
This is supported on Unix only.
impl<T> Any for T where
T: 'static + ?Sized,
impl<T, U> Into<U> for T where
U: From<T>,