)
.collect_vec();
-// let mut output = vec![];
+ let mut output = vec![];
for field in &fields.named {
dbg!(field);
let mut skl = quote!{ SKL::Ordinary };
skl = get_path(tskl);
}
}
+ let fname = &field.ident;
+ let fname_string = fname.as_ref().unwrap().to_string();
+ let fname_lit = Literal::string( &fname_string );
+
+ output.push(quote!{
+ #fname: rctx. #method ( #fname_lit )?,
+ });
eprintln!("{:?} method={:?} skl={:?}", field.ident, method, skl);
}
let output = quote! {
impl #target {
const FIELDS: &'static [&'static str] = &[ #( #names ),* ];
+
+ fn resolve_instance(rctx: &ResolveContext)
+ -> ::std::result::Result<#target, anyhow::Error>
+ {
+ ::std::result::Result::Ok(#target {
+ #( #output )*
+ })
+ }
}
};
+ eprintln!("{}", &output);
output.into()
}
#[derive(hippotat_macros::ResolveConfig)]
pub struct InstanceConfig {
+/*
// Exceptional settings
#[special(special_name, SKL::ServerName)] pub server: String,
pub secret: String, // xxx newytpe
#[special(special_ipif, SKL::Ordinary)] pub ipif: String,
// Capped settings:
+*/
#[limited] pub max_batch_down: u32,
+/*
#[limited] pub max_queue_time: Duration,
#[limited] pub http_timeout: Duration,
#[limited] pub target_requests_outstanding: u32,
#[client] pub http_retry: Duration,
#[client] pub url: Uri,
#[client] pub vroutes: Vec<CidrString>,
+*/
}
#[derive(Debug,Clone,Hash,Eq,PartialEq)]