Skip to main content

Process

Struct Process 

Source
pub struct Process {
Show 13 fields pub args: Vec<OsString>, pub env: Env, pub cwd: Result<PathBuf, String>, pub host: HostOs, pub temp: PathBuf, pub exe: Result<PathBuf, String>, pub cores: NonZeroU32, pub stdout: Box<dyn Write>, pub stdout_is_terminal: bool, pub stderr: Box<dyn Write>, pub stderr_is_terminal: bool, pub stdin: Box<dyn BufRead>, pub stdin_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.

§exe: Result<PathBuf, String>

Where the running executable is, or why that cannot be found. Only cuno self needs it.

§cores: NonZeroU32

How many processors this machine has: the default number of jobs.

§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.

§stdin: Box<dyn BufRead>

Standard input: the answer to a question cuno asks.

§stdin_is_terminal: bool

Whether standard input is a terminal; cuno only asks one that is.

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> Same for T

Source§

type Output = T

Should always be Self
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.