liveBook · Manning

Poll

poll is the Rust Future operation that advances an asynchronous computation and returns Poll::Ready with its output or Poll::Pending.

How 2 Manning books explain it

Rust Servers, Services, and Apps

Poll is a Rust result type that indicates whether a polled asynchronous computation is ready with a value or still pending.

How it is used
Signals a future's progress to the Tokio executor so it can schedule other tasks or receive a completed value.
How deep it goes
Works through the poll signature, both variants, wakeups, and a custom timer; defers detailed Pin mechanics.
Examples
Uses a custom future that stays pending, a repeated-wakeup experiment, and an expiration timer that becomes ready.
What you can do after
Build it from scratch by implementing a Future that returns Pending until its timer expires, then Ready with a String.

Read how Rust Servers, Services, and Apps explains poll →

Learn Rust in a Month of Lunches

poll is the operation by which an asynchronous runtime advances a future toward completion and obtains its current state or output.

How it is used
Explains how awaiting a Future obtains its output while an async runtime manages checks for readiness.
How deep it goes
Defines Pending and Ready, shows the Future method signature, and defers a deep explanation of Pin.
Examples
Uses an async function returning u8, compiler errors for misplaced .await, and a working Tokio main function.
What you can do after
Apply it via .await and Tokio to obtain a future’s output without calling poll manually.

Read how Learn Rust in a Month of Lunches explains poll →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.