I'm not even sure that I can describe what I want clear enough, but I'll try.
In my lib, there is a procedural macro reexported through the main part and some struct with the private field in the main part. The proc-macro is an attribute, which is placed by the user on some function; the function is then converted to the
macro_rules definition, which, being called in the expression position like the original function would, should yield the struct from the main crate.
The problem is that I don't want users of the lib to create the instances of this struct in any other way: only through this proc-macro. But is it ever possible? Or, if some code is used in macro expansion, then the same code would work at the same place being simply written by hand?