@@ -35,9 +35,21 @@ use crate::io;
35
35
use crate :: sync:: { Arc , Mutex } ;
36
36
use crate :: prelude:: * ;
37
37
38
- /// A sender, receiver and forwarder of onion messages. In upcoming releases, this object will be
39
- /// used to retrieve invoices and fulfill invoice requests from [offers]. Currently, only sending
40
- /// and receiving custom onion messages is supported.
38
+ /// A sender, receiver and forwarder of [`OnionMessage`]s.
39
+ ///
40
+ /// # Handling Messages
41
+ ///
42
+ /// `OnionMessenger` implements [`OnionMessageHandler`], making it responsible for either forwarding
43
+ /// messages to peers or delegating to the appropriate handler for the message type. Currently, the
44
+ /// available handlers are:
45
+ /// * [`OffersMessageHandler`], for responding to [`InvoiceRequest`]s and paying [`Bolt12Invoice`]s
46
+ /// * [`CustomOnionMessageHandler`], for handling user-defined message types
47
+ ///
48
+ /// # Sending Messages
49
+ ///
50
+ /// [`OnionMessage`]s are sent initially using [`OnionMessenger::send_onion_message`]. When handling
51
+ /// a message, the matched handler may return a response message which `OnionMessenger` will send
52
+ /// on its behalf.
41
53
///
42
54
/// # Example
43
55
///
@@ -121,8 +133,9 @@ use crate::prelude::*;
121
133
/// onion_messenger.send_onion_message(path, message, reply_path);
122
134
/// ```
123
135
///
124
- /// [offers]: <https://github.com/lightning/bolts/pull/798>
125
- /// [`OnionMessenger`]: crate::onion_message::OnionMessenger
136
+ /// [`OnionMessage`]: crate::ln::msgs::OnionMessage
137
+ /// [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
138
+ /// [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
126
139
pub struct OnionMessenger < ES : Deref , NS : Deref , L : Deref , MR : Deref , OMH : Deref , CMH : Deref >
127
140
where
128
141
ES :: Target : EntropySource ,
0 commit comments