MCPcopy Create free account
hub / github.com/dxx/feignhttp / feign_context_impl

Function feign_context_impl

codegen/src/structure.rs:170–190  ·  view source on GitHub ↗
(item: TokenStream)

Source from the content-addressed store, hash-verified

168}
169
170pub 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
192fn impl_signature(item_impl: &ItemImpl) -> proc_macro2::TokenStream {
193 let impl_token = &item_impl.impl_token;

Callers 1

feign_contextFunction · 0.85

Calls 1

client_fn_implFunction · 0.85

Tested by

no test coverage detected