Skip to main content

HarnessStep

Struct HarnessStep 

Source
pub struct HarnessStep<'harness, G, C, O> { /* private fields */ }
Expand description

Builder for one harness transaction step.

Implementations§

Source§

impl<'harness, G, C, O> HarnessStep<'harness, G, C, O>
where G: ScenarioTarget<C, O>, C: Clone + Debug + PartialEq, O: Clone + Debug + PartialEq,

Source

pub fn input<T>(self, input: InputNode<T>, value: T) -> Self
where T: Clone + PartialEq + Send + Sync + 'static,

Stages a typed canonical input write for this step.

Source

pub fn operation( self, operation: impl for<'tx> Fn(&mut Transaction<'tx, C, O>) -> GraphResult<()> + 'static, ) -> Self

Stages a custom operation against the transaction.

Source

pub fn expect_plan(self, command: ResourceCommandTrace) -> Self

Expects one resource command trace in this step.

Source

pub fn expect_plans( self, commands: impl IntoIterator<Item = ResourceCommandTrace>, ) -> Self

Expects the complete resource command trace for this step.

Source

pub fn expect_output(self, frame: OutputFrameTrace) -> Self

Expects one output frame trace in this step.

Source

pub fn expect_outputs( self, frames: impl IntoIterator<Item = OutputFrameTrace>, ) -> Self

Expects the complete output frame trace for this step.

Source

pub fn check( self, name: impl Into<String>, check: impl Fn(&G, &TransactionResult<C, O>) -> bool + 'static, ) -> Self

Adds a structural invariant check to record in the transaction trace.

Source

pub fn commit( self, ) -> Result<&'harness mut TrellisHarness<G, C, O>, ScenarioError>

Commits exactly one transaction for this step.

Auto Trait Implementations§

§

impl<'harness, G, C, O> !RefUnwindSafe for HarnessStep<'harness, G, C, O>

§

impl<'harness, G, C, O> !Send for HarnessStep<'harness, G, C, O>

§

impl<'harness, G, C, O> !Sync for HarnessStep<'harness, G, C, O>

§

impl<'harness, G, C, O> !UnwindSafe for HarnessStep<'harness, G, C, O>

§

impl<'harness, G, C, O> Freeze for HarnessStep<'harness, G, C, O>

§

impl<'harness, G, C, O> Unpin for HarnessStep<'harness, G, C, O>

§

impl<'harness, G, C, O> UnsafeUnpin for HarnessStep<'harness, G, C, O>

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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.