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