@@ -3,10 +3,14 @@ use crate::client::transport::ConnectedTransport;
33use crate :: client:: transport:: Transport ;
44use crate :: client:: transport:: TransportOptions ;
55use crate :: codec:: BytesCodec ;
6+ use crate :: rt:: hyper_wrapper:: { HyperCompatExec , HyperCompatTimer , HyperStream } ;
7+ use crate :: rt:: Runtime ;
8+ use crate :: rt:: TaskHandle ;
69use crate :: rt:: TcpOptions ;
710use crate :: service:: Message ;
811use crate :: service:: Request as GrpcRequest ;
912use crate :: service:: Response as GrpcResponse ;
13+ use crate :: { client:: name_resolution:: TCP_IP_NETWORK_TYPE , service:: Service } ;
1014use bytes:: Bytes ;
1115use http:: uri:: PathAndQuery ;
1216use http:: Request as HttpRequest ;
@@ -15,40 +19,21 @@ use http::Uri;
1519use hyper:: client:: conn:: http2:: Builder ;
1620use hyper:: client:: conn:: http2:: SendRequest ;
1721use std:: any:: Any ;
22+ use std:: task:: { Context , Poll } ;
1823use std:: time:: Instant ;
19- use std:: {
20- error:: Error ,
21- future:: Future ,
22- net:: SocketAddr ,
23- pin:: Pin ,
24- str:: FromStr ,
25- sync:: Arc ,
26- task:: { Context , Poll } ,
27- } ;
24+ use std:: { error:: Error , future:: Future , net:: SocketAddr , pin:: Pin , str:: FromStr , sync:: Arc } ;
25+ use tokio:: sync:: oneshot;
2826use tokio_stream:: Stream ;
2927use tokio_stream:: StreamExt ;
28+ use tonic:: client:: GrpcService ;
3029use tonic:: Request as TonicRequest ;
3130use tonic:: Response as TonicResponse ;
3231use tonic:: Streaming ;
33- use tower:: {
34- buffer:: { future:: ResponseFuture as BufferResponseFuture , Buffer } ,
35- limit:: { ConcurrencyLimitLayer , RateLimitLayer } ,
36- util:: BoxService ,
37- ServiceBuilder ,
38- } ;
39- use tower_service:: Service as TowerService ;
40-
41- use crate :: {
42- client:: name_resolution:: TCP_IP_NETWORK_TYPE ,
43- rt:: {
44- self ,
45- hyper_wrapper:: { HyperCompatExec , HyperCompatTimer , HyperStream } ,
46- } ,
47- service:: Service ,
48- } ;
49- use tokio:: sync:: oneshot;
50- use tonic:: client:: GrpcService ;
5132use tonic:: { async_trait, body:: Body , client:: Grpc , Status } ;
33+ use tower:: buffer:: { future:: ResponseFuture as BufferResponseFuture , Buffer } ;
34+ use tower:: limit:: { ConcurrencyLimitLayer , RateLimitLayer } ;
35+ use tower:: { util:: BoxService , ServiceBuilder } ;
36+ use tower_service:: Service as TowerService ;
5237
5338#[ cfg( test) ]
5439mod test;
@@ -66,7 +51,7 @@ struct TransportBuilder {}
6651
6752struct TonicTransport {
6853 grpc : Grpc < TonicService > ,
69- task_handle : Box < dyn rt :: TaskHandle > ,
54+ task_handle : Box < dyn TaskHandle > ,
7055}
7156
7257impl Drop for TonicTransport {
@@ -139,7 +124,7 @@ impl Transport for TransportBuilder {
139124 async fn connect (
140125 & self ,
141126 address : String ,
142- runtime : Arc < dyn rt :: Runtime > ,
127+ runtime : Arc < dyn Runtime > ,
143128 opts : & TransportOptions ,
144129 ) -> Result < ConnectedTransport , String > {
145130 let runtime = runtime. clone ( ) ;
0 commit comments