Skip to content
Free public beta until December 4, 2026: every course is open, no card needed. After that, the first chapter of each course stays free and full access is a one-time $39 ($19 for up to 100 founding members chosen for helpful feedback). Your progress is kept. How the beta works

Future trait

The trait for a value that will be ready later; async functions return one.

A Future is polled by an executor until it returns Poll::Ready; it does nothing on its own, so creating one without awaiting or spawning it runs none of its code.

Loading interactive…

Examples

  • Calling read_station("harbor"); without .await runs none of its body; rustc warns unused implementer of Future that must be used.

  • Future has one method, poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output>, which returns Poll::Ready(value) or Poll::Pending.

Read the full section →