use std::{
ffi::c_void,
fmt::{Debug, Display},
};
use crate::{message::MessageId, XPAPI};
pub mod management;
#[doc(hidden)]
pub mod internal;
pub struct PluginInfo {
pub name: String,
pub signature: String,
pub description: String,
}
pub trait Plugin: Sized {
type Error: Debug + Display;
fn start(xpapi: &mut XPAPI) -> Result<Self, Self::Error>;
fn enable(&mut self, xpapi: &mut XPAPI) -> Result<(), Self::Error>;
fn disable(&mut self, xpapi: &mut XPAPI);
fn info(&self) -> PluginInfo;
fn receive_message(
&mut self,
xpapi: &mut XPAPI,
from: i32,
message: MessageId,
param: *mut c_void,
);
}