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:
using #[datastore(rename_all = "<casing-name>")] on the whole struct/enum.
using #[datastore(rename = "<field-name>")] on a single field.
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):
"lowercase"
"UPPERCASE"
"PascalCase"
"camelCase"
"snake_case"
"kebab-case"
"SCREAMING_SNAKE_CASE"
"SCREAMING-KEBAB-CASE"
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.
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:
#[datastore(rename_all = "<casing-name>")]
on the whole struct/enum.#[datastore(rename = "<field-name>")]
on a single field.rename_all = "<casing-name>"
allows to change the casing for all fields or variants, its values can be any of these (just like how theserde
crate does it):"lowercase"
"UPPERCASE"
"PascalCase"
"camelCase"
"snake_case"
"kebab-case"
"SCREAMING_SNAKE_CASE"
"SCREAMING-KEBAB-CASE"
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.