Skip to main content

JobProducerExt

Trait JobProducerExt 

Source
pub trait JobProducerExt: JobProducer {
    // Provided method
    fn push<'life0, 'life1, 'async_trait, J>(
        &'life0 self,
        queue: &'life1 str,
        job: J,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where J: 'async_trait + Job + Serialize,
             Self: Sync + 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
}
Expand description

Typed-push convenience over any JobProducer. Lives as an extension trait so the producer trait stays object-safe (Arc<dyn JobProducer>).

Provided Methods§

Source

fn push<'life0, 'life1, 'async_trait, J>( &'life0 self, queue: &'life1 str, job: J, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where J: 'async_trait + Job + Serialize, Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Serialize job to JSON and push it onto queue.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§