]> git.proxmox.com Git - proxmox.git/commitdiff
use Send+Sync on dyn ObjectSchemaType
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Thu, 25 Feb 2021 08:16:38 +0000 (09:16 +0100)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Thu, 25 Feb 2021 08:16:38 +0000 (09:16 +0100)
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
proxmox/src/api/section_config.rs

index b74b81557f7c5909315ffc80e3881af25ed963a4..1fd2721f09964ee6f5b340da8b2c24701a789594 100644 (file)
@@ -34,7 +34,7 @@ use crate::try_block;
 /// Associates a section type name with a `Schema`.
 pub struct SectionConfigPlugin {
     type_name: String,
-    properties: &'static (dyn ObjectSchemaType + 'static),
+    properties: &'static (dyn ObjectSchemaType + Send + Sync + 'static),
     id_property: Option<String>,
 }
 
@@ -42,7 +42,7 @@ impl SectionConfigPlugin {
     pub fn new(
         type_name: String,
         id_property: Option<String>,
-        properties: &'static (dyn ObjectSchemaType + 'static),
+        properties: &'static (dyn ObjectSchemaType + Send + Sync + 'static),
     ) -> Self {
         Self {
             type_name,
@@ -59,7 +59,7 @@ impl SectionConfigPlugin {
         self.id_property.as_deref()
     }
 
-    pub fn properties(&self) -> &(dyn ObjectSchemaType + 'static) {
+    pub fn properties(&self) -> &(dyn ObjectSchemaType + Send + Sync + 'static) {
         self.properties
     }
 
@@ -361,7 +361,7 @@ impl SectionConfig {
         let mut state = ParseState::BeforeHeader;
 
         let test_required_properties = |value: &Value,
-                                        schema: &dyn ObjectSchemaType,
+                                        schema: &(dyn ObjectSchemaType + Send + Sync),
                                         id_property: &Option<String>|
          -> Result<(), Error> {
             for (name, optional, _prop_schema) in schema.properties() {