Crate pollster[][src]

A minimal async executor that lets you block on a future

Note that pollster will not work for arbitrary futures because some require a specific runtime or reactor. See here for more information about when and where pollster may be used. However, if you’re already pulling in the required dependencies to create such a future in the first place, it’s likely that you already have a version of block_on in your dependency tree that’s designed to poll your future, so use that instead.

Example

let my_fut = async {};
let result = pollster::block_on(my_fut);

Functions

block_on

Block the thread until the future is ready.