pub struct UpdateResult {
pub num_updates: u64,
pub total_num_updates: u64,
pub frame_time: Duration,
pub blending_factor: f64,
pub total_time_passed: Duration,
pub exit: bool,
}
Expand description
The result of calling GameLoop::update
.
Fields§
§num_updates: u64
The number of updates.
total_num_updates: u64
Total number of updates since GameLoop
’s creation.
frame_time: Duration
Time between previous and current update.
blending_factor: f64
Blending between current and next frames. Primarily useful for rendering.
total_time_passed: Duration
Total time passed since GameLoop
’s creation.
This is a sum of the provided elapsed
arguments.
exit: bool
Whether to exit next iteration.
This is only useful in UpdateResult::run()
or UpdateResult::run_result()
.
Implementations§
Source§impl UpdateResult
impl UpdateResult
Sourcepub fn run<F>(self, func: F) -> Selfwhere
F: FnMut(&mut Self),
pub fn run<F>(self, func: F) -> Selfwhere
F: FnMut(&mut Self),
Run the provided function UpdateResult::num_updates
times.
Aborts early if UpdateResult::exit
is true.
Returns self
for convenience.
Sourcepub fn run_result<F, E>(self, func: F) -> Result<Self, E>
pub fn run_result<F, E>(self, func: F) -> Result<Self, E>
Run the provided function UpdateResult::num_updates
times.
Aborts early if func
returns Err
or UpdateResult::exit
is true.
Returns self
for convenience.
Trait Implementations§
Source§impl Clone for UpdateResult
impl Clone for UpdateResult
Source§fn clone(&self) -> UpdateResult
fn clone(&self) -> UpdateResult
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for UpdateResult
impl RefUnwindSafe for UpdateResult
impl Send for UpdateResult
impl Sync for UpdateResult
impl Unpin for UpdateResult
impl UnwindSafe for UpdateResult
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