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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
//! Models for market hours endpoints
use serde::{Deserialize, Serialize};
/// Market hours for a trading session
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct MarketHours {
/// Exchange name
pub exchange: Option<String>,
/// Stock exchange name
pub stock_exchange_name: Option<String>,
/// Stock market (e.g., "NYSE", "NASDAQ")
pub stock_market: Option<String>,
/// Current status (e.g., "open", "closed")
pub is_market_open: Option<bool>,
/// Market open time
pub opening_hour: Option<String>,
/// Market close time
pub closing_hour: Option<String>,
/// Current date and time
pub current_date_time: Option<String>,
/// Timezone
pub timezone: Option<String>,
}
/// Extended market hours information
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ExtendedMarketHours {
/// Exchange symbol
pub exchange: Option<String>,
/// Exchange name
pub name: Option<String>,
/// Market is open status
pub is_open: Option<bool>,
/// Regular session open time
pub market_open: Option<String>,
/// Regular session close time
pub market_close: Option<String>,
/// Pre-market open time
pub pre_market_open: Option<String>,
/// Pre-market close time
pub pre_market_close: Option<String>,
/// After hours open time
pub after_hours_open: Option<String>,
/// After hours close time
pub after_hours_close: Option<String>,
/// Timezone
pub timezone: Option<String>,
/// Current date time
pub current_date_time: Option<String>,
}
/// Market holiday information
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct MarketHoliday {
/// Holiday date
pub date: Option<String>,
/// Holiday year
pub year: Option<i32>,
/// Holiday name
pub holiday: Option<String>,
/// Exchange
pub exchange: Option<String>,
/// Market status on holiday (e.g., "closed", "early_close")
pub market_status: Option<String>,
/// Early close time if applicable
pub early_close_time: Option<String>,
}
/// Exchange trading hours and status
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ExchangeHours {
/// Exchange symbol (e.g., "NYSE", "NASDAQ")
pub exchange: Option<String>,
/// Full exchange name
pub exchange_name: Option<String>,
/// Country
pub country: Option<String>,
/// Timezone
pub timezone: Option<String>,
/// Regular trading open time
pub market_open: Option<String>,
/// Regular trading close time
pub market_close: Option<String>,
/// Pre-market start time
pub pre_market_start: Option<String>,
/// Pre-market end time
pub pre_market_end: Option<String>,
/// After hours start time
pub after_hours_start: Option<String>,
/// After hours end time
pub after_hours_end: Option<String>,
/// Current market status
pub is_open: Option<bool>,
/// Current date and time
pub current_time: Option<String>,
/// Day of week
pub day_of_week: Option<String>,
}