pub trait MainThreadHandler<'a>: 'a {
// Provided method
fn initialized(&self, instance: InitializedPluginHandle<'a>) { ... }
}Expand description
Host data and callbacks that are tied to [main-thread] operations.
This trait requires neither Send nor Sync, as types implementing it are intended to
contain host data staying on the main thread.
This trait is bound to a lifetime ('a) that lives at least as long as the plugin instance
does. Since the plugin can call host callbacks during its destructor, this is actually kept alive
slightly longer.
See the module docs for more information, and for an example implementation.
Provided Methods§
Sourcefn initialized(&self, instance: InitializedPluginHandle<'a>)
fn initialized(&self, instance: InitializedPluginHandle<'a>)
Called when the plugin has been successfully instantiated.
This is given a handle to the plugin’s own main thread data (InitializedPluginHandle),
which can be used to call plugin callbacks, and can be kept for the remainder of this
handler’s lifetime.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".