pub fn run(self, handler: Option<Box<dyn AppHandler>>) {
        // Make sure this application hasn't run() yet.
        if let Ok(mut state) = self.state.try_borrow_mut() {
            if state.running {
                panic!("Application is already running");
            }
            state.running = true;
        } else {
            panic!("Application state already borrowed");
        }

        // Run the platform application
        self.backend_app.run(handler);

        // This application is no longer active, so clear the global reference
        GLOBAL_APP.with(|global_app| {
            *global_app.borrow_mut() = None;
        });
        // .. and release the main thread
        util::release_main_thread();
        // .. and mark as done so a new sequence can start
        APPLICATION_CREATED
            .compare_exchange(true, false, Ordering::AcqRel, Ordering::Acquire)
            .expect("Application marked as not created while still running.");
    }
/// Start the `Application` runloop.
///
/// The provided `handler` will be used to inform of events.
///
/// This will consume the `Application` and block the current thread
/// until the `Application` has finished executing.
///
/// # Panics
///
/// Panics if the `Application` is already running.
Start the `Application` runloop.
The provided `handler` will be used to inform of events.

This will consume the `Application` and block the current thread
until the `Application` has finished executing.
Start the ` Application ` runloop . The provided ` handler ` will be used to inform of events . This will consume the ` Application ` and block the current thread until the ` Application ` has finished executing .
pub fn run(self, handler: Option<Box<dyn AppHandler>>) {
        // Make sure this application hasn't run() yet.
        if let Ok(mut state) = self.state.try_borrow_mut() {
            if state.running {
                panic!("Application is already running");
            }
            state.running = true;
        } else {
            panic!("Application state already borrowed");
        }
        // Run the platform application
        self.backend_app.run(handler);
        // This application is no longer active, so clear the global reference
        GLOBAL_APP.with(|global_app| {
            *global_app.borrow_mut() = None;
        });
        // .. and release the main thread
        util::release_main_thread();
        // .. and mark as done so a new sequence can start
        APPLICATION_CREATED
            .compare_exchange(true, false, Ordering::AcqRel, Ordering::Acquire)
            .expect("Application marked as not created while still running.");
    }
pub fn run ( self , handler : Option < Box < dyn AppHandler > > ) { // Make sure this application hasn't run() yet. if let Ok ( mut state ) = self . state . try_borrow_mut ( ) { if state . running { panic ! ( " " ) ; } state . running = true ; } else { panic ! ( " " ) ; } // Run the platform application self . backend_app . run ( handler ) ; // This application is no longer active, so clear the global reference GLOBAL_APP . with ( | global_app | { * global_app . borrow_mut ( ) = None ; } ) ; // .. and release the main thread util :: release_main_thread ( ) ; // .. and mark as done so a new sequence can start APPLICATION_CREATED . compare_exchange ( true , false , Ordering :: AcqRel , Ordering :: Acquire ) . expect ( " " ) ; }
Start the `Application` runloop.
Start the ` Application ` runloop .
self
handler
Option<Box<dyn AppHandler>>
self
handler
Option<Box<dyn AppHandler>>
panics
Panics if the `Application` is already running.
Panics if the ` Application ` is already running .