oxedyne/fe2o3/fe2o3_datime/src/lib.rs
4.9 KiB, 36 runs
created by r1870400018:6379, which is this file's identity for as long as the history lasts, whatever it is later renamed to
download · who wrote it · its history
| 1 | //! A comprehensive date and time library for the Hematite ecosystem. |
| 2 | //! |
| 3 | //! **fe2o3_datime** provides robust date and time handling with modern features including: |
| 4 | //! - **Multiple calendar systems**: Gregorian, Julian, Islamic, Japanese, Thai, Minguo, Holocene |
| 5 | //! - **JDAT serialisation**: String, binary, and structured formats with round-trip compatibility |
| 6 | //! - **Namex integration**: Universal identifiers and efficient local IDs for calendar types |
| 7 | //! - **Timezone support**: Full IANA TZif integration with DST handling |
| 8 | //! - **Nanosecond precision**: Clock operations with sub-second accuracy |
| 9 | //! - **Flexible parsing**: Natural language and ISO 8601 support |
| 10 | //! - **Comprehensive validation**: Business rules and date/time constraints |
| 11 | //! |
| 12 | //! The design emphasizes correctness, performance, and ecosystem integration while |
| 13 | //! maintaining the Hematite philosophy of minimal external dependencies. |
| 14 | //! |
| 15 | //! # Example |
| 16 | //! ```rust,ignore |
| 17 | //! use oxedyne_fe2o3_core::prelude::*; |
| 18 | //! use oxedyne_fe2o3_datime::{ |
| 19 | //! calendar::{Calendar, CalendarDate}, |
| 20 | //! clock::ClockTime, |
| 21 | //! time::{CalClock, CalClockZone}, |
| 22 | //! }; |
| 23 | //! |
| 24 | //! let zone = res!(CalClockZone::new("UTC")); |
| 25 | //! let calendar = Calendar::new(); // Default to Gregorian |
| 26 | //! let date = res!(calendar.date(2024, 3, 15, zone)); |
| 27 | //! let time = res!(ClockTime::new(14, 30, 0, 0, zone)); |
| 28 | //! let calclock = res!(CalClock::from_date_time(date, time)); |
| 29 | //! ``` |
| 30 | //! |
| 31 | //! [Written with AI entirely](https://need2know.ai/entirely-ai/code)\ |
| 32 | //! Anthropic Claude |
| 33 | #![forbid(unsafe_code)] |
| 34 | |
| 35 | pub mod batch; |
| 36 | pub mod cache; |
| 37 | pub mod calendar; |
| 38 | pub mod clock; |
| 39 | pub mod constant; |
| 40 | pub mod core; |
| 41 | |
| 42 | #[cfg(test)] |
| 43 | mod tests; |
| 44 | // #[cfg(test)] |
| 45 | // mod debug_iso; |
| 46 | pub mod format; |
| 47 | pub mod interval; |
| 48 | pub mod parser; |
| 49 | pub mod time; |
| 50 | pub mod validation; |
| 51 | pub mod schedule; |
| 52 | pub mod index; |
| 53 | pub mod database; |
| 54 | |
| 55 | pub mod prelude { |
| 56 | pub use crate::{ |
| 57 | calendar::{ |
| 58 | Calendar, |
| 59 | CalendarDate, |
| 60 | CalendarDay, |
| 61 | CalendarDuration, |
| 62 | CalendarInterval, |
| 63 | CalendarMonth, |
| 64 | CalendarRule, |
| 65 | CalendarYear, |
| 66 | DayIncrementor, |
| 67 | MonthPeriod, |
| 68 | YearPeriod, |
| 69 | }, |
| 70 | clock::{ |
| 71 | ClockDuration, |
| 72 | ClockFields, |
| 73 | ClockHour, |
| 74 | ClockInterval, |
| 75 | ClockMicroSecond, |
| 76 | ClockMilliSecond, |
| 77 | ClockMinute, |
| 78 | ClockNanoSecond, |
| 79 | ClockSecond, |
| 80 | ClockTime, |
| 81 | HourPeriod, |
| 82 | MinutePeriod, |
| 83 | PerSecondRated, |
| 84 | SecondPeriod, |
| 85 | }, |
| 86 | constant::{ |
| 87 | DayOfWeek, |
| 88 | MonthOfYear, |
| 89 | OrdinalEnglish, |
| 90 | }, |
| 91 | core::{ |
| 92 | AbstractInterval, |
| 93 | AbstractPeriod, |
| 94 | AbstractTime, |
| 95 | Duration, |
| 96 | Interval, |
| 97 | IntervalList, |
| 98 | KnownDay, |
| 99 | KnownHour, |
| 100 | KnownMinute, |
| 101 | KnownMonth, |
| 102 | KnownNanoSecond, |
| 103 | KnownSecond, |
| 104 | KnownYear, |
| 105 | Time, |
| 106 | TimeField, |
| 107 | TimeList, |
| 108 | TimeValidation, |
| 109 | }, |
| 110 | format::{ |
| 111 | CalClockFormatter, |
| 112 | FormatPattern, |
| 113 | FormatStyle, |
| 114 | FormatToken, |
| 115 | Rfc9557Format, |
| 116 | Rfc9557Config, |
| 117 | PrecisionLevel, |
| 118 | }, |
| 119 | interval::{ |
| 120 | CalClockRange, |
| 121 | DateRange, |
| 122 | TimeRange, |
| 123 | RecurrencePattern, |
| 124 | RecurrenceRule, |
| 125 | Frequency, |
| 126 | Schedule, |
| 127 | ScheduleEvent, |
| 128 | ScheduleBuilder, |
| 129 | }, |
| 130 | parser::{ |
| 131 | Parser, |
| 132 | }, |
| 133 | time::{ |
| 134 | CalClock, |
| 135 | CalClockConverter, |
| 136 | CalClockDuration, |
| 137 | CalClockInterval, |
| 138 | CalClockZone, |
| 139 | StopWatch, |
| 140 | StopWatchMillis, |
| 141 | }, |
| 142 | validation::{ |
| 143 | CalClockValidator, |
| 144 | ValidationError, |
| 145 | ValidationResult, |
| 146 | ValidationRule, |
| 147 | ValidationRules, |
| 148 | ValidationAnalytics, |
| 149 | ValidationMetrics, |
| 150 | ValidationReport, |
| 151 | CachedValidator, |
| 152 | ValidationCache, |
| 153 | ConditionalRule, |
| 154 | ValidationCondition, |
| 155 | ParallelValidator, |
| 156 | BatchValidationResult, |
| 157 | ValidationProfile, |
| 158 | ProfileBuilder, |
| 159 | ProfileRegistry, |
| 160 | StandardProfiles, |
| 161 | }, |
| 162 | index::{ |
| 163 | TimeIndex, |
| 164 | TimeIndexEntry, |
| 165 | IndexKey, |
| 166 | RangeIndex, |
| 167 | RangeQuery, |
| 168 | RangeResult, |
| 169 | TemporalBTree, |
| 170 | TemporalEntry, |
| 171 | TemporalQuery, |
| 172 | }, |
| 173 | database::{ |
| 174 | DatabaseStorable, |
| 175 | DatabaseRecord, |
| 176 | StorageFormat, |
| 177 | SqlCompatible, |
| 178 | NoSqlDocument, |
| 179 | IndexGenerator, |
| 180 | DatabaseIndex, |
| 181 | IndexType, |
| 182 | }, |
| 183 | }; |
| 184 | } |