google-apis-rs / google-cloud-rs

Asynchronous Rust bindings for Google Cloud Platform APIs.
176 stars 48 forks source link

Support for deriving datastore conversion traits on enums + Renaming fields #9

Closed Hirevo closed 4 years ago

Hirevo commented 4 years ago

This PR adds support for deriving google_cloud::datastore::{FromValue, IntoValue} for enums which only contains unit variants (and includes an integration test for this feature).
The derive will currently reject variants that holds any data, adding support for these cases will be addressed separately.

This PR also adds support for renaming fields:

rename_all = "<casing-name>" allows to change the casing for all fields or variants, its values can be any of these (just like how the serde crate does it):

rename = "<field-name>", however, allows to choose an arbitrary name, its value is directly taken as the name of the field in its datastore form.