Struct may_waiter::WaiterMap
source · pub struct WaiterMap<K, T> { /* private fields */ }
Expand description
Waiter map that could be used to wait response for given keys
Implementations§
source§impl<K: Hash + Eq, T> WaiterMap<K, T>
impl<K: Hash + Eq, T> WaiterMap<K, T>
pub fn new() -> Self
sourcepub fn new_waiter(&self, id: K) -> WaiterGuard<'_, K, T>where
K: Clone,
pub fn new_waiter(&self, id: K) -> WaiterGuard<'_, K, T>where K: Clone,
return a waiter on the stack!
sourcepub fn set_rsp(&self, id: &K, rsp: T) -> Result<(), T>where
K: Debug,
pub fn set_rsp(&self, id: &K, rsp: T) -> Result<(), T>where K: Debug,
set rsp for the corresponding waiter
sourcepub fn cancel_all(&self)
pub fn cancel_all(&self)
cancel all the waiting waiter, all wait would return NotFound error