pub trait Plugin:
Send
+ Sync
+ Any
+ 'static {
// Required method
fn debug_name(&self) -> &'static str;
// Provided methods
fn setup(&mut self, ctx: &Context) { ... }
fn on_begin_pass(&mut self, ctx: &Context) { ... }
fn on_end_pass(&mut self, ctx: &Context) { ... }
fn input_hook(&mut self, input: &mut RawInput) { ... }
fn output_hook(&mut self, output: &mut FullOutput) { ... }
}Expand description
A plugin to extend egui.
Add plugins via Context::add_plugin.
Plugins should not hold a reference to the Context, since this would create a cycle
(which would prevent the Context from being dropped).
Required Methods§
Sourcefn debug_name(&self) -> &'static str
fn debug_name(&self) -> &'static str
Plugin name.
Used when profiling.
Provided Methods§
Sourcefn setup(&mut self, ctx: &Context)
fn setup(&mut self, ctx: &Context)
Called once, when the plugin is registered.
Useful to e.g. register image loaders.
Sourcefn on_begin_pass(&mut self, ctx: &Context)
fn on_begin_pass(&mut self, ctx: &Context)
Called at the start of each pass.
Can be used to show ui, e.g. a crate::Window or crate::SidePanel.
Sourcefn on_end_pass(&mut self, ctx: &Context)
fn on_end_pass(&mut self, ctx: &Context)
Called at the end of each pass.
Can be used to show ui, e.g. a crate::Window.
Sourcefn input_hook(&mut self, input: &mut RawInput)
fn input_hook(&mut self, input: &mut RawInput)
Called just before the input is processed.
Useful to inspect or modify the input. Since this is called outside a pass, don’t show ui here.
Sourcefn output_hook(&mut self, output: &mut FullOutput)
fn output_hook(&mut self, output: &mut FullOutput)
Called just before the output is passed to the backend.
Useful to inspect or modify the output. Since this is called outside a pass, don’t show ui here.