Struct std::process::ChildStdin
1.0.0 · source · pub struct ChildStdin { /* private fields */ }
Expand description
Trait Implementations§
1.63.0 · source§impl AsFd for ChildStdin
Available on Unix only.
impl AsFd for ChildStdin
Available on Unix only.
source§fn as_fd(&self) -> BorrowedFd<'_>
fn as_fd(&self) -> BorrowedFd<'_>
借用文件描述符。 Read more
1.63.0 · source§impl AsHandle for ChildStdin
Available on Windows only.
impl AsHandle for ChildStdin
Available on Windows only.
source§fn as_handle(&self) -> BorrowedHandle<'_>
fn as_handle(&self) -> BorrowedHandle<'_>
借用句柄。 Read more
1.2.0 · source§impl AsRawFd for ChildStdin
Available on Unix only.
impl AsRawFd for ChildStdin
Available on Unix only.
1.2.0 · source§impl AsRawHandle for ChildStdin
Available on Windows only.
impl AsRawHandle for ChildStdin
Available on Windows only.
source§fn as_raw_handle(&self) -> RawHandle
fn as_raw_handle(&self) -> RawHandle
提取原始句柄。 Read more
1.16.0 · source§impl Debug for ChildStdin
impl Debug for ChildStdin
1.63.0 · 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
从输入类型转换为此类型。
1.63.0 · source§impl From<ChildStdin> for OwnedHandle
Available on Windows only.
impl From<ChildStdin> for OwnedHandle
Available on Windows only.
source§fn from(child_stdin: ChildStdin) -> OwnedHandle
fn from(child_stdin: ChildStdin) -> OwnedHandle
从输入类型转换为此类型。
1.20.0 · source§impl From<ChildStdin> for Stdio
impl From<ChildStdin> for Stdio
source§fn from(child: ChildStdin) -> Stdio
fn from(child: ChildStdin) -> Stdio
将 ChildStdin
转换为 Stdio
。
Examples
ChildStdin
将在引擎盖下使用 Stdio::from
转换为 Stdio
。
use std::process::{Command, Stdio};
let reverse = Command::new("rev")
.stdin(Stdio::piped())
.spawn()
.expect("failed reverse command");
let _echo = Command::new("echo")
.arg("Hello, world!")
.stdout(reverse.stdin.unwrap()) // 在此处转换为 Stdio
.output()
.expect("failed echo command");
// "!dlrow ,olleH" 回显到控制台
Run1.4.0 · source§impl IntoRawFd for ChildStdin
Available on Unix only.
impl IntoRawFd for ChildStdin
Available on Unix only.
source§fn into_raw_fd(self) -> RawFd
fn into_raw_fd(self) -> RawFd
消费这个对象,返回原始的底层文件描述符。 Read more
1.4.0 · source§impl IntoRawHandle for ChildStdin
Available on Windows only.
impl IntoRawHandle for ChildStdin
Available on Windows only.
source§fn into_raw_handle(self) -> RawHandle
fn into_raw_handle(self) -> RawHandle
消耗此对象,返回原始底层句柄。 Read more
1.48.0 · source§impl Write for &ChildStdin
impl Write for &ChildStdin
source§fn is_write_vectored(&self) -> bool
fn is_write_vectored(&self) -> bool
🔬This is a nightly-only experimental API. (
can_vector
#69941)source§fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<()>
fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<()>
🔬This is a nightly-only experimental API. (
write_all_vectored
#70436)尝试将多个缓冲区写入此 writer。 Read more
source§impl Write for ChildStdin
impl Write for ChildStdin
source§fn is_write_vectored(&self) -> bool
fn is_write_vectored(&self) -> bool
🔬This is a nightly-only experimental API. (
can_vector
#69941)source§fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<()>
fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<()>
🔬This is a nightly-only experimental API. (
write_all_vectored
#70436)尝试将多个缓冲区写入此 writer。 Read more