Skip to content

Instantly share code, notes, and snippets.

@vadimcn
Last active February 5, 2017 23:17
Show Gist options
  • Save vadimcn/d83f548b6134b76d80d0f6f33ea439a6 to your computer and use it in GitHub Desktop.
Save vadimcn/d83f548b6134b76d80d0f6f33ea439a6 to your computer and use it in GitHub Desktop.
Futures
impl<A,Y,R,F> Coroutine<A> for F where F: FnMut(A) -> CoResult<Y,R> {
type Yield = Y;
type Return = R;
fn call(&mut self, a: A) -> CoResult<Self::Yield, Self::Return> {
self(a)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment