This forces a consumer of the client to create types when wanting to use the API
let response = client
.cat()
.count(CatCountUrlParts::Index(vec!["index-1".into()]))
.filter_path(Some(vec!["some_path".into()]))
.send()
.await?;
A more idiomatic way would be to allow a consumer to pass references and slices, something like the following
let response = client
.cat()
.count(CatCountUrlParts::Index(&["index-1"]))
.filter_path(Some(&["some_path"]))
.send()
.await?;
Such a change likely requires lifetimes to be specified on the builders and enums. See the example/reference-args branch for an example with the Cat Count API.
Builder structs and their associated UrlParts enum accept all arguments as owned types. For example, for
CatCount
andCatCountUrlParts
Arguments that accept
Vec<String>
String
This forces a consumer of the client to create types when wanting to use the API
A more idiomatic way would be to allow a consumer to pass references and slices, something like the following
Such a change likely requires lifetimes to be specified on the builders and enums. See the
example/reference-args
branch for an example with the Cat Count API.