Future.fallback

Future!T fallback(T defaultValue) @trusted

Provide a fallback value if this future is rejected.

If the future is already rejected at the time of the call, the returned future resolves immediately with defaultValue. If the future resolves successfully, the returned future resolves with the original value. Cancellation propagates through unchanged.

Parameters

defaultValueValue to use when this future is rejected.

Returns

A new Future!T that always resolves (never rejects).