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<Pin<Box<dyn Stream<Item = CommandEvent> + Send>>, UbiquityError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn cancel<'life0, 'async_trait>(
        &'life0 self,
        command_id: Uuid,
    ) -> Pin<Box<dyn Future<Output = Result<(), UbiquityError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn status<'life0, 'async_trait>(
        &'life0 self,
        command_id: Uuid,
    ) -> Pin<Box<dyn Future<Output = Result<Option<CommandResult>, UbiquityError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Command executor trait for different implementations

Required Methods§

Source

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

Execute a command and return a stream of events

Source

fn cancel<'life0, 'async_trait>( &'life0 self, command_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<(), UbiquityError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Cancel a running command

Source

fn status<'life0, 'async_trait>( &'life0 self, command_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<Option<CommandResult>, UbiquityError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get the status of a command

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§