From ecdb3ee944f5c171faac3a71117e2ff27e064295 Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 26 Oct 2026 21:48:54 +0100 Subject: turn all pub into pub(crate) --- src/transport/mycelium/daemon.rs | 50 ++++++++++++++++++++-------------------- 1 file changed, 25 insertions(+), 25 deletions(-) (limited to 'src/transport/mycelium/daemon.rs') diff --git a/src/transport/mycelium/daemon.rs b/src/transport/mycelium/daemon.rs index f194fca..f986d52 100644 --- a/src/transport/mycelium/daemon.rs +++ b/src/transport/mycelium/daemon.rs @@ -14,28 +14,28 @@ use url::Url; /// Represents where a 32-byte cryptographic key originates. #[derive(Debug, Clone)] -pub enum KeySource { +pub(crate) enum KeySource { Raw([u8; 32]), Path(PathBuf), } /// Atomic structure ensuring private network credentials are always handled together. #[derive(Debug, Clone)] -pub struct PrivateNetworkConfig { - pub name: String, - pub key: KeySource, +pub(crate) struct PrivateNetworkConfig { + pub(crate) name: String, + pub(crate) key: KeySource, } /// Comprehensive parameters required to spawn or target an instance. #[derive(Debug, Clone)] -pub struct MyceliumSpawnConfig { - pub rest_url_opt: Option, - pub key_file_opt: Option, - pub network_key_file: Option, +pub(crate) struct MyceliumSpawnConfig { + pub(crate) rest_url_opt: Option, + pub(crate) key_file_opt: Option, + pub(crate) network_key_file: Option, /// Set together with `network_key_file` (`Settings::check`). - pub network_name: Option, - pub tcp_port: Option, - pub peers: Vec, + pub(crate) network_name: Option, + pub(crate) tcp_port: Option, + pub(crate) peers: Vec, } impl Default for MyceliumSpawnConfig { @@ -51,19 +51,19 @@ impl Default for MyceliumSpawnConfig { } } -pub enum MyceliumRuntime { +pub(crate) enum MyceliumRuntime { Supervised(Box), External, } -pub struct MyceliumSetup { - pub runtime: MyceliumRuntime, - pub rest_url: Url, +pub(crate) struct MyceliumSetup { + pub(crate) runtime: MyceliumRuntime, + pub(crate) rest_url: Url, } impl MyceliumSetup { /// Evaluates the configuration payload and initializes the chosen execution strategy. - pub async fn bootstrap(config: MyceliumSpawnConfig) -> Result { + pub(crate) async fn bootstrap(config: MyceliumSpawnConfig) -> Result { // TODO warn for all ignored options if rest_url_opt is set if let Some(url) = config.rest_url_opt { tracing::info!( @@ -115,7 +115,7 @@ impl MyceliumSetup { } /// Blocks until the background daemon drops out. If running externally, hangs open indefinitely. - pub async fn wait_for_exit(&mut self) -> std::io::Result { + pub(crate) async fn wait_for_exit(&mut self) -> std::io::Result { match &mut self.runtime { MyceliumRuntime::Supervised(node) => node.wait_for_exit().await, MyceliumRuntime::External => { @@ -126,16 +126,16 @@ impl MyceliumSetup { } #[derive(Debug, Clone)] -pub struct MyceliumNodeConfig { - pub tcp_port: u16, - pub api_port: u16, - pub rpc_port: u16, - pub private_network: Option, +pub(crate) struct MyceliumNodeConfig { + pub(crate) tcp_port: u16, + pub(crate) api_port: u16, + pub(crate) rpc_port: u16, + pub(crate) private_network: Option, } -pub struct SupervisedMycelium { +pub(crate) struct SupervisedMycelium { child: Child, - pub config: MyceliumNodeConfig, + pub(crate) config: MyceliumNodeConfig, _key_file_handle: Option, _net_key_file_handle: Option, } @@ -327,7 +327,7 @@ impl SupervisedMycelium { } } - pub async fn wait_for_exit(&mut self) -> std::io::Result { + pub(crate) async fn wait_for_exit(&mut self) -> std::io::Result { self.child.wait().await } } -- cgit v1.3.1