Skip to content
This repository was archived by the owner on Jan 6, 2025. It is now read-only.

Commit 91a3974

Browse files
clarify docs
1 parent 5c7c78d commit 91a3974

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

src/transport/message_handler.rs

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@ use std::sync::{Arc, Mutex};
1717

1818
const LSPS_FEATURE_BIT: usize = 729;
1919

20-
/// A trait used to implement a specific LSPS protocol
20+
/// A trait used to implement a specific LSPS protocol.
21+
///
2122
/// The messages the protocol uses need to be able to be mapped
22-
/// from and into LSPSMessages.
23+
/// from and into [`LSPSMessage`].
2324
pub(crate) trait ProtocolMessageHandler {
2425
type ProtocolMessage: TryFrom<LSPSMessage> + Into<LSPSMessage>;
2526
const PROTOCOL_NUMBER: Option<u16>;
@@ -29,14 +30,19 @@ pub(crate) trait ProtocolMessageHandler {
2930
) -> Result<(), LightningError>;
3031
}
3132

32-
/// Configuration for the LSPManager
33-
/// Allows end-user to configure the behavior of the client
33+
/// A configuration for [`LSPManager`].
34+
///
35+
/// Allows end-user to configure options for both client and server
36+
/// usage of the [`LSPManager`].
3437
pub struct LSPConfig {
35-
/// whether or not you intend to provide services
38+
/// Indicates whether or not you intend to provide services.
3639
is_lsp: bool,
3740
}
3841

39-
/// The main interface into LSP functionality
42+
/// The main interface into LSP functionality.
43+
///
44+
/// Should be used as a [`CustomMessageHandler`] for your
45+
/// [`lightning::ln::peer_handler::PeerManager`]'s [`lightning::ln::peer_handler::MessageHandler`].
4046
pub struct LSPManager<ES: Deref>
4147
where
4248
ES::Target: EntropySource,
@@ -53,7 +59,7 @@ where
5359
{
5460
/// Constructor for the LSPManager
5561
///
56-
/// Sets up all required protocol message handlers based on configuration passed in
62+
/// Sets up the required protocol message handlers based on the given [`LSPConfig`].
5763
pub fn new(entropy_source: ES, config: LSPConfig) -> Self {
5864
let pending_messages = Arc::new(Mutex::new(vec![]));
5965

0 commit comments

Comments
 (0)