HedgingHandler<T>
using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
namespace Polly.Hedging.Utils
{
[System.Runtime.CompilerServices.NullableContext(1)]
[System.Runtime.CompilerServices.Nullable(0)]
internal sealed class HedgingHandler<[System.Runtime.CompilerServices.Nullable(2)] T> : IEquatable<HedgingHandler<T>>
{
[CompilerGenerated]
private Type EqualityContract {
[CompilerGenerated]
get {
return typeof(HedgingHandler<T>);
}
}
[System.Runtime.CompilerServices.Nullable(new byte[] {
1,
0,
1,
0
})]
[field: System.Runtime.CompilerServices.Nullable(new byte[] {
1,
0,
1,
0
})]
public Func<HedgingPredicateArguments<T>, ValueTask<bool>> ShouldHandle {
[return: System.Runtime.CompilerServices.Nullable(new byte[] {
1,
0,
1,
0
})]
get;
[param: System.Runtime.CompilerServices.Nullable(new byte[] {
1,
0,
1,
0
})]
set;
}
[System.Runtime.CompilerServices.Nullable(new byte[] {
1,
0,
1,
2,
0,
0,
1
})]
[field: System.Runtime.CompilerServices.Nullable(new byte[] {
1,
0,
1,
2,
0,
0,
1
})]
public Func<HedgingActionGeneratorArguments<T>, Func<ValueTask<Outcome<T>>>> ActionGenerator {
[return: System.Runtime.CompilerServices.Nullable(new byte[] {
1,
0,
1,
2,
0,
0,
1
})]
get;
[param: System.Runtime.CompilerServices.Nullable(new byte[] {
1,
0,
1,
2,
0,
0,
1
})]
set;
}
public HedgingHandler([System.Runtime.CompilerServices.Nullable(new byte[] {
1,
0,
1,
0
})] Func<HedgingPredicateArguments<T>, ValueTask<bool>> ShouldHandle, [System.Runtime.CompilerServices.Nullable(new byte[] {
1,
0,
1,
2,
0,
0,
1
})] Func<HedgingActionGeneratorArguments<T>, Func<ValueTask<Outcome<T>>>> ActionGenerator)
{
ShouldHandle = ShouldHandle;
ActionGenerator = ActionGenerator;
base..ctor();
}
[return: System.Runtime.CompilerServices.Nullable(new byte[] {
2,
0,
0,
1
})]
public Func<ValueTask<Outcome<T>>> GenerateAction([System.Runtime.CompilerServices.Nullable(new byte[] {
0,
1
})] HedgingActionGeneratorArguments<T> args)
{
HedgingActionGeneratorArguments<T> arg = new HedgingActionGeneratorArguments<T>(args.PrimaryContext, args.ActionContext, args.AttemptNumber, args.Callback);
return ActionGenerator(arg);
}
[CompilerGenerated]
public override string ToString()
{
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.Append("HedgingHandler");
stringBuilder.Append(" { ");
if (PrintMembers(stringBuilder))
stringBuilder.Append(' ');
stringBuilder.Append('}');
return stringBuilder.ToString();
}
[CompilerGenerated]
private bool PrintMembers(StringBuilder builder)
{
RuntimeHelpers.EnsureSufficientExecutionStack();
builder.Append("ShouldHandle = ");
builder.Append(ShouldHandle);
builder.Append(", ActionGenerator = ");
builder.Append(ActionGenerator);
return true;
}
public static bool operator !=([System.Runtime.CompilerServices.Nullable(new byte[] {
2,
0
})] HedgingHandler<T> left, [System.Runtime.CompilerServices.Nullable(new byte[] {
2,
0
})] HedgingHandler<T> right)
{
return !(left == right);
}
public static bool operator ==([System.Runtime.CompilerServices.Nullable(new byte[] {
2,
0
})] HedgingHandler<T> left, [System.Runtime.CompilerServices.Nullable(new byte[] {
2,
0
})] HedgingHandler<T> right)
{
if ((object)left != right)
return left?.Equals(right) ?? false;
return true;
}
[CompilerGenerated]
public override int GetHashCode()
{
return (EqualityComparer<Type>.Default.GetHashCode(EqualityContract) * -1521134295 + EqualityComparer<Func<HedgingPredicateArguments<T>, ValueTask<bool>>>.Default.GetHashCode(ShouldHandle)) * -1521134295 + EqualityComparer<Func<HedgingActionGeneratorArguments<T>, Func<ValueTask<Outcome<T>>>>>.Default.GetHashCode(ActionGenerator);
}
[System.Runtime.CompilerServices.NullableContext(2)]
[CompilerGenerated]
public override bool Equals(object obj)
{
return Equals(obj as HedgingHandler<T>);
}
[CompilerGenerated]
public bool Equals([System.Runtime.CompilerServices.Nullable(new byte[] {
2,
0
})] HedgingHandler<T> other)
{
if ((object)this != other) {
if ((object)other != null && EqualityContract == other.EqualityContract && EqualityComparer<Func<HedgingPredicateArguments<T>, ValueTask<bool>>>.Default.Equals(ShouldHandle, other.ShouldHandle))
return EqualityComparer<Func<HedgingActionGeneratorArguments<T>, Func<ValueTask<Outcome<T>>>>>.Default.Equals(ActionGenerator, other.ActionGenerator);
return false;
}
return true;
}
[CompilerGenerated]
private HedgingHandler([System.Runtime.CompilerServices.Nullable(new byte[] {
1,
0
})] HedgingHandler<T> original)
{
ShouldHandle = original.ShouldHandle;
ActionGenerator = original.ActionGenerator;
}
[CompilerGenerated]
public void Deconstruct([System.Runtime.CompilerServices.Nullable(new byte[] {
1,
0,
1,
0
})] out Func<HedgingPredicateArguments<T>, ValueTask<bool>> ShouldHandle, [System.Runtime.CompilerServices.Nullable(new byte[] {
1,
0,
1,
2,
0,
0,
1
})] out Func<HedgingActionGeneratorArguments<T>, Func<ValueTask<Outcome<T>>>> ActionGenerator)
{
ShouldHandle = this.ShouldHandle;
ActionGenerator = this.ActionGenerator;
}
}
}