Struct config_it::config::entity::EntityData
source · pub struct EntityData {
pub id: ItemID,
pub meta: &'static PropertyInfo,
/* private fields */
}Expand description
Events are two directional …
-
Remote commit entity / Local commit entity
- ‘on update’ user observer hooked
- ‘any value update’ observer hooked
-
Local commit entity silent
- ‘any value update’ observer hooked
-
Local set retrieves entity update
Fields§
§id: ItemIDUnique entity id for program run-time
meta: &'static PropertyInfoImplementations§
source§impl EntityData
impl EntityData
sourcepub fn serialize_into<S: Serializer>(&self, ser: S) -> Result<S::Ok, S::Error>
pub fn serialize_into<S: Serializer>(&self, ser: S) -> Result<S::Ok, S::Error>
Serialize this property into given serializer.
sourcepub fn update_value_from<'a, T>(
&self,
de: T
) -> Result<Validation, EntityUpdateError>where
T: Deserializer<'a>,
pub fn update_value_from<'a, T>( &self, de: T ) -> Result<Validation, EntityUpdateError>where T: Deserializer<'a>,
Attempts to update the central value of a config entity by deserializing the provided input.
This function first deserializes the input to the expected data structure. After successful deserialization, it validates the value to ensure it conforms to the expected constraints. The method offers three potential outcomes:
- Successful deserialization and validation: the value is perfectly valid and requires no alterations.
- Successful deserialization but failed validation: the value needed adjustments to meet the validator’s constraints.
- Failed deserialization or validation: an error occurred during the process.
Returns
Ok(true)- Both deserialization and validation were successful without the need for any modifications.Ok(false)- Deserialization succeeded, but the value was adjusted during validation to meet constraints.Err(_)- Either the deserialization process or validation failed.
Type Parameters
T: Represents the type of the deserializer.
Parameters
de: An instance of the deserializer used to update the central value.
sourcepub fn touch(&self, make_storage_dirty: bool)
pub fn touch(&self, make_storage_dirty: bool)
Notifies the underlying storage that a field within this group has been updated.
The touch method serves as a mechanism to propagate changes to the appropriate parts of
the system. Depending on the make_storage_dirty flag:
-
If set to
true, the notification of change will be broadcasted to all group instances that share the same group context, ensuring synchronization across shared contexts. -
If set to
false, only the monitor will be notified of the value update, without affecting other group instances.
Arguments
make_storage_dirty: A boolean flag that determines the scope of the update notification. When set totrue, it affects all group instances sharing the same context. Whenfalse, only the monitor is alerted of the change.