Reorder Bar struct
Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
@@ -26,8 +26,8 @@ pub struct Bar {
|
|||||||
impl From<(Bar, String)> for types::Bar {
|
impl From<(Bar, String)> for types::Bar {
|
||||||
fn from((bar, symbol): (Bar, String)) -> Self {
|
fn from((bar, symbol): (Bar, String)) -> Self {
|
||||||
Self {
|
Self {
|
||||||
time: bar.time,
|
|
||||||
symbol,
|
symbol,
|
||||||
|
time: bar.time,
|
||||||
open: bar.open,
|
open: bar.open,
|
||||||
high: bar.high,
|
high: bar.high,
|
||||||
low: bar.low,
|
low: bar.low,
|
||||||
|
@@ -28,8 +28,8 @@ pub struct Message {
|
|||||||
impl From<Message> for Bar {
|
impl From<Message> for Bar {
|
||||||
fn from(bar: Message) -> Self {
|
fn from(bar: Message) -> Self {
|
||||||
Self {
|
Self {
|
||||||
time: bar.time,
|
|
||||||
symbol: bar.symbol,
|
symbol: bar.symbol,
|
||||||
|
time: bar.time,
|
||||||
open: bar.open,
|
open: bar.open,
|
||||||
high: bar.high,
|
high: bar.high,
|
||||||
low: bar.low,
|
low: bar.low,
|
||||||
|
@@ -4,9 +4,9 @@ use time::OffsetDateTime;
|
|||||||
|
|
||||||
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Row)]
|
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Row)]
|
||||||
pub struct Bar {
|
pub struct Bar {
|
||||||
|
pub symbol: String,
|
||||||
#[serde(with = "clickhouse::serde::time::datetime")]
|
#[serde(with = "clickhouse::serde::time::datetime")]
|
||||||
pub time: OffsetDateTime,
|
pub time: OffsetDateTime,
|
||||||
pub symbol: String,
|
|
||||||
pub open: f64,
|
pub open: f64,
|
||||||
pub high: f64,
|
pub high: f64,
|
||||||
pub low: f64,
|
pub low: f64,
|
||||||
|
Reference in New Issue
Block a user