Is it possible to get the function signature of a attr param that is passed into a procedural macro?
Let's imagine that I have an function "foo" fn foo(u32) -> u64.
If I passed in "foo" to the procedural macro attr as shown below, is there a way for me to somehow determine that it represents a function with the signature fn(u32) -> f64?
You're not showing exactly how you intend to use your macro, but I think this is the information you want:
Macro expansion is done before type information is available. You don't have more information to work with than if you were using macro_rules!. What's different about procedural macros is that you can write the transformation with code instead of with the macro language. This all means that if you want to use the type information in your macro, you'll need to pass it in directly.
The syn crate should be able to help you out. It parses a token stream into inspectable rust structures. The annotated function should be parsed as an Item from which you can inspect the ItemKind which will let you unwrap the FnDecl which provides the list of of FnArg inputs and the FunctionRetTy output. To check a type, you can use e.g. syn::parse_type(u64) which will give you a Ty instance that you can use to check equality.