1
1
pub use tonic:: { service:: Interceptor , transport:: ClientTlsConfig } ;
2
2
use {
3
3
bytes:: Bytes ,
4
- futures:: {
5
- channel:: mpsc,
6
- sink:: { Sink , SinkExt } ,
7
- stream:: Stream ,
8
- } ,
4
+ futures:: { channel:: mpsc, sink:: SinkExt } ,
9
5
std:: time:: Duration ,
10
6
tonic:: {
11
7
codec:: { CompressionEncoding , Streaming } ,
@@ -88,9 +84,7 @@ impl<F: Interceptor> GeyserGrpcClient<F> {
88
84
Ok ( response. into_inner ( ) )
89
85
}
90
86
91
- pub async fn health_watch (
92
- & mut self ,
93
- ) -> GeyserGrpcClientResult < impl Stream < Item = Result < HealthCheckResponse , Status > > > {
87
+ pub async fn health_watch ( & mut self ) -> GeyserGrpcClientResult < Streaming < HealthCheckResponse > > {
94
88
let request = HealthCheckRequest {
95
89
service : "geyser.Geyser" . to_owned ( ) ,
96
90
} ;
@@ -102,8 +96,8 @@ impl<F: Interceptor> GeyserGrpcClient<F> {
102
96
pub async fn subscribe (
103
97
& mut self ,
104
98
) -> GeyserGrpcClientResult < (
105
- impl Sink < SubscribeRequest , Error = mpsc:: SendError > ,
106
- impl Stream < Item = Result < SubscribeUpdate , Status > > ,
99
+ mpsc:: UnboundedSender < SubscribeRequest > ,
100
+ Streaming < SubscribeUpdate > ,
107
101
) > {
108
102
self . subscribe_with_request ( None ) . await
109
103
}
@@ -112,8 +106,8 @@ impl<F: Interceptor> GeyserGrpcClient<F> {
112
106
& mut self ,
113
107
request : Option < SubscribeRequest > ,
114
108
) -> GeyserGrpcClientResult < (
115
- impl Sink < SubscribeRequest , Error = mpsc:: SendError > ,
116
- impl Stream < Item = Result < SubscribeUpdate , Status > > ,
109
+ mpsc:: UnboundedSender < SubscribeRequest > ,
110
+ Streaming < SubscribeUpdate > ,
117
111
) > {
118
112
let ( mut subscribe_tx, subscribe_rx) = mpsc:: unbounded ( ) ;
119
113
if let Some ( request) = request {
@@ -130,7 +124,7 @@ impl<F: Interceptor> GeyserGrpcClient<F> {
130
124
pub async fn subscribe_once (
131
125
& mut self ,
132
126
request : SubscribeRequest ,
133
- ) -> GeyserGrpcClientResult < impl Stream < Item = Result < SubscribeUpdate , Status > > > {
127
+ ) -> GeyserGrpcClientResult < Streaming < SubscribeUpdate > > {
134
128
self . subscribe_with_request ( Some ( request) )
135
129
. await
136
130
. map ( |( _sink, stream) | stream)
@@ -244,7 +238,7 @@ impl GeyserGrpcBuilder {
244
238
fn build (
245
239
self ,
246
240
channel : Channel ,
247
- ) -> GeyserGrpcBuilderResult < GeyserGrpcClient < impl Interceptor > > {
241
+ ) -> GeyserGrpcBuilderResult < GeyserGrpcClient < InterceptorXToken > > {
248
242
let interceptor = InterceptorXToken {
249
243
x_token : self . x_token ,
250
244
x_request_snapshot : self . x_request_snapshot ,
@@ -270,12 +264,12 @@ impl GeyserGrpcBuilder {
270
264
) )
271
265
}
272
266
273
- pub async fn connect ( self ) -> GeyserGrpcBuilderResult < GeyserGrpcClient < impl Interceptor > > {
267
+ pub async fn connect ( self ) -> GeyserGrpcBuilderResult < GeyserGrpcClient < InterceptorXToken > > {
274
268
let channel = self . endpoint . connect ( ) . await ?;
275
269
self . build ( channel)
276
270
}
277
271
278
- pub fn connect_lazy ( self ) -> GeyserGrpcBuilderResult < GeyserGrpcClient < impl Interceptor > > {
272
+ pub fn connect_lazy ( self ) -> GeyserGrpcBuilderResult < GeyserGrpcClient < InterceptorXToken > > {
279
273
let channel = self . endpoint . connect_lazy ( ) ;
280
274
self . build ( channel)
281
275
}
0 commit comments