#[repr(transparent)]pub struct OwnedFd { /* private fields */ }
Expand description
拥有所有权的文件描述符。
这将在关闭文件描述符时丢弃。
这使用 repr(transparent)
并具有主机文件描述符的表示,因此它可以在 FFI 中的文件描述符作为消耗参数传递或作为拥有值返回的地方使用,并且它永远不会有值 -1
。
Implementations§
Trait Implementations§
source§impl From<ChildStderr> for OwnedFd
Available on Unix only.
impl From<ChildStderr> for OwnedFd
Available on Unix only.
source§fn from(child_stderr: ChildStderr) -> OwnedFd
fn from(child_stderr: ChildStderr) -> OwnedFd
从输入类型转换为此类型。
source§impl From<ChildStdin> for OwnedFd
Available on Unix only.
impl From<ChildStdin> for OwnedFd
Available on Unix only.
source§fn from(child_stdin: ChildStdin) -> OwnedFd
fn from(child_stdin: ChildStdin) -> OwnedFd
从输入类型转换为此类型。
source§impl From<ChildStdout> for OwnedFd
Available on Unix only.
impl From<ChildStdout> for OwnedFd
Available on Unix only.
source§fn from(child_stdout: ChildStdout) -> OwnedFd
fn from(child_stdout: ChildStdout) -> OwnedFd
从输入类型转换为此类型。
source§impl From<OwnedFd> for UnixDatagram
Available on Unix only.
impl From<OwnedFd> for UnixDatagram
Available on Unix only.
source§impl From<OwnedFd> for UnixListener
Available on Unix only.
impl From<OwnedFd> for UnixListener
Available on Unix only.
source§fn from(fd: OwnedFd) -> UnixListener
fn from(fd: OwnedFd) -> UnixListener
从输入类型转换为此类型。
source§impl From<OwnedFd> for UnixStream
Available on Unix only.
impl From<OwnedFd> for UnixStream
Available on Unix only.
source§impl From<TcpListener> for OwnedFd
impl From<TcpListener> for OwnedFd
source§fn from(tcp_listener: TcpListener) -> OwnedFd
fn from(tcp_listener: TcpListener) -> OwnedFd
从输入类型转换为此类型。
source§impl From<UnixDatagram> for OwnedFd
Available on Unix only.
impl From<UnixDatagram> for OwnedFd
Available on Unix only.
source§fn from(unix_datagram: UnixDatagram) -> OwnedFd
fn from(unix_datagram: UnixDatagram) -> OwnedFd
从输入类型转换为此类型。
source§impl From<UnixListener> for OwnedFd
Available on Unix only.
impl From<UnixListener> for OwnedFd
Available on Unix only.
source§fn from(listener: UnixListener) -> OwnedFd
fn from(listener: UnixListener) -> OwnedFd
从输入类型转换为此类型。
source§impl From<UnixStream> for OwnedFd
Available on Unix only.
impl From<UnixStream> for OwnedFd
Available on Unix only.
source§fn from(unix_stream: UnixStream) -> OwnedFd
fn from(unix_stream: UnixStream) -> OwnedFd
从输入类型转换为此类型。
1.70.0 · source§impl IsTerminal for OwnedFd
impl IsTerminal for OwnedFd
source§fn is_terminal(&self) -> bool
fn is_terminal(&self) -> bool
如果 descriptor/handle 引用 terminal/tty,则返回
true
。 Read more