Struct xplm::flight_loop::FlightLoop
source · pub struct FlightLoop { /* private fields */ }
Expand description
Tracks a flight loop callback, which can be called by X-Plane periodically for calculations
Implementations§
source§impl FlightLoop
impl FlightLoop
sourcepub fn new<C: FlightLoopCallback>(callback: C) -> Self
pub fn new<C: FlightLoopCallback>(callback: C) -> Self
Creates a new flight loop
Provide the callback to be called
The callback will not be called until it is scheduled
sourcepub fn schedule_immediate(&mut self)
pub fn schedule_immediate(&mut self)
Schedules the flight loop callback to be executed in the next flight loop
After the flight loop callback is first called, it will continue to be called every flight loop unless it cancels itself or changes its schedule.
sourcepub fn schedule_after_loops(&mut self, loops: u32)
pub fn schedule_after_loops(&mut self, loops: u32)
Schedules the flight loop callback to be executed after a specified number of flight loops
After the callback is first called, it will continue to be called with the provided loop interval.
sourcepub fn schedule_after(&mut self, time: Duration)
pub fn schedule_after(&mut self, time: Duration)
Schedules the flight loop callback to be executed after the specified delay
After the callback is first called, it will continue to be called with that interval.
sourcepub fn deactivate(&mut self)
pub fn deactivate(&mut self)
Deactivates the flight loop