proxmox/proxmox-api-macro/src
Wolfgang Bumiller f340968773 macro: ability to rename enum variants via an attribute
In PVE we have multiple different enum types: hyphenated,
all-caps, underscores.

By default our api-macro enums will convert CamelCase to
underscores, so we need a way to represent the rest:

enum AnEnum {
	CaseOne, // becomes "case_one",
	#[api(rename = "case-two")]
	CaseTwo, // "case-two",
	#[api(rename = "CASE_THREE")]
	CaseThree,
}

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-07-18 14:52:25 +02:00
..
api_def.rs macro: add types.rs, preserve Span for Expressions 2019-07-18 13:54:52 +02:00
api_macro.rs macro: ability to rename enum variants via an attribute 2019-07-18 14:52:25 +02:00
lib.rs macro: cleanup error handling, remove error module 2019-07-18 14:41:27 +02:00
parsing.rs macro: cleanup error handling, remove error module 2019-07-18 14:41:27 +02:00
router_macro.rs router: parse an optional visibility 2019-06-12 15:31:19 +02:00
types.rs macro: ability to rename enum variants via an attribute 2019-07-18 14:52:25 +02:00
util.rs macro: ability to rename enum variants via an attribute 2019-07-18 14:52:25 +02:00