Transforming Futures

  • A type-erased wrapper over any future.

    Forwards operations to an arbitrary underlying future having the same Value type, hiding the specifics of the underlying FutureProtocol.

    This type may be used to:

    • Prevent clients from coupling to the specific kind of FutureProtocol your implementation is currently using.
    • Publicly expose only the FutureProtocol aspect of a deferred value, ensuring that only your implementation can fill the deferred value using the PromiseProtocol aspect.
    See more

    Declaration

    Swift

    public struct Future<Value> : FutureProtocol