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

Method handle_get_manifest

plugins/src/lib.rs:455–498  ·  view source on GitHub ↗
(
        &mut self,
        _call: messages::GetManifestCall,
    )

Source from the content-addressed store, hash-verified

453 }
454
455 fn handle_get_manifest(
456 &mut self,
457 _call: messages::GetManifestCall,
458 ) -> messages::GetManifestResponse {
459 let rpcmethods: Vec<_> = self
460 .rpcmethods
461 .values()
462 .map(|v| messages::RpcMethod {
463 name: v.name.clone(),
464 description: v.description.clone(),
465 usage: v.usage.clone(),
466 })
467 .collect();
468
469 let subscriptions = self
470 .subscriptions
471 .keys()
472 .map(|s| s.clone())
473 .chain(self.wildcard_subscription.iter().map(|_| String::from("*")))
474 .collect();
475
476 let hooks: Vec<messages::Hook> = self
477 .hooks
478 .values()
479 .map(|v| messages::Hook {
480 name: v.name.clone(),
481 before: v.before.clone(),
482 after: v.after.clone(),
483 filters: v.filters.clone(),
484 })
485 .collect();
486
487 messages::GetManifestResponse {
488 options: self.options.values().cloned().collect(),
489 subscriptions,
490 hooks,
491 rpcmethods,
492 notifications: self.notifications.clone(),
493 featurebits: self.featurebits.clone(),
494 dynamic: self.dynamic,
495 nonnumericids: true,
496 custommessages: self.custommessages.clone(),
497 }
498 }
499
500 fn handle_init(&mut self, call: messages::InitCall) -> Result<Configuration, Error> {
501 use options::Value as OValue;

Callers

nothing calls this directly

Calls 1

mapMethod · 0.80

Tested by

no test coverage detected