1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
//! Core domain types for the paft ecosystem.
//!
//! This crate defines strongly-typed primitives for instruments, exchanges,
//! market sessions, security identifiers (`Symbol`, `Figi`, `Isin`), and
//! financial periods used across the paft ecosystem. Types are designed to be:
//! - Canonical and stable in string form (for serde, display, and storage)
//! - Liberal in what they accept when parsing (aliases, case-insensitivity),
//! strict and consistent in emission
//! - Extensible via `Other(...)` variants where providers use custom codes
//!
//! # Quickstart
//!
//! ```rust
//! use paft_domain::{AssetKind, Exchange, Instrument, Period, Symbol};
//!
//! let symbol = Symbol::new("AAPL").unwrap();
//! let aapl = Instrument::from_symbol_and_exchange(
//! symbol.as_str(),
//! Exchange::NASDAQ,
//! AssetKind::Equity,
//! ).unwrap();
//! assert_eq!(aapl.symbol.as_str(), "AAPL");
//! assert!(aapl.exchange.is_some());
//!
//! let q4 = "2023-Q4".parse::<Period>().unwrap();
//! assert_eq!(q4.to_string(), "2023Q4");
//! ```
//!
//! # Serde
//! All domain types implement serde with stable string representations that match
//! their `Display` output. Unknown provider codes round-trip via `Other` where
//! applicable.
//!
//! # Feature flags
//! - `tracing`: enable lightweight instrumentation on constructors and validators
//! - `dataframe`: enable `paft-utils` `DataFrame` traits for convenient export
pub use DomainError;
pub use Exchange;
pub use ;
pub use ;
pub use MarketState;
pub use Period;
pub use ;
pub use ;
pub use ;