pub trait OutputOkExtwhere
Self: Sized,{
// Required method
fn ok(self) -> OutputResult;
// Provided methods
fn unwrap(self) -> Output { ... }
fn unwrap_err(self) -> OutputError { ... }
}Expand description
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§
Sourcefn ok(self) -> OutputResult
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§
Sourcefn unwrap_err(self) -> OutputError
fn unwrap_err(self) -> OutputError
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.