Type Definition elastic::client::requests::ping::PingRequestBuilder
[−]
[src]
type PingRequestBuilder<TSender> = RequestBuilder<TSender, PingRequestInner>;
A ping request builder that can be configured before sending.
Call Client.ping
to get a PingRequestBuilder
.
The send
method will either send the request synchronously or asynchronously, depending on the Client
it was created from.
Methods
impl PingRequestBuilder<SyncSender>
[src]
pub fn send(self) -> Result<PingResponse>
[src]
Send a PingRequestBuilder
synchronously using a SyncClient
.
This will block the current thread until a response arrives and is deserialised.
Examples
Ping an Elasticsearch node:
let response = client.ping().send()?; println!("node: {}", response.name());
impl PingRequestBuilder<AsyncSender>
[src]
pub fn send(self) -> Pending
[src]
Send a PingRequestBuilder
asynchronously using an AsyncClient
.
This will return a future that will resolve to the deserialised ping response.
Examples
Ping an Elasticsearch node:
let future = client.ping().send(); future.and_then(|response| { println!("node: {}", response.name()); Ok(()) });