pub struct ScenarioStep { /* private fields */ }
Expand description

A ScenarioStep is one step in a scenario.

In essence, a scenario step is a named closure. Its name can be used when reporting an error encountered in running a scenario.

Scenario steps are typically constructed from step builders, rather than directly. This permits the step builder to correctly register context types etc.


let step = ScenarioStep::new(
    "when everything works".to_string(), |ctx, ok| Ok(()), |scen| ()
);

Implementations

Create a new scenario step taking the scenario context

This is used to construct a scenario step from a function which takes the scenario context container. This will generally be called from the generated build method for the step.

Call the step function

This simply calls the encased step function

Return the full text of this step

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.