Struct grpcio::Client
[−]
[src]
pub struct Client { /* fields omitted */ }
A generic client for making rpc calls.
Methods
impl Client
[src]
fn new(channel: Channel) -> Client
[src]
fn unary_call<P, Q>(
&self,
method: &Method<P, Q>,
req: P,
opt: CallOption
) -> Result<Q>
[src]
&self,
method: &Method<P, Q>,
req: P,
opt: CallOption
) -> Result<Q>
Create a synchronized unary rpc call.
fn unary_call_async<P, Q>(
&self,
method: &Method<P, Q>,
req: P,
opt: CallOption
) -> ClientUnaryReceiver<Q>
[src]
&self,
method: &Method<P, Q>,
req: P,
opt: CallOption
) -> ClientUnaryReceiver<Q>
Create a asynchronized unary rpc call.
fn client_streaming<P, Q>(
&self,
method: &Method<P, Q>,
opt: CallOption
) -> (ClientCStreamSender<P>, ClientCStreamReceiver<Q>)
[src]
&self,
method: &Method<P, Q>,
opt: CallOption
) -> (ClientCStreamSender<P>, ClientCStreamReceiver<Q>)
Create a asynchronized client streaming call.
Client can send a stream of requests and server responds with a single response.
fn server_streaming<P, Q>(
&self,
method: &Method<P, Q>,
req: P,
opt: CallOption
) -> ClientSStreamReceiver<Q>
[src]
&self,
method: &Method<P, Q>,
req: P,
opt: CallOption
) -> ClientSStreamReceiver<Q>
Create a asynchronized server streaming call.
Client sends on request and server responds with a stream of responses.
fn duplex_streaming<P, Q>(
&self,
method: &Method<P, Q>,
opt: CallOption
) -> (ClientDuplexSender<P>, ClientDuplexReceiver<Q>)
[src]
&self,
method: &Method<P, Q>,
opt: CallOption
) -> (ClientDuplexSender<P>, ClientDuplexReceiver<Q>)
Create an asynchronized duplex streaming call.
Client sends a stream of requests and server responds with a stream of responses. The response stream is completely independent and both side can be sending messages at the same time.
fn spawn<F>(&self, f: F) where
F: Future<Item = (), Error = ()> + Send + 'static,
[src]
F: Future<Item = (), Error = ()> + Send + 'static,
Spawn the future into current grpc poll thread.
This can reduce a lot of context switching, but please make sure there is no heavy work in the future.