poll — check future state. wake — notify readiness.
poll:
wake:
1use std::future::Future;2use std::pin::Pin;3use std::task::{Context, Poll};45struct MyFuture {6 data: String,7}89impl Future for MyFuture {10 type Output = String;11 fn poll(self: Pin<&mut Self>, cx: &mut Context) -> Poll<Self::Output> {12 Poll::Ready(self.data.clone())13 }14}
Key: poll for checking, wake for notifying.