Add a hook subscription using a [`HookBuilder`], which allows configuring `before`, `after`, and `filters` in addition to the callback. Use [`HookBuilder::new`] for raw [`serde_json::Value`] hooks or [`HookBuilder::new_typed`] for type-safe hooks.
(mut self, hook: HookBuilder<S>)
| 222 | /// and `filters` in addition to the callback. Use [`HookBuilder::new`] for raw |
| 223 | /// [`serde_json::Value`] hooks or [`HookBuilder::new_typed`] for type-safe hooks. |
| 224 | pub fn hook_from_builder(mut self, hook: HookBuilder<S>) -> Builder<S, I, O> { |
| 225 | self.hooks.insert(hook.name.clone(), hook.build()); |
| 226 | self |
| 227 | } |
| 228 | |
| 229 | /// Add a hook subscription for `hookname` with typed request and response. The request is |
| 230 | /// deserialized from JSON into `Req` and the response is serialized from `Resp` back to JSON |