Skip to content

Commit 5024bd3

Browse files
committed
WIP: getting compilation to work
1 parent 14fb690 commit 5024bd3

File tree

3 files changed

+7
-11
lines changed

3 files changed

+7
-11
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ iroh-blobs = "0.35"
1919
iroh-gossip = { version = "0.35", default-features = false }
2020
iroh-metrics = "0.34"
2121
n0-future = "0.1.2"
22+
paste = "1.0.14"
2223
rand = "0.8"
2324
rcan = { git = "https://github.com/n0-computer/rcan", branch = "main" }
2425
serde = { version = "1.0.217", features = ["derive"] }

src/n0des.rs

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,14 @@
1+
use std::future::Future;
2+
13
use anyhow::Result;
24
use iroh::Endpoint;
3-
use n0_future::Future;
45

6+
/// A trait for nodes that can be spawned and shut down
57
pub trait N0de: 'static + Send {
68
fn spawn(endpoint: Endpoint) -> impl Future<Output = Result<Self>> + Send
79
where
810
Self: Sized;
9-
fn shutdown(&mut self) -> impl Future<Output = Result<()>> + Send;
10-
}
1111

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-
};
12+
/// Asynchronously shut down the node
13+
fn shutdown(&mut self) -> impl Future<Output = Result<()>> + Send;
2014
}

0 commit comments

Comments
 (0)