Trait Plugin

Source
pub trait Plugin<D: Device, A: App> {
    // Required methods
    fn create() -> Self
       where Self: Sized;
    fn setup(&mut self, client: Client<D, A>) -> Client<D, A>;
    fn update(&mut self, client: Client<D, A>) -> Client<D, A>;
    fn ui(&mut self, client: Client<D, A>) -> Client<D, A>;
    fn unload(&mut self, client: Client<D, A>) -> Client<D, A>;
}
Expand description

Public trait for defining a plugin in a another library implement this trait and instantiate it with hotline_plugin!

Required Methods§

Source

fn create() -> Self
where Self: Sized,

Create a new instance of the plugin

Source

fn setup(&mut self, client: Client<D, A>) -> Client<D, A>

Called when the plugin is loaded and after a reload has happened, setup resources and state in here

Source

fn update(&mut self, client: Client<D, A>) -> Client<D, A>

Called each and every frame, here put your update and render logic

Source

fn ui(&mut self, client: Client<D, A>) -> Client<D, A>

Source

fn unload(&mut self, client: Client<D, A>) -> Client<D, A>

Implementors§