[−][src]Trait coil::Job
Background job
Associated Types
type Environment: 'static + Send + Sync
The environment this job is run with. This is a struct you define, which should encapsulate things like database connection pools, any configuration, and any other static data or shared resources.
Associated Constants
const JOB_TYPE: &'static str
The key to use for storing this job.
Typically this is the name of your struct in snake_case
.
Provided methods
#[must_use]fn enqueue<'a, 'async_trait, C>(
self,
conn: C
) -> Pin<Box<dyn Future<Output = Result<(), EnqueueError>> + Send + 'async_trait>> where
C: Executor<'a, Database = Postgres>,
'a: 'async_trait,
C: 'async_trait,
Self: Send + 'async_trait,
self,
conn: C
) -> Pin<Box<dyn Future<Output = Result<(), EnqueueError>> + Send + 'async_trait>> where
C: Executor<'a, Database = Postgres>,
'a: 'async_trait,
C: 'async_trait,
Self: Send + 'async_trait,
inserts the job into the Postgres Database