Struct Stderr

struct Stderr { ... }

A handle to the standard error stream of a process.

Concurrent writes to stderr must be executed with care: Only individual writes to this AsyncWrite are guaranteed to be intact. In particular you should be aware that writes using write_all are not guaranteed to occur as a single write, so multiple threads writing data with write_all may result in interleaved output.

Created by the stderr function.

Examples

use tokio::io::{self, AsyncWriteExt};

#[tokio::main]
async fn main() -> io::Result<()> {
    let mut stderr = io::stdout();
    stderr.write_all(b"Print some error here.").await?;
    Ok(())
}

Implementations

impl AsFd for Stderr

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

impl AsRawFd for Stderr

fn as_raw_fd(self: &Self) -> RawFd

impl AsyncWrite for Stderr

fn poll_write(self: Pin<&mut Self>, cx: &mut Context<'_>, buf: &[u8]) -> Poll<Result<usize>>
fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<(), Error>>
fn poll_shutdown(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<(), Error>>

impl Debug for Stderr

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

impl Freeze for Stderr

impl RefUnwindSafe for Stderr

impl Send for Stderr

impl Sync for Stderr

impl Unpin for Stderr

impl UnsafeUnpin for Stderr

impl UnwindSafe for Stderr

impl<T> Any for Stderr

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for Stderr

fn borrow(self: &Self) -> &T

impl<T> BorrowMut for Stderr

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

impl<T> From for Stderr

fn from(t: T) -> T

Returns the argument unchanged.

impl<T, U> Into for Stderr

fn into(self: 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 for Stderr

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

impl<T, U> TryInto for Stderr

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

impl<W> AsyncWriteExt for Stderr