Table of Contents

Struct SymbolMappingMsg

Namespace
DatabentoDotNet.Dbn
Assembly
DatabentoDotNet.Dbn.dll

A symbol mapping from the live API, mapping a symbol from one SType to another over an interval.

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

Remarks

This is the DBN v2 layout, unchanged in v3, at 176 bytes. Version 1 is 80 bytes and has no symbology-type fields at all — see SymbolMappingMsgV1. The record has no ts_recv, so its index timestamp is TsEvent.

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

RawStypeIn

The raw wire byte behind StypeIn. Not validated on decode — pass it to TryFromSType(byte, out SType) for a checked conversion.

public readonly byte RawStypeIn

Field Value

byte

RawStypeOut

The raw wire byte behind StypeOut. Not validated on decode — pass it to TryFromSType(byte, out SType) for a checked conversion.

public readonly byte RawStypeOut

Field Value

byte

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 CStr71 StypeInSymbol

Field Value

CStr71

StypeOutSymbol

The output symbol. Always a RawSymbol.

public readonly CStr71 StypeOutSymbol

Field Value

CStr71

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.

StypeIn

The symbology type of StypeInSymbol. Undefined wire bytes cast through to an unnamed value rather than throwing; see RawStypeIn. NullStype on a record upgraded from DBN v1, which does not carry the field.

public SType StypeIn { get; }

Property Value

SType

StypeOut

The symbology type of StypeOutSymbol. Undefined wire bytes cast through to an unnamed value rather than throwing; see RawStypeOut. NullStype on a record upgraded from DBN v1, which does not carry the field.

public SType StypeOut { get; }

Property Value

SType

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 SymbolMappingMsg 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>.