Trait expect_exit::ExpectedResult [−][src]
pub trait ExpectedResult<T> {
fn expect_result_nb_(self, msg: &str) -> Result<T, ExpectationFailed>;
fn expect_result_(self, msg: &str) -> Result<T, Box<dyn Error>>;
fn expect_result_nb<F>(self, f: F) -> Result<T, ExpectationFailed>
where
F: FnOnce() -> String;
fn expect_result<F>(self, f: F) -> Result<T, Box<dyn Error>>
where
F: FnOnce() -> String;
}
Expand description
Test the value and return a result object containing either the inner value or an error object that, when displayed, will provide the specified error message.
Required methods
fn expect_result_nb_(self, msg: &str) -> Result<T, ExpectationFailed>
fn expect_result_nb_(self, msg: &str) -> Result<T, ExpectationFailed>
Return a result object with a non-boxed Error
object.
Return a result object that may be tested using the ?
operator.
fn expect_result_nb<F>(self, f: F) -> Result<T, ExpectationFailed> where
F: FnOnce() -> String,
fn expect_result_nb<F>(self, f: F) -> Result<T, ExpectationFailed> where
F: FnOnce() -> String,
Return a result object with a non-boxed Error
object.
Invoke the specified function to obtain the error message.