pub struct RpcClient<Request, Response>{ /* private fields */ }
Expand description
A client for sending RPCs to a protosockets rpc server.
It handles sending messages to the server and associating the responses. Messages are sent and received in any order, asynchronously, and support cancellation. To cancel an RPC, drop the response future.
Implementations§
Source§impl<Request, Response> RpcClient<Request, Response>
impl<Request, Response> RpcClient<Request, Response>
Sourcepub async fn send_streaming(
&self,
request: Request,
) -> Result<StreamingCompletion<Response>>
pub async fn send_streaming( &self, request: Request, ) -> Result<StreamingCompletion<Response>>
Send a server-streaming rpc to the server.
This function only sends the request. You must consume the completion stream to get the response.
Sourcepub async fn send_unary(
&self,
request: Request,
) -> Result<UnaryCompletion<Response>>
pub async fn send_unary( &self, request: Request, ) -> Result<UnaryCompletion<Response>>
Send a unary rpc to the server.
This function only sends the request. You must await the completion to get the response.
Trait Implementations§
Auto Trait Implementations§
impl<Request, Response> Freeze for RpcClient<Request, Response>
impl<Request, Response> !RefUnwindSafe for RpcClient<Request, Response>
impl<Request, Response> Send for RpcClient<Request, Response>
impl<Request, Response> Sync for RpcClient<Request, Response>
impl<Request, Response> Unpin for RpcClient<Request, Response>
impl<Request, Response> !UnwindSafe for RpcClient<Request, Response>
Blanket Implementations§
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
Mutably borrows from an owned value. Read more