Struct task_tracker::TaskTracker
source · pub struct TaskTracker<K, R>where
K: Clone + Eq + Hash + Sync + Send + Debug + 'static,
R: Sync + Send + Debug + 'static,{ /* private fields */ }
Implementations§
source§impl<K, R> TaskTracker<K, R>where
K: Clone + Eq + Hash + Sync + Send + Debug + 'static,
R: Sync + Send + Debug + 'static,
impl<K, R> TaskTracker<K, R>where K: Clone + Eq + Hash + Sync + Send + Debug + 'static, R: Sync + Send + Debug + 'static,
pub fn new() -> Self
pub async fn add( &self, key: K, task: BoxFuture<'static, R> ) -> Option<TaskResult<R>>
pub async fn remove(&self, key: &K) -> Option<TaskResult<R>>
pub async fn apply<S, F>(&self, keys: S, create_task: F)where S: Iterator<Item = K>, F: Fn(&K) -> BoxFuture<'static, R>,
pub async fn wait_for_tasks(&self) -> HashMap<K, TaskResult<R>>
Trait Implementations§
source§impl<K, R> Clone for TaskTracker<K, R>where
K: Clone + Eq + Hash + Sync + Send + Debug + 'static + Clone,
R: Sync + Send + Debug + 'static + Clone,
impl<K, R> Clone for TaskTracker<K, R>where K: Clone + Eq + Hash + Sync + Send + Debug + 'static + Clone, R: Sync + Send + Debug + 'static + Clone,
source§fn clone(&self) -> TaskTracker<K, R>
fn clone(&self) -> TaskTracker<K, R>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more