Struct xplm::flight_loop::LoopState
source · pub struct LoopState<'a> { /* private fields */ }
Expand description
Information available during a flight loop callback
By default, a flight loop callback will continue to be called on its initial schedule. The scheduling functions only need to be called if the callback scheduling should change.
Implementations§
source§impl<'a> LoopState<'a>
impl<'a> LoopState<'a>
sourcepub fn since_last_call(&self) -> Duration
pub fn since_last_call(&self) -> Duration
Returns the duration since the last time this callback was called
sourcepub fn since_last_loop(&self) -> Duration
pub fn since_last_loop(&self) -> Duration
Returns the duration since the last flight loop
If this callback is not called every flight loop, this may be different from the
value returned from time_since_last_call
.
sourcepub fn counter(&self) -> i32
pub fn counter(&self) -> i32
Returns the value of a counter that increments every time the callback is called
sourcepub fn deactivate(&mut self)
pub fn deactivate(&mut self)
Deactivates this flight loop. It will not be called again until it is scheduled.
sourcepub fn call_next_loop(&mut self)
pub fn call_next_loop(&mut self)
Configures this callback to be called on the next flight loop
sourcepub fn call_after_loops(&mut self, loops: u32)
pub fn call_after_loops(&mut self, loops: u32)
Configures this callback to be called after the specified number of loops
sourcepub fn call_after(&mut self, time: Duration)
pub fn call_after(&mut self, time: Duration)
Configures this callback to be called after the provided duration