Coroutines and async/await 150 self. state = State::Wait1(fut); } State::Wait1(ref mut fut) => match fut. poll() { Poll State::Ready(txt) => { println!("{txt}"); let fut2 = Box::new(Http::get("/400/Hello World2")); self. state = State::Wait2(fut2); } Poll State::Not Ready => break Poll State::Not Ready, }, State::Wait2(ref mut fut2) => match fut2. poll() { Poll State::Ready(txt2) => { println!("{txt2}"); self. state = State::Resolved; break Poll State::Ready(()); } Poll State::Not Ready => break Poll State::Not Ready, }, State::Resolved => panic!("Polled a resolved future"), } } } } Let's start from the top: 1. The first thing we do is set the Output type to (). Since we won't be returning anything, it just makes our example simpler. 2. Next up is the implementation of the poll method. The first thing you notice is that we write a loop instance that matches self. state. We do this so we can drive the state machine forward until we reach a point where we can't progress any further without getting Poll State::Not Ready from one of our child futures. 3. If the state is State::Start, we know that this is the first time it was polled, so we run whatever instructions we need until we reach the point where we get a new future that we need to resolve. 4. When we call Http::get, we receive a future in return that we need to poll to completion before we progress any further.