Skip to main content

Crate whichtime

Crate whichtime 

Source
Expand description

WhichTime - Natural language date parsing library

High-level Rust API built on [whichtime-sys]. Use the same types as whichtime-sys: ParsedResult, Locale, Error, etc. This crate adds a multi-locale parser holder (WhichTime, LocaleParser) for convenient reuse across locales.

FFI bindings (UniFFI for Swift, Kotlin, Python) live in the internal whichtime-ffi crate.

Structs§

FastComponents
Fast, stack-allocated date/time components
LocaleParser
Parser holder with lazy initialization per locale. Uses OnceLock for thread-safe lazy initialization.
ParsedResult
A parsed result representing a matched date/time expression.
Parser
The main natural-language date parser.
ReferenceWithTimezone
Reference date/time with timezone information.
WhichTime
Multi-locale parser: holds lazy-initialized parsers per locale for reuse.

Enums§

Component
Date/time components that can be parsed
Error
Error values returned by parsing and locale setup code.
Locale
Supported parser locales.

Type Aliases§

Result
Convenience result type used throughout whichtime-sys.