Table of Contents

Struct StatusMsg

Namespace
DatabentoDotNet.Dbn
Assembly
DatabentoDotNet.Dbn.dll

An exchange status change. The record of the Status schema.

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

Remarks

The three enum-valued fields here are 16-bit, not the single ASCII byte used by Action and Side elsewhere, while the three tri-state flags are single ASCII bytes. Field order is transcribed from the #[repr(C)] Rust declaration.

Fields

Header

The common header.

public readonly RecordHeader Header

Field Value

RecordHeader

RawAction

The raw wire value behind Action. Not validated on decode — pass it to TryFromStatusAction(ushort, out StatusAction) for a checked conversion.

public readonly ushort RawAction

Field Value

ushort

RawIsQuoting

The raw wire byte behind IsQuoting. Not validated on decode — pass it to TryFromTriState(byte, out TriState) for a checked conversion.

public readonly byte RawIsQuoting

Field Value

byte

RawIsShortSellRestricted

The raw wire byte behind IsShortSellRestricted. Not validated on decode — pass it to TryFromTriState(byte, out TriState) for a checked conversion.

public readonly byte RawIsShortSellRestricted

Field Value

byte

RawIsTrading

The raw wire byte behind IsTrading. Not validated on decode — pass it to TryFromTriState(byte, out TriState) for a checked conversion.

public readonly byte RawIsTrading

Field Value

byte

RawReason

The raw wire value behind Reason. Not validated on decode — pass it to TryFromStatusReason(ushort, out StatusReason) for a checked conversion.

public readonly ushort RawReason

Field Value

ushort

RawTradingEvent

The raw wire value behind TradingEvent. Not validated on decode — pass it to TryFromTradingEvent(ushort, out TradingEvent) for a checked conversion.

public readonly ushort RawTradingEvent

Field Value

ushort

TsRecv

The capture-server-received timestamp, in nanoseconds since the UNIX epoch. This, not TsEvent, is the record's index timestamp.

public readonly ulong TsRecv

Field Value

ulong

Properties

Action

The type of status change. Undefined wire values cast through to an unnamed value rather than throwing; see RawAction.

public StatusAction Action { get; }

Property Value

StatusAction

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.

IsQuoting

Whether the instrument is currently quoting. Undefined wire bytes cast through to an unnamed value rather than throwing; see RawIsQuoting.

public TriState IsQuoting { get; }

Property Value

TriState

IsQuotingChar

Whether the instrument is currently quoting, as its raw ASCII character.

public char IsQuotingChar { get; }

Property Value

char

IsShortSellRestricted

Whether the instrument is subject to a short-sell restriction. Undefined wire bytes cast through to an unnamed value rather than throwing; see RawIsShortSellRestricted.

public TriState IsShortSellRestricted { get; }

Property Value

TriState

IsShortSellRestrictedChar

Whether the instrument is subject to a short-sell restriction, as its raw ASCII character.

public char IsShortSellRestrictedChar { get; }

Property Value

char

IsTrading

Whether the instrument is currently trading. Undefined wire bytes cast through to an unnamed value rather than throwing; see RawIsTrading.

public TriState IsTrading { get; }

Property Value

TriState

IsTradingChar

Whether the instrument is currently trading, as its raw ASCII character.

public char IsTradingChar { get; }

Property Value

char

Reason

The reason for the status change. Undefined wire values cast through to an unnamed value rather than throwing; see RawReason.

public StatusReason Reason { get; }

Property Value

StatusReason

TradingEvent

Further information about the status change and its effect on trading. Undefined wire values cast through to an unnamed value rather than throwing; see RawTradingEvent.

public TradingEvent TradingEvent { get; }

Property Value

TradingEvent

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