BridgeOperationResult record

Namespace Runic.Application.Views · Runic.Application 0.7.0-preview.5

public sealed record BridgeOperationResult : IEquatable<BridgeOperationResult>

Inherits or implements IEquatable.

The retained outcome of a bridge operation.

Parameters

Kind

Whether the operation produced no value, a value or a stream.

EncodedJson

The encoded result value, when Kind is BridgeOperationResultKind.Value.

DeliveryFailure

Why a completed result could not be retained or delivered, if it could not.

OperationStream

The result stream, when Kind is BridgeOperationResultKind.Stream.

Constructors

BridgeOperationResult

public BridgeOperationResult(BridgeOperationResultKind Kind, string? EncodedJson = null, BridgeOperationDeliveryFailure? DeliveryFailure = null, BridgeOperationStream? OperationStream = null)

The retained outcome of a bridge operation.

Parameters

Kind

Whether the operation produced no value, a value or a stream.

EncodedJson

The encoded result value, when Kind is BridgeOperationResultKind.Value.

DeliveryFailure

Why a completed result could not be retained or delivered, if it could not.

OperationStream

The result stream, when Kind is BridgeOperationResultKind.Stream.

Properties

DeliveryFailure

public BridgeOperationDeliveryFailure? DeliveryFailure { get; init; }

Why a completed result could not be retained or delivered, if it could not.

Empty

public static BridgeOperationResult Empty { get; }

EncodedJson

public string? EncodedJson { get; init; }

The encoded result value, when Kind is BridgeOperationResultKind.Value.

Kind

public BridgeOperationResultKind Kind { get; init; }

Whether the operation produced no value, a value or a stream.

None

public static BridgeOperationResult None { get; }

A completed operation without a result value.

OperationStream

public BridgeOperationStream? OperationStream { get; init; }

The result stream, when Kind is BridgeOperationResultKind.Stream.

Methods

DeliveryFailed

public static BridgeOperationResult DeliveryFailed(BridgeOperationDeliveryFailure failure)

Creates a result for a completed operation whose value could not be delivered.

Encode

public static BridgeOperationResult Encode(Func<string> encode)

Encodes a value result, reporting an encoding failure as a delivery failure.

Stream

public static BridgeOperationResult Stream(BridgeOperationStream stream)

Creates a result whose values are read through stream.

Succeeded

public static BridgeOperationResult Succeeded(string encodedJson)

Creates a value result from already encoded JSON.

Exceptions

JsonException

encodedJson is not valid JSON.