Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #![feature(async_await)]
- use std::future::Future;
- use std::task::{Context, Poll};
- use std::pin::Pin;
- struct Five;
- impl Future for Five {
- type Output = i32;
- fn poll(self: Pin<&mut Self>, _cx: &mut Context) -> Poll<Self::Output> {
- Poll::Ready(5)
- }
- }
- fn returns_five() -> impl Future<Output=i32> {
- Five
- }
- async fn testing() {
- returns_five().await;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement