(item: TokenStream)
| 168 | } |
| 169 | |
| 170 | pub fn feign_context_impl(item: TokenStream) -> TokenStream { |
| 171 | let derive = parse_macro_input!(item as DeriveInput); |
| 172 | |
| 173 | let context_gen = &derive.generics; |
| 174 | let ident = &derive.ident; |
| 175 | |
| 176 | match derive.data { |
| 177 | syn::Data::Struct(struc) => match client_fn_impl(struc) { |
| 178 | Ok(x) => quote! { |
| 179 | impl #context_gen ::feignhttp::FeignContext for #ident #context_gen { |
| 180 | #x |
| 181 | } |
| 182 | } |
| 183 | .into(), |
| 184 | Err(e) => e.into_compile_error().into(), |
| 185 | }, |
| 186 | _ => syn::Error::new_spanned(derive, "Expected a struct") |
| 187 | .into_compile_error() |
| 188 | .into(), |
| 189 | } |
| 190 | } |
| 191 | |
| 192 | fn impl_signature(item_impl: &ItemImpl) -> proc_macro2::TokenStream { |
| 193 | let impl_token = &item_impl.impl_token; |
no test coverage detected