1 2 3 4 5 6 7 8 9
use super::{Task, TaskResult}; use crate::error::Result; use async_trait::async_trait; #[async_trait] pub trait TaskHandler: Send + Sync { async fn execute(&self, task: &Task) -> Result<TaskResult>; fn task_type(&self) -> &str; }