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

Function http_impl

codegen/src/func.rs:29–50  ·  view source on GitHub ↗
(method: Method, attr: TokenStream, item: TokenStream)

Source from the content-addressed store, hash-verified

27}
28
29pub fn http_impl(method: Method, attr: TokenStream, item: TokenStream) -> TokenStream {
30 let url = match parse_url_stream(&attr) {
31 Ok(url) => url,
32 Err(err) => return err.into_compile_error().into(),
33 };
34
35 let meta_map = parse_exprs(&remove_url_attr(&attr.to_string()));
36
37 let stream = fn_impl(
38 FnMetadata {
39 url,
40 method,
41 meta_map,
42 },
43 item,
44 true,
45 );
46 match stream {
47 Ok(stream) => stream.into(),
48 Err(err) => err.into_compile_error().into(),
49 }
50}
51
52pub fn client_fn_impl(mut item_struct: DataStruct) -> syn::Result<proc_macro2::TokenStream> {
53 let args = parse_args_from_struct(&mut item_struct)?;

Callers 4

getFunction · 0.85
postFunction · 0.85
putFunction · 0.85
deleteFunction · 0.85

Calls 4

parse_url_streamFunction · 0.85
parse_exprsFunction · 0.85
remove_url_attrFunction · 0.85
fn_implFunction · 0.85

Tested by

no test coverage detected