MCPcopy Create free account
hub / github.com/ElementsProject/lightning / hook_from_builder

Method hook_from_builder

plugins/src/lib.rs:224–227  ·  view source on GitHub ↗

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>)

Source from the content-addressed store, hash-verified

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

Callers 3

mainFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80

Calls 2

insertMethod · 0.45
buildMethod · 0.45

Tested by

no test coverage detected