#[repr(transparent)]
pub struct BorrowedFd<'fd> { /* fields omitted */ }
🔬 This is a nightly-only experimental API. (
io_safety
#87074)
This is supported on Unix only.
Expand description
借用的文件描述符。
它有一个生命周期参数,将它与拥有文件描述符的事物的生命周期联系起来。
这使用 repr(transparent)
并具有主机文件描述符的表示,因此它可以在 FFI 中使用文件描述符作为参数传递的地方,它不会被捕获或消耗,它永远不会有值 -1
。
🔬 This is a nightly-only experimental API. (
io_safety
#87074)
返回包含给定原始文件描述符的 BorrowedFd
。
fd
指向的资源在返回的 BorrowedFd
期间必须保持打开状态,并且它不能具有值 -1
。
🔬 This is a nightly-only experimental API. (
io_safety
#87074)
This is supported on Unix only.
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>,
🔬 This is a nightly-only experimental API. (
toowned_clone_into
#41263)