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
//! Market and trading-hours model types for the Robinhood API.
//!
//! Contains structs describing stock exchanges and their operating hours.
use serde::{Deserialize, Serialize};
/// Represents a stock exchange or market venue.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Market {
/// API URL for this market resource.
pub url: Option<String>,
/// API URL for today's trading hours.
pub todays_hours: Option<String>,
/// Market Identifier Code (MIC) for the exchange.
pub mic: Option<String>,
/// Operating MIC for the exchange.
pub operating_mic: Option<String>,
/// Short acronym for the exchange (e.g., "NYSE", "NASDAQ").
pub acronym: Option<String>,
/// Full name of the exchange.
pub name: Option<String>,
/// City where the exchange is located.
pub city: Option<String>,
/// Country where the exchange is located.
pub country: Option<String>,
/// IANA timezone of the exchange (e.g., "US/Eastern").
pub timezone: Option<String>,
/// Website URL for the exchange.
pub website: Option<String>,
}
/// Represents the trading hours for a market on a specific date.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct MarketHours {
/// Date these hours apply to (YYYY-MM-DD).
pub date: Option<String>,
/// Indicates whether the market is open on this date.
pub is_open: Option<bool>,
/// Timestamp when regular trading opens.
pub opens_at: Option<String>,
/// Timestamp when regular trading closes.
pub closes_at: Option<String>,
/// Timestamp when extended (pre-market) trading opens.
pub extended_opens_at: Option<String>,
/// Timestamp when extended (after-hours) trading closes.
pub extended_closes_at: Option<String>,
/// API URL for the previous day's open hours.
pub previous_open_hours: Option<String>,
/// API URL for the next day's open hours.
pub next_open_hours: Option<String>,
}