Skip to content

Commit 2b3da10

Browse files
committed
fix: use discrete return types instead of impl
1 parent bb3a44a commit 2b3da10

File tree

1 file changed

+10
-16
lines changed
  • yellowstone-grpc-client/src

1 file changed

+10
-16
lines changed

yellowstone-grpc-client/src/lib.rs

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
pub use tonic::{service::Interceptor, transport::ClientTlsConfig};
22
use {
33
bytes::Bytes,
4-
futures::{
5-
channel::mpsc,
6-
sink::{Sink, SinkExt},
7-
stream::Stream,
8-
},
4+
futures::{channel::mpsc, sink::SinkExt},
95
std::time::Duration,
106
tonic::{
117
codec::{CompressionEncoding, Streaming},
@@ -88,9 +84,7 @@ impl<F: Interceptor> GeyserGrpcClient<F> {
8884
Ok(response.into_inner())
8985
}
9086

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>> {
9488
let request = HealthCheckRequest {
9589
service: "geyser.Geyser".to_owned(),
9690
};
@@ -102,8 +96,8 @@ impl<F: Interceptor> GeyserGrpcClient<F> {
10296
pub async fn subscribe(
10397
&mut self,
10498
) -> GeyserGrpcClientResult<(
105-
impl Sink<SubscribeRequest, Error = mpsc::SendError>,
106-
impl Stream<Item = Result<SubscribeUpdate, Status>>,
99+
mpsc::UnboundedSender<SubscribeRequest>,
100+
Streaming<SubscribeUpdate>,
107101
)> {
108102
self.subscribe_with_request(None).await
109103
}
@@ -112,8 +106,8 @@ impl<F: Interceptor> GeyserGrpcClient<F> {
112106
&mut self,
113107
request: Option<SubscribeRequest>,
114108
) -> GeyserGrpcClientResult<(
115-
impl Sink<SubscribeRequest, Error = mpsc::SendError>,
116-
impl Stream<Item = Result<SubscribeUpdate, Status>>,
109+
mpsc::UnboundedSender<SubscribeRequest>,
110+
Streaming<SubscribeUpdate>,
117111
)> {
118112
let (mut subscribe_tx, subscribe_rx) = mpsc::unbounded();
119113
if let Some(request) = request {
@@ -130,7 +124,7 @@ impl<F: Interceptor> GeyserGrpcClient<F> {
130124
pub async fn subscribe_once(
131125
&mut self,
132126
request: SubscribeRequest,
133-
) -> GeyserGrpcClientResult<impl Stream<Item = Result<SubscribeUpdate, Status>>> {
127+
) -> GeyserGrpcClientResult<Streaming<SubscribeUpdate>> {
134128
self.subscribe_with_request(Some(request))
135129
.await
136130
.map(|(_sink, stream)| stream)
@@ -244,7 +238,7 @@ impl GeyserGrpcBuilder {
244238
fn build(
245239
self,
246240
channel: Channel,
247-
) -> GeyserGrpcBuilderResult<GeyserGrpcClient<impl Interceptor>> {
241+
) -> GeyserGrpcBuilderResult<GeyserGrpcClient<InterceptorXToken>> {
248242
let interceptor = InterceptorXToken {
249243
x_token: self.x_token,
250244
x_request_snapshot: self.x_request_snapshot,
@@ -270,12 +264,12 @@ impl GeyserGrpcBuilder {
270264
))
271265
}
272266

273-
pub async fn connect(self) -> GeyserGrpcBuilderResult<GeyserGrpcClient<impl Interceptor>> {
267+
pub async fn connect(self) -> GeyserGrpcBuilderResult<GeyserGrpcClient<InterceptorXToken>> {
274268
let channel = self.endpoint.connect().await?;
275269
self.build(channel)
276270
}
277271

278-
pub fn connect_lazy(self) -> GeyserGrpcBuilderResult<GeyserGrpcClient<impl Interceptor>> {
272+
pub fn connect_lazy(self) -> GeyserGrpcBuilderResult<GeyserGrpcClient<InterceptorXToken>> {
279273
let channel = self.endpoint.connect_lazy();
280274
self.build(channel)
281275
}

0 commit comments

Comments
 (0)