Expand description
Core types for the partial-date library.
This module contains all the structs and enums that describe inputs, configuration, and extraction results.
Structs§
- Century
- A year that falls exactly on a century boundary (divisible by 100).
- Component
Order - The expected ordering of date components in positional (numeric) input.
- Config
- Top-level configuration for the extractor.
- Day
- Extracted day component (1–31).
- DayConfig
- Configuration for day extraction.
- Input
- Input to the partial date extractor.
- Month
- Extracted month component (1–12).
- Month
Config - Configuration for month extraction.
- Partial
Date - A fully-resolved (possibly partial) date returned by the extractor.
- Sliding
Window Pivot - The pivot point for a
TwoDigitYearExpansion::SlidingWindow. - Year
- Extracted year component.
- Year
Config - Configuration for year extraction.
Enums§
- Century
Error - Errors returned by
Century::try_newwhen validation fails. - Component
Order Error - Errors returned by
ComponentOrder::newwhen validation fails. - Config
Range Error - Error returned by
DayConfig::try_with_range,MonthConfig::try_with_range, andYearConfig::try_with_rangewhen the provided range is invalid. - Date
Component - A single date component: day, month, or year.
- Extracted
- The outcome of attempting to extract a single date component (day, month, or year).
- IsExpected
- Indicates whether a date component is expected to be present in the input.
- Month
Name - The name of a calendar month, as extracted from natural language input.
- Month
Name Error - Errors returned when a
MonthNameconversion fails. - Sliding
Window Pivot Error - Errors returned by
SlidingWindowPivot::try_newwhen validation fails. - Token
- A single meaningful chunk produced by
crate::extract::tokenise. - TwoDigit
Year Expansion - Strategy for expanding two-digit years into four-digit years.