Skip to main content

apple_quant_algorithmic/instrument/
kind.rs

1#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
2pub enum InstrumentKind {
3	Future,
4	FutureOption,
5	Equity,
6	EquityOption,
7	ETF,
8	ETFOption,
9}
10
11impl InstrumentKind {
12	pub fn as_str(
13		&self,
14	) -> &'static str {
15		match self {
16			Self::Future => "FUT",
17			Self::FutureOption => "FUT_OPT",
18			Self::Equity => "EQ",
19			Self::EquityOption => "EQ_OPT",
20			Self::ETF => "ETF",
21			Self::ETFOption => "ETF_OPT",
22		}
23	}
24}