<PackageReference Include="Polly.Core" Version="8.2.1" />

Outcome

public static class Outcome
Produces instances of Outcome<T>.
using Polly.Utils; using System; using System.Runtime.CompilerServices; using System.Threading.Tasks; namespace Polly { [System.Runtime.CompilerServices.NullableContext(1)] [System.Runtime.CompilerServices.Nullable(0)] public static class Outcome { [System.Runtime.CompilerServices.Nullable(new byte[] { 0, 1 })] internal static Outcome<VoidResult> Void { [return: System.Runtime.CompilerServices.Nullable(new byte[] { 0, 1 })] get { return FromResult(VoidResult.Instance); } } [System.Runtime.CompilerServices.NullableContext(2)] [return: System.Runtime.CompilerServices.Nullable(new byte[] { 0, 1 })] public static Outcome<TResult> FromResult<TResult>(TResult value) { return new Outcome<TResult>(value); } [return: System.Runtime.CompilerServices.Nullable(new byte[] { 0, 0, 1 })] public static ValueTask<Outcome<TResult>> FromResultAsValueTask<[System.Runtime.CompilerServices.Nullable(2)] TResult>(TResult value) { return new ValueTask<Outcome<TResult>>(FromResult(value)); } [return: System.Runtime.CompilerServices.Nullable(new byte[] { 0, 1 })] public static Outcome<TResult> FromException<[System.Runtime.CompilerServices.Nullable(2)] TResult>(Exception exception) { Guard.NotNull(exception, "exception"); return new Outcome<TResult>(exception); } [return: System.Runtime.CompilerServices.Nullable(new byte[] { 0, 0, 1 })] public static ValueTask<Outcome<TResult>> FromExceptionAsValueTask<[System.Runtime.CompilerServices.Nullable(2)] TResult>(Exception exception) { Guard.NotNull(exception, "exception"); return new ValueTask<Outcome<TResult>>(FromException<TResult>(exception)); } [return: System.Runtime.CompilerServices.Nullable(new byte[] { 0, 1 })] internal static Outcome<VoidResult> FromException(Exception exception) { return FromException<VoidResult>(exception); } } }