+ /**
+ * Gets the node feature flags which this handler itself supports. All available handlers are
+ * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`]
+ * which are broadcasted in our [`NodeAnnouncement`] message.
+ */
+ inline LDK::NodeFeatures provided_node_features();
+ /**
+ * Gets the init feature flags which should be sent to the given peer. All available handlers
+ * are queried similarly and their feature flags are OR'd together to form the [`InitFeatures`]
+ * which are sent in our [`Init`] message.
+ *
+ * Note that this method is called before [`Self::peer_connected`].
+ */
+ inline LDK::InitFeatures provided_init_features(struct LDKPublicKey their_node_id);
+};
+class OnionMessageHandler {
+private:
+ LDKOnionMessageHandler self;
+public:
+ OnionMessageHandler(const OnionMessageHandler&) = delete;
+ OnionMessageHandler(OnionMessageHandler&& o) : self(o.self) { memset(&o, 0, sizeof(OnionMessageHandler)); }
+ OnionMessageHandler(LDKOnionMessageHandler&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKOnionMessageHandler)); }
+ operator LDKOnionMessageHandler() && { LDKOnionMessageHandler res = self; memset(&self, 0, sizeof(LDKOnionMessageHandler)); return res; }
+ ~OnionMessageHandler() { OnionMessageHandler_free(self); }
+ OnionMessageHandler& operator=(OnionMessageHandler&& o) { OnionMessageHandler_free(self); self = o.self; memset(&o, 0, sizeof(OnionMessageHandler)); return *this; }
+ LDKOnionMessageHandler* operator &() { return &self; }
+ LDKOnionMessageHandler* operator ->() { return &self; }
+ const LDKOnionMessageHandler* operator &() const { return &self; }
+ const LDKOnionMessageHandler* operator ->() const { return &self; }
+ /**
+ * Handle an incoming onion_message message from the given peer.
+ */
+ inline void handle_onion_message(struct LDKPublicKey peer_node_id, const struct LDKOnionMessage *NONNULL_PTR msg);
+ /**
+ * Called when a connection is established with a peer. Can be used to track which peers
+ * advertise onion message support and are online.
+ */
+ inline void peer_connected(struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR init);
+ /**
+ * Indicates a connection to the peer failed/an existing connection was lost. Allows handlers to
+ * drop and refuse to forward onion messages to this peer.
+ */
+ inline void peer_disconnected(struct LDKPublicKey their_node_id, bool no_connection_possible);
+ /**
+ * Gets the node feature flags which this handler itself supports. All available handlers are
+ * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`]
+ * which are broadcasted in our [`NodeAnnouncement`] message.
+ */
+ inline LDK::NodeFeatures provided_node_features();
+ /**
+ * Gets the init feature flags which should be sent to the given peer. All available handlers
+ * are queried similarly and their feature flags are OR'd together to form the [`InitFeatures`]
+ * which are sent in our [`Init`] message.
+ *
+ * Note that this method is called before [`Self::peer_connected`].
+ */
+ inline LDK::InitFeatures provided_init_features(struct LDKPublicKey their_node_id);