Skip to main content

Process

Struct Process 

Source
pub struct Process {
    pub args: Vec<OsString>,
    pub env: Env,
    pub cwd: Result<PathBuf, String>,
    pub host: HostOs,
    pub temp: PathBuf,
    pub stdout: Box<dyn Write>,
    pub stdout_is_terminal: bool,
    pub stderr: Box<dyn Write>,
    pub stderr_is_terminal: bool,
}
Expand description

What only the process has, collected by the binary and handed in as values: no library reads the process itself (docs/en/specs/ architecture.md, “Dependencies between crates”).

Fields§

§args: Vec<OsString>

The command line, the program’s name first.

§env: Env

The environment variables.

§cwd: Result<PathBuf, String>

The current directory, or why it cannot be read. Only a command that needs it reports the reason, so --help works without one.

§host: HostOs

The operating system cuno runs on.

§temp: PathBuf

The temporary directory.

§stdout: Box<dyn Write>

Standard output: help, the version and the usage. Any writer, so a test can read what was written.

§stdout_is_terminal: bool

Whether standard output is a terminal.

§stderr: Box<dyn Write>

Standard error: everything else cuno prints.

§stderr_is_terminal: bool

Whether standard error is a terminal.

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.