I'm learning Rust, and still very much trying to get my head around it. Consider the following Go definition:
type FnType func(paramType) FnType
It's just a function that returns a function of the same type. Can something similar be implemented in Rust? And, ideally, can it be done generically, so that paramType
is specified by the client?
enum
with a method consumingself
(and an event) and returningSelf
(orResult<Self>
) is more flexible (but transitions are not compile-time checked).