motiongfx/subject.rs
1//! The [`SubjectId`] trait represents an identifier for a "subject"
2//! within a timeline system. A subject is the entity, object, or role
3//! that actions are applied to during playback. This abstraction
4//! allows MotionGfx to remain agnostic about what uniquely identifies
5//! a subject across different backends.
6//!
7//! By standardizing on [`SubjectId`], actions can generically
8//! reference and manipulate their intended subjects without assuming
9//! a specific engine or ID representation.
10
11use core::fmt::Debug;
12use core::hash::Hash;
13
14use crate::ThreadSafe;
15
16/// An auto trait bound for the identifier of the subject.
17///
18/// The identifier should be thread safe, lightweight, and supports
19/// debug, copy, comparison, and hash.
20pub trait SubjectId:
21 ThreadSafe + Debug + Copy + Clone + Eq + Ord + Hash
22{
23}
24
25impl<T> SubjectId for T where
26 T: ThreadSafe + Debug + Copy + Clone + Eq + Ord + Hash
27{
28}