Type Definition elastic::client::requests::document_delete::DeleteRequestBuilder
[−]
[src]
type DeleteRequestBuilder<TSender, TDocument> = RequestBuilder<TSender, DeleteRequestInner<TDocument>>;
A delete document request builder that can be configured before sending.
Call Client.document_delete
to get a DeleteRequestBuilder
.
The send
method will either send the request synchronously or asynchronously, depending on the Client
it was created from.
Methods
impl<TSender, TDocument> DeleteRequestBuilder<TSender, TDocument> where
TSender: Sender,
[src]
TSender: Sender,
Builder methods
Configure a DeleteRequestBuilder
before sending it.
pub fn ty<I>(self, ty: I) -> Self where
I: Into<Type<'static>>,
[src]
I: Into<Type<'static>>,
Set the type for the delete request.
impl<TDocument> DeleteRequestBuilder<SyncSender, TDocument>
[src]
pub fn send(self) -> Result<DeleteResponse>
[src]
Send a DeleteRequestBuilder
synchronously using a SyncClient
.
This will block the current thread until a response arrives and is deserialised.
Examples
Delete a document from an index called myindex
with an id of 1
:
let response = client.document_delete::<MyType>(index("myindex"), id(1)) .send()?; assert!(response.deleted());
impl<TDocument> DeleteRequestBuilder<AsyncSender, TDocument>
[src]
pub fn send(self) -> Pending
[src]
Send a DeleteRequestBuilder
asynchronously using an AsyncClient
.
This will return a future that will resolve to the deserialised delete document response.
Examples
Delete a document from an index called myindex
with an id of 1
:
let future = client.document_delete::<Value>(index("myindex"), id(1)) .ty("mytype") .send(); future.and_then(|response| { assert!(response.deleted()); Ok(()) });