We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ee423e7 commit a4f7867Copy full SHA for a4f7867
src/n0des.rs
@@ -8,3 +8,13 @@ pub trait N0de: 'static + Send {
8
Self: Sized;
9
fn shutdown(&mut self) -> impl Future<Output = Result<()>> + Send;
10
}
11
+
12
+#[macro_export]
13
+macro_rules! export_node {
14
+ ($type:ty) => {
15
+ #[no_mangle]
16
+ pub extern "C" fn load_plugin() -> Box<dyn $crate::N0de> {
17
+ Box::new(<$type>::default())
18
+ }
19
+ };
20
+}
0 commit comments