Struct StderrLock

#[must_use = "if unused stderr will immediately unlock"]
pub struct StderrLock<'a> { pub(in ::io::stdio) inner: ReentrantLockGuard<'a, RefCell<StderrRaw>> }

A locked reference to the Stderr handle.

This handle implements the Write trait and is constructed via the Stderr::lock method. See its documentation for more.

Note: Windows Portability Considerations

When operating in a console, the Windows implementation of this stream does not support non-UTF-8 byte sequences. Attempting to write bytes that are not valid UTF-8 will return an error.

In a process with a detached console, such as one using #![windows_subsystem = "windows"], or in a child process spawned from such a process, the contained handle will be null. In such cases, the standard library's Read and Write will do nothing and silently succeed. All other I/O operations, via the standard library or via raw Windows API calls, will fail.

Fields

inner: ReentrantLockGuard<'a, RefCell<StderrRaw>>

Trait Implementations

impl CopyWrite for StderrLock<'_>

fn properties(&self) -> CopyParams

impl Debug for StderrLock<'_>

fn fmt(&self, f: &mut Formatter<'_>) -> Result

impl IsTerminal for StderrLock<'_>

fn is_terminal(&self) -> bool

impl RefUnwindSafe for StderrLock<'_>

impl StdioExt for StderrLock<'_>

fn set_fd<T: Into<OwnedFd>>(&mut self, fd: T) -> Result<()>
fn take_fd(&mut self) -> Result<OwnedFd>
fn replace_fd<T: Into<OwnedFd>>(&mut self, replace_with: T) -> Result<OwnedFd>

impl StdioExt for StderrLock<'_>

fn set_handle<T: Into<OwnedHandle>>(&mut self, handle: Option<T>) -> Result<()>
fn replace_handle<T: Into<OwnedHandle>>(&mut self, replace_with: T) -> Result<Option<BorrowedHandle<'static>>>
fn take_handle(&mut self) -> Result<Option<BorrowedHandle<'static>>>

impl UnwindSafe for StderrLock<'_>

impl Write for StderrLock<'_>

fn write(&mut self, buf: &[u8]) -> Result<usize>
fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> Result<usize>
fn is_write_vectored(&self) -> bool
fn flush(&mut self) -> Result<()>
fn write_all(&mut self, buf: &[u8]) -> Result<()>
fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<()>

impl<'a> AsFd for StderrLock<'a>

fn as_fd(&self) -> BorrowedFd<'_>

impl<'a> AsHandle for StderrLock<'a>

fn as_handle(&self) -> BorrowedHandle<'_>

impl<'a> AsRawFd for StderrLock<'a>

fn as_raw_fd(&self) -> RawFd

impl<'a> AsRawHandle for StderrLock<'a>

fn as_raw_handle(&self) -> RawHandle

Auto Trait Implementations

impl<'a> !Send for StderrLock<'a>

impl<'a> !Sync for StderrLock<'a>

impl<'a> Freeze for StderrLock<'a>

impl<'a> Unpin for StderrLock<'a>

impl<'a> UnsafeUnpin for StderrLock<'a>

Blanket Implementations

impl<T> Any for StderrLock<'a> where T: 'static + ?Sized,

fn type_id(&self) -> TypeId

impl<T> Borrow<T> for StderrLock<'a> where T: ?Sized,

fn borrow(&self) -> &T

impl<T> BorrowMut<T> for StderrLock<'a> where T: ?Sized,

fn borrow_mut(&mut self) -> &mut T

impl<T> From<T> for StderrLock<'a>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> SizeHint for StderrLock<'a> where T: ?Sized,

fn lower_bound(&self) -> usize
fn upper_bound(&self) -> Option<usize>

impl<T> SizedTypeProperties for StderrLock<'a>

impl<T, U> Into<U> for StderrLock<'a> where U: From<T>,

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom<U> for StderrLock<'a> where U: Into<T>,

type Error = Infallible;
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

impl<T, U> TryInto<U> for StderrLock<'a> where U: TryFrom<T>,

type Error = <U as TryFrom<T>>::Error;
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>