pub trait Entity {
// Required methods
fn id(&self) -> PlayerId;
fn name(&self) -> &str;
fn vision(&self) -> usize;
fn speed(&self) -> u64;
fn position(&self) -> Position;
fn direction(&self) -> Direction;
fn maze_id(&self) -> usize;
// Provided methods
fn view(&self) -> View { ... }
fn movement_recovery_duration(&self) -> Duration { ... }
}Required Methods§
fn id(&self) -> PlayerId
fn name(&self) -> &str
fn vision(&self) -> usize
fn speed(&self) -> u64
fn position(&self) -> Position
fn direction(&self) -> Direction
fn maze_id(&self) -> usize
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".