Tutorial by Topics: iterators



Iterators are a powerful language feature in Rust, described by the Iterator trait. Iterators allow you to perform many operations on collection-like types, e.g. Vec<T>, and they are easily composable.

An async function is one that returns a promise. await yields to the caller until the promise resolves and then continues with the result.

An iterator allows the collection to be looped through with a for-of loop.

An async iterator is a collection where each iteration is a promise which can be awaited using a for-await-of loop.

Async iterators are a stage 3 proposal. They are in Chrome Canary 60 with --harmony-async-iteration


Page 1 of 1