From 055efc604d8cf56b2cdd05bbd863acb9c2ea12d6 Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 30 Oct 2026 15:55:21 +0100 Subject: make mycelium optional --- src/transport/mod.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/transport/mod.rs') 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, ) -> Result)>> { use std::sync::Arc; - let _ = key; + let _ = (key, &stop); let started: Option<(&'static str, Arc)> = match name { + #[cfg(feature = "mycelium")] "mycelium" => mycelium::start(settings, stop) .await? .map(|transport| (mycelium::SCHEME, Arc::new(transport) as Arc)), -- cgit v1.3.1