From fc26194ca2203573e2ef6f2946f1c216b6e96a17 Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Sun, 21 Sep 2025 16:17:05 +0800 Subject: Add some comment --- crates/env/src/local/config.rs | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'crates/env/src/local/config.rs') diff --git a/crates/env/src/local/config.rs b/crates/env/src/local/config.rs index dcaf4df..ddb7dd0 100644 --- a/crates/env/src/local/config.rs +++ b/crates/env/src/local/config.rs @@ -8,13 +8,15 @@ use crate::constants::PORT; #[derive(Serialize, Deserialize, ConfigFile)] #[cfg_file(path = CLIENT_FILE_WORKSPACE)] pub struct LocalConfig { - target: SocketAddr, + /// The vault address, representing the upstream address of the local workspace, + /// to facilitate timely retrieval of new updates from the upstream source. + vault_addr: SocketAddr, } impl Default for LocalConfig { fn default() -> Self { Self { - target: SocketAddr::V4(std::net::SocketAddrV4::new( + vault_addr: SocketAddr::V4(std::net::SocketAddrV4::new( std::net::Ipv4Addr::new(127, 0, 0, 1), PORT, )), @@ -22,4 +24,14 @@ impl Default for LocalConfig { } } -impl LocalConfig {} +impl LocalConfig { + /// Set the vault address. + pub fn set_vault_addr(&mut self, addr: SocketAddr) { + self.vault_addr = addr; + } + + /// Get the vault address. + pub fn vault_addr(&self) -> SocketAddr { + self.vault_addr + } +} -- cgit