elastic-rs / elastic

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

Do the RequestParams for params_fluent() need to be 'static? #379

Closed mwilliammyers closed 5 years ago

mwilliammyers commented 5 years ago

Currently the RequestParams parameter to the .params_fluent() closure is 'static. Does it need to be? I am trying to let a user set refresh via an API call and that makes it really tricky...

I tried using the regular .params() method but then I have to pass in a URL...

KodrAus commented 5 years ago

Ah yes, this is a limitation of the way the request parameters use builders right now. I'd like to just throw out the whole fluent_builder thing that captures closures and just update a set of request parameters internally, then we won't need for them to be static.

mwilliammyers commented 5 years ago

Ahhh... Then could we make the Elasticsearch host URL available via RequestParams or just get rid of it and use PreRequestParams everywhere? I haven't really dug into what would be required to do that...

mwilliammyers commented 5 years ago

Closing in favor of #372