/// Atrributes:
///
/// * `limited`, `server`, `client`: cooked sets of settings;
-/// default `SKL` is `Ordinary` except for `limited`
+/// default `SKL` is `PerClient` except for `limited`
/// * `special(method, SKL)`
///
/// Generated code
//dbg!(field);
let fname = &field.ident.as_ref().unwrap();
let fname_span = fname.span();
- let mut skl = quote_spanned!{fname_span=> SectionKindList::Ordinary };
+ let mut skl = quote_spanned!{fname_span=> SectionKindList::PerClient };
let mut method = quote_spanned!{fname_span=> ordinary };
for attr in &field.attrs {
let atspan = attr.path.segments.last().unwrap().ident.span();
// Exceptional settings
#[special(special_link, SKL::ServerName)] pub link: LinkName,
pub secret: Secret,
- #[special(special_ipif, SKL::Ordinary)] pub ipif: String,
+ #[special(special_ipif, SKL::PerClient)] pub ipif: String,
// Capped settings:
#[limited] pub max_batch_down: u32,
#[derive(Debug,Copy,Clone)]
enum SectionKindList {
- Ordinary,
+ PerClient,
Limited,
Limits,
ClientAgnostic,
impl SectionKindList {
fn contains(self, s: &SectionName) -> bool {
match self {
- SKL::Ordinary => matches!(s, SN::Link(_)
+ SKL::PerClient => matches!(s, SN::Link(_)
| SN::Client(_)
| SN::Server(_)
| SN::Common),
SKL::ClientAgnostic => matches!(s, SN::Common
| SN::Server(_)),
- SKL::Limited => SKL::Ordinary.contains(s)
- | SKL::Limits .contains(s),
+ SKL::Limited => SKL::PerClient.contains(s)
+ | SKL::Limits .contains(s),
SKL::ServerName => matches!(s, SN::Common)
| matches!(s, SN::Server(ServerName(name))
pub fn ordinary<T>(&self, key: &'static str) -> T
where T: Parseable
{
- match self.first_of(key, SKL::Ordinary)? {
+ match self.first_of(key, SKL::PerClient)? {
Some(y) => y,
None => Parseable::default_for_key(key)?,
}
],
};
- if rctx.first_of_raw("secret", SKL::Ordinary).is_none() { continue }
+ if rctx.first_of_raw("secret", SKL::PerClient).is_none() { continue }
let mut ic = InstanceConfig::resolve_instance(&rctx)
.with_context(|| format!("resolve config for {}", &link))?;