sustenet_shared/
lib.rs

1use tokio::sync::mpsc::Sender;
2
3pub mod config;
4pub mod logging;
5pub mod network;
6pub mod packets;
7pub mod utils;
8
9pub mod security;
10
11pub mod macros;
12
13pub trait Plugin: Send + Sync {
14    fn receive(
15        &self,
16        tx: Sender<Box<[u8]>>,
17        command: u8
18    ) -> std::pin::Pin<Box<dyn std::future::Future<Output = ()> + Send>>;
19
20    fn info(&self, message: &str);
21}
22
23// TODO: Use a Result instead.
24// #[derive(Debug)]
25// pub enum PluginError {
26//     Other {
27//         msg: String,
28//     },
29// }