pub trait Task: Send + Sync {
type Input: Serialize + for<'de> Deserialize<'de> + Send;
type Output: Serialize + for<'de> Deserialize<'de> + Send;
// Required methods
fn execute<'life0, 'async_trait>(
&'life0 self,
input: Self::Input,
) -> Pin<Box<dyn Future<Output = Result<Self::Output>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn name(&self) -> &str;
}Expand description
Trait for tasks that can be executed
Required Associated Types§
Sourcetype Input: Serialize + for<'de> Deserialize<'de> + Send
type Input: Serialize + for<'de> Deserialize<'de> + Send
The input type for this task
Sourcetype Output: Serialize + for<'de> Deserialize<'de> + Send
type Output: Serialize + for<'de> Deserialize<'de> + Send
The output type for this task