pub struct Stderr { /* private fields */ }
Expand description
进程的标准错误流的句柄。
有关更多信息,请参见 io::stderr
方法。
Note: Windows 可移植性注意事项
在控制台中操作时,此流的 Windows 实现不支持非 UTF-8 字节序列。 尝试写入无效的 UTF-8 字节将返回错误。
在具有分离控制台的进程中,例如使用 #![windows_subsystem = "windows"]
的进程,或在从此类进程派生的子进程中,包含的句柄将为空。
在这种情况下,标准库的 Read
和 Write
将什么都不做,默默地成功。
通过标准库或通过原始 Windows API 调用的所有其他 I/O 操作都将失败。
Implementations§
Trait Implementations§
1.63.0 · source§impl AsHandle for Stderr
Available on Windows only.
impl AsHandle for Stderr
Available on Windows only.
source§fn as_handle(&self) -> BorrowedHandle<'_>
fn as_handle(&self) -> BorrowedHandle<'_>
借用句柄。 Read more
1.21.0 · source§impl AsRawHandle for Stderr
Available on Windows only.
impl AsRawHandle for Stderr
Available on Windows only.
source§fn as_raw_handle(&self) -> RawHandle
fn as_raw_handle(&self) -> RawHandle
提取原始句柄。 Read more
1.70.0 · source§impl IsTerminal for Stderr
impl IsTerminal for Stderr
source§fn is_terminal(&self) -> bool
fn is_terminal(&self) -> bool
如果 descriptor/handle 引用 terminal/tty,则返回
true
。 Read more1.48.0 · source§impl Write for &Stderr
impl Write for &Stderr
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 Stderr
impl Write for Stderr
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