@@ -34,7 +34,7 @@ use crate::chain::transaction::OutPoint;
3434use crate :: ln:: types:: ChannelId ;
3535use crate :: sign:: { ecdsa:: EcdsaChannelSigner , EntropySource , SignerProvider } ;
3636use crate :: sync:: Mutex ;
37- use crate :: util:: async_poll:: { dummy_waker, MaybeSend , MaybeSync } ;
37+ use crate :: util:: async_poll:: { dummy_waker, AsyncResult , MaybeSend , MaybeSync } ;
3838use crate :: util:: logger:: Logger ;
3939use crate :: util:: native_async:: FutureSpawner ;
4040use crate :: util:: ser:: { Readable , ReadableArgs , Writeable } ;
@@ -160,31 +160,31 @@ where
160160{
161161 fn read (
162162 & self , primary_namespace : & str , secondary_namespace : & str , key : & str ,
163- ) -> Pin < Box < dyn Future < Output = Result < Vec < u8 > , io:: Error > > + ' static + Send > > {
163+ ) -> AsyncResult < ' static , Vec < u8 > , io:: Error > {
164164 let res = self . 0 . read ( primary_namespace, secondary_namespace, key) ;
165165
166166 Box :: pin ( async move { res } )
167167 }
168168
169169 fn write (
170170 & self , primary_namespace : & str , secondary_namespace : & str , key : & str , buf : Vec < u8 > ,
171- ) -> Pin < Box < dyn Future < Output = Result < ( ) , io:: Error > > + ' static + Send > > {
171+ ) -> AsyncResult < ' static , ( ) , io:: Error > {
172172 let res = self . 0 . write ( primary_namespace, secondary_namespace, key, buf) ;
173173
174174 Box :: pin ( async move { res } )
175175 }
176176
177177 fn remove (
178178 & self , primary_namespace : & str , secondary_namespace : & str , key : & str ,
179- ) -> Pin < Box < dyn Future < Output = Result < ( ) , io:: Error > > + ' static + Send > > {
179+ ) -> AsyncResult < ' static , ( ) , io:: Error > {
180180 let res = self . 0 . remove ( primary_namespace, secondary_namespace, key) ;
181181
182182 Box :: pin ( async move { res } )
183183 }
184184
185185 fn list (
186186 & self , primary_namespace : & str , secondary_namespace : & str ,
187- ) -> Pin < Box < dyn Future < Output = Result < Vec < String > , io:: Error > > + ' static + Send > > {
187+ ) -> AsyncResult < ' static , Vec < String > , io:: Error > {
188188 let res = self . 0 . list ( primary_namespace, secondary_namespace) ;
189189
190190 Box :: pin ( async move { res } )
@@ -222,7 +222,7 @@ pub trait KVStore {
222222 /// [`ErrorKind::NotFound`]: io::ErrorKind::NotFound
223223 fn read (
224224 & self , primary_namespace : & str , secondary_namespace : & str , key : & str ,
225- ) -> Pin < Box < dyn Future < Output = Result < Vec < u8 > , io:: Error > > + ' static + Send > > ;
225+ ) -> AsyncResult < ' static , Vec < u8 > , io:: Error > ;
226226 /// Persists the given data under the given `key`.
227227 ///
228228 /// The order of multiple writes to the same key needs to be retained while persisting
@@ -242,23 +242,23 @@ pub trait KVStore {
242242 /// Will create the given `primary_namespace` and `secondary_namespace` if not already present in the store.
243243 fn write (
244244 & self , primary_namespace : & str , secondary_namespace : & str , key : & str , buf : Vec < u8 > ,
245- ) -> Pin < Box < dyn Future < Output = Result < ( ) , io:: Error > > + ' static + Send > > ;
245+ ) -> AsyncResult < ' static , ( ) , io:: Error > ;
246246 /// Removes any data that had previously been persisted under the given `key`.
247247 ///
248248 /// Returns successfully if no data will be stored for the given `primary_namespace`,
249249 /// `secondary_namespace`, and `key`, independently of whether it was present before its
250250 /// invokation or not.
251251 fn remove (
252252 & self , primary_namespace : & str , secondary_namespace : & str , key : & str ,
253- ) -> Pin < Box < dyn Future < Output = Result < ( ) , io:: Error > > + ' static + Send > > ;
253+ ) -> AsyncResult < ' static , ( ) , io:: Error > ;
254254 /// Returns a list of keys that are stored under the given `secondary_namespace` in
255255 /// `primary_namespace`.
256256 ///
257257 /// Returns the keys in arbitrary order, so users requiring a particular order need to sort the
258258 /// returned keys. Returns an empty list if `primary_namespace` or `secondary_namespace` is unknown.
259259 fn list (
260260 & self , primary_namespace : & str , secondary_namespace : & str ,
261- ) -> Pin < Box < dyn Future < Output = Result < Vec < String > , io:: Error > > + ' static + Send > > ;
261+ ) -> AsyncResult < ' static , Vec < String > , io:: Error > ;
262262}
263263
264264/// Provides additional interface methods that are required for [`KVStore`]-to-[`KVStore`]
0 commit comments