pub trait ProbarEntity: Copy {
// Required methods
fn entity_id(&self) -> EntityId;
fn entity_name(&self) -> &'static str;
}Expand description
Trait for type-safe entity selectors (Poka-Yoke pattern)
This trait is implemented by #[derive(ProbarEntities)] macro
to provide compile-time verified entity access.
§Example
ⓘ
// Generated by probar-derive
#[derive(ProbarEntities)]
pub struct PongGame {
pub player1_paddle: Entity,
pub player2_paddle: Entity,
pub ball: Entity,
}
// In tests - compile-time verified!
let paddle = game.entity(PongGame::Player1Paddle);Required Methods§
Sourcefn entity_name(&self) -> &'static str
fn entity_name(&self) -> &'static str
Get the entity name for debugging
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".