A wrapper that holds either a pending future or its resolved value.
FutureOrValue is designed for manual polling state machines (in DoPend) where a task must wait for multiple independent asynchronous operations to complete. As operations may complete at different times, the results of each may need to be stored across later suspension points while waiting for the remaining operations. FutureOrValue simplifies writing such state machines by holding either a pending future or its resolved result.
FutureOrValue should only be used in manual polling contexts, stored directly as a member within the final consumer of the future. It should never be used as a general purpose container, as it breaks async composability. FutureOrValue should never be used if the result of a future is consumed immediately. It only provides value when the result needs to persist across subsequent suspension points before it is used.