Trait TskClient

Source
pub trait TskClient: Send + Sync {
    // Required methods
    fn is_server_available<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn add_task<'life0, 'async_trait>(
        &'life0 self,
        repo_path: PathBuf,
        task: Task,
    ) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn list_tasks<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Task>, Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_task_status<'life0, 'async_trait>(
        &'life0 self,
        task_id: String,
    ) -> Pin<Box<dyn Future<Output = Result<TaskStatus, Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn shutdown_server<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Trait for communicating with the TSK server

Required Methods§

Source

fn is_server_available<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Check if the server is available

Source

fn add_task<'life0, 'async_trait>( &'life0 self, repo_path: PathBuf, task: Task, ) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Add a task to the server

Source

fn list_tasks<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<Task>, Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

List all tasks from the server

Source

fn get_task_status<'life0, 'async_trait>( &'life0 self, task_id: String, ) -> Pin<Box<dyn Future<Output = Result<TaskStatus, Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get the status of a specific task

Source

fn shutdown_server<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Shutdown the server

Implementors§