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§
Sourcefn execute<'a>(
&'a mut self,
env: &'a mut Environment<I>,
) -> BoxFuture<'a, Result<()>>
fn execute<'a>( &'a mut self, env: &'a mut Environment<I>, ) -> BoxFuture<'a, Result<()>>
Executes the action
Implementors§
impl<Engine> Action<Engine> for AssertMineBlock<Engine>where
Engine: EngineTypes,
Engine::PayloadAttributes: From<PayloadAttributes>,
impl<I, F, Fut> Action<I> for F
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| {...})
.