pub struct StderrOverride { /* private fields */ }
Expand description
An overridden standard error.
Writing to this writes to the original standard error. When it is dropped the standard error will be reset.
Implementations§
Source§impl StderrOverride
impl StderrOverride
Sourcepub fn from_raw(raw: RawFd) -> Result<Self>
pub fn from_raw(raw: RawFd) -> Result<Self>
Redirect standard error to the raw file descriptor or handle. It must be writable.
The stream is not owned, so it is your job to close it later. Closing it while this exists will not close the standard error.
Sourcepub fn from_raw_owned(raw: RawFd) -> Result<Self>
pub fn from_raw_owned(raw: RawFd) -> Result<Self>
Redirect standard error to the owned raw file descriptor or handle. It must be writable.
The stream is owned, and so you must not use it after passing it to this function.
Sourcepub fn from_io_ref<T: AsRaw>(io: &T) -> Result<Self>
pub fn from_io_ref<T: AsRaw>(io: &T) -> Result<Self>
Redirect standard error to the IO device. The device must be writable.
Dropping the IO device after calling this function will not close the standard error.
Sourcepub fn from_io<T: IntoRaw>(io: T) -> Result<Self>
pub fn from_io<T: IntoRaw>(io: T) -> Result<Self>
Redirect standard error to the IO device. The device must be writable.
Trait Implementations§
Source§impl AsRawFd for StderrOverride
impl AsRawFd for StderrOverride
Source§impl Debug for StderrOverride
impl Debug for StderrOverride
Source§impl Drop for StderrOverride
impl Drop for StderrOverride
Source§impl Write for &StderrOverride
impl Write for &StderrOverride
Source§fn write(&mut self, buf: &[u8]) -> Result<usize>
fn write(&mut self, buf: &[u8]) -> Result<usize>
Writes a buffer into this writer, returning how many bytes were written. Read more
Source§fn flush(&mut self) -> Result<()>
fn flush(&mut self) -> Result<()>
Flushes this output stream, ensuring that all intermediately buffered
contents reach their destination. Read more
Source§fn is_write_vectored(&self) -> bool
fn is_write_vectored(&self) -> bool
🔬This is a nightly-only experimental API. (
can_vector
)1.0.0 · Source§fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
Attempts to write an entire buffer into this writer. Read more
Source§fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
🔬This is a nightly-only experimental API. (
write_all_vectored
)Attempts to write multiple buffers into this writer. Read more
Source§impl Write for StderrOverride
impl Write for StderrOverride
Source§fn write(&mut self, buf: &[u8]) -> Result<usize>
fn write(&mut self, buf: &[u8]) -> Result<usize>
Writes a buffer into this writer, returning how many bytes were written. Read more
Source§fn flush(&mut self) -> Result<()>
fn flush(&mut self) -> Result<()>
Flushes this output stream, ensuring that all intermediately buffered
contents reach their destination. Read more
Source§fn is_write_vectored(&self) -> bool
fn is_write_vectored(&self) -> bool
🔬This is a nightly-only experimental API. (
can_vector
)1.0.0 · Source§fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
Attempts to write an entire buffer into this writer. Read more
Source§fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
🔬This is a nightly-only experimental API. (
write_all_vectored
)Attempts to write multiple buffers into this writer. Read more
Auto Trait Implementations§
impl Freeze for StderrOverride
impl RefUnwindSafe for StderrOverride
impl Send for StderrOverride
impl Sync for StderrOverride
impl Unpin for StderrOverride
impl UnwindSafe for StderrOverride
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more