[][src]Type Definition elastic::client::requests::document_put_mapping::PutMappingRequestBuilder

type PutMappingRequestBuilder<TSender, TDocument> = RequestBuilder<TSender, PutMappingRequestInner<TDocument>>;

A put mapping request builder that can be configured before sending.

Call Client.document_put_mapping to get a PutMappingRequestBuilder. The send method will either send the request synchronously or asynchronously, depending on the Client it was created from.

Methods

impl<TSender, TDocument> PutMappingRequestBuilder<TSender, TDocument> where
    TSender: Sender
[src]

Builder methods

Configure a PutMappingRequestBuilder before sending it.

pub fn index(self, index: impl Into<Index<'static>>) -> Self[src]

Set the index for the put mapping request.

pub fn ty(self, ty: impl Into<Type<'static>>) -> Self[src]

Set the type for the put mapping request.

impl<TDocument> PutMappingRequestBuilder<SyncSender, TDocument> where
    TDocument: DocumentType
[src]

pub fn send(self) -> Result<CommandResponse>[src]

Send a PutMappingRequestBuilder synchronously using a SyncClient.

This will block the current thread until a response arrives and is deserialised.

Examples

Put the mapping for a document type called MyType:

let response = client.document::<MyType>()
                     .put_mapping()
                     .send()?;

assert!(response.acknowledged());

impl<TDocument> PutMappingRequestBuilder<AsyncSender, TDocument> where
    TDocument: DocumentType + Send + 'static, 
[src]

pub fn send(self) -> Pending[src]

Send a PutMappingRequestBuilder asynchronously using an AsyncClient.

This will return a future that will resolve to the deserialised command response.

Examples

Put the mapping for a document type called MyType:

let future = client.document::<MyType>()
                   .put_mapping()
                   .send();

future.and_then(|response| {
    assert!(response.acknowledged());

    Ok(())
});