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§
- Default
Message Router - A
MessageRouter
that can only route to a directly connectedDestination
. - Onion
Message Path - A path for sending an
OnionMessage
. - Onion
Messenger - A sender, receiver and forwarder of
OnionMessage
s. - Responder
- The
Responder
struct creates an appropriateResponseInstruction
for responding to a message. - Response
Instruction - Instructions for how and where to send the response to an onion message.
Enums§
- Destination
- The destination of an onion message.
- Message
Send Instructions - Instructions for how and where to send a message.
- Peeled
Onion - A processed incoming onion message, containing either a Forward (another onion message) or a Receive payload with decrypted contents.
- Send
Error - Errors that may occur when sending an onion message.
- Send
Success - Result of successfully sending an onion message.
Traits§
- AOnion
Messenger - A trivial trait which describes any
OnionMessenger
. - Custom
Onion Message Handler - Handler for custom onion messages. If you are using
SimpleArcOnionMessenger
,SimpleRefOnionMessenger
, or prefer to ignore inbound custom onion messages,IgnoringMessageHandler
must be provided toOnionMessenger::new
. Otherwise, a custom implementation of this trait must be provided, withCustomMessage
specifying the supported message types. - Message
Router - A trait defining behavior for routing an
OnionMessage
.
Functions§
- create_
onion_ message - Creates an
OnionMessage
with the givencontents
for sending to the destination ofpath
. - create_
onion_ message_ resolving_ destination - Creates an
OnionMessage
with the givencontents
for sending to the destination ofpath
, first callingDestination::resolve
onpath.destination
with the givenReadOnlyNetworkGraph
. - peel_
onion_ message - Decode one layer of an incoming
OnionMessage
.
Type Aliases§
- Simple
ArcOnion Messenger - Useful for simplifying the parameters of
SimpleArcChannelManager
andSimpleArcPeerManager
. See their docs for more details. - Simple
RefOnion Messenger - Useful for simplifying the parameters of
SimpleRefChannelManager
andSimpleRefPeerManager
. See their docs for more details.