The state machine here is a struct given to `poll()` methods that advance the state. It's similar to iterator structs that have `next()` calls.
It could cause code bloat, but in practice these are small functions that get inlined and optimized out to almost nothing (sometimes even the whole struct disappears).