Table of Contents

Struct SymbolMappingMsgV1

Namespace
DatabentoDotNet.Dbn
Assembly
DatabentoDotNet.Dbn.dll

The DBN v1 layout of SymbolMappingMsg, 80 bytes.

public readonly struct SymbolMappingMsgV1 : IRecord<SymbolMappingMsgV1>
Implements
Inherited Members

Remarks

Version 1 carries the two symbols and the interval, but neither symbology type: the stype_in and stype_out fields arrived in v2. The symbol fields are 22 bytes rather than 71, and a four-byte reserved block sits between them and StartTs to keep that field 8-byte aligned.

Fields

EndTs

The end of the mapping interval, in nanoseconds since the UNIX epoch.

public readonly ulong EndTs

Field Value

ulong

Header

The common header.

public readonly RecordHeader Header

Field Value

RecordHeader

StartTs

The start of the mapping interval, in nanoseconds since the UNIX epoch.

public readonly ulong StartTs

Field Value

ulong

StypeInSymbol

The input symbol.

public readonly CStr22 StypeInSymbol

Field Value

CStr22

StypeOutSymbol

The output symbol.

public readonly CStr22 StypeOutSymbol

Field Value

CStr22

Properties

IndexTs

The record's index timestamp: the one to sort by, and the one to key a symbol map with. Nanoseconds since the UNIX epoch.

public ulong IndexTs { get; }

Property Value

ulong

Remarks

This is usually ts_recv, not TsEvent. Fourteen of the twenty-one record structs carry a ts_recv and index on it; the rest have no ts_recv at all and fall back to the header's ts_event. Port of upstream's Record::raw_index_ts (record/traits.rs:52-54), whose default body is ts_event and which the #[dbn(index_ts)] field attribute overrides per struct (record.rs, compat.rs).

The distinction is not cosmetic: ts_event and ts_recv can fall on opposite sides of UTC midnight, so resolving a symbol by the wrong one silently returns the previous day's symbol, or nothing, with no error anywhere.

This is a raw timestamp and can be UndefTimestamp. Convert it with ToUtcDate(ulong) or TryToUtcDate(ulong, out LocalDate), which check the sentinel.

WireSize

The struct's exact size on the wire, in bytes, excluding any trailing ts_out.

public static int WireSize { get; }

Property Value

int

Methods

HasRType(RType)

Reports whether SymbolMappingMsgV1 is the layout for records carrying rtype.

public static bool HasRType(RType rtype)

Parameters

rtype RType

The record type read from a record header.

Returns

bool

true if rtype is one of the record types this struct decodes. This is necessary but not sufficient to identify the record — see the remarks on IRecord<TSelf>.

UpgradeTo()

Converts this record to the current-version SymbolMappingMsg.

public SymbolMappingMsg UpgradeTo()

Returns

SymbolMappingMsg

The equivalent current-version record.

Remarks

A value-level conversion into larger storage, never an in-place reinterpret. Length is recomputed for the new size, both symbols are copied into the wider buffers, and the two symbology-type fields this version does not carry are set to NullStype rather than zero — zero is InstrumentId, a real answer. SymbolMappingMsg's layout is identical in v2 and v3, so this one conversion serves both upgrade policies.