Trait EntityIdType
Source pub trait EntityIdType:
Copy
+ Clone
+ Eq
+ PartialEq
+ Hash
+ Debug
+ Display
+ FromStr
+ Serialize
+ DeserializeOwned
+ Send
+ Sync
+ 'static {
const ENTITY_NAME: &'static str;
// Required methods
fn new(uuid: Uuid) -> Self;
fn as_uuid(&self) -> Uuid;
// Provided methods
fn nil() -> Self { ... }
fn now_v7() -> Self { ... }
fn new_v4() -> Self { ... }
}Expand description
Trait for type-safe entity IDs.
This trait provides compile-time safety by ensuring entity IDs cannot be accidentally mixed up. Each entity type has its own strongly-typed ID.
Required Associated Constants§
Sourceconst ENTITY_NAME: &'static str
const ENTITY_NAME: &'static str
The name of the entity type (e.g., “tenant”, “trajectory”).
Required Methods§
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.