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
MessageRouterthat can only route to a directly connectedDestination. - Onion
Message Path - A path for sending an
OnionMessage. - Onion
Messenger - A sender, receiver and forwarder of
OnionMessages. - Responder
- The
Responderstruct creates an appropriateResponseInstructionfor 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,IgnoringMessageHandlermust be provided toOnionMessenger::new. Otherwise, a custom implementation of this trait must be provided, withCustomMessagespecifying the supported message types. - Message
Router - A trait defining behavior for routing an
OnionMessage.
Functions§
- create_
onion_ message - Creates an
OnionMessagewith the givencontentsfor sending to the destination ofpath. - create_
onion_ message_ resolving_ destination - Creates an
OnionMessagewith the givencontentsfor sending to the destination ofpath, first callingDestination::resolveonpath.destinationwith the givenReadOnlyNetworkGraph. - peel_
onion_ message - Decode one layer of an incoming
OnionMessage.
Type Aliases§
- Simple
ArcOnion Messenger - Useful for simplifying the parameters of
SimpleArcChannelManagerandSimpleArcPeerManager. See their docs for more details. - Simple
RefOnion Messenger - Useful for simplifying the parameters of
SimpleRefChannelManagerandSimpleRefPeerManager. See their docs for more details.