Trait cucumber::Writer

source ·
pub trait Writer<World> {
    type Cli: Args;

    // Required method
    fn handle_event<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        ev: Result<Event<Cucumber<World>>>,
        cli: &'life1 Self::Cli
    ) -> Pin<Box<dyn Future<Output = ()> + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Writer of Cucumber events to some output.

As Runner produces events in a happened-before order (see its order guarantees), Writers are required to be Normalized.

As Cucumber::run() returns Writer, it can hold some state inside for inspection after execution. See Summarize and Cucumber::run_and_exit() for examples.

Required Associated Types§

source

type Cli: Args

CLI options of this Writer. In case no options should be introduced, just use cli::Empty.

All CLI options from Parser, Runner and Writer will be merged together, so overlapping arguments will cause a runtime panic.

Required Methods§

source

fn handle_event<'life0, 'life1, 'async_trait>( &'life0 mut self, ev: Result<Event<Cucumber<World>>>, cli: &'life1 Self::Cli ) -> Pin<Box<dyn Future<Output = ()> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Handles the given Cucumber event.

Implementors§

source§

impl<W, L, R> Writer<W> for Tee<L, R>
where W: World, L: Writer<W>, R: Writer<W>,

§

type Cli = Compose<<L as Writer<W>>::Cli, <R as Writer<W>>::Cli>

source§

impl<W, L, R, F> Writer<W> for Or<L, R, F>
where W: World, L: Writer<W>, R: Writer<W>, F: FnMut(&Result<Event<Cucumber<W>>>, &Compose<L::Cli, R::Cli>) -> bool,

§

type Cli = Compose<<L as Writer<W>>::Cli, <R as Writer<W>>::Cli>

source§

impl<W, Out> Writer<W> for Basic<Out>
where W: World + Debug, Out: Write,

§

type Cli = Cli

source§

impl<W, Out> Writer<W> for JUnit<W, Out>
where W: World + Debug, Out: Write,

Available on crate feature output-junit only.
§

type Cli = Cli

source§

impl<W, Wr> Writer<W> for Summarize<Wr>
where W: World, Wr: for<'val> Arbitrary<'val, W, String> + Summarizable, Wr::Cli: Colored,

§

type Cli = <Wr as Writer<W>>::Cli

source§

impl<W, Wr, F> Writer<W> for FailOnSkipped<Wr, F>
where W: World, F: Fn(&Feature, Option<&Rule>, &Scenario) -> bool, Wr: Writer<W>,

§

type Cli = <Wr as Writer<W>>::Cli

source§

impl<W, Wr, F> Writer<W> for Repeat<W, Wr, F>
where W: World, Wr: Writer<W> + NonTransforming, F: Fn(&Result<Event<Cucumber<W>>>) -> bool,

§

type Cli = <Wr as Writer<W>>::Cli

source§

impl<W: World + Debug, Out: Write> Writer<W> for Json<Out>

Available on crate feature output-json only.
§

type Cli = Empty

source§

impl<W: World + Debug, Out: Write> Writer<W> for Libtest<W, Out>

Available on crate feature libtest only.
§

type Cli = Cli

source§

impl<W: World, Wr: Writer<W> + ?Sized> Writer<W> for Arbitrary<Wr>

§

type Cli = <Wr as Writer<W>>::Cli

source§

impl<W: World, Wr: Writer<W> + ?Sized> Writer<W> for Stats<Wr>

§

type Cli = <Wr as Writer<W>>::Cli

source§

impl<W: World, Wr: Writer<W> + ?Sized> Writer<W> for AssertNormalized<Wr>

§

type Cli = <Wr as Writer<W>>::Cli

source§

impl<World, Wr: Writer<World>> Writer<World> for Normalize<World, Wr>

§

type Cli = <Wr as Writer<World>>::Cli