From 6666f23c01db4610975d004cf8430f53ec641d63 Mon Sep 17 00:00:00 2001 From: Trent Nelson Date: Mon, 28 Feb 2022 11:49:37 -0700 Subject: [PATCH] client: expose creating `RpcClient`s with custom `RpcSender` impls --- client/src/rpc_client.rs | 2 +- client/src/rpc_sender.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client/src/rpc_client.rs b/client/src/rpc_client.rs index ee1a311093..152a78e59a 100644 --- a/client/src/rpc_client.rs +++ b/client/src/rpc_client.rs @@ -163,7 +163,7 @@ impl RpcClient { /// `RpcSender`. Most applications should use one of the other constructors, /// such as [`new`] and [`new_mock`], which create an `RpcClient` /// encapsulating an [`HttpSender`] and [`MockSender`] respectively. - fn new_sender( + pub fn new_sender( sender: T, config: RpcClientConfig, ) -> Self { diff --git a/client/src/rpc_sender.rs b/client/src/rpc_sender.rs index c71f17d730..68b71dc2ef 100644 --- a/client/src/rpc_sender.rs +++ b/client/src/rpc_sender.rs @@ -29,7 +29,7 @@ pub struct RpcTransportStats { /// [`HttpSender`]: crate::http_sender::HttpSender /// [`MockSender`]: crate::mock_sender::MockSender #[async_trait] -pub(crate) trait RpcSender { +pub trait RpcSender { async fn send( &self, request: RpcRequest,