[][src]Type Definition elastic::client::AsyncClient

type AsyncClient = Client<AsyncSender>;

An asynchronous Elasticsearch client.

Use an AsyncClientBuilder to configure and build an AsyncClient. For more details about the methods available to an AsyncClient, see the base Client type.

Examples

Create an asynchronous Client and send a ping request:

let client = AsyncClientBuilder::new().build()?;

let response_future = client.request(PingRequest::new())
                            .send()
                            .and_then(|res| res.into_response::<PingResponse>());

tokio::runtime::current_thread::block_on_all(response_future)?;