Table of Contents

Struct Transition<TLinkAddress>

Namespace
Foundation.Data.Doublets.Cli
Assembly
Foundation.Data.Doublets.Cli.dll

A reversible write captured by the transactions layer. Holds both Before and After link states so the operation can be undone (replay After → Before) or replayed (Before → After).

public readonly record struct Transition<TLinkAddress> : IEquatable<Transition<TLinkAddress>> where TLinkAddress : IUnsignedNumber<TLinkAddress>

Type Parameters

TLinkAddress
Implements
IEquatable<Transition<TLinkAddress>>
Inherited Members

Constructors

A reversible write captured by the transactions layer. Holds both Before and After link states so the operation can be undone (replay After → Before) or replayed (Before → After).

public Transition(Guid TransactionId, long Sequence, DateTimeOffset Timestamp, TransitionKind Kind, Link<TLinkAddress> Before, Link<TLinkAddress> After)

Parameters

TransactionId Guid
Sequence long
Timestamp DateTimeOffset
Kind TransitionKind
Before Link<TLinkAddress>
After Link<TLinkAddress>

Properties

After

public Link<TLinkAddress> After { get; init; }

Property Value

Link<TLinkAddress>

Before

public Link<TLinkAddress> Before { get; init; }

Property Value

Link<TLinkAddress>

Kind

public TransitionKind Kind { get; init; }

Property Value

TransitionKind

Sequence

public long Sequence { get; init; }

Property Value

long

Timestamp

public DateTimeOffset Timestamp { get; init; }

Property Value

DateTimeOffset

TransactionId

public Guid TransactionId { get; init; }

Property Value

Guid

Methods

Serialize()

Encodes the transition as a single line stored as the name of one link in the log doublets store.

public string Serialize()

Returns

string

TryParse(string, out Transition<TLinkAddress>)

public static bool TryParse(string text, out Transition<TLinkAddress> transition)

Parameters

text string
transition Transition<TLinkAddress>

Returns

bool