Trait ApplicationExt

Source
pub trait ApplicationExt: Clone {
    // Required methods
    fn assert_correct_thread(&self);
    fn dispatch(
        &self,
        work: fn(ApplicationImpl, *mut ()),
        data: *mut (),
    ) -> bool;
    fn dispatch_delayed(
        &self,
        work: fn(ApplicationImpl, *mut ()),
        data: *mut (),
        delay: Duration,
    ) -> bool;
    fn exit(&self, exit_code: i32);
    fn exit_threadsafe(&self, exit_code: i32);
    fn initialize(
        argc: c_int,
        argv: *mut *mut c_char,
        settings: &ApplicationSettings,
    ) -> Result<ApplicationImpl>;
    fn mark_as_done(&self);
    fn run(&self, on_ready: fn(ApplicationImpl, *mut ()), data: *mut ()) -> i32;

    // Provided method
    fn free(&self) { ... }
}

Required Methods§

Source

fn assert_correct_thread(&self)

Asserts if not on the GUI thread

Source

fn dispatch(&self, work: fn(ApplicationImpl, *mut ()), data: *mut ()) -> bool

Dispatches work to be executed on the GUI thread.

Source

fn dispatch_delayed( &self, work: fn(ApplicationImpl, *mut ()), data: *mut (), delay: Duration, ) -> bool

Dispatches work to be executed on the GUI thread, but delayed by the specified number of milliseconds.

Source

fn exit(&self, exit_code: i32)

Causes the main loop to exit and lets it return the given code.

Source

fn exit_threadsafe(&self, exit_code: i32)

Same as exit, but is thread-safe.

Source

fn initialize( argc: c_int, argv: *mut *mut c_char, settings: &ApplicationSettings, ) -> Result<ApplicationImpl>

Source

fn mark_as_done(&self)

When this is called, the runtime will exit as soon as there are no more windows left.

Source

fn run(&self, on_ready: fn(ApplicationImpl, *mut ()), data: *mut ()) -> i32

Runs the main loop. This blocks until the application is exitting.

Provided Methods§

Source

fn free(&self)

Shuts down all application processes and performs necessary clean-up code.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§