Trait assert_cmd::OutputOkExt [−][src]
pub trait OutputOkExt where
Self: Sized, { fn ok(self) -> OutputResult; fn unwrap(self) -> Output { ... } fn unwrap_err(self) -> OutputError { ... } }
Converts a type to an OutputResult
.
This is for example implemented on std::process::Output
.
Examples
use assert_cmd::prelude::*; use std::process::Command; let result = Command::new("echo") .args(&["42"]) .ok(); assert!(result.is_ok());
Required Methods
fn ok(self) -> OutputResult
Convert an Output
to an OutputResult
.
Examples
use assert_cmd::prelude::*; use std::process::Command; let result = Command::new("echo") .args(&["42"]) .ok(); assert!(result.is_ok());
Provided Methods
fn unwrap(self) -> Output
Unwrap a Output
but with a prettier message than .ok().unwrap()
.
Examples
use assert_cmd::prelude::*; use std::process::Command; let output = Command::new("echo") .args(&["42"]) .unwrap();
fn unwrap_err(self) -> OutputError
Implementations on Foreign Types
impl OutputOkExt for Output
[src]
impl OutputOkExt for Output
fn ok(self) -> OutputResult
[src]
fn ok(self) -> OutputResult
fn unwrap(self) -> Output
[src]
fn unwrap(self) -> Output
fn unwrap_err(self) -> OutputError
[src]
fn unwrap_err(self) -> OutputError
impl<'c> OutputOkExt for &'c mut Command
[src]
impl<'c> OutputOkExt for &'c mut Command
fn ok(self) -> OutputResult
[src]
fn ok(self) -> OutputResult
fn unwrap_err(self) -> OutputError
[src]
fn unwrap_err(self) -> OutputError
fn unwrap(self) -> Output
[src]
fn unwrap(self) -> Output
Implementors
impl<'c, 'a> OutputOkExt for &'c mut StdInCommand<'a>