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
Trait Implementations§
Auto Trait Implementations§
impl<S, C> Freeze for RpcClient<S, C>where
C: Freeze,
impl<S, C> RefUnwindSafe for RpcClient<S, C>where
C: RefUnwindSafe,
S: RefUnwindSafe,
impl<S, C> Send for RpcClient<S, C>
impl<S, C> Sync for RpcClient<S, C>
impl<S, C> Unpin for RpcClient<S, C>
impl<S, C> UnwindSafe for RpcClient<S, C>where
C: UnwindSafe,
S: UnwindSafe,
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)