Skip to main content

CommandExecutor

Trait CommandExecutor 

Source
pub trait CommandExecutor: Send + Sync {
    // Required methods
    fn execute<'life0, 'async_trait>(
        &'life0 self,
        request: CommandRequest,
    ) -> Pin<Box<dyn Future<Output = Result<CommandResult>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn validate<'life0, 'life1, 'async_trait>(
        &'life0 self,
        request: &'life1 CommandRequest,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<ValidationIssue>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn supports(&self, command_type: &CommandType) -> bool;
    fn capabilities(&self) -> ExecutorCapabilities;
    fn estimate_resources<'life0, 'life1, 'async_trait>(
        &'life0 self,
        request: &'life1 CommandRequest,
    ) -> Pin<Box<dyn Future<Output = Result<ResourceEstimate>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Command executor trait

Required Methods§

Source

fn execute<'life0, 'async_trait>( &'life0 self, request: CommandRequest, ) -> Pin<Box<dyn Future<Output = Result<CommandResult>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Execute a command with the unified pipeline

Source

fn validate<'life0, 'life1, 'async_trait>( &'life0 self, request: &'life1 CommandRequest, ) -> Pin<Box<dyn Future<Output = Result<Vec<ValidationIssue>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Validate a command request without executing it

Source

fn supports(&self, command_type: &CommandType) -> bool

Check if this executor supports the given command type

Source

fn capabilities(&self) -> ExecutorCapabilities

Get executor capabilities and limitations

Source

fn estimate_resources<'life0, 'life1, 'async_trait>( &'life0 self, request: &'life1 CommandRequest, ) -> Pin<Box<dyn Future<Output = Result<ResourceEstimate>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Estimate resource requirements for a command

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl CommandExecutor for UnifiedCommandExecutor

Command executor trait