Skip to content

Determine payload value type based on enum #93

Open
@pohlm01

Description

@pohlm01

For the payloads in the intervals, the data type of the value is determined by the type of the payload.
The VTN should make sure that the data type it expects for the provided type matches the one it received.

/// Represents one or more values associated with a type. E.g. a type of PRICE contains a single float value.
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct EventValuesMap {
/// Enumerated or private string signifying the nature of values. E.G. \"PRICE\" indicates value is to be interpreted as a currency.
#[serde(rename = "type")]
pub value_type: EventType,
/// A list of data points. Most often a singular value such as a price.
// TODO: The type of Value is actually defined by value_type
pub values: Vec<Value>,
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions