use std::fmt::Debug;
use async_trait::async_trait;
use serde::{Deserialize, Serialize};
#[async_trait]
pub trait Job: Debug + Send + Sync + 'static {
type Output: Clone + Serialize + for<'de> Deserialize<'de> + Send + Sync + 'static;
async fn execute(&mut self) -> anyhow::Result<Self::Output>;
}
pub trait Keyed<Key>: Job
where
Key: Clone + std::hash::Hash + Eq + Send + Sync + Debug + 'static,
{
fn key(&self) -> Key;
}
#[async_trait]
pub trait Executable: Send + Sync + Debug {
async fn execute(&mut self);
}