updated plugin example
This commit is contained in:
parent
dcd18c6b7c
commit
d70aa28f17
|
|
@ -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")
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue