1 2 3 4 5 6 7 8
use serde::{de::DeserializeOwned, Serialize}; use std::time::Duration; pub trait TaskLevel<C>: Default + Serialize + DeserializeOwned { fn success(&mut self, context: C); fn failure(&mut self, context: C); fn duration(&self) -> Duration; }