pub struct Result<T> { /* private fields */ }
Expand description
Result of a testcase.
This includes both the returned value of the testcase and the status.
§Example
let result = PlanRunner::new().ok("test", || Result::<_,()>::Ok(42));
assert!(result.is_ok());
assert_eq!(result.as_status(), TestStatus::Pass);
assert_eq!(result.into_value(), Some(Ok(42)));
Implementations§
Source§impl<T> Result<T>
impl<T> Result<T>
pub fn new(ret: Option<T>, case: TestCase) -> Self
pub fn record_expect<V>(self, v: V) -> Selfwhere
V: Debug,
pub fn record_got(self) -> Selfwhere
T: Debug,
pub fn record_got_fn<F, R>(self, f: F) -> Self
pub fn set_reason_on_error(self, reason: &str) -> Self
pub fn map<F, R>(self, f: F) -> Result<R>where
F: FnOnce(T) -> R,
pub fn is_ok(&self) -> bool
pub fn as_status(&self) -> TestStatus
pub fn into_case(self) -> TestCase
pub fn into_value(self) -> Option<T>
Auto Trait Implementations§
impl<T> Freeze for Result<T>where
T: Freeze,
impl<T> RefUnwindSafe for Result<T>where
T: RefUnwindSafe,
impl<T> Send for Result<T>where
T: Send,
impl<T> Sync for Result<T>where
T: Sync,
impl<T> Unpin for Result<T>where
T: Unpin,
impl<T> UnwindSafe for Result<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more