Poll
poll is the Rust Future operation that advances an asynchronous computation and returns Poll::Ready with its output or Poll::Pending.
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.
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.
Related concepts
- executorused by · An executor is a software component or interface that accepts tasks or actions and arranges for their execution by an appropriate runtime or worker.
- futureuses · A future is an abstraction representing an asynchronous computation or its result, which may not be complete or available yet.
- async/awaitused by · Async/await is language syntax for expressing asynchronous computations that suspend at awaited operations and resume when they can proceed without blocking the execution thread.
- Tokioused by · Tokio is a Rust asynchronous runtime and library for scheduling tasks, polling futures, and performing nonblocking I/O.
- pollingused by · Polling is the repeated checking or querying of a resource, system, or condition, often at intervals, to detect data, events, or state changes.
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.

