elastic-rs / elastic

An Elasticsearch REST API client for Rust
Apache License 2.0
252 stars 40 forks source link

Simplify request params building #372

Open KodrAus opened 5 years ago

KodrAus commented 5 years ago

Using captured fluent builders means we need to allocate for each call to _fluent, and means we need to impose Send + Sync constraints on the builder methods themselves. There are other footguns around APIs that issue multiple requests, like a bulk stream that may go on indefinitely. Since we don't rebuild the parameters we'll always issue those requests to the same node.

So we should just remove the fluent builder infrastructure and apply fluent methods to values inline.