chiark / gitweb /
Change InstanceConfig to have a LinkName
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 25 Jul 2021 17:44:03 +0000 (18:44 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 25 Jul 2021 17:49:03 +0000 (18:49 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
src/config.rs

index 69718d7a1ff0e457f270a85938a7ef618ecac316..76cafdb0620950e4f43f9740b419ebc3872955d8 100644 (file)
@@ -10,7 +10,7 @@ use configparser::ini::Ini;
 #[derive(Debug,Clone)]
 pub struct InstanceConfig {
   // Exceptional settings
-  #[special(special_server, SKL::ServerName)] pub server: ServerName,
+  #[special(special_link, SKL::ServerName)]   pub link:   LinkName,
   pub                                             secret: Secret,
   #[special(special_ipif, SKL::Ordinary)]     pub ipif:   String,
 
@@ -193,9 +193,7 @@ impl FromStr for SectionName {
 }
 impl Display for InstanceConfig {
   #[throws(fmt::Error)]
-  fn fmt(&self, f: &mut fmt::Formatter) {
-    write!(f, "[{} {}]", &self.server, &self.vaddr)?;
-  }
+  fn fmt(&self, f: &mut fmt::Formatter) { Display::fmt(&self.link, f)? }
 }
 
 impl Display for SectionName {
@@ -637,8 +635,8 @@ impl<'c> ResolveContext<'c> {
   }
 
   #[throws(AE)]
-  pub fn special_server(&self, _key: &'static str) -> ServerName {
-    self.link.server.clone()
+  pub fn special_link(&self, _key: &'static str) -> LinkName {
+    self.link.clone()
   }
 }