Trait ora_api::client::ClientObj

source ·
pub trait ClientObj {
    // Required methods
    fn add_task<'life0, 'async_trait>(
        &'life0 self,
        task: TaskDefinition
    ) -> Pin<Box<dyn Future<Output = Result<TaskHandle>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn add_tasks<'life0, 'life1, 'async_trait>(
        &'life0 self,
        tasks: &'life1 mut (dyn ExactSizeIterator<Item = TaskDefinition> + Send)
    ) -> Pin<Box<dyn Future<Output = Result<Vec<TaskHandle>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn task<'life0, 'async_trait>(
        &'life0 self,
        task_id: Uuid
    ) -> Pin<Box<dyn Future<Output = Result<TaskHandle>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn tasks<'life0, 'life1, 'async_trait>(
        &'life0 self,
        options: &'life1 Tasks
    ) -> Pin<Box<dyn Future<Output = Result<Vec<TaskHandle>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn cancel_tasks<'life0, 'life1, 'async_trait>(
        &'life0 self,
        options: &'life1 Tasks
    ) -> Pin<Box<dyn Future<Output = Result<Vec<TaskHandle>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn task_count<'life0, 'life1, 'async_trait>(
        &'life0 self,
        options: &'life1 Tasks
    ) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn add_schedule<'life0, 'async_trait>(
        &'life0 self,
        schedule: ScheduleDefinition
    ) -> Pin<Box<dyn Future<Output = Result<ScheduleHandle>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn add_schedules<'life0, 'life1, 'async_trait>(
        &'life0 self,
        schedules: &'life1 mut (dyn ExactSizeIterator<Item = ScheduleDefinition> + Send)
    ) -> Pin<Box<dyn Future<Output = Result<Vec<ScheduleHandle>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn schedule<'life0, 'async_trait>(
        &'life0 self,
        schedule_id: Uuid
    ) -> Pin<Box<dyn Future<Output = Result<ScheduleHandle>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn schedules<'life0, 'life1, 'async_trait>(
        &'life0 self,
        options: &'life1 Schedules
    ) -> Pin<Box<dyn Future<Output = Result<Vec<ScheduleHandle>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn schedule_count<'life0, 'life1, 'async_trait>(
        &'life0 self,
        options: &'life1 Schedules
    ) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn cancel_schedules<'life0, 'life1, 'async_trait>(
        &'life0 self,
        options: &'life1 Schedules
    ) -> Pin<Box<dyn Future<Output = Result<Vec<ScheduleHandle>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

An object-safe version of Client with type-erased task information and no generic arguments.

Required Methods§

source

fn add_task<'life0, 'async_trait>( &'life0 self, task: TaskDefinition ) -> Pin<Box<dyn Future<Output = Result<TaskHandle>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Add a new task of the given type.

source

fn add_tasks<'life0, 'life1, 'async_trait>( &'life0 self, tasks: &'life1 mut (dyn ExactSizeIterator<Item = TaskDefinition> + Send) ) -> Pin<Box<dyn Future<Output = Result<Vec<TaskHandle>>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Add multiple tasks of a given type.

This is more performant for some implementations than calling add_tasks repeatedly.

source

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

Retrieve a task by its ID.

source

fn tasks<'life0, 'life1, 'async_trait>( &'life0 self, options: &'life1 Tasks ) -> Pin<Box<dyn Future<Output = Result<Vec<TaskHandle>>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Retrieve multiple tasks.

source

fn cancel_tasks<'life0, 'life1, 'async_trait>( &'life0 self, options: &'life1 Tasks ) -> Pin<Box<dyn Future<Output = Result<Vec<TaskHandle>>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Cancel all matching tasks and return handles to tasks that were cancelled.

Cancellation is no-op on already finished tasks.

source

fn task_count<'life0, 'life1, 'async_trait>( &'life0 self, options: &'life1 Tasks ) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Count current tasks.

source

fn add_schedule<'life0, 'async_trait>( &'life0 self, schedule: ScheduleDefinition ) -> Pin<Box<dyn Future<Output = Result<ScheduleHandle>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Add a new schedule.

source

fn add_schedules<'life0, 'life1, 'async_trait>( &'life0 self, schedules: &'life1 mut (dyn ExactSizeIterator<Item = ScheduleDefinition> + Send) ) -> Pin<Box<dyn Future<Output = Result<Vec<ScheduleHandle>>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Add multiple schedules.

This is more performant for some implementations than calling add_schedule repeatedly.

source

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

Retrieve a schedule by its ID.

source

fn schedules<'life0, 'life1, 'async_trait>( &'life0 self, options: &'life1 Schedules ) -> Pin<Box<dyn Future<Output = Result<Vec<ScheduleHandle>>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Retrieve multiple schedules.

source

fn schedule_count<'life0, 'life1, 'async_trait>( &'life0 self, options: &'life1 Schedules ) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Count current schedules.

source

fn cancel_schedules<'life0, 'life1, 'async_trait>( &'life0 self, options: &'life1 Schedules ) -> Pin<Box<dyn Future<Output = Result<Vec<ScheduleHandle>>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Cancel all matching schedules and return handles to schedules that were cancelled.

Cancellation is no-op on inactive schedules.

Implementors§

source§

impl<C> ClientObj for Cwhere C: Client,