Skip to main content

ContractRun

Struct ContractRun 

Source
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

Source

pub const fn report(&self) -> &ContractReport

Returns the registered checks and their evidence.

§Returns

The report containing every check and its evidence.

Source

pub const fn cleanup(&self) -> &CleanupReport

Returns cleanup evidence and the history of all attempts.

§Returns

The cleanup report retained by this run.

Source

pub fn failures(&self) -> &[ContractFailure]

Returns preserved failures in observation order.

§Returns

The failures recorded while executing the contract.

Source

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.

Source

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.

Source

pub fn requirements_satisfied_with(&self, required: &[ContractCheckId]) -> bool

Also requires evidence for caller-selected optional probes.

Missing selections outside this run fail rather than being ignored.

§Parameters
  • required - Optional check identities that must have evidence.
§Returns

true when execution and cleanup succeeded and every selected check has evidence.

Source

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.

Source

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.

Source

pub fn assert_satisfied_with(&self, required: &[ContractCheckId])

Asserts the run including caller-selected optional probes.

§Panics

Panics for execution or cleanup failures and missing required evidence.

§Parameters
  • required - Optional check identities that must have evidence.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.