(&self, event: &HookEvent, name: &str)
| 202 | } |
| 203 | |
| 204 | pub async fn remove(&self, event: &HookEvent, name: &str) -> bool { |
| 205 | let mut hooks = self.hooks.write().await; |
| 206 | if let Some(hook_list) = hooks.get_mut(event) { |
| 207 | let initial_len = hook_list.len(); |
| 208 | hook_list.retain(|h| h.name != name); |
| 209 | return hook_list.len() < initial_len; |
| 210 | } |
| 211 | false |
| 212 | } |
| 213 | |
| 214 | pub async fn list(&self) -> Vec<(HookEvent, String, bool)> { |
| 215 | let hooks = self.hooks.read().await; |
no test coverage detected