Class MetadataWireStrings
- Namespace
- DatabentoDotNet.Historical
- Assembly
- DatabentoDotNet.Historical.dll
Wire-string conversions for the two enums the metadata.* responses carry.
public static class MetadataWireStrings
- Inheritance
-
MetadataWireStrings
- Inherited Members
Remarks
Deliberately shaped like WireStrings and holding to the
same contract: ToWireString throws ArgumentOutOfRangeException for a value
outside the defined set, and every TryParse answers false without
throwing. One method per enum rather than an overload set, for the reason that file gives — an
overload would make the ordinary out var call form ambiguous and fail to compile.
These two enums live here rather than in the codec because nothing on the wire carries them:
they exist only in metadata.* JSON response bodies. Upstream establishes both spellings
by hand, with no serde attribute anywhere: ToWireString mirrors each enum's own
as_str (metadata.rs:369-375 for FeedMode, :408-415 for
DatasetCondition), and TryParse mirrors each enum's own FromStr
(:378-391, :418-432), so these tables are the only written record of them in
this codebase.
Methods
ToWireString(DatasetCondition)
Returns the wire string for value.
public static string ToWireString(this DatasetCondition value)
Parameters
valueDatasetCondition
Returns
Exceptions
- ArgumentOutOfRangeException
valueis not a defined DatasetCondition.
ToWireString(FeedMode)
Returns the wire string for value.
public static string ToWireString(this FeedMode value)
Parameters
valueFeedMode
Returns
Exceptions
- ArgumentOutOfRangeException
valueis not a defined FeedMode.
TryParseDatasetCondition(string?, out DatasetCondition)
Parses a DatasetCondition wire string.
public static bool TryParseDatasetCondition(string? value, out DatasetCondition result)
Parameters
valuestringresultDatasetCondition
Returns
TryParseFeedMode(string?, out FeedMode)
Parses a FeedMode wire string.
public static bool TryParseFeedMode(string? value, out FeedMode result)