Skip to main content

FlightLoopCallback

Trait FlightLoopCallback 

Source
pub trait FlightLoopCallback<T>: 'static {
    // Required method
    fn flight_loop(
        &mut self,
        x: &mut XPAPI,
        state: &mut LoopState<T>,
    ) -> LoopResult;
}
Expand description

Trait for objects that can receive flight loop callbacks

Required Methods§

Source

fn flight_loop(&mut self, x: &mut XPAPI, state: &mut LoopState<T>) -> LoopResult

Called periodically by X-Plane according to the provided scheduling

In this callback, processing can be done. Drawing cannot be done.

The provided LoopState can be used to get information and change the scheduling of callbacks. If the scheduling is not changed, this callback will continue to be called with the same schedule.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<F, T> FlightLoopCallback<T> for F
where F: 'static + FnMut(&mut XPAPI, &mut LoopState<T>) -> LoopResult,

Closures can be used as FlightLoopCallbacks