Module messenger

Expand description

LDK sends, receives, and forwards onion messages via this OnionMessenger, which lives here, as well as various types, traits, and utilities that it uses.

Structs§

DefaultMessageRouter
A MessageRouter that can only route to a directly connected Destination.
OnionMessagePath
A path for sending an OnionMessage.
OnionMessenger
A sender, receiver and forwarder of OnionMessages.
Responder
The Responder struct creates an appropriate ResponseInstruction for responding to a message.
ResponseInstruction
Instructions for how and where to send the response to an onion message.

Enums§

Destination
The destination of an onion message.
MessageSendInstructions
Instructions for how and where to send a message.
PeeledOnion
A processed incoming onion message, containing either a Forward (another onion message) or a Receive payload with decrypted contents.
SendError
Errors that may occur when sending an onion message.
SendSuccess
Result of successfully sending an onion message.

Traits§

AOnionMessenger
A trivial trait which describes any OnionMessenger.
CustomOnionMessageHandler
Handler for custom onion messages. If you are using SimpleArcOnionMessenger, SimpleRefOnionMessenger, or prefer to ignore inbound custom onion messages, IgnoringMessageHandler must be provided to OnionMessenger::new. Otherwise, a custom implementation of this trait must be provided, with CustomMessage specifying the supported message types.
MessageRouter
A trait defining behavior for routing an OnionMessage.

Functions§

create_onion_message
Creates an OnionMessage with the given contents for sending to the destination of path.
create_onion_message_resolving_destination
Creates an OnionMessage with the given contents for sending to the destination of path, first calling Destination::resolve on path.destination with the given ReadOnlyNetworkGraph.
peel_onion_message
Decode one layer of an incoming OnionMessage.

Type Aliases§

SimpleArcOnionMessenger
Useful for simplifying the parameters of SimpleArcChannelManager and SimpleArcPeerManager. See their docs for more details.
SimpleRefOnionMessenger
Useful for simplifying the parameters of SimpleRefChannelManager and SimpleRefPeerManager. See their docs for more details.