Skip to main content

apple_quant_algorithmic/instrument/
ticker.rs

1use smallstr::SmallString;
2
3use super::InstrumentKind;
4
5#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
6pub struct InstrumentTicker {
7	bare_symbol: SmallString<[u8; 3]>,
8	instrument_kind: InstrumentKind,
9}
10
11impl InstrumentTicker {
12	pub fn new(
13		bare_symbol: &str,
14		instrument_kind: InstrumentKind,
15	) -> Self {
16		Self {
17			bare_symbol: SmallString::from_str(bare_symbol),
18			instrument_kind,
19		}
20	}
21}
22
23impl InstrumentTicker {
24	pub fn bare_symbol(
25		&self,
26	) -> &str {
27		&self.bare_symbol
28	}
29
30	pub fn instrument_kind(
31		&self,
32	) -> InstrumentKind {
33		self.instrument_kind
34	}
35}