Expand description
Timestamp handling utilities
Structs§
- Timestamp
Cache - Optimized cache-friendly timestamp cache for frequent conversions Used for caching and reusing conversion results for common timestamps
Enums§
- Timestamp
Format - Timestamp format used by different exchanges
Functions§
- days_
since_ epoch - Calculate days since Unix epoch (1970-01-01) with leap year handling
- exchange_
time_ to_ nanos - Convert exchange timestamp to nanoseconds based on its format This is a performance-critical function used in hot paths
- is_
leap_ year - Check if a year is a leap year
- iso8601_
to_ nanos - Parse ISO8601 String to nanoseconds since epoch using optimized parsing This version is significantly faster than the previous implementation Handles format like “2023-01-01T12:00:00Z” or “2023-01-01T12:00:00.123Z”
- ms_
to_ nanos - Optimized version that converts timestamp to nanoseconds without checking format Used when format is known at compile time
- parse_
u64_ from_ bytes - Parse a fixed-width byte slice to u64, optimized for parsing ISO8601 components
- seconds_
to_ nanos - Optimized version that converts seconds to nanoseconds
- time_
smartstring_ to_ seconds - Convert timestamp String like “HH:MM:SS” to seconds since midnight Optimized for minimal allocations and faster parsing
- us_
to_ nanos - Optimized version that converts microseconds to nanoseconds