pub trait Behavior: Any + Debug {
// Required methods
fn score(&self, world: &World) -> Result<BehaviorScore>;
fn behave(&self, world: &mut World) -> Result<ControlFlow<()>>;
// Provided method
fn boxed(self) -> Box<dyn Behavior>
where Self: Sized + 'static { ... }
}Required Methods§
fn score(&self, world: &World) -> Result<BehaviorScore>
fn behave(&self, world: &mut World) -> Result<ControlFlow<()>>
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".