pub struct Client { /* private fields */ }
Expand description

A generic client for making RPC calls.

Implementations

Initialize a new Client.

Create a synchronized unary RPC call.

It uses futures_executor::block_on to wait for the futures. It’s recommended to use the asynchronous version.

Create an asynchronized unary RPC call.

Create an asynchronized client streaming call.

Client can send a stream of requests and server responds with a single response.

Create an asynchronized server streaming call.

Client sends on request and server responds with a stream of responses.

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.

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.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.