client: expose creating `RpcClient`s with custom `RpcSender` impls
This commit is contained in:
parent
f0a235d16f
commit
6666f23c01
|
@ -163,7 +163,7 @@ impl RpcClient {
|
||||||
/// `RpcSender`. Most applications should use one of the other constructors,
|
/// `RpcSender`. Most applications should use one of the other constructors,
|
||||||
/// such as [`new`] and [`new_mock`], which create an `RpcClient`
|
/// such as [`new`] and [`new_mock`], which create an `RpcClient`
|
||||||
/// encapsulating an [`HttpSender`] and [`MockSender`] respectively.
|
/// encapsulating an [`HttpSender`] and [`MockSender`] respectively.
|
||||||
fn new_sender<T: RpcSender + Send + Sync + 'static>(
|
pub fn new_sender<T: RpcSender + Send + Sync + 'static>(
|
||||||
sender: T,
|
sender: T,
|
||||||
config: RpcClientConfig,
|
config: RpcClientConfig,
|
||||||
) -> Self {
|
) -> Self {
|
||||||
|
|
|
@ -29,7 +29,7 @@ pub struct RpcTransportStats {
|
||||||
/// [`HttpSender`]: crate::http_sender::HttpSender
|
/// [`HttpSender`]: crate::http_sender::HttpSender
|
||||||
/// [`MockSender`]: crate::mock_sender::MockSender
|
/// [`MockSender`]: crate::mock_sender::MockSender
|
||||||
#[async_trait]
|
#[async_trait]
|
||||||
pub(crate) trait RpcSender {
|
pub trait RpcSender {
|
||||||
async fn send(
|
async fn send(
|
||||||
&self,
|
&self,
|
||||||
request: RpcRequest,
|
request: RpcRequest,
|
||||||
|
|
Loading…
Reference in New Issue