updated plugin example

This commit is contained in:
michael-bailey 2022-04-16 09:40:44 +01:00
parent dcd18c6b7c
commit d70aa28f17
1 changed files with 7 additions and 0 deletions

View File

@ -1,4 +1,5 @@
use futures::lock::Mutex;
use serverlib::plugin::WeakPluginInterface;
use std::thread::sleep;
use std::time::Duration;
@ -9,12 +10,14 @@ use serverlib::plugin::IPlugin;
#[derive(Debug)]
pub struct ExamplePlugin {
number: Mutex<u8>,
interface: Option<WeakPluginInterface>,
}
impl Default for ExamplePlugin {
fn default() -> Self {
ExamplePlugin {
number: Mutex::new(0),
interface: None,
}
}
}
@ -30,6 +33,10 @@ impl IPlugin for ExamplePlugin {
}
}
fn set_interface(&self, interface: WeakPluginInterface) {
todo!()
}
fn init(&self) {
println!("[ExamplePlugin]: example init")
}