Community Code Review: elastic_types


#1

Hi everyone!

So I’ve been working on an Elasticsearch mapping crate for a few months and hoped I could get some feedback from the community on what they think before I push the first release to crates.io.

Basically it allows you to write PORS (Plain Old Rust Structs), which can then have a correct Elasticsearch mapping generated by serde.

I’ve tried to build the implementation with no non-standard serde and also using as much of Rust’s type system as I can, so what-you-see-is-what-you-get as far as mapping goes. But that means lots of possibly weird generics in struct definitions.

I’ve tried to outline all this in the docs

Also, an example of how your Rust types would look

Unfortunately it does currently need a compiler plugin, otherwise you have to write a bunch of boilerplate manually.

I’d love to know what you think: is the overall design palatable, useful and not too much work?

PS: someone please make Community Code Review a thing