pub trait OffersMessageHandler {
    // Required method
    fn handle_message(&self, message: OffersMessage) -> Option<OffersMessage>;

    // Provided method
    fn release_pending_messages(
        &self,
    ) -> Vec<PendingOnionMessage<OffersMessage>> { ... }
}
Expand description

A handler for an OnionMessage containing a BOLT 12 Offers message as its payload.

Required Methods§

fn handle_message(&self, message: OffersMessage) -> Option<OffersMessage>

Handles the given message by either responding with an Bolt12Invoice, sending a payment, or replying with an error.

The returned OffersMessage, if any, is enqueued to be sent by OnionMessenger.

Provided Methods§

fn release_pending_messages(&self) -> Vec<PendingOnionMessage<OffersMessage>>

Releases any OffersMessages that need to be sent.

Typically, this is used for messages initiating a payment flow rather than in response to another message. The latter should use the return value of Self::handle_message.

Implementors§

§

impl OffersMessageHandler for IgnoringMessageHandler

§

impl<M, T, ES, NS, SP, F, R, L> OffersMessageHandler for ChannelManager<M, T, ES, NS, SP, F, R, L>
where M: Deref, T: Deref, ES: Deref, NS: Deref, SP: Deref, F: Deref, R: Deref, L: Deref, <M as Deref>::Target: Watch<<<SP as Deref>::Target as SignerProvider>::Signer>, <T as Deref>::Target: BroadcasterInterface, <ES as Deref>::Target: EntropySource, <NS as Deref>::Target: NodeSigner, <SP as Deref>::Target: SignerProvider, <F as Deref>::Target: FeeEstimator, <R as Deref>::Target: Router, <L as Deref>::Target: Logger,