You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Could IntoEnumIterator::Iterator implement Send, Sync and 'static? This would be very helpful when using it within frameworks that allow for async code or multithreading.
I guess the only restriction this poses is to some manual implementation of IntoEnumIterator that for some reasons are not thread-safe. But since enums are static objects, that should be pretty unlikely?
The text was updated successfully, but these errors were encountered:
Hey @ISibboI, I've included a snippet below that might help solve your issue.
Regarding adding the trait bounds, it's a little bit tricky because EnumIter supports enums with generic types so long as they havea Default::default. With that restriction, it's possible to add a Send + Sync constraint using the change I just made in #402, but that wouldn't magically make every iterator 'static so you'd still need to do something like the snippet below, which makes me somewhat skeptical of adding additional bounds to the trait (especially since it isn't object safe in the first place).
Could
IntoEnumIterator::Iterator
implementSend
,Sync
and'static
? This would be very helpful when using it within frameworks that allow for async code or multithreading.I guess the only restriction this poses is to some manual implementation of
IntoEnumIterator
that for some reasons are not thread-safe. But since enums are static objects, that should be pretty unlikely?The text was updated successfully, but these errors were encountered: