euv-core 0.48.3

Core cross-platform runtime for euv featuring arena-based fine-grained reactivity, deterministic layout, flat scene graph, multi-mode rendering, and direct OS platform adapters.
Documentation
/// Trait for simulation snapshots supporting discontinuity-safe render interpolation and zero-allocation in-place reuse.
pub trait InterpolatableState: Clone {
    /// Interpolates between `self` (previous fixed-step snapshot) and `next` (current fixed-step snapshot) at `alpha` in `[0.0, 1.0]`.
    ///
    /// # Arguments
    ///
    /// - `&Self` - Previous immutable simulation snapshot (`t - dt`).
    /// - `&Self` - Current immutable simulation snapshot (`t`).
    /// - `f32` - Render interpolation factor clamped to `[0.0, 1.0]`.
    ///
    /// # Returns
    ///
    /// - `Self` - Smoothly interpolated state for rendering without interpolating discontinuous events.
    #[must_use]
    fn interpolate(&self, next: &Self, alpha: f32) -> Self;

    /// Copies `src` into `self` reusing existing internal buffer capacities without heap allocation whenever possible.
    ///
    /// # Arguments
    ///
    /// - `&Self` - Mutable destination snapshot.
    /// - `&Self` - Source snapshot to copy from.
    fn copy_from_snapshot(&mut self, src: &Self) {
        *self = src.clone();
    }

    /// Interpolates between `self` and `next` at `alpha` directly into pre-allocated `out` with zero steady-state allocations.
    ///
    /// # Arguments
    ///
    /// - `&Self` - Previous fixed-step snapshot (`t - dt`).
    /// - `&Self` - Current fixed-step snapshot (`t`).
    /// - `f32` - Render interpolation factor clamped to `[0.0, 1.0]`.
    /// - `&mut Self` - Persistent destination snapshot overwritten in place.
    fn interpolate_into(&self, next: &Self, alpha: f32, out: &mut Self) {
        *out = self.interpolate(next, alpha);
    }
}