@@ -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.
@@ -216,7 +216,7 @@ impl<ChannelSigner: WriteableEcdsaChannelSigner, K: KVStore> Persist<ChannelSign
216
216
/// Read previously persisted [`ChannelMonitor`]s from the store.
217
217
pub fn read_channel_monitors < K : Deref , ES : Deref , SP : Deref > (
218
218
kv_store : K , entropy_source : ES , signer_provider : SP ,
219
- ) -> io :: Result < Vec < ( BlockHash , ChannelMonitor < <SP :: Target as SignerProvider >:: Signer > ) > >
219
+ ) -> Result < Vec < ( BlockHash , ChannelMonitor < <SP :: Target as SignerProvider >:: Signer > ) > , io :: Error >
220
220
where
221
221
K :: Target : KVStore ,
222
222
ES :: Target : EntropySource + Sized ,
@@ -403,7 +403,7 @@ where
403
403
/// documentation for [`MonitorUpdatingPersister`].
404
404
pub fn read_all_channel_monitors_with_updates < B : Deref , F : Deref + Clone > (
405
405
& self , broadcaster : B , fee_estimator : F ,
406
- ) -> io :: Result < Vec < ( BlockHash , ChannelMonitor < <SP :: Target as SignerProvider >:: Signer > ) > >
406
+ ) -> Result < Vec < ( BlockHash , ChannelMonitor < <SP :: Target as SignerProvider >:: Signer > ) > , io :: Error >
407
407
where
408
408
ES :: Target : EntropySource + Sized ,
409
409
SP :: Target : SignerProvider + Sized ,
@@ -435,7 +435,7 @@ where
435
435
/// function to accomplish this. Take care to limit the number of parallel readers.
436
436
pub fn read_channel_monitor_with_updates < B : Deref , F : Deref + Clone > (
437
437
& self , broadcaster : B , fee_estimator : F , monitor_key : String ,
438
- ) -> io :: Result < ( BlockHash , ChannelMonitor < <SP :: Target as SignerProvider >:: Signer > ) >
438
+ ) -> Result < ( BlockHash , ChannelMonitor < <SP :: Target as SignerProvider >:: Signer > ) , io :: Error >
439
439
where
440
440
ES :: Target : EntropySource + Sized ,
441
441
SP :: Target : SignerProvider + Sized ,
@@ -478,7 +478,7 @@ where
478
478
/// Read a channel monitor.
479
479
fn read_monitor (
480
480
& self , monitor_name : & MonitorName ,
481
- ) -> io :: Result < ( BlockHash , ChannelMonitor < <SP :: Target as SignerProvider >:: Signer > ) > {
481
+ ) -> Result < ( BlockHash , ChannelMonitor < <SP :: Target as SignerProvider >:: Signer > ) , io :: Error > {
482
482
let outpoint: OutPoint = monitor_name. try_into ( ) ?;
483
483
let mut monitor_cursor = io:: Cursor :: new ( self . kv_store . read (
484
484
CHANNEL_MONITOR_PERSISTENCE_NAMESPACE ,
@@ -525,7 +525,7 @@ where
525
525
/// Read a channel monitor update.
526
526
fn read_monitor_update (
527
527
& self , monitor_name : & MonitorName , update_name : & UpdateName ,
528
- ) -> io :: Result < ChannelMonitorUpdate > {
528
+ ) -> Result < ChannelMonitorUpdate , io :: Error > {
529
529
let update_bytes = self . kv_store . read (
530
530
CHANNEL_MONITOR_UPDATE_PERSISTENCE_NAMESPACE ,
531
531
monitor_name. as_str ( ) ,
@@ -550,7 +550,7 @@ where
550
550
/// updates. The updates that have an `update_id` less than or equal to than the stored monitor
551
551
/// are deleted. The deletion can either be lazy or non-lazy based on the `lazy` flag; this will
552
552
/// be passed to [`KVStore::remove`].
553
- pub fn cleanup_stale_updates ( & self , lazy : bool ) -> io :: Result < ( ) > {
553
+ pub fn cleanup_stale_updates ( & self , lazy : bool ) -> Result < ( ) , io :: Error > {
554
554
let monitor_keys = self . kv_store . list (
555
555
CHANNEL_MONITOR_PERSISTENCE_NAMESPACE ,
556
556
CHANNEL_MONITOR_PERSISTENCE_SUB_NAMESPACE ,
0 commit comments