chiark / gitweb /
config derive: Have special no longer take an argument
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 19 Mar 2025 19:12:30 +0000 (19:12 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 20 Mar 2025 00:23:06 +0000 (00:23 +0000)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
src/config.rs
src/config_derive.rs

index 10771b2babf9099197b6657242cbd22aa6ce56d1..1ca2006c451f5fb197ef347ca3a2afaa7831e544 100644 (file)
@@ -9,16 +9,16 @@ use crate::prelude::*;
 #[derive_deftly(InspectableConfigAuto, InstanceConfig)]
 pub struct InstanceConfig {
   // Exceptional settings
-  #[deftly(special="link", skl="SKL::None")]  pub    link:   LinkName,
-  #[deftly(per_client)]                        pub    secret: Secret,
-  #[deftly(global, special="ipif", skl="SKL::PerClient")] pub ipif: String,
+  #[deftly(special, skl="SKL::None")]              pub link:   LinkName,
+  #[deftly(per_client)]                            pub secret: Secret,
+  #[deftly(global, special, skl="SKL::PerClient")] pub ipif:   String,
 
   // Capped settings:
   #[deftly(limited)] pub max_batch_down:               u32,
   #[deftly(limited)] pub max_queue_time:               Duration,
   #[deftly(limited)] pub http_timeout:                 Duration,
   #[deftly(limited)] pub target_requests_outstanding:  u32,
-  #[deftly(special="max_up", skl="SKL::Limited")]  pub max_batch_up: u32,
+  #[deftly(special, skl="SKL::Limited")]  pub max_batch_up: u32,
 
   // Ordinary settings, used by both, not client-specifi:
   #[deftly(global)]  pub addrs:                        Vec<IpAddr>,
@@ -845,7 +845,7 @@ impl<'c> ResolveContext<'c> {
   }
 
   #[throws(AE)]
-  pub fn special_max_up(&self, key: &'static str, skl: SKL) -> u32 {
+  pub fn special_max_batch_up(&self, key: &'static str, skl: SKL) -> u32 {
     assert_eq!(skl, SKL::Limited);
     match self.end {
       LinkEnd::Client => self.ordinary(key, SKL::Limited)?,
index 0f9322a927aa4598c27bdf0b1d16815688e92dc6..a8203f32e1595295e567418f0168b5edeefb5073 100644 (file)
@@ -89,7 +89,7 @@ define_derive_deftly! {
         $(
           $fname: rctx.
             ${if fmeta(special) {
-              ${paste special_ ${fmeta(special)}}
+              ${paste special_ $fname}
             } else {
               ${select1
                 fmeta( server     ) { server   }