File tree Expand file tree Collapse file tree 3 files changed +6
-8
lines changed Expand file tree Collapse file tree 3 files changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ use std::io;
26
26
/// [`KVStore`]: ldk_node::lightning::util::persist::KVStore
27
27
/// [`KVSTORE_NAMESPACE_KEY_ALPHABET`]: ldk_node::lightning::util::persist::KVSTORE_NAMESPACE_KEY_ALPHABET
28
28
/// [`KVSTORE_NAMESPACE_KEY_MAX_LEN`]: ldk_node::lightning::util::persist::KVSTORE_NAMESPACE_KEY_MAX_LEN
29
- pub trait PaginatedKVStore {
29
+ pub trait PaginatedKVStore : Send + Sync {
30
30
/// Returns the data stored for the given `primary_namespace`, `secondary_namespace`, and `key`.
31
31
///
32
32
/// Returns an [`ErrorKind::NotFound`] if the given `key` could not be found in the given
Original file line number Diff line number Diff line change @@ -92,7 +92,7 @@ fn main() {
92
92
} ,
93
93
} ;
94
94
95
- let paginated_store =
95
+ let paginated_store: Arc < dyn PaginatedKVStore > =
96
96
Arc :: new ( match SqliteStore :: new ( PathBuf :: from ( config_file. storage_dir_path ) , None , None ) {
97
97
Ok ( store) => store,
98
98
Err ( e) => {
@@ -240,7 +240,7 @@ fn main() {
240
240
match res {
241
241
Ok ( ( stream, _) ) => {
242
242
let io_stream = TokioIo :: new( stream) ;
243
- let node_service = NodeService :: new( Arc :: clone( & node) , Arc :: clone( & paginated_store) as Arc <dyn PaginatedKVStore + Send + Sync > ) ;
243
+ let node_service = NodeService :: new( Arc :: clone( & node) , Arc :: clone( & paginated_store) ) ;
244
244
runtime. spawn( async move {
245
245
if let Err ( err) = http1:: Builder :: new( ) . serve_connection( io_stream, node_service) . await {
246
246
eprintln!( "Failed to serve connection: {}" , err) ;
Original file line number Diff line number Diff line change @@ -39,20 +39,18 @@ use std::sync::Arc;
39
39
#[ derive( Clone ) ]
40
40
pub struct NodeService {
41
41
node : Arc < Node > ,
42
- paginated_kv_store : Arc < dyn PaginatedKVStore + Send + Sync > ,
42
+ paginated_kv_store : Arc < dyn PaginatedKVStore > ,
43
43
}
44
44
45
45
impl NodeService {
46
- pub ( crate ) fn new (
47
- node : Arc < Node > , paginated_kv_store : Arc < dyn PaginatedKVStore + Send + Sync > ,
48
- ) -> Self {
46
+ pub ( crate ) fn new ( node : Arc < Node > , paginated_kv_store : Arc < dyn PaginatedKVStore > ) -> Self {
49
47
Self { node, paginated_kv_store }
50
48
}
51
49
}
52
50
53
51
pub ( crate ) struct Context {
54
52
pub ( crate ) node : Arc < Node > ,
55
- pub ( crate ) paginated_kv_store : Arc < dyn PaginatedKVStore + Send + Sync > ,
53
+ pub ( crate ) paginated_kv_store : Arc < dyn PaginatedKVStore > ,
56
54
}
57
55
58
56
impl Service < Request < Incoming > > for NodeService {
You can’t perform that action at this time.
0 commit comments