Trait hotline_rs::plugin::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() -> Selfwhere 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§