futures-scopes
An extension to futures-rs that offers scopes. Scopes can be used to spawn non-static futures that can reference variables on the stack that where created before the scope was created. The scope will relay these futures onto one oder multiple underlying spawns. This enables the combination of multiple Spawns into a single one. When the scope is dropped, all futures of that spawn will be immediately dropped as well.
As a scope is a Spawn
itself, it can spawn further nested scopes inside it.
Example
// An async example function that has access to some kind of spawner
async