RFC: Clone for generator?


#1

Hi all.
I’m writing a discrete-time events simulator in rust: desim.
I wanted to use generators in order to have ease of use and efficiency.
In this kind of application it would be useful to have the possibility to clone the state machine without copying the state in which the coroutine is.

Does it make sense, in your opinion to propose such a feature in the internal forum?


#2

I imagine you’d use the exact same argument as automatically implementing Clone for closures and it’s just because generators are still new and experimental that an RFC hasn’t been made for this yet. Feel free to create a topic on the internal forum and get the discussion started :slightly_smiling_face:


#3

I want this feature because it would give generators equivalent power to Haskell do notation :slight_smile:


#4

Maybe I don’t know how to post on the internals forum, but nobody answered.