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§
sourcefn setup(&mut self, client: Client<D, A>) -> Client<D, A>
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
sourcefn update(&mut self, client: Client<D, A>) -> Client<D, A>
fn update(&mut self, client: Client<D, A>) -> Client<D, A>
Called each and every frame, here put your update and render logic