Skip to main content

Step

Struct Step 

Source
pub struct Step {
    pub keyword: StepKeyword,
    pub pattern: &'static StepPattern,
    pub run: StepFn,
    pub run_async: AsyncStepFn,
    pub execution_mode: StepExecutionMode,
    pub fixtures: &'static [&'static str],
    pub file: &'static str,
    pub line: u32,
}
Expand description

Represents a single step definition registered with the framework.

Fields§

§keyword: StepKeyword

The step keyword, e.g. Given or When.

§pattern: &'static StepPattern

Pattern text used to match a Gherkin step.

§run: StepFn

Function pointer executed when the step is invoked (sync mode).

§run_async: AsyncStepFn

Function pointer executed when the step is invoked (async mode).

For sync step definitions, this wraps the result in an immediately-ready future, enabling mixed sync and async steps within async scenarios.

§execution_mode: StepExecutionMode

Whether the step has a native sync body, a native async body, or both.

§fixtures: &'static [&'static str]

Names of fixtures this step requires.

§file: &'static str

Source file where the step is defined.

§line: u32

Line number within the source file.

Trait Implementations§

Source§

impl Debug for Step

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Collect for Step

Auto Trait Implementations§

§

impl Freeze for Step

§

impl RefUnwindSafe for Step

§

impl Send for Step

§

impl Sync for Step

§

impl Unpin for Step

§

impl UnwindSafe for Step

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> Same for T

Source§

type Output = T

Should always be Self
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.