Trait Job

Source
pub trait Job:
    AsJob
    + Send
    + Sync {
    // Required method
    fn run_once<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided method
    fn name(&self) -> String { ... }
}

Required Methods§

Source

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

Provided Methods§

Source

fn name(&self) -> String

Implementations on Foreign Types§

Source§

impl Job for Vec<Arc<dyn Job>>

Source§

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

Source§

impl<J: Job> Job for Vec<J>

Source§

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

Source§

impl<J: Job, T: Send + Sync> Job for (J, T)

Source§

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

Source§

fn name(&self) -> String

Source§

impl<Mj: MutJob + Send + Sync> Job for Mutex<Mj>

Source§

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

Source§

fn name(&self) -> String

Implementors§

Source§

impl Job for LoopingJobService

Source§

impl<F: Fn() + Send + Sync> Job for F