0.1.0-0-pre.3

This commit is contained in:
2026-09-16 00:46:04 +02:00
parent 8c0252e34e
commit 2c79a05dd6
26 changed files with 589 additions and 53 deletions

View File

@@ -0,0 +1,36 @@
// file: crates/engines/engine-v1-common/src/frame.rs
// version: 1
/// Immutable timing information associated with one engine update.
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub struct EngineFrame {
index: u64,
delta: std::time::Duration,
elapsed: std::time::Duration,
}
impl EngineFrame {
/// Creates timing information for one update.
#[must_use]
pub const fn new(index: u64, delta: std::time::Duration, elapsed: std::time::Duration) -> Self {
return Self { index, delta, elapsed };
}
/// Returns the zero-based update index.
#[must_use]
pub const fn index(self) -> u64 {
return self.index;
}
/// Returns the duration represented by this update.
#[must_use]
pub const fn delta(self) -> std::time::Duration {
return self.delta;
}
/// Returns the accumulated simulated duration before this update completes.
#[must_use]
pub const fn elapsed(self) -> std::time::Duration {
return self.elapsed;
}
}