Coroutines / Generators - Resume with a value after a Yield?
Coroutines / Generators - Resume with a value after a Yield?
Please let me know if this is possible...
I would like to be able to have a coroutine / generator yield
to resume with a value.
This is a simplified version of what I am looking for:
In this example, yield
would end up requesting from the parent, that it wants to read the next byte, and the parent would resume the coroutine with the next byte. (In this case, it's hardcoded to 54, but it can be any value.)
Yet it seems like Rust doesn't have the ability to resume a yield with a value.
Is there any way I can get this to work?
You're viewing a single thread.
I think your playground link might be broken because of all the amp bits.
3 0 ReplyYou are right. I fixed it just now. That is an annoying "feature" of lemmy...
3 0 ReplyConverting ampersands to say amp instead is a bug that got fixed in version 0.19, world hasnt upgraded yet though
2 0 ReplyAmp is a Google thing, not a Lemmy thing. I can't see the original, so I can't tell if it's a Lemmy thing or some client that has issues.
1 2 ReplyThey're talking about
&
, the HTML code for an ampersand.4 0 ReplyAh, thanks. :)
1 0 Reply