Open zeenix opened 4 months ago
Could you elaborate on the issue with doing this at compile time some more? If it's all done then, indentation can be inferred there. And in my eyes, the signatures could also be obtained unless they are inferred.
Could you elaborate on the issue with doing this at compile time some more? If it's all done then, indentation can be inferred there.
You're right that the level
argument of Interface::introspect_to_writer
can be changed to a const generic and we can do so w/o bumping the major version since Interface
is declared to be unstable API.
However, the indent
argument is bumped internally for each level here. Perhaps, the inner indentation level should be something the Interface
implementation (i-e the macro) should handle and caller of introspect_to_writer
should just pass the main indentation level. :thinking:
And in my eyes, the signatures could also be obtained unless they are inferred.
I only wish it was that easy. :cry: Currently in rust you can't concatenate strings at compile time unless they're themselves literals (trait constants can't work). I do have a plan now to make most signature handling (especially during ser/de) constant though, through parsed signatures (#882). I'm planning on working on this during the weekend/next week.
This is adding to the binary size (#304).
The problem is number of
format!
calls andformat
macro generating a lot of code. Possible solutions:Type::signature()
so it will not be as easy as simply moving theformat!
calls to the macro side.ufmt
crate but it seems to be not well-maintained and hasn't seen a release for 2 years. Perhaps some other crate?