Folds the two cases of this Result into a single new Result.
Result<Object> fold( @noFuturesAllowed Result<Object>? Function(Ok<T> ok) onOk, @noFuturesAllowed Result<Object>? Function(Err<T> err) onErr, );