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

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

Required Methods§

source

fn assert_correct_thread(&self)

Asserts if not on the GUI thread

source

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

Dispatches work to be executed on the GUI thread.

source

fn dispatch_delayed( &self, work: unsafe 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: i32, argv: *mut *mut i8, settings: &ApplicationSettings ) -> Result<ApplicationImpl, CbwError>

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: unsafe fn(_: ApplicationImpl, _: *mut ()), data: *mut () ) -> i32

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

Provided Methods§

source

fn finish(&self)

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

Object Safety§

This trait is not object safe.

Implementors§