pub struct EntityData {
    pub id: ItemID,
    pub meta: &'static PropertyInfo,
    /* private fields */
}
Expand description

Events are two directional …

  1. Remote commit entity / Local commit entity

    • ‘on update’ user observer hooked
    • ‘any value update’ observer hooked
  2. Local commit entity silent

    • ‘any value update’ observer hooked
  3. Local set retrieves entity update

Fields§

§id: ItemID

Unique entity id for program run-time

§meta: &'static PropertyInfo

Implementations§

source§

impl EntityData

source

pub fn serialize_into<S: Serializer>(&self, ser: S) -> Result<S::Ok, S::Error>

Serialize this property into given serializer.

source

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:

  1. Successful deserialization and validation: the value is perfectly valid and requires no alterations.
  2. Successful deserialization but failed validation: the value needed adjustments to meet the validator’s constraints.
  3. 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.
source

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 to true, it affects all group instances sharing the same context. When false, only the monitor is alerted of the change.

Trait Implementations§

source§

impl Debug for EntityData

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more