The Future trait in std

Changes in new versions / Rust 1.36

// *** before: ***
// the trait lived in the outside futures crate, and its versions
// made async libraries incompatible with one another

// *** in version 1.36: ***
use std::future::Future;
use std::pin::Pin;
use std::task::{Context, Poll};

struct Ready(i32);

impl Future for Ready {
    type Output = i32;
    fn poll(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<i32> {
        Poll::Ready(self.0)
    }
}