Skip to content

Commit

Permalink
Restore docs
Browse files Browse the repository at this point in the history
  • Loading branch information
marcinjahn committed Nov 23, 2024
1 parent 1639211 commit 394f925
Showing 1 changed file with 48 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ namespace CSharpFunctionalExtensions.ValueTasks
{
public static partial class ResultExtensions
{
/// <summary>
/// If the calling Result is a success, a new success result is returned. Otherwise, creates a new failure result from the return value of a given valueTask action.
/// </summary>
public static async ValueTask<Result> MapError(
this Result result,
Func<string, ValueTask<string>> errorFactory
Expand All @@ -20,6 +23,9 @@ Func<string, ValueTask<string>> errorFactory
return Result.Failure(error);
}

/// <summary>
/// If the calling Result is a success, a new success result is returned. Otherwise, creates a new failure result from the return value of a given valueTask action.
/// </summary>
public static async ValueTask<Result> MapError<TContext>(
this Result result,
Func<string, TContext, ValueTask<string>> errorFactory,
Expand All @@ -35,6 +41,9 @@ TContext context
return Result.Failure(error);
}

/// <summary>
/// If the calling Result is a success, a new success result is returned. Otherwise, creates a new failure result from the return value of a given valueTask action.
/// </summary>
public static async ValueTask<UnitResult<E>> MapError<E>(
this Result result,
Func<string, ValueTask<E>> errorFactory
Expand All @@ -49,6 +58,9 @@ Func<string, ValueTask<E>> errorFactory
return UnitResult.Failure(error);
}

/// <summary>
/// If the calling Result is a success, a new success result is returned. Otherwise, creates a new failure result from the return value of a given valueTask action.
/// </summary>
public static async ValueTask<UnitResult<E>> MapError<E, TContext>(
this Result result,
Func<string, TContext, ValueTask<E>> errorFactory,
Expand All @@ -64,6 +76,9 @@ TContext context
return UnitResult.Failure(error);
}

/// <summary>
/// If the calling Result is a success, a new success result is returned. Otherwise, creates a new failure result from the return value of a given valueTask action.
/// </summary>
public static async ValueTask<Result<T>> MapError<T>(
this Result<T> result,
Func<string, ValueTask<string>> errorFactory
Expand All @@ -78,6 +93,9 @@ Func<string, ValueTask<string>> errorFactory
return Result.Failure<T>(error);
}

/// <summary>
/// If the calling Result is a success, a new success result is returned. Otherwise, creates a new failure result from the return value of a given valueTask action.
/// </summary>
public static async ValueTask<Result<T>> MapError<T, TContext>(
this Result<T> result,
Func<string, TContext, ValueTask<string>> errorFactory,
Expand All @@ -93,6 +111,9 @@ TContext context
return Result.Failure<T>(error);
}

/// <summary>
/// If the calling Result is a success, a new success result is returned. Otherwise, creates a new failure result from the return value of a given valueTask action.
/// </summary>
public static async ValueTask<Result<T, E>> MapError<T, E>(
this Result<T> result,
Func<string, ValueTask<E>> errorFactory
Expand All @@ -107,6 +128,9 @@ Func<string, ValueTask<E>> errorFactory
return Result.Failure<T, E>(error);
}

/// <summary>
/// If the calling Result is a success, a new success result is returned. Otherwise, creates a new failure result from the return value of a given valueTask action.
/// </summary>
public static async ValueTask<Result<T, E>> MapError<T, E, TContext>(
this Result<T> result,
Func<string, TContext, ValueTask<E>> errorFactory,
Expand All @@ -122,6 +146,9 @@ TContext context
return Result.Failure<T, E>(error);
}

/// <summary>
/// If the calling Result is a success, a new success result is returned. Otherwise, creates a new failure result from the return value of a given valueTask action.
/// </summary>
public static async ValueTask<Result> MapError<E>(
this UnitResult<E> result,
Func<E, ValueTask<string>> errorFactory
Expand All @@ -136,6 +163,9 @@ Func<E, ValueTask<string>> errorFactory
return Result.Failure(error);
}

/// <summary>
/// If the calling Result is a success, a new success result is returned. Otherwise, creates a new failure result from the return value of a given valueTask action.
/// </summary>
public static async ValueTask<Result> MapError<E, TContext>(
this UnitResult<E> result,
Func<E, TContext, ValueTask<string>> errorFactory,
Expand All @@ -151,6 +181,9 @@ TContext context
return Result.Failure(error);
}

/// <summary>
/// If the calling Result is a success, a new success result is returned. Otherwise, creates a new failure result from the return value of a given valueTask action.
/// </summary>
public static async ValueTask<UnitResult<E2>> MapError<E, E2>(
this UnitResult<E> result,
Func<E, ValueTask<E2>> errorFactory
Expand All @@ -165,6 +198,9 @@ Func<E, ValueTask<E2>> errorFactory
return UnitResult.Failure(error);
}

/// <summary>
/// If the calling Result is a success, a new success result is returned. Otherwise, creates a new failure result from the return value of a given valueTask action.
/// </summary>
public static async ValueTask<UnitResult<E2>> MapError<E, E2, TContext>(
this UnitResult<E> result,
Func<E, TContext, ValueTask<E2>> errorFactory,
Expand All @@ -180,6 +216,9 @@ TContext context
return UnitResult.Failure(error);
}

/// <summary>
/// If the calling Result is a success, a new success result is returned. Otherwise, creates a new failure result from the return value of a given valueTask action.
/// </summary>
public static async ValueTask<Result<T>> MapError<T, E>(
this Result<T, E> result,
Func<E, ValueTask<string>> errorFactory
Expand All @@ -194,6 +233,9 @@ Func<E, ValueTask<string>> errorFactory
return Result.Failure<T>(error);
}

/// <summary>
/// If the calling Result is a success, a new success result is returned. Otherwise, creates a new failure result from the return value of a given valueTask action.
/// </summary>
public static async ValueTask<Result<T>> MapError<T, E, TContext>(
this Result<T, E> result,
Func<E, TContext, ValueTask<string>> errorFactory,
Expand All @@ -209,6 +251,9 @@ TContext context
return Result.Failure<T>(error);
}

/// <summary>
/// If the calling Result is a success, a new success result is returned. Otherwise, creates a new failure result from the return value of a given valueTask action.
/// </summary>
public static async ValueTask<Result<T, E2>> MapError<T, E, E2>(
this Result<T, E> result,
Func<E, ValueTask<E2>> errorFactory
Expand All @@ -223,6 +268,9 @@ Func<E, ValueTask<E2>> errorFactory
return Result.Failure<T, E2>(error);
}

/// <summary>
/// If the calling Result is a success, a new success result is returned. Otherwise, creates a new failure result from the return value of a given valueTask action.
/// </summary>
public static async ValueTask<Result<T, E2>> MapError<T, E, E2, TContext>(
this Result<T, E> result,
Func<E, TContext, ValueTask<E2>> errorFactory,
Expand Down

0 comments on commit 394f925

Please sign in to comment.