Closed TmLev closed 3 years ago
You need: <some_crate::Struct>::init()
. There is an example in the documentation for actor!
. Perhaps it is not obvious enough?
As far as I can see, this is a limitation of the parsing rules for macro_rules!
. I couldn't find a way to allow you to write it in a natural way. If I write $type:ty
, that cannot be followed by a ::
(see here).
If trying with <...>
works, and reviewing the docs it seems clear enough, then please close this. If you can think of a better way to do this in macro_rules!
let me know. If you think Stakker needs better documentation in this area, then let me know what would be helpful and I'll see about putting the changes in. Thanks.
Oh, sorry -- I've been using stakker without the documentation for some time now, forgot to look there. Thanks for your quick response.
With the following code
Compiler fails with error:
I assume that the
actor!
macro does not expect anything apart from the struct's name and method, which is quite limiting.