Returning futures

The Future trait relies on three main ingredients: a type, an error, and a poll() function that returns a Result<Async<T>, E> structure. The poll() method will never block the main thread, and Async<T> is an enumerator with two variants: Ready(T) and Pending. Periodically, the poll() method will be invoked by a task’s context's waker() trait, located in futures::task::context::waker, until a value is ready to be returned.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.189.195.34