#[client] pub http_retry: Duration,
#[client] pub url: Uri,
#[client] pub vroutes: Vec<IpNet>,
+
+ // Computed, rather than looked up. Client only:
+ #[computed] pub effective_http_timeout: Duration,
}
static DEFAULT_CONFIG: &str = r#"
}
}
+ #[throws(AE)]
+ pub fn computed<T>(&self, _key: &'static str) -> T
+ where T: Default
+ {
+ default()
+ }
+
#[throws(AE)]
pub fn special_ipif(&self, key: &'static str) -> String {
match self.end {
.parse().unwrap()
}
+ self.effective_http_timeout = {
+ let a = self.http_timeout;
+ let b = self.http_timeout_grace;
+ a.checked_add(b).ok_or_else(
+ || anyhow!("calculate effective http timeout ({:?} + {:?})", a, b)
+ )?
+ };
+
check_batch(self.max_batch_up, "max_batch_up")?;
},