mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-04-25 07:09:59 -07:00
25 lines
602 B
Rust
25 lines
602 B
Rust
use std::fmt::{self};
|
|
|
|
use allocative::Allocative;
|
|
use bincode::{Decode, Encode};
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
#[allow(clippy::upper_case_acronyms)]
|
|
#[derive(Debug, Default, Deserialize, Serialize, Encode, Decode, Clone, Copy, Allocative)]
|
|
pub struct OHLC {
|
|
pub open: f32,
|
|
pub high: f32,
|
|
pub low: f32,
|
|
pub close: f32,
|
|
}
|
|
|
|
impl fmt::Display for OHLC {
|
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
|
write!(
|
|
f,
|
|
"{{ open: {}, high: {}, low: {}, close: {} }}",
|
|
self.open, self.high, self.low, self.close
|
|
)
|
|
}
|
|
}
|