Skip to main content

ForgeJob

Trait ForgeJob 

Source
pub trait ForgeJob:
    Send
    + Sync
    + 'static {
    type Args: DeserializeOwned + Serialize + Send + Sync;
    type Output: Serialize + Send;

    // Required methods
    fn info() -> JobInfo;
    fn execute(
        ctx: &JobContext,
        args: Self::Args,
    ) -> Pin<Box<dyn Future<Output = Result<Self::Output>> + Send + '_>>;
}
Expand description

Trait for FORGE job handlers.

Required Associated Types§

Source

type Args: DeserializeOwned + Serialize + Send + Sync

Input arguments type.

Source

type Output: Serialize + Send

Output result type.

Required Methods§

Source

fn info() -> JobInfo

Get job metadata.

Source

fn execute( ctx: &JobContext, args: Self::Args, ) -> Pin<Box<dyn Future<Output = Result<Self::Output>> + Send + '_>>

Execute the job.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§