pub struct TestResult<T> { /* private fields */ }Expand description
The result from running the test. This also contains the data associated with the test and the
index of the test when added to the TestContext.
Implementations§
Source§impl<T> TestResult<T>
impl<T> TestResult<T>
Sourcepub fn index(&self) -> usize
pub fn index(&self) -> usize
The index of the test as added in TestContext.
Sourcepub fn take_data(&mut self) -> Option<T>
pub fn take_data(&mut self) -> Option<T>
Take the data associated with this test. After the first call, will always return None.
Sourcepub fn data(&self) -> Option<&T>
pub fn data(&self) -> Option<&T>
Get the data associated with this test. Returns None if the data has been taken via
TestResult::take_data.
See also TestResult::take_data if the data needs to be owned.
Sourcepub fn time_taken(&self) -> Duration
pub fn time_taken(&self) -> Duration
Get the time taken by this test case
Sourcepub fn state(&self) -> TestResultState
pub fn state(&self) -> TestResultState
Get the state of this test result
Methods from Deref<Target = Output>§
Sourcepub fn exit_status(&self) -> i32
pub fn exit_status(&self) -> i32
Get the exit status of this Output
Trait Implementations§
Source§impl<T: Clone> Clone for TestResult<T>
impl<T: Clone> Clone for TestResult<T>
Source§fn clone(&self) -> TestResult<T>
fn clone(&self) -> TestResult<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T: Debug> Debug for TestResult<T>
impl<T: Debug> Debug for TestResult<T>
Source§impl<T> Deref for TestResult<T>
impl<T> Deref for TestResult<T>
Source§impl<T: Hash> Hash for TestResult<T>
impl<T: Hash> Hash for TestResult<T>
Source§impl<T: PartialEq> PartialEq for TestResult<T>
impl<T: PartialEq> PartialEq for TestResult<T>
impl<T: Eq> Eq for TestResult<T>
impl<T> StructuralPartialEq for TestResult<T>
Auto Trait Implementations§
impl<T> Freeze for TestResult<T>where
T: Freeze,
impl<T> RefUnwindSafe for TestResult<T>where
T: RefUnwindSafe,
impl<T> Send for TestResult<T>where
T: Send,
impl<T> Sync for TestResult<T>where
T: Sync,
impl<T> Unpin for TestResult<T>where
T: Unpin,
impl<T> UnwindSafe for TestResult<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