diff options
| author | tv <tv@krebsco.de> | 2026-10-26 21:48:54 +0100 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-10-26 21:48:54 +0100 |
| commit | ecdb3ee944f5c171faac3a71117e2ff27e064295 (patch) | |
| tree | a8e35f4dec4de93c7d53416da43fc4f9a3a381ed /src/transport/mycelium/daemon.rs | |
| parent | 7135c860db4169bfc9a06838cf637350ef68c0c0 (diff) | |
turn all pub into pub(crate)
Diffstat (limited to 'src/transport/mycelium/daemon.rs')
| -rw-r--r-- | src/transport/mycelium/daemon.rs | 50 |
1 files changed, 25 insertions, 25 deletions
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<Url>, - pub key_file_opt: Option<PathBuf>, - pub network_key_file: Option<PathBuf>, +pub(crate) struct MyceliumSpawnConfig { + pub(crate) rest_url_opt: Option<Url>, + pub(crate) key_file_opt: Option<PathBuf>, + pub(crate) network_key_file: Option<PathBuf>, /// Set together with `network_key_file` (`Settings::check`). - pub network_name: Option<String>, - pub tcp_port: Option<u16>, - pub peers: Vec<String>, + pub(crate) network_name: Option<String>, + pub(crate) tcp_port: Option<u16>, + pub(crate) peers: Vec<String>, } impl Default for MyceliumSpawnConfig { @@ -51,19 +51,19 @@ impl Default for MyceliumSpawnConfig { } } -pub enum MyceliumRuntime { +pub(crate) enum MyceliumRuntime { Supervised(Box<SupervisedMycelium>), 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<Self> { + pub(crate) async fn bootstrap(config: MyceliumSpawnConfig) -> Result<Self> { // 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<std::process::ExitStatus> { + pub(crate) async fn wait_for_exit(&mut self) -> std::io::Result<std::process::ExitStatus> { 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<String>, +pub(crate) struct MyceliumNodeConfig { + pub(crate) tcp_port: u16, + pub(crate) api_port: u16, + pub(crate) rpc_port: u16, + pub(crate) private_network: Option<String>, } -pub struct SupervisedMycelium { +pub(crate) struct SupervisedMycelium { child: Child, - pub config: MyceliumNodeConfig, + pub(crate) config: MyceliumNodeConfig, _key_file_handle: Option<File>, _net_key_file_handle: Option<File>, } @@ -327,7 +327,7 @@ impl SupervisedMycelium { } } - pub async fn wait_for_exit(&mut self) -> std::io::Result<std::process::ExitStatus> { + pub(crate) async fn wait_for_exit(&mut self) -> std::io::Result<std::process::ExitStatus> { self.child.wait().await } } |
