aboutsummaryrefslogtreecommitdiffstats
path: root/src/transport/mod.rs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-10-30 15:55:21 +0100
committertv <tv@krebsco.de>2026-10-30 15:55:21 +0100
commit055efc604d8cf56b2cdd05bbd863acb9c2ea12d6 (patch)
treeef3f557b93f7daf3bef0c2cc6d0e38048bec4377 /src/transport/mod.rs
parent54a8d7b3409f6a5857b6fc9a964a36b66c28ae25 (diff)
make mycelium optional
Diffstat (limited to 'src/transport/mod.rs')
-rw-r--r--src/transport/mod.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/transport/mod.rs b/src/transport/mod.rs
index 9d43e5a..d8c6e2b 100644
--- a/src/transport/mod.rs
+++ b/src/transport/mod.rs
@@ -18,6 +18,7 @@ pub(crate) mod firewall;
pub(crate) mod identity;
#[cfg(feature = "libp2p")]
pub(crate) mod libp2p;
+#[cfg(feature = "mycelium")]
pub(crate) mod mycelium;
pub(crate) mod paths;
#[cfg(test)]
@@ -28,6 +29,11 @@ pub(crate) mod tor;
pub(crate) mod traffic;
pub(crate) mod wire;
+#[cfg(not(any(feature = "mycelium", feature = "libp2p", feature = "tor")))]
+compile_error!(
+ "continuum needs a transport: build with at least one of the mycelium, libp2p and tor features, e.g. `cargo build --features mycelium`"
+);
+
/// Starts the transport `name` (one of `config::TRANSPORTS`) as `settings` configure
/// it: its scheme and the transport, or None if `stop` came first (some take a while to
/// start: a supervised Mycelium daemon, arti). `key`: the node key, which some prove
@@ -39,8 +45,9 @@ pub(crate) async fn start(
stop: tokio::sync::watch::Receiver<bool>,
) -> Result<Option<(&'static str, std::sync::Arc<dyn Transport>)>> {
use std::sync::Arc;
- let _ = key;
+ let _ = (key, &stop);
let started: Option<(&'static str, Arc<dyn Transport>)> = match name {
+ #[cfg(feature = "mycelium")]
"mycelium" => mycelium::start(settings, stop)
.await?
.map(|transport| (mycelium::SCHEME, Arc::new(transport) as Arc<dyn Transport>)),