1 2 3 4 5 6 7 8 9 10 11 12
use async_trait::async_trait; use crate::Result; #[async_trait] pub trait Dispatch { type InnerData; async fn prepare(&self) -> Result<Self::InnerData>; async fn dispatch(&self, payload: Self::InnerData) -> Result<()>; }