mapSuspendCatching

inline suspend fun <T, R> Result<T>.mapSuspendCatching(transform: suspend (T) -> R): Result<R>

Coroutine-safe alternative to Result.mapCatching.

Like Result.mapCatching, applies transform to a successful result and wraps the outcome in Result, but rethrows CancellationException instead of wrapping it.

If the receiver is already a failure, the failure is propagated unchanged.

See kotlinx.coroutines#1814.