yooso_core/component.rs
1//! This module defines the [Component] struct, which represents a
2//! composable unit of functionality within the Yooso ecosystem.
3
4#[cfg(doc)]
5use crate::Entity;
6use serde::{Deserialize, Serialize};
7use uuid::Uuid;
8
9/// A [Component] represents a building block of data that can be
10/// attached to an [Entity] within the Yooso ecosystem.
11#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
12pub struct Component {
13 pub id: Uuid,
14
15 /// The name of the component, used for identification and retrieval.
16 /// It is unique across the application.
17 pub name: String,
18
19 /// System-level components are used internally by the Yooso framework
20 /// to manage application state.
21 pub is_system: bool,
22
23 /// Color code for visual representation in the Admin UI, stored as an
24 /// RGB0 integer.
25 pub color: u32,
26
27 /// The timestamp of the component's creation, used for tracking and
28 /// debugging. It is represented as a Unix timestamp in milliseconds.
29 pub created_at: i64,
30}