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
// SPDX-License-Identifier: MIT-0
//! The calendar: exchange trading hours, sessions, and bar boundaries.
//!
//! Everything in this crate lives here and is re-exported flat from the crate
//! root, so `calendar` is an organisational boundary rather than a public path.
//! The submodules are layered — each one depends only on the ones above it:
//!
//! | Layer | Modules | Owns |
//! |---|---|---|
//! | Values | [`exchange`], [`rule`], [`resolution`] | Venue identity, one session slice, one bar interval |
//! | Data | [`profiles`], [`futures_profile`] | The static venue tables, addressed by venue and by product family |
//! | Resolution | [`local_time`] | The one place a local wall-clock becomes an instant |
//! | Queries | [`hours`], [`session`], [`period`], [`candle`] | Open/closed, session bounds, period closes, bar boundaries |
//! | Entry points | [`presets`], [`bulk`] | Venue → hours, one venue or many |
//!
//! ## The three things that decide every answer
//!
//! **Time semantics.** All public helpers take and return
//! `chrono::DateTime<Utc>`. The exchange's local zone is used only internally —
//! to interpret a rule's seconds-since-local-midnight (SSM) and to define "the
//! day". Weekdays are indexed Monday = 0 through Sunday = 6 throughout.
//!
//! **End-exclusive closes.** An instant exactly equal to a close is *closed*.
//! Without this, adjacent sessions overlap and every duration double-counts at
//! its boundary.
//!
//! **Wraps.** `open_ssm > close_ssm` means the session runs past local midnight
//! and closes the next local day. This is how overnight and Globex-style trading
//! days are expressed, and it is why "is it open?" must consult yesterday's
//! rules as well as today's.
//!
//! ## What this calendar is not
//!
//! It is a **normal-week** model. Holidays, early closes, half-days, and
//! product-level variations are out of scope: [`local_time::is_holiday`] is a
//! stub that always returns `false`, and the profiles are pragmatic
//! exchange-level defaults, not contract-exact schedules. The wrap and daily-close
//! paths already route through the holiday hook, so a real calendar lands as a
//! body change rather than a control-flow change.
pub use ;
pub use ;
pub use Exchange;
pub use ParseExchangeError;
pub use ;
pub use MarketHours;
pub use ;
pub use ;
pub use CalendarResolution;
pub use ;
pub use ;