Skip to main content

MainThreadHandler

Trait MainThreadHandler 

Source
pub trait MainThreadHandler: Sized {
    // Required method
    fn add_action(&self, _view: Ref<MainThreadAction>);

    // Provided methods
    unsafe extern "C" fn cb_add_action(
        ctxt: *mut c_void,
        action: *mut BNMainThreadAction,
    ) { ... }
    fn register(self) { ... }
}
Expand description

The trait required for receiving main thread actions

Required Methods§

Provided Methods§

Source

unsafe extern "C" fn cb_add_action( ctxt: *mut c_void, action: *mut BNMainThreadAction, )

Source

fn register(self)

Register the main thread handler. Leaking Self in the process.

NOTE: This MUST be called from within the main thread.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§