merge develop into master #20

Merged
michael-bailey merged 181 commits from develop into master 2023-12-01 21:48:28 +00:00
1 changed files with 15 additions and 4 deletions
Showing only changes of commit 80bd281cd8 - Show all commits

View File

@ -1,8 +1,19 @@
use std::sync::Arc;
type CreatePluginFn = dyn Fn() -> Arc<dyn Plugin>;
/// # GetPluginFn
/// This defines the type for getting the plugin struct from a
pub type GetPluginFn = fn() -> Arc<dyn Plugin>;
/// # Plugin
/// This trait defines an interface for plugins to implement.
///
/// ## Methods
/// - details: This returns the details about the plugin.
/// - init: This defines the initialisation routine for the.
/// - run: defines a routine to be ran like a thread.
#[async_trait::async_trait]
pub trait Plugin {
fn name(&self) -> String;
fn init(&self);
}
fn details(&self) -> PluginDetails;
fn init(self: &Arc<Self>);
async fn run(self: &Arc<Self>);
}