Skip to main content

Trajectory

Trait Trajectory 

Source
pub trait Trajectory {
    // Required methods
    fn frame_count(&self) -> usize;
    fn representative(&self) -> &Model;
    fn frame(&self, index: usize) -> Cow<'_, Model>;
}
Expand description

Multi-model structure access. Object-safe: usable as dyn Trajectory.

Implementors expose an ordered sequence of Model frames. Frames may be returned as borrowed references (Cow::Borrowed) when already in memory, or as owned values (Cow::Owned) when constructed lazily.

Required Methods§

Source

fn frame_count(&self) -> usize

Total number of frames in the trajectory.

Source

fn representative(&self) -> &Model

A representative frame (typically the first), useful when callers need topology access without specifying a frame index.

Source

fn frame(&self, index: usize) -> Cow<'_, Model>

Returns the frame at index, either borrowed or constructed on demand.

§Panics

Panics if index >= frame_count().

Implementors§