@@ -17,9 +17,10 @@ use std::sync::{Arc, Mutex};
17
17
18
18
const LSPS_FEATURE_BIT : usize = 729 ;
19
19
20
- /// A trait used to implement a specific LSPS protocol
20
+ /// A trait used to implement a specific LSPS protocol.
21
+ ///
21
22
/// The messages the protocol uses need to be able to be mapped
22
- /// from and into LSPSMessages .
23
+ /// from and into [`LSPSMessage`] .
23
24
pub ( crate ) trait ProtocolMessageHandler {
24
25
type ProtocolMessage : TryFrom < LSPSMessage > + Into < LSPSMessage > ;
25
26
const PROTOCOL_NUMBER : Option < u16 > ;
@@ -29,14 +30,19 @@ pub(crate) trait ProtocolMessageHandler {
29
30
) -> Result < ( ) , LightningError > ;
30
31
}
31
32
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`].
34
37
pub struct LSPConfig {
35
- /// whether or not you intend to provide services
38
+ /// Indicates whether or not you intend to provide services.
36
39
is_lsp : bool ,
37
40
}
38
41
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`].
40
46
pub struct LSPManager < ES : Deref >
41
47
where
42
48
ES :: Target : EntropySource ,
53
59
{
54
60
/// Constructor for the LSPManager
55
61
///
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`].
57
63
pub fn new ( entropy_source : ES , config : LSPConfig ) -> Self {
58
64
let pending_messages = Arc :: new ( Mutex :: new ( vec ! [ ] ) ) ;
59
65
0 commit comments