Skip to main content

TrajectoryModel

Trait TrajectoryModel 

Source
pub trait TrajectoryModel: Send + Sync {
    // Required methods
    fn spawned(&self, from: Time, to: Time) -> Range<u64> ⓘ;
    fn birth_time(&self, index: u64) -> Time;
    fn state(
        &self,
        index: u64,
        age_seconds: f32,
    ) -> Result<Option<Particle>, ValidationError>;

    // Provided method
    fn duration(&self) -> Option<Duration> { ... }
}
Expand description

A whole random-access particle trajectory, not separately composable forces.

Required Methods§

Source

fn spawned(&self, from: Time, to: Time) -> Range<u64> ⓘ

Stable IDs born in [from,to).

Source

fn birth_time(&self, index: u64) -> Time

Exact integer-tick birth time of one stable ID.

Source

fn state( &self, index: u64, age_seconds: f32, ) -> Result<Option<Particle>, ValidationError>

Complete state at this age; None means absent/dead.

Provided Methods§

Source

fn duration(&self) -> Option<Duration>

Optional finite natural duration for timeline registration.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§