yooso_core/entity.rs
1//! This module defines the [Entity] struct, which represents a
2//! composed unit within the Yooso ecosystem. An [Entity] is a
3//! a collection of [Component]s.
4
5#[cfg(doc)]
6use crate::Component;
7use serde::{Deserialize, Serialize};
8use uuid::Uuid;
9
10#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
11pub struct Entity(Uuid);
12
13/// Converts an [Entity] into its underlying [Uuid] representation.
14impl Into<Uuid> for Entity {
15 fn into(self) -> Uuid {
16 self.0
17 }
18}