pub enum MarketSession {
UsEquity,
Crypto,
Forex,
}Expand description
Broad category of market session.
Variants§
UsEquity
US equity market (NYSE/NASDAQ) — 9:30–16:00 ET Mon–Fri.
Crypto
Crypto market — 24/7/365, always open.
Forex
Forex market — 24/5, Sunday 22:00 UTC – Friday 22:00 UTC.
Implementations§
Source§impl MarketSession
impl MarketSession
Sourcepub fn session_duration_ms(self) -> u64
pub fn session_duration_ms(self) -> u64
Duration of one regular trading session in milliseconds.
UsEquity: 9:30–16:00 ET = 6.5 hours = 23,400,000 msForex: continuous 24/5 week = 120 hours = 432,000,000 msCrypto: always open — returnsu64::MAX
Sourcepub fn has_extended_hours(self) -> bool
pub fn has_extended_hours(self) -> bool
Returns true if this session has a defined extended-hours trading period.
Only MarketSession::UsEquity has pre-market (4:00–9:30 ET) and
after-hours (16:00–20:00 ET) periods. Crypto is always open; Forex has
no separate extended session.
Trait Implementations§
Source§impl Clone for MarketSession
impl Clone for MarketSession
Source§fn clone(&self) -> MarketSession
fn clone(&self) -> MarketSession
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MarketSession
impl Debug for MarketSession
Source§impl<'de> Deserialize<'de> for MarketSession
impl<'de> Deserialize<'de> for MarketSession
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for MarketSession
impl Display for MarketSession
Source§impl FromStr for MarketSession
impl FromStr for MarketSession
Source§impl Hash for MarketSession
impl Hash for MarketSession
Source§impl PartialEq for MarketSession
impl PartialEq for MarketSession
Source§impl Serialize for MarketSession
impl Serialize for MarketSession
impl Copy for MarketSession
impl Eq for MarketSession
impl StructuralPartialEq for MarketSession
Auto Trait Implementations§
impl Freeze for MarketSession
impl RefUnwindSafe for MarketSession
impl Send for MarketSession
impl Sync for MarketSession
impl Unpin for MarketSession
impl UnsafeUnpin for MarketSession
impl UnwindSafe for MarketSession
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more