pub struct RpcClient<S, C = BoxedConnector<<S as Service>::Res, <S as Service>::Req>> { /* 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 as Service>::Res, <SNext as Service>::Req, C>>
pub fn map<SNext>( self, ) -> RpcClient<SNext, MappedConnector<<SNext as Service>::Res, <SNext as Service>::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.
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 as BidiStreamingMsg<S>>::Update>, Pin<Box<dyn Stream<Item = Result<<M as BidiStreamingMsg<S>>::Response, ItemError<C>>> + Send + Sync>>), Error<C>>where
M: BidiStreamingMsg<S>,
pub async fn bidi<M>(
&self,
msg: M,
) -> Result<(UpdateSink<C, <M as BidiStreamingMsg<S>>::Update>, Pin<Box<dyn Stream<Item = Result<<M as BidiStreamingMsg<S>>::Response, ItemError<C>>> + Send + Sync>>), 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 as ClientStreamingMsg<S>>::Update>, Pin<Box<dyn Future<Output = Result<<M as ClientStreamingMsg<S>>::Response, ItemError<C>>> + Send>>), Error<C>>where
M: ClientStreamingMsg<S>,
pub async fn client_streaming<M>(
&self,
msg: M,
) -> Result<(UpdateSink<C, <M as ClientStreamingMsg<S>>::Update>, Pin<Box<dyn Future<Output = Result<<M as ClientStreamingMsg<S>>::Response, ItemError<C>>> + Send>>), 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<Pin<Box<dyn Stream<Item = Result<<M as ServerStreamingMsg<S>>::Response, ItemError<C>>> + Send + Sync>>, Error<C>>where
M: ServerStreamingMsg<S>,
pub async fn server_streaming<M>(
&self,
msg: M,
) -> Result<Pin<Box<dyn Stream<Item = Result<<M as ServerStreamingMsg<S>>::Response, ItemError<C>>> + Send + Sync>>, 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<Pin<Box<dyn Stream<Item = Result<<M as TryServerStreamingMsg<S>>::Item, ItemError<C, <M as TryServerStreamingMsg<S>>::ItemError>>> + Send + Sync>>, Error<C, <M as TryServerStreamingMsg<S>>::CreateError>>where
M: TryServerStreamingMsg<S>,
Result<<M as TryServerStreamingMsg<S>>::Item, <M as TryServerStreamingMsg<S>>::ItemError>: Into<<S as Service>::Res> + TryFrom<<S as Service>::Res>,
Result<StreamCreated, <M as TryServerStreamingMsg<S>>::CreateError>: Into<<S as Service>::Res> + TryFrom<<S as Service>::Res>,
pub async fn try_server_streaming<M>(
&self,
msg: M,
) -> Result<Pin<Box<dyn Stream<Item = Result<<M as TryServerStreamingMsg<S>>::Item, ItemError<C, <M as TryServerStreamingMsg<S>>::ItemError>>> + Send + Sync>>, Error<C, <M as TryServerStreamingMsg<S>>::CreateError>>where
M: TryServerStreamingMsg<S>,
Result<<M as TryServerStreamingMsg<S>>::Item, <M as TryServerStreamingMsg<S>>::ItemError>: Into<<S as Service>::Res> + TryFrom<<S as Service>::Res>,
Result<StreamCreated, <M as TryServerStreamingMsg<S>>::CreateError>: Into<<S as Service>::Res> + TryFrom<<S as Service>::Res>,
Bidi call to the server, request opens a stream, response is a stream