Trait Action

Source
pub trait Action<I>: Send + 'static {
    // Required method
    fn execute<'a>(
        &'a mut self,
        env: &'a mut Environment<I>,
    ) -> BoxFuture<'a, Result<()>>;
}
Expand description

An action that can be performed on an instance.

Actions execute operations and potentially make assertions in a single step. The action name indicates what it does (e.g., AssertMineBlock would both mine a block and assert it worked).

Required Methods§

Source

fn execute<'a>( &'a mut self, env: &'a mut Environment<I>, ) -> BoxFuture<'a, Result<()>>

Executes the action

Implementors§

Source§

impl<Engine> Action<Engine> for AssertMineBlock<Engine>
where Engine: EngineTypes, Engine::PayloadAttributes: From<PayloadAttributes>,

Source§

impl<I, F, Fut> Action<I> for F
where F: FnMut(&Environment<I>) -> Fut + Send + 'static, Fut: Future<Output = Result<()>> + Send + 'static,

Implementation of Action for any function/closure that takes an Environment reference and returns a Future resolving to Result<()>.

This allows using closures directly as actions with .with_action(async move |env| {...}).

Source§

impl<I: Sync + Send + 'static> Action<I> for Sequence<I>