Struct grpcio::Client
[−]
[src]
pub struct Client { /* fields omitted */ }
A generic client for making rpc calls.
Methods
impl Client
[src]
pub fn new(channel: Channel) -> Client
[src]
pub 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.
pub fn unary_call_async<P, Q>(
&self,
method: &Method<P, Q>,
req: &P,
opt: CallOption
) -> Result<ClientUnaryReceiver<Q>>
[src]
&self,
method: &Method<P, Q>,
req: &P,
opt: CallOption
) -> Result<ClientUnaryReceiver<Q>>
Create a asynchronized unary rpc call.
pub fn client_streaming<P, Q>(
&self,
method: &Method<P, Q>,
opt: CallOption
) -> Result<(ClientCStreamSender<P>, ClientCStreamReceiver<Q>)>
[src]
&self,
method: &Method<P, Q>,
opt: CallOption
) -> Result<(ClientCStreamSender<P>, ClientCStreamReceiver<Q>)>
Create a asynchronized client streaming call.
Client can send a stream of requests and server responds with a single response.
pub fn server_streaming<P, Q>(
&self,
method: &Method<P, Q>,
req: &P,
opt: CallOption
) -> Result<ClientSStreamReceiver<Q>>
[src]
&self,
method: &Method<P, Q>,
req: &P,
opt: CallOption
) -> Result<ClientSStreamReceiver<Q>>
Create a asynchronized server streaming call.
Client sends on request and server responds with a stream of responses.
pub fn duplex_streaming<P, Q>(
&self,
method: &Method<P, Q>,
opt: CallOption
) -> Result<(ClientDuplexSender<P>, ClientDuplexReceiver<Q>)>
[src]
&self,
method: &Method<P, Q>,
opt: CallOption
) -> Result<(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.
pub 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.