Trait Plugin

Source
pub trait Plugin:
    Send
    + Sync
    + Debug {
Show 13 methods // Required methods fn info(&self) -> PluginInfo; fn required_dependencies(&self) -> Vec<PluginDependency>; fn required_permissions(&self) -> Vec<Permission>; fn initialize<'life0, 'async_trait>( &'life0 mut self, context: PluginContext, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn shutdown<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn ui_components(&self) -> Vec<UIComponent>; fn menu_items(&self) -> Vec<MenuItem>; fn settings_schema(&self) -> Option<SettingsSchema>; fn api_routes(&self) -> Vec<ApiRoute>; fn event_handlers(&self) -> Vec<EventHandler>; fn render_component( &self, component_id: &str, props: Value, ) -> Result<VNode>; fn handle_api_request<'life0, 'life1, 'async_trait>( &'life0 self, route_id: &'life1 str, request: ApiRequest, ) -> Pin<Box<dyn Future<Output = Result<ApiResponse>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn handle_event<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, handler_id: &'life1 str, event: &'life2 dyn Event, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait;
}
Expand description

Main plugin trait that all plugins must implement

Required Methods§

Source

fn info(&self) -> PluginInfo

Get plugin information

Source

fn required_dependencies(&self) -> Vec<PluginDependency>

Get required dependencies

Source

fn required_permissions(&self) -> Vec<Permission>

Get required permissions

Source

fn initialize<'life0, 'async_trait>( &'life0 mut self, context: PluginContext, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Initialize the plugin

Source

fn shutdown<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Shutdown the plugin

Source

fn ui_components(&self) -> Vec<UIComponent>

Get UI components provided by this plugin

Source

fn menu_items(&self) -> Vec<MenuItem>

Get menu items provided by this plugin

Source

fn settings_schema(&self) -> Option<SettingsSchema>

Get settings schema for configuration

Source

fn api_routes(&self) -> Vec<ApiRoute>

Get API routes provided by this plugin

Source

fn event_handlers(&self) -> Vec<EventHandler>

Get event handlers provided by this plugin

Source

fn render_component(&self, component_id: &str, props: Value) -> Result<VNode>

Render a UI component

Source

fn handle_api_request<'life0, 'life1, 'async_trait>( &'life0 self, route_id: &'life1 str, request: ApiRequest, ) -> Pin<Box<dyn Future<Output = Result<ApiResponse>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Handle an API request

Source

fn handle_event<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, handler_id: &'life1 str, event: &'life2 dyn Event, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Handle an event

Implementors§