pub trait PhysicsFanout: Debug + Send {
// Required methods
fn worker_count(&self, mode: ScheduleMode) -> usize;
fn step(&self, sim: &mut Simulation, dt: f32, mode: ScheduleMode);
}Expand description
A host’s way of lending the simulation the threads it has.
A world with none runs its steps on the calling thread through
SerialFanout, which is the default a PhysicsSystem is built with.
Required Methods§
Sourcefn worker_count(&self, mode: ScheduleMode) -> usize
fn worker_count(&self, mode: ScheduleMode) -> usize
Workers the step’s per-worker scratch is reserved for under mode.
Read once, at world start.
Sourcefn step(&self, sim: &mut Simulation, dt: f32, mode: ScheduleMode)
fn step(&self, sim: &mut Simulation, dt: f32, mode: ScheduleMode)
Advance sim by dt, lending it whatever mode names.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".