Skip to main content

CompanionTasks

Trait CompanionTasks 

Source
pub trait CompanionTasks: Send + Sync {
    // Required methods
    fn start<'life0, 'async_trait>(
        &'life0 self,
        input: StartTaskInput,
    ) -> Pin<Box<dyn Future<Output = Result<TaskSnapshot, String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get<'life0, 'life1, 'async_trait>(
        &'life0 self,
        task_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<TaskSnapshot, String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn cancel<'life0, 'life1, 'async_trait>(
        &'life0 self,
        task_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<bool, String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Binary-owned execution boundary. The transport never launches processes.

Required Methods§

Source

fn start<'life0, 'async_trait>( &'life0 self, input: StartTaskInput, ) -> Pin<Box<dyn Future<Output = Result<TaskSnapshot, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Start one task or reject it without side effects.

Source

fn get<'life0, 'life1, 'async_trait>( &'life0 self, task_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<TaskSnapshot, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Inspect a task owned by this service.

Source

fn cancel<'life0, 'life1, 'async_trait>( &'life0 self, task_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<bool, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Request cancellation. False means the task is already terminal.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§