apple_quant_algorithmic/
timestamp.rs1use thiserror::Error;
2
3mod bin;
4mod engine;
5mod latest_session_start;
6mod point;
7mod point_trade;
8mod provider;
9mod range;
10mod range_trade;
11
12pub use bin::*;
13pub use engine::*;
14pub use latest_session_start::*;
15pub use point::*;
16pub use point_trade::*;
17pub use provider::*;
18pub use range::*;
19pub use range_trade::*;
20
21#[derive(Debug, Error)]
22pub enum TimestampError {
23 #[error("Range is not satisfied. MIN: {min:?} MAX: {max:?}.")]
44 RangeNotSatisfied {
45 min: Option<TradeTimestamp>,
46 max: Option<TradeTimestamp>,
47 },
48}
49
50pub trait Timestamped {
51 fn timestamp(&self) -> &Timestamp;
52}
53
54pub trait TradeTimestamped {
55 fn trade_timestamp(&self) -> &TradeTimestamp;
56}
57
58pub trait TimestampedRange {
59 fn timestamp_range(&self) -> &TimestampRange;
60}
61
62pub trait TradeTimestampedRange {
63 fn trade_timestamp_range(&self) -> &TradeTimestampRange;
64}