@@ -64,6 +64,45 @@ pub struct LiquidityClientConfig {
64
64
pub lsps2_client_config : Option < LSPS2ClientConfig > ,
65
65
}
66
66
67
+ /// A trivial trait which describes any [`LiquidityManager`].
68
+ ///
69
+ /// This is not exported to bindings users as general cover traits aren't useful in other
70
+ /// languages.
71
+ pub trait ALiquidityManager {
72
+ /// A type implementing [`EntropySource`]
73
+ type EntropySource : EntropySource + ?Sized ;
74
+ /// A type that may be dereferenced to [`Self::EntropySource`].
75
+ type ES : Deref < Target = Self :: EntropySource > + Clone ;
76
+ /// A type implementing [`AChannelManager`]
77
+ type AChannelManager : AChannelManager + ?Sized ;
78
+ /// A type that may be dereferenced to [`Self::ChannelManager`].
79
+ type CM : Deref < Target = Self :: AChannelManager > + Clone ;
80
+ /// A type implementing [`Filter`].
81
+ type Filter : Filter + ?Sized ;
82
+ /// A type that may be dereferenced to [`Self::Filter`].
83
+ type C : Deref < Target = Self :: Filter > + Clone ;
84
+ /// Returns a reference to the actual [`LiquidityManager`] object.
85
+ fn get_lm ( & self ) -> & LiquidityManager < Self :: ES , Self :: CM , Self :: C > ;
86
+ }
87
+
88
+ impl < ES : Deref + Clone , CM : Deref + Clone , C : Deref + Clone > ALiquidityManager
89
+ for LiquidityManager < ES , CM , C >
90
+ where
91
+ ES :: Target : EntropySource ,
92
+ CM :: Target : AChannelManager ,
93
+ C :: Target : Filter ,
94
+ {
95
+ type EntropySource = ES :: Target ;
96
+ type ES = ES ;
97
+ type AChannelManager = CM :: Target ;
98
+ type CM = CM ;
99
+ type Filter = C :: Target ;
100
+ type C = C ;
101
+ fn get_lm ( & self ) -> & LiquidityManager < ES , CM , C > {
102
+ self
103
+ }
104
+ }
105
+
67
106
/// The main interface into LSP functionality.
68
107
///
69
108
/// Should be used as a [`CustomMessageHandler`] for your [`PeerManager`]'s [`MessageHandler`].
0 commit comments