Skip to main content

ProtocolExecutor

Trait ProtocolExecutor 

Source
pub trait ProtocolExecutor {
    type PreparedData: Clone + Debug + Send + Sync;

    // Required method
    fn execute(
        &mut self,
        data: &Self::PreparedData,
        context: &ExecutionContext,
    ) -> impl Future<Output = Result<RawExecutionResult>> + Send;
}
Expand description

Contract implemented by all protocol executors.

Each protocol crate provides an executor struct that implements this trait. The associated PreparedData type links the executor to its matching prepared data produced by the builder.

Required Associated Types§

Source

type PreparedData: Clone + Debug + Send + Sync

Protocol-specific prepared data (e.g. PreparedHttpData, PreparedBashScript).

Required Methods§

Source

fn execute( &mut self, data: &Self::PreparedData, context: &ExecutionContext, ) -> impl Future<Output = Result<RawExecutionResult>> + Send

Execute a single protocol request and return the raw result.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§