pub struct EntityState<S = ()> {
pub uid: Uuid,
pub entity_version: u64,
pub parent_uid: Option<Uuid>,
pub created_at: OffsetDateTime,
pub updated_at: OffsetDateTime,
pub main: Option<EntityStateComponent<S>>,
pub components: HashMap<String, EntityStateComponent>,
}Expand description
State of an entity.
Contains a main state, which will be managed by the owning service that
manages the entity.
Additional services may inject their own state, which will be found in
Self::components.
Fields§
§uid: UuidGlobally unique UUID.
entity_version: u64Version of the entity. All modifications to metadata or spec will increment this version.
parent_uid: Option<Uuid>UUID of the parent entity. This is only set if the entity is a child of another entity.
created_at: OffsetDateTimeCreation timestamp.
updated_at: OffsetDateTimeLast update timestamp. Will be set on each metadata or spec change, but not on state changes.
main: Option<EntityStateComponent<S>>The primary state of the entity, managed by the owning service.
components: HashMap<String, EntityStateComponent>Additional entity states, managed by services other than the entity owners.
Trait Implementations§
Source§impl<S: Clone> Clone for EntityState<S>
impl<S: Clone> Clone for EntityState<S>
Source§fn clone(&self) -> EntityState<S>
fn clone(&self) -> EntityState<S>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<S: Debug> Debug for EntityState<S>
impl<S: Debug> Debug for EntityState<S>
Source§impl<'de, S> Deserialize<'de> for EntityState<S>where
S: Deserialize<'de>,
impl<'de, S> Deserialize<'de> for EntityState<S>where
S: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<S: JsonSchema> JsonSchema for EntityState<S>
impl<S: JsonSchema> JsonSchema for EntityState<S>
Source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref keyword. Read moreSource§impl<S: PartialEq> PartialEq for EntityState<S>
impl<S: PartialEq> PartialEq for EntityState<S>
Source§impl<S> Serialize for EntityState<S>where
S: Serialize,
impl<S> Serialize for EntityState<S>where
S: Serialize,
impl<S: Eq> Eq for EntityState<S>
impl<S> StructuralPartialEq for EntityState<S>
Auto Trait Implementations§
impl<S> Freeze for EntityState<S>where
S: Freeze,
impl<S> RefUnwindSafe for EntityState<S>where
S: RefUnwindSafe,
impl<S> Send for EntityState<S>where
S: Send,
impl<S> Sync for EntityState<S>where
S: Sync,
impl<S> Unpin for EntityState<S>where
S: Unpin,
impl<S> UnwindSafe for EntityState<S>where
S: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.