Wolfgang Bumiller
1992abf96e
api-macro: even more documentation
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-01-08 11:28:00 +01:00
Wolfgang Bumiller
0f630a4cb8
api-macro: more documentation
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-01-08 11:23:48 +01:00
Wolfgang Bumiller
799c993d63
api-macro: prepare to support serde::rename_all
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-01-07 15:17:20 +01:00
Wolfgang Bumiller
778983c1b0
remove old router macro documentation
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-12-18 09:40:40 +01:00
Wolfgang Bumiller
ebda5a3c5c
api-macro: parse properties as attributes to #[api]
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-11-27 11:01:40 +01:00
Wolfgang Bumiller
5a2fe67cd8
api-macro: rename elements to properties
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-11-26 12:16:05 +01:00
Wolfgang Bumiller
a646146f75
replace builder-pattern api macro parser with json
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-11-26 12:12:49 +01:00
Wolfgang Bumiller
5721d21a5e
import a first draft of api macros
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-11-22 15:23:24 +01:00
Wolfgang Bumiller
068d56ed3d
delete the old api macro stuff
...
to be replaced by a new set of macros for the current api
schema in proxmox-backup
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-11-21 13:13:18 +01:00
Wolfgang Bumiller
05b432c422
[clippy] macro: remaining clippy lints
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-08-22 09:24:37 +02:00
Wolfgang Bumiller
169bf79c72
formatting cleanup
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-08-09 12:42:06 +02:00
Wolfgang Bumiller
080f62916e
macro: errors shouldn't discard the code
...
Otherwise we'll get even more errors.
Consider this example:
#[api(...)]
struct Foo { ... }
impl MyTrait for Foo { ... }
If the #[api] macro fails and does not at least produce the
`struct Foo{}` along with its `compile_error!()` output,
then in addition to our macro errors, we'll see errors about
trying to implement `MyTrait` for an unknown thing called
`Foo`.
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-08-08 14:04:28 +02:00
Wolfgang Bumiller
4b3333aa5c
macro: cleanup error handling, remove error module
...
syn::Error already covers this
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-07-18 14:41:27 +02:00
Wolfgang Bumiller
9c9413ae56
macro: add types.rs, preserve Span for Expressions
...
Move the Name type into types.rs and make it hashable.
Expression::Object not contains an Object where the
hashmap's key is a Name and therefore preserves the Span of
all the keys for better error messages.
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-07-18 13:54:52 +02:00
Wolfgang Bumiller
145abf62a5
macro: helpers for error handling
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-07-18 10:30:40 +02:00
Wolfgang Bumiller
b5c05fc85c
import proxmox-api-macro crate
...
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-06-06 15:25:47 +02:00