Struct tryrun::Output[][src]

pub struct Output<StdOut, StdErr> {
    pub stdout: Option<StdOut>,
    pub stderr: Option<StdErr>,
}
Expand description

Path to files that store expected Command stdout and stderr.

None means expecting stdout or stderr to be empty. Note that providing an empty file does not work and will resulting an “output is empty” assertion failure.

Fields

stdout: Option<StdOut>

Path to the stdout file.

stderr: Option<StdErr>

Path to the stderr file.

Implementations

Expects empty output.

Example

const EMPTY: OutputStr = OutputStr::empty();
assert!(EMPTY.stdout.is_none());
assert!(EMPTY.stderr.is_none());

Expects stdout to match the specified file and empty stderr.

Example

const STDOUT_ONLY: OutputStr = OutputStr::stdout("foo/bar.stdout");
assert_eq!(STDOUT_ONLY.stdout.unwrap(), "foo/bar.stdout");
assert!(STDOUT_ONLY.stderr.is_none());

Expects stderr to match the specified file and empty stdout.

Example

const STDERR_ONLY: OutputStr = OutputStr::stderr("foo/bar.stderr");
assert!(STDERR_ONLY.stdout.is_none());
assert_eq!(STDERR_ONLY.stderr.unwrap(), "foo/bar.stderr");

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.