@@ -16,7 +16,7 @@ use bitcoin::{BlockHash, Txid};
16
16
17
17
use crate :: { io, log_error} ;
18
18
use crate :: alloc:: string:: ToString ;
19
- use crate :: prelude:: { Vec , String } ;
19
+ use crate :: prelude:: * ;
20
20
21
21
use crate :: chain;
22
22
use crate :: chain:: chaininterface:: { BroadcasterInterface , FeeEstimator } ;
@@ -98,11 +98,11 @@ pub trait KVStore {
98
98
/// `namespace` and `sub_namespace`.
99
99
///
100
100
/// [`ErrorKind::NotFound`]: io::ErrorKind::NotFound
101
- fn read ( & self , namespace : & str , sub_namespace : & str , key : & str ) -> io :: Result < Vec < u8 > > ;
101
+ fn read ( & self , namespace : & str , sub_namespace : & str , key : & str ) -> Result < Vec < u8 > , io :: Error > ;
102
102
/// Persists the given data under the given `key`.
103
103
///
104
104
/// Will create the given `namespace` and `sub_namespace` if not already present in the store.
105
- fn write ( & self , namespace : & str , sub_namespace : & str , key : & str , buf : & [ u8 ] ) -> io :: Result < ( ) > ;
105
+ fn write ( & self , namespace : & str , sub_namespace : & str , key : & str , buf : & [ u8 ] ) -> Result < ( ) , io :: Error > ;
106
106
/// Removes any data that had previously been persisted under the given `key`.
107
107
///
108
108
/// If the `lazy` flag is set to `true`, the backend implementation might choose to lazily
@@ -117,12 +117,12 @@ pub trait KVStore {
117
117
///
118
118
/// Returns successfully if no data will be stored for the given `namespace`, `sub_namespace`, and
119
119
/// `key`, independently of whether it was present before its invokation or not.
120
- fn remove ( & self , namespace : & str , sub_namespace : & str , key : & str , lazy : bool ) -> io :: Result < ( ) > ;
120
+ fn remove ( & self , namespace : & str , sub_namespace : & str , key : & str , lazy : bool ) -> Result < ( ) , io :: Error > ;
121
121
/// Returns a list of keys that are stored under the given `sub_namespace` in `namespace`.
122
122
///
123
123
/// Returns the keys in arbitrary order, so users requiring a particular order need to sort the
124
124
/// returned keys. Returns an empty list if `namespace` or `sub_namespace` is unknown.
125
- fn list ( & self , namespace : & str , sub_namespace : & str ) -> io :: Result < Vec < String > > ;
125
+ fn list ( & self , namespace : & str , sub_namespace : & str ) -> Result < Vec < String > , io :: Error > ;
126
126
}
127
127
128
128
/// Trait that handles persisting a [`ChannelManager`], [`NetworkGraph`], and [`WriteableScore`] to disk.
0 commit comments