@@ -342,7 +342,7 @@ impl OnionMessageRecipient {
342
342
}
343
343
344
344
345
- /// The `Responder` struct creates an appropriate [`ResponseInstruction `]
345
+ /// The `Responder` struct creates an appropriate [`MessageSendInstructions `]
346
346
/// for responding to a message.
347
347
#[ derive( Clone , Debug , Eq , PartialEq ) ]
348
348
pub struct Responder {
@@ -362,42 +362,42 @@ impl Responder {
362
362
}
363
363
}
364
364
365
- /// Creates a [`ResponseInstruction ::WithoutReplyPath`] for a given response.
365
+ /// Creates a [`MessageSendInstructions ::WithoutReplyPath`] for a given response.
366
366
///
367
367
/// Use when the recipient doesn't need to send back a reply to us.
368
- pub fn respond < T : OnionMessageContents > ( self , response : T ) -> Option < ( T , ResponseInstruction ) > {
369
- Some ( ( response, ResponseInstruction :: WithoutReplyPath {
368
+ pub fn respond < T : OnionMessageContents > ( self , response : T ) -> Option < ( T , MessageSendInstructions ) > {
369
+ Some ( ( response, MessageSendInstructions :: WithoutReplyPath {
370
370
send_path : self . reply_path ,
371
371
} ) )
372
372
}
373
373
374
- /// Creates a [`ResponseInstruction ::WithReplyPath`] for a given response.
374
+ /// Creates a [`MessageSendInstructions ::WithReplyPath`] for a given response.
375
375
///
376
376
/// Use when the recipient needs to send back a reply to us.
377
- pub fn respond_with_reply_path < T : OnionMessageContents > ( self , response : T , context : MessageContext ) -> Option < ( T , ResponseInstruction ) > {
378
- Some ( ( response, ResponseInstruction :: WithReplyPath {
377
+ pub fn respond_with_reply_path < T : OnionMessageContents > ( self , response : T , context : MessageContext ) -> Option < ( T , MessageSendInstructions ) > {
378
+ Some ( ( response, MessageSendInstructions :: WithReplyPath {
379
379
send_path : self . reply_path ,
380
380
context : context,
381
381
} ) )
382
382
}
383
383
}
384
384
385
- /// `ResponseInstruction` represents instructions for responding to received messages .
385
+ /// Instructions for how and where to send a message .
386
386
#[ derive( Clone ) ]
387
- pub enum ResponseInstruction {
388
- /// Indicates that a response should be sent including a reply path for
389
- /// the recipient to respond back .
387
+ pub enum MessageSendInstructions {
388
+ /// Indicates that a message should be sent including a reply path for the recipient to
389
+ /// respond.
390
390
WithReplyPath {
391
- /// The path over which we'll send our reply .
391
+ /// The desination where we need to send our message .
392
392
send_path : BlindedMessagePath ,
393
393
/// The context to include in the reply path we'll give the recipient so they can respond
394
394
/// to us.
395
395
context : MessageContext ,
396
396
} ,
397
- /// Indicates that a response should be sent without including a reply path
398
- /// for the recipient to respond back .
397
+ /// Indicates that a emssage should be sent without including a reply path, preventing the
398
+ /// recipient from responding .
399
399
WithoutReplyPath {
400
- /// The path over which we'll send our reply .
400
+ /// The desination where we need to send our message .
401
401
send_path : BlindedMessagePath ,
402
402
}
403
403
}
@@ -802,7 +802,7 @@ pub trait CustomOnionMessageHandler {
802
802
/// The returned [`Self::CustomMessage`], if any, is enqueued to be sent by [`OnionMessenger`].
803
803
fn handle_custom_message (
804
804
& self , message : Self :: CustomMessage , context : Option < Vec < u8 > > , responder : Option < Responder >
805
- ) -> Option < ( Self :: CustomMessage , ResponseInstruction ) > ;
805
+ ) -> Option < ( Self :: CustomMessage , MessageSendInstructions ) > ;
806
806
807
807
/// Read a custom message of type `message_type` from `buffer`, returning `Ok(None)` if the
808
808
/// message type is unknown.
@@ -1313,7 +1313,7 @@ where
1313
1313
)
1314
1314
}
1315
1315
1316
- /// Handles the response to an [`OnionMessage`] based on its [`ResponseInstruction `],
1316
+ /// Handles the response to an [`OnionMessage`] based on its [`MessageSendInstructions `],
1317
1317
/// enqueueing any response for sending.
1318
1318
///
1319
1319
/// This function is useful for asynchronous handling of [`OnionMessage`]s.
@@ -1322,11 +1322,11 @@ where
1322
1322
/// generating the response asynchronously. Subsequently, when the response is prepared and
1323
1323
/// ready for sending, that task can invoke this method to enqueue the response for delivery.
1324
1324
pub fn handle_onion_message_response < T : OnionMessageContents > (
1325
- & self , response_message : T , response : ResponseInstruction ,
1325
+ & self , response_message : T , response : MessageSendInstructions ,
1326
1326
) -> Result < Option < SendSuccess > , SendError > {
1327
1327
let ( response_path, context) = match response {
1328
- ResponseInstruction :: WithReplyPath { send_path, context } => ( send_path, Some ( context) ) ,
1329
- ResponseInstruction :: WithoutReplyPath { send_path } => ( send_path, None ) ,
1328
+ MessageSendInstructions :: WithReplyPath { send_path, context } => ( send_path, Some ( context) ) ,
1329
+ MessageSendInstructions :: WithoutReplyPath { send_path } => ( send_path, None ) ,
1330
1330
} ;
1331
1331
1332
1332
let message_type = response_message. msg_type ( ) ;
0 commit comments