pub struct StepBudget(/* private fields */);Expand description
The most simulation steps one frame may execute. Everything beyond it is discarded and reported, never banked.
The budget is the only guard on per-frame work, deliberately. An elapsed-time clamp in front of it was considered and rejected: it only changes how much time is discarded versus reported, destroying the information about how big the hitch was in exchange for a second knob, a second branch, and a second coverage obligation.
Implementations§
Source§impl StepBudget
impl StepBudget
Sourcepub const DEFAULT: Self
pub const DEFAULT: Self
Five steps — about 83 ms of simulation per frame at 60 Hz.
Whether five is the right number is an open question the first frame-time capture on the reference machine settles, not an argument.
pub const fn new(steps: NonZeroU32) -> Self
pub const fn get(self) -> NonZeroU32
Trait Implementations§
Source§impl Clone for StepBudget
impl Clone for StepBudget
Source§fn clone(&self) -> StepBudget
fn clone(&self) -> StepBudget
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for StepBudget
Source§impl Debug for StepBudget
impl Debug for StepBudget
impl Eq for StepBudget
Source§impl PartialEq for StepBudget
impl PartialEq for StepBudget
impl StructuralPartialEq for StepBudget
Auto Trait Implementations§
impl Freeze for StepBudget
impl RefUnwindSafe for StepBudget
impl Send for StepBudget
impl Sync for StepBudget
impl Unpin for StepBudget
impl UnsafeUnpin for StepBudget
impl UnwindSafe for StepBudget
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more