@@ -74,6 +74,7 @@ use iroh::NodeAddr;
7474use portable_atomic:: { AtomicU64 , Ordering } ;
7575use quic_rpc:: {
7676 client:: { BoxStreamSync , BoxedConnector } ,
77+ transport:: boxed:: BoxableConnector ,
7778 Connector , RpcClient ,
7879} ;
7980use serde:: { Deserialize , Serialize } ;
@@ -87,7 +88,7 @@ use crate::{
8788 format:: collection:: { Collection , SimpleStore } ,
8889 get:: db:: DownloadProgress as BytesDownloadProgress ,
8990 net_protocol:: BlobDownloadRequest ,
90- rpc:: proto:: RpcService ,
91+ rpc:: proto:: { Request , Response , RpcService } ,
9192 store:: { BaoBlobSize , ConsistencyCheckProgress , ExportFormat , ExportMode , ValidateProgress } ,
9293 util:: SetTagOption ,
9394 BlobFormat , Hash , Tag ,
@@ -108,7 +109,7 @@ use crate::rpc::proto::blobs::{
108109#[ derive( Debug , Clone ) ]
109110#[ repr( transparent) ]
110111pub struct Client < C = BoxedConnector < RpcService > > {
111- pub ( super ) rpc : RpcClient < RpcService , C > ,
112+ pub ( crate ) rpc : RpcClient < RpcService , C > ,
112113}
113114
114115/// Type alias for a memory-backed client.
@@ -123,6 +124,14 @@ where
123124 Self { rpc }
124125 }
125126
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+
126135 /// Get a tags client.
127136 pub fn tags ( & self ) -> tags:: Client < C > {
128137 tags:: Client :: new ( self . rpc . clone ( ) )
0 commit comments