pub struct RpcClient<S, C = BoxedConnector<S>> { /* private fields */ }
Expand description
A client for a specific service
This is a wrapper around a Connector
that serves as the entry point
for the client DSL.
Type parameters:
S
is the service type that determines what interactions this client supports.
C
is the connector that determines the transport.
Implementations§
Source§impl<S, C> RpcClient<S, C>
impl<S, C> RpcClient<S, C>
Sourcepub fn into_inner(self) -> C
pub fn into_inner(self) -> C
Get the underlying connection
Sourcepub fn map<SNext>(
self,
) -> RpcClient<SNext, MappedConnector<SNext::Res, SNext::Req, C>>
pub fn map<SNext>( self, ) -> RpcClient<SNext, MappedConnector<SNext::Res, SNext::Req, C>>
Map this channel’s service into an inner service.
This method is available if the required bounds are upheld: SNext::Req: Into<S::Req> + TryFrom<S::Req>, SNext::Res: Into<S::Res> + TryFrom<S::Res>,
Where SNext is the new service to map to and S is the current inner service.
This method can be chained infintely.
Sourcepub fn boxed(self) -> RpcClient<S, BoxedConnector<S>>
pub fn boxed(self) -> RpcClient<S, BoxedConnector<S>>
box
Source§impl<S, C> RpcClient<S, C>
impl<S, C> RpcClient<S, C>
Sourcepub async fn bidi<M>(
&self,
msg: M,
) -> Result<(UpdateSink<C, M::Update>, BoxStreamSync<'static, Result<M::Response, ItemError<C>>>), Error<C>>where
M: BidiStreamingMsg<S>,
pub async fn bidi<M>(
&self,
msg: M,
) -> Result<(UpdateSink<C, M::Update>, BoxStreamSync<'static, Result<M::Response, ItemError<C>>>), Error<C>>where
M: BidiStreamingMsg<S>,
Bidi call to the server, request opens a stream, response is a stream
Source§impl<S, C> RpcClient<S, C>
impl<S, C> RpcClient<S, C>
Sourcepub async fn client_streaming<M>(
&self,
msg: M,
) -> Result<(UpdateSink<C, M::Update>, Boxed<Result<M::Response, ItemError<C>>>), Error<C>>where
M: ClientStreamingMsg<S>,
pub async fn client_streaming<M>(
&self,
msg: M,
) -> Result<(UpdateSink<C, M::Update>, Boxed<Result<M::Response, ItemError<C>>>), Error<C>>where
M: ClientStreamingMsg<S>,
Call to the server that allows the client to stream, single response
Source§impl<S, C> RpcClient<S, C>
impl<S, C> RpcClient<S, C>
Sourcepub async fn server_streaming<M>(
&self,
msg: M,
) -> Result<BoxStreamSync<'static, Result<M::Response, ItemError<C>>>, Error<C>>where
M: ServerStreamingMsg<S>,
pub async fn server_streaming<M>(
&self,
msg: M,
) -> Result<BoxStreamSync<'static, Result<M::Response, ItemError<C>>>, Error<C>>where
M: ServerStreamingMsg<S>,
Bidi call to the server, request opens a stream, response is a stream
Source§impl<S, C> RpcClient<S, C>
impl<S, C> RpcClient<S, C>
Sourcepub async fn try_server_streaming<M>(
&self,
msg: M,
) -> Result<BoxStreamSync<'static, Result<M::Item, ItemError<C, M::ItemError>>>, Error<C, M::CreateError>>where
M: TryServerStreamingMsg<S>,
Result<M::Item, M::ItemError>: Into<S::Res> + TryFrom<S::Res>,
Result<StreamCreated, M::CreateError>: Into<S::Res> + TryFrom<S::Res>,
pub async fn try_server_streaming<M>(
&self,
msg: M,
) -> Result<BoxStreamSync<'static, Result<M::Item, ItemError<C, M::ItemError>>>, Error<C, M::CreateError>>where
M: TryServerStreamingMsg<S>,
Result<M::Item, M::ItemError>: Into<S::Res> + TryFrom<S::Res>,
Result<StreamCreated, M::CreateError>: Into<S::Res> + TryFrom<S::Res>,
Bidi call to the server, request opens a stream, response is a stream