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,
impl<Engine> Action<Engine> for BroadcastLatestForkchoicewhere
Engine: EngineTypes + PayloadTypes<PayloadAttributes = PayloadAttributes>,
EthPayloadAttributes: From<<Engine as EngineTypes>::ExecutionPayloadEnvelopeV3>,
impl<Engine> Action<Engine> for BroadcastNextNewPayloadwhere
Engine: EngineTypes + PayloadTypes<PayloadAttributes = PayloadAttributes>,
EthPayloadAttributes: From<<Engine as EngineTypes>::ExecutionPayloadEnvelopeV3>,
impl<Engine> Action<Engine> for CheckPayloadAcceptedwhere
Engine: EngineTypes<ExecutionPayloadEnvelopeV3 = ExecutionPayloadEnvelopeV3> + PayloadTypes<PayloadAttributes = PayloadAttributes>,
ExecutionPayloadEnvelopeV3: From<<Engine as EngineTypes>::ExecutionPayloadEnvelopeV3>,
impl<Engine> Action<Engine> for GenerateNextPayloadwhere
Engine: EngineTypes + PayloadTypes<PayloadAttributes = PayloadAttributes>,
EthPayloadAttributes: From<<Engine as EngineTypes>::ExecutionPayloadEnvelopeV3>,
impl<Engine> Action<Engine> for GeneratePayloadAttributeswhere
Engine: EngineTypes,
impl<Engine> Action<Engine> for PickNextBlockProducerwhere
Engine: EngineTypes,
impl<Engine> Action<Engine> for ProduceBlocks<Engine>where
Engine: EngineTypes,
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| {...})
.