Cancel the token associated with the given key (if any).
(&self, key: &str)
| 68 | |
| 69 | /// Cancel the token associated with the given key (if any). |
| 70 | pub fn cancel(&self, key: &str) { |
| 71 | if let Ok(mut map) = self.tokens.lock() { |
| 72 | if let Some(token) = map.remove(key) { |
| 73 | token.cancel(); |
| 74 | } |
| 75 | } |
| 76 | } |
| 77 | |
| 78 | /// Remove the token for the given key without cancelling it (cleanup after normal completion). |
| 79 | pub fn remove(&self, key: &str) { |
no test coverage detected