From 17805f9791a0b40bcbf3d2f0a11f92b776c126b6 Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Mon, 23 May 2022 10:34:57 +0200 Subject: [PATCH] api-macro: doc update Signed-off-by: Wolfgang Bumiller --- proxmox-api-macro/src/lib.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/proxmox-api-macro/src/lib.rs b/proxmox-api-macro/src/lib.rs index ffe4a802..9888b76c 100644 --- a/proxmox-api-macro/src/lib.rs +++ b/proxmox-api-macro/src/lib.rs @@ -239,9 +239,13 @@ fn router_do(item: TokenStream) -> Result { This is only supported for `struct`s with named fields and will generate a new `struct` whose name is suffixed with `Updater` containing the `Updater` types of each field as a member. - Additionally the `#[updater(fixed)]` option is available to make it illegal for an updater to - modify a field (generating an error if it is set), while still allowing it to be used to create - a new object via the `build_from()` method. + For the updater, the following additional attributes can be used: + + - `#[updater(skip)]`: skip the field entirely in the updater + - `#[updater(type = "DifferentType")]`: use `DifferentType` instead of `Option` + for the updater field. + - `#[updater(serde())]`: *replace* the `#[serde]` attributes in the generated updater + with `. This can be used to have different `skip_serializing_if` serde attributes. ```ignore #[api]