pub struct ContractRun { /* private fields */ }Expand description
Retains contract evidence and execution diagnostics in the borrowing suite.
A completed run may fail its requirements. Completion means only that execution and its automatic cleanup attempt returned.
§Examples
use qubit_fs_testkit::{FileSystemContract, FileSystemContractSuite};
let fixture = RustdocSyncFixture::new();
let mut suite = FileSystemContractSuite::new(&fixture);
suite.run_contract(FileSystemContract::Properties);
let run = suite.run();
assert!(!run.was_interrupted());
assert!(!run.report().checks().is_empty());Implementations§
Source§impl ContractRun
impl ContractRun
Sourcepub const fn report(&self) -> &ContractReport
pub const fn report(&self) -> &ContractReport
Returns the registered checks and their evidence.
§Returns
The report containing every check and its evidence.
Sourcepub const fn cleanup(&self) -> &CleanupReport
pub const fn cleanup(&self) -> &CleanupReport
Returns cleanup evidence and the history of all attempts.
§Returns
The cleanup report retained by this run.
Sourcepub fn failures(&self) -> &[ContractFailure]
pub fn failures(&self) -> &[ContractFailure]
Returns preserved failures in observation order.
§Returns
The failures recorded while executing the contract.
Sourcepub const fn was_interrupted(&self) -> bool
pub const fn was_interrupted(&self) -> bool
Reports that a started session was dropped before returning its result.
The runner exclusively borrows the suite while active. Callers can inspect this retained state only after that borrow ends, including when a pending execution or cleanup future is cancelled.
§Returns
true when the session started but did not complete.
Sourcepub fn requirements_satisfied(&self) -> bool
pub fn requirements_satisfied(&self) -> bool
Returns whether execution ended and every required check has evidence.
§Returns
true when execution, required evidence, and cleanup all succeeded.
Sourcepub fn requirements_satisfied_with(&self, required: &[ContractCheckId]) -> bool
pub fn requirements_satisfied_with(&self, required: &[ContractCheckId]) -> bool
Sourcepub fn all_applicable_checks_verified(&self) -> bool
pub fn all_applicable_checks_verified(&self) -> bool
Includes every applicable optional probe in the evidence requirement.
§Returns
true when execution and cleanup succeeded and all applicable checks
have evidence.
Sourcepub fn assert_satisfied(&self)
pub fn assert_satisfied(&self)
Asserts the run’s requirements and prints retained safe diagnostics.
§Panics
Panics if execution, contract evidence, or cleanup did not succeed.