Future.map

Future!U map(U)(U delegate(T) @safe fn) @trusted

Transform the future's value with a mapping function, returning a new future that resolves with the mapped result.

Cancellation propagation: if this (parent) future is cancelled, the returned (child) future is also cancelled. Cancelling the child does not propagate back to the parent.

If the parent is already resolved at the time of the call, the mapping function executes immediately and the returned future is already resolved. If the parent is already cancelled, the returned future is already cancelled.

Parameters

fnMapping function that converts T to U.

Returns

A new Future!U that resolves with fn(parentValue).