Table of Contents

Struct SettledResult<T>

Namespace
Restate.Sdk
Assembly
Restate.Sdk.dll

The settlement outcome of a single durable future awaited by AllSettled<T>(params ReadOnlySpan<IDurableFuture<T>>). Conveys either a successful value or the failure that faulted the future, without throwing.

public readonly record struct SettledResult<T> : IEquatable<SettledResult<T>>

Type Parameters

T

The result type of the underlying durable future.

Implements
Inherited Members

Remarks

Only the Success(T) and Failure(Exception) factories produce meaningful instances. A default(SettledResult<T>) (zero-initialized) value represents no settlement at all: IsSuccess is false yet Error is null. The SDK never produces such a value.

Properties

Error

The failure that faulted the future, or null when IsSuccess is true. Non-null for every factory-produced failed settlement (see the remarks on SettledResult<T> for the default-value caveat).

public Exception? Error { get; }

Property Value

Exception

IsSuccess

True when the future completed successfully.

[MemberNotNullWhen(false, "Error")]
public bool IsSuccess { get; }

Property Value

bool

Value

The successful result value, or default when IsSuccess is false.

public T? Value { get; }

Property Value

T

Methods

Failure(Exception)

Creates a failed settlement carrying the given error.

public static SettledResult<T> Failure(Exception error)

Parameters

error Exception

Returns

SettledResult<T>

Success(T)

Creates a successful settlement carrying the given value.

public static SettledResult<T> Success(T value)

Parameters

value T

Returns

SettledResult<T>