@@ -74,7 +74,7 @@ use iroh_net::NodeAddr;
7474use portable_atomic:: { AtomicU64 , Ordering } ;
7575use quic_rpc:: {
7676 client:: { BoxStreamSync , BoxedServiceConnection } ,
77- RpcClient ,
77+ RpcClient , ServiceConnection ,
7878} ;
7979use serde:: { Deserialize , Serialize } ;
8080use tokio:: io:: { AsyncRead , AsyncReadExt , ReadBuf } ;
@@ -87,6 +87,7 @@ use crate::{
8787 format:: collection:: { Collection , SimpleStore } ,
8888 get:: db:: DownloadProgress as BytesDownloadProgress ,
8989 net_protocol:: BlobDownloadRequest ,
90+ rpc:: proto:: RpcService ,
9091 store:: { BaoBlobSize , ConsistencyCheckProgress , ExportFormat , ExportMode , ValidateProgress } ,
9192 util:: SetTagOption ,
9293 BlobFormat , Hash , Tag ,
@@ -105,16 +106,16 @@ use crate::rpc::proto::blobs::{
105106
106107/// Iroh blobs client.
107108#[ derive( Debug , Clone ) ]
108- pub struct Client < C = BoxedServiceConnection < crate :: rpc :: proto :: RpcService > > {
109- pub ( super ) rpc : RpcClient < crate :: rpc :: proto :: RpcService , C > ,
109+ pub struct Client < C = BoxedServiceConnection < RpcService > > {
110+ pub ( super ) rpc : RpcClient < RpcService , C > ,
110111}
111112
112113impl < C > Client < C >
113114where
114- C : quic_rpc :: ServiceConnection < crate :: rpc :: proto :: RpcService > ,
115+ C : ServiceConnection < RpcService > ,
115116{
116117 /// Create a new client
117- pub fn new ( rpc : RpcClient < crate :: rpc :: proto :: RpcService , C > ) -> Self {
118+ pub fn new ( rpc : RpcClient < RpcService , C > ) -> Self {
118119 Self { rpc }
119120 }
120121
@@ -460,7 +461,7 @@ where
460461
461462impl < C > SimpleStore for Client < C >
462463where
463- C : quic_rpc :: ServiceConnection < crate :: rpc :: proto :: RpcService > ,
464+ C : ServiceConnection < RpcService > ,
464465{
465466 async fn load ( & self , hash : Hash ) -> anyhow:: Result < Bytes > {
466467 self . read_to_bytes ( hash) . await
@@ -878,23 +879,23 @@ impl Reader {
878879
879880 /// todo make private again
880881 pub async fn from_rpc_read < C > (
881- rpc : & RpcClient < crate :: rpc :: proto :: RpcService , C > ,
882+ rpc : & RpcClient < RpcService , C > ,
882883 hash : Hash ,
883884 ) -> anyhow:: Result < Self >
884885 where
885- C : quic_rpc :: ServiceConnection < crate :: rpc :: proto :: RpcService > ,
886+ C : ServiceConnection < RpcService > ,
886887 {
887888 Self :: from_rpc_read_at ( rpc, hash, 0 , ReadAtLen :: All ) . await
888889 }
889890
890891 async fn from_rpc_read_at < C > (
891- rpc : & RpcClient < crate :: rpc :: proto :: RpcService , C > ,
892+ rpc : & RpcClient < RpcService , C > ,
892893 hash : Hash ,
893894 offset : u64 ,
894895 len : ReadAtLen ,
895896 ) -> anyhow:: Result < Self >
896897 where
897- C : quic_rpc :: ServiceConnection < crate :: rpc :: proto :: RpcService > ,
898+ C : ServiceConnection < RpcService > ,
898899 {
899900 let stream = rpc
900901 . server_streaming ( ReadAtRequest { hash, offset, len } )
@@ -1001,10 +1002,9 @@ mod tests {
10011002 util:: local_pool:: LocalPool ,
10021003 } ;
10031004
1004- type RpcClient = quic_rpc:: RpcClient <
1005- crate :: rpc:: proto:: RpcService ,
1006- BoxedServiceConnection < crate :: rpc:: proto:: RpcService > ,
1007- > ;
1005+ use super :: RpcService ;
1006+
1007+ type RpcClient = quic_rpc:: RpcClient < RpcService > ;
10081008
10091009 /// An iroh node that just has the blobs transport
10101010 #[ derive( Debug ) ]
@@ -1122,7 +1122,7 @@ mod tests {
11221122
11231123 // Setup RPC
11241124 let ( internal_rpc, controller) =
1125- quic_rpc:: transport:: flume:: service_connection :: < crate :: rpc :: proto :: RpcService > ( 32 ) ;
1125+ quic_rpc:: transport:: flume:: service_connection :: < RpcService > ( 32 ) ;
11261126 let controller = quic_rpc:: transport:: boxed:: Connection :: new ( controller) ;
11271127 let internal_rpc = quic_rpc:: transport:: boxed:: ServerEndpoint :: new ( internal_rpc) ;
11281128 let internal_rpc = quic_rpc:: RpcServer :: new ( internal_rpc) ;
0 commit comments