[pbs-devel] [PATCH v3 proxmox 1/1] updater: impl UpdaterType for Vec

Fabian Grünbichler f.gruenbichler at proxmox.com
Thu Oct 28 15:00:47 CEST 2021


by replacing the whole Vec.

if we ever want to support adding/removing/modifying elements of a Vec
via the Updater, we'd need to extend it anyway (or use a custom
updater).

Suggested-by: Dominik Csapak <d.csapak at proxmox.com>
Signed-off-by: Fabian Grünbichler <f.gruenbichler at proxmox.com>
---
 proxmox-schema/src/schema.rs | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/proxmox-schema/src/schema.rs b/proxmox-schema/src/schema.rs
index 34135f4..5e6e818 100644
--- a/proxmox-schema/src/schema.rs
+++ b/proxmox-schema/src/schema.rs
@@ -1179,6 +1179,11 @@ where
     type Updater = T::Updater;
 }
 
+// this will replace the whole Vec
+impl<T> UpdaterType for Vec<T> {
+    type Updater = Option<Self>;
+}
+
 pub trait ApiType {
     const API_SCHEMA: Schema;
 }
-- 
2.30.2





More information about the pbs-devel mailing list