pub struct RuntimeConfig { /* private fields */ }Expand description
Configuration for fixed simulation and variable-rate rendering.
Implementations§
Source§impl RuntimeConfig
impl RuntimeConfig
Sourcepub fn fixed_hz(updates_per_second: u32) -> Result<Self, RuntimeConfigError>
pub fn fixed_hz(updates_per_second: u32) -> Result<Self, RuntimeConfigError>
Creates a fixed-rate configuration with bounded catch-up defaults.
The default maximum accepted frame delta is 250 milliseconds and at most eight fixed steps
may run in one frame. Whole fixed steps beyond that budget are discarded to avoid a spiral
of death, and the discarded duration is reported by FramePlan::dropped_time.
§Errors
Returns RuntimeConfigError::ZeroUpdateRate when updates_per_second is zero, or
RuntimeConfigError::UpdateRateTooHigh when its period is below Duration resolution.
Sourcepub fn with_max_frame_delta(
self,
max_frame_delta: Duration,
) -> Result<Self, RuntimeConfigError>
pub fn with_max_frame_delta( self, max_frame_delta: Duration, ) -> Result<Self, RuntimeConfigError>
Replaces the largest wall-clock delta accepted for one frame.
§Errors
Returns RuntimeConfigError::ZeroMaxFrameDelta when the duration is zero.
Sourcepub fn with_max_fixed_steps(
self,
max_fixed_steps: u32,
) -> Result<Self, RuntimeConfigError>
pub fn with_max_fixed_steps( self, max_fixed_steps: u32, ) -> Result<Self, RuntimeConfigError>
Replaces the maximum number of fixed updates allowed in one frame.
§Errors
Returns RuntimeConfigError::ZeroMaxFixedSteps when the limit is zero.
Sourcepub const fn fixed_step(self) -> Duration
pub const fn fixed_step(self) -> Duration
Returns the duration of one fixed simulation update.
Sourcepub const fn max_frame_delta(self) -> Duration
pub const fn max_frame_delta(self) -> Duration
Returns the largest wall-clock delta accepted for one frame.
Sourcepub const fn max_fixed_steps(self) -> u32
pub const fn max_fixed_steps(self) -> u32
Returns the maximum number of fixed updates allowed in one frame.
Trait Implementations§
Source§impl Clone for RuntimeConfig
impl Clone for RuntimeConfig
Source§fn clone(&self) -> RuntimeConfig
fn clone(&self) -> RuntimeConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more