Type Definition elastic::client::requests::document_put_mapping::PutMappingRequestBuilder
[−]
[src]
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]
TSender: Sender,
Builder methods
Configure a PutMappingRequestBuilder
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 put mapping request.
impl<TDocument> PutMappingRequestBuilder<SyncSender, TDocument> where
TDocument: DocumentType,
[src]
TDocument: DocumentType,
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_put_mapping::<MyType>(index("myindex")) .send()?; assert!(response.acknowledged());
impl<TDocument> PutMappingRequestBuilder<AsyncSender, TDocument> where
TDocument: DocumentType + Send + 'static,
[src]
TDocument: DocumentType + Send + 'static,
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_put_mapping::<MyType>(index("myindex")) .send(); future.and_then(|response| { assert!(response.acknowledged()); Ok(()) });