Skip to main content

apple_quant_algorithmic/instrument/
spec.rs

1mod decimal;
2mod floating_point;
3mod xspec;
4
5use std::fmt::Debug;
6use std::hash::Hash;
7
8use crate::{price::PriceType, volume::VolumeType};
9
10use super::InstrumentKind;
11
12pub use decimal::*;
13pub use floating_point::*;
14pub use xspec::*;
15
16pub trait InstrumentSpec:
17	  'static
18	+ Debug
19	+ Clone
20	+ Copy
21	+ PartialEq
22	+ Eq
23	+ PartialOrd
24	+ Ord
25	+ Hash
26	+ Send
27	+ Sync
28{
29	const INSTRUMENT_KIND: InstrumentKind;
30	const BARE_SYMBOL: &'static str;
31
32	type PriceSpec: XSpec;
33	type VolumeSpec: XSpec;
34	type PriceType: PriceType<Self::PriceSpec>;
35	type VolumeType: VolumeType<Self::VolumeSpec>;
36}