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§
Sourcefn info(&self) -> PluginInfo
fn info(&self) -> PluginInfo
Get plugin information
Sourcefn required_dependencies(&self) -> Vec<PluginDependency>
fn required_dependencies(&self) -> Vec<PluginDependency>
Get required dependencies
Sourcefn required_permissions(&self) -> Vec<Permission>
fn required_permissions(&self) -> Vec<Permission>
Get required permissions
Sourcefn 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 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
Sourcefn shutdown<'life0, 'async_trait>(
&'life0 mut self,
) -> 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,
Shutdown the plugin
Sourcefn ui_components(&self) -> Vec<UIComponent>
fn ui_components(&self) -> Vec<UIComponent>
Get UI components provided by this plugin
Get menu items provided by this plugin
Sourcefn settings_schema(&self) -> Option<SettingsSchema>
fn settings_schema(&self) -> Option<SettingsSchema>
Get settings schema for configuration
Sourcefn api_routes(&self) -> Vec<ApiRoute>
fn api_routes(&self) -> Vec<ApiRoute>
Get API routes provided by this plugin
Sourcefn event_handlers(&self) -> Vec<EventHandler>
fn event_handlers(&self) -> Vec<EventHandler>
Get event handlers provided by this plugin
Sourcefn render_component(&self, component_id: &str, props: Value) -> Result<VNode>
fn render_component(&self, component_id: &str, props: Value) -> Result<VNode>
Render a UI component
Sourcefn 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_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
Sourcefn 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,
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