Class RTypeSchemaMapping
- Namespace
- DatabentoDotNet.Dbn
- Assembly
- DatabentoDotNet.Dbn.dll
public static class RTypeSchemaMapping
- Inheritance
-
RTypeSchemaMapping
- Inherited Members
Remarks
The two directions are not exact inverses. Mbp1 and
Tbbo both map to Mbp1 via
ToRType(Schema), so TryIntoSchema(RType, out Schema) can never
recover Tbbo from an Mbp1 byte — it always yields
Mbp1. This mirrors the Rust crate's impl From<Schema> for
RType and RType::try_into_schema exactly; the further collapse between
Cmbp1/Tcbbo at the record-struct dispatch level is
out of scope here (it lands with record decoding).
Methods
ToRType(Schema)
Returns the canonical RType for schema.
public static RType ToRType(this Schema schema)
Parameters
schemaSchema
Returns
Exceptions
- ArgumentOutOfRangeException
schemais not a defined Schema.
TryIntoSchema(RType, out Schema)
public static bool TryIntoSchema(RType rtype, out Schema schema)
Parameters
rtypeRTypeThe record type read from a record header.
schemaSchemaReceives the schema, or default when there is none.
Returns
Remarks
The typed counterpart of ToRType(Schema), and the overload to reach for from a decoded record. It delegates to the byte overload, which stays public for callers holding an unvalidated wire byte — an rtype this library has no member for is a false here either way, so the two never disagree.
TryIntoSchema(byte, out Schema)
public static bool TryIntoSchema(byte rtype, out Schema schema)
Parameters
Returns
Remarks
Returns false for OhlcvDeprecated — it predates the per-cadence OHLCV rtypes and does not map to a single schema — and for the control/meta rtypes Error, SymbolMapping, and System, none of which carry an associated schema. Also returns false for any byte that is not a defined RType at all.