pub struct TestInstance<'a> { /* private fields */ }Expand description
A lightweight handle to a test for execution in a sandbox.
TestInstance holds a reference to a TestRecord and provides read access
to test metadata plus the ability to record results. Sandboxes only
see TestInstance, while TestRecord owns the data and aggregates results.
§Lifetime
The lifetime 'a ties this TestInstance to its associated TestRecord.
Implementations§
Source§impl<'a> TestInstance<'a>
impl<'a> TestInstance<'a>
Sourcepub fn new(record: &'a TestRecord) -> Self
pub fn new(record: &'a TestRecord) -> Self
Creates a new test handle for the given record.
Sourcepub fn record(&self) -> &'a TestRecord
pub fn record(&self) -> &'a TestRecord
Returns the underlying test record.
Sourcepub fn record_result(&self, result: TestResult)
pub fn record_result(&self, result: TestResult)
Records a result from executing this test.
The result is stored in the associated TestRecord.
Trait Implementations§
Source§impl<'a> Clone for TestInstance<'a>
impl<'a> Clone for TestInstance<'a>
Source§fn clone(&self) -> TestInstance<'a>
fn clone(&self) -> TestInstance<'a>
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<'a> Debug for TestInstance<'a>
impl<'a> Debug for TestInstance<'a>
impl<'a> Copy for TestInstance<'a>
Auto Trait Implementations§
impl<'a> Freeze for TestInstance<'a>
impl<'a> RefUnwindSafe for TestInstance<'a>
impl<'a> Send for TestInstance<'a>
impl<'a> Sync for TestInstance<'a>
impl<'a> Unpin for TestInstance<'a>
impl<'a> UnsafeUnpin for TestInstance<'a>
impl<'a> UnwindSafe for TestInstance<'a>
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