@@ -74,6 +74,7 @@ use iroh::NodeAddr;
74
74
use portable_atomic:: { AtomicU64 , Ordering } ;
75
75
use quic_rpc:: {
76
76
client:: { BoxStreamSync , BoxedConnector } ,
77
+ transport:: boxed:: BoxableConnector ,
77
78
Connector , RpcClient ,
78
79
} ;
79
80
use serde:: { Deserialize , Serialize } ;
@@ -87,7 +88,7 @@ use crate::{
87
88
format:: collection:: { Collection , SimpleStore } ,
88
89
get:: db:: DownloadProgress as BytesDownloadProgress ,
89
90
net_protocol:: BlobDownloadRequest ,
90
- rpc:: proto:: RpcService ,
91
+ rpc:: proto:: { Request , Response , RpcService } ,
91
92
store:: { BaoBlobSize , ConsistencyCheckProgress , ExportFormat , ExportMode , ValidateProgress } ,
92
93
util:: SetTagOption ,
93
94
BlobFormat , Hash , Tag ,
@@ -108,7 +109,7 @@ use crate::rpc::proto::blobs::{
108
109
#[ derive( Debug , Clone ) ]
109
110
#[ repr( transparent) ]
110
111
pub struct Client < C = BoxedConnector < RpcService > > {
111
- pub ( super ) rpc : RpcClient < RpcService , C > ,
112
+ pub ( crate ) rpc : RpcClient < RpcService , C > ,
112
113
}
113
114
114
115
/// Type alias for a memory-backed client.
@@ -123,6 +124,14 @@ where
123
124
Self { rpc }
124
125
}
125
126
127
+ /// Box the client to avoid having to provide the connector type.
128
+ pub fn boxed ( & self ) -> Client < BoxedConnector < RpcService > >
129
+ where
130
+ C : BoxableConnector < Response , Request > ,
131
+ {
132
+ Client :: new ( self . rpc . clone ( ) . boxed ( ) )
133
+ }
134
+
126
135
/// Get a tags client.
127
136
pub fn tags ( & self ) -> tags:: Client < C > {
128
137
tags:: Client :: new ( self . rpc . clone ( ) )
0 commit comments