Table of Contents

Struct WithTsOut<T>

Namespace
DatabentoDotNet.Dbn
Assembly
DatabentoDotNet.Dbn.dll

A record plus the live gateway's send timestamp: eight more bytes on the wire, appended after the record itself.

public readonly struct WithTsOut<T> where T : unmanaged, IRecord<T>

Type Parameters

T

The wrapped record type.

Inherited Members

Remarks

A live session can be configured to have the gateway stamp each record with the time it sent it. When it is, every record on that stream is eight bytes longer than its own struct, and the DBN metadata says so — the wrapper is a property of the stream, not of the record type.

Every record's size is a multiple of eight, so TsOut lands 8-byte aligned with no padding between it and the record, whatever T is.

Constructors

WithTsOut(T, ulong)

Wraps a record, recomputing its header length to account for the extra eight bytes.

public WithTsOut(T record, ulong tsOut)

Parameters

record T

The record to wrap.

tsOut ulong

The live gateway send timestamp, in nanoseconds since the UNIX epoch.

Remarks

This is the one construction path in the codec that does not get its length right for free. Everywhere else hd.length either arrives from the wire already correct or is computed from the target struct's own size; here the record is correct for itself and wrong by eight bytes for the stream it is about to go into, and a wrong length desynchronises every record after it.

Fields

Record

The wrapped record.

public readonly T Record

Field Value

T

TsOut

The live gateway send timestamp, in nanoseconds since the UNIX epoch.

public readonly ulong TsOut

Field Value

ulong

Properties

IndexTs

The wrapped record's index timestamp, forwarded unchanged. Nanoseconds since the UNIX epoch.

public ulong IndexTs { get; }

Property Value

ulong

Remarks

Port of upstream's WithTsOut forwarding impl (with_ts_out_methods.rs:10-12). TsOut is the gateway's send time and is never the index timestamp — see the remarks on IndexTs.