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<F>(self, f: F) -> Result<T, ExpectationFailed>
where
F: FnOnce() -> String; fn expect_result_f<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>
[src]
fn expect_result_nb(self, msg: &str) -> Result<T, ExpectationFailed>
[src]Return a result object with a non-boxed Error
object.
fn expect_result(self, msg: &str) -> Result<T, Box<dyn Error>>
[src]
fn expect_result(self, msg: &str) -> Result<T, Box<dyn Error>>
[src]Return a result object that may be tested using the ?
operator.
fn expect_result_nb_f<F>(self, f: F) -> Result<T, ExpectationFailed> where
F: FnOnce() -> String,
[src]
fn expect_result_nb_f<F>(self, f: F) -> Result<T, ExpectationFailed> where
F: FnOnce() -> String,
[src]Return a result object with a non-boxed Error
object.
Invoke the specified function to obtain the error message.
Implementations on Foreign Types
impl<T> ExpectedResult<T> for Option<T>
[src]
impl<T> ExpectedResult<T> for Option<T>
[src]fn expect_result_nb(self, msg: &str) -> Result<T, ExpectationFailed>
[src]
fn expect_result(self, msg: &str) -> Result<T, Box<dyn Error>>
[src]
fn expect_result_nb_f<F>(self, f: F) -> Result<T, ExpectationFailed> where
F: FnOnce() -> String,
[src]
F: FnOnce() -> String,
fn expect_result_f<F>(self, f: F) -> Result<T, Box<dyn Error>> where
F: FnOnce() -> String,
[src]
F: FnOnce() -> String,
impl<T, E> ExpectedResult<T> for Result<T, E> where
E: Display,
[src]
impl<T, E> ExpectedResult<T> for Result<T, E> where
E: Display,
[src]fn expect_result_nb(self, msg: &str) -> Result<T, ExpectationFailed>
[src]
fn expect_result(self, msg: &str) -> Result<T, Box<dyn Error>>
[src]
fn expect_result_nb_f<F>(self, f: F) -> Result<T, ExpectationFailed> where
F: FnOnce() -> String,
[src]
F: FnOnce() -> String,
fn expect_result_f<F>(self, f: F) -> Result<T, Box<dyn Error>> where
F: FnOnce() -> String,
[src]
F: FnOnce() -> String,