Skip to main content

Module models

Module models 

Source
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).
ComponentOrder
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).
MonthConfig
Configuration for month extraction.
PartialDate
A fully-resolved (possibly partial) date returned by the extractor.
SlidingWindowPivot
The pivot point for a TwoDigitYearExpansion::SlidingWindow.
Year
Extracted year component.
YearConfig
Configuration for year extraction.

Enums§

CenturyError
Errors returned by Century::try_new when validation fails.
ComponentOrderError
Errors returned by ComponentOrder::new when validation fails.
ConfigRangeError
Error returned by DayConfig::try_with_range, MonthConfig::try_with_range, and YearConfig::try_with_range when the provided range is invalid.
DateComponent
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.
MonthName
The name of a calendar month, as extracted from natural language input.
MonthNameError
Errors returned when a MonthName conversion fails.
SlidingWindowPivotError
Errors returned by SlidingWindowPivot::try_new when validation fails.
Token
A single meaningful chunk produced by crate::extract::tokenise.
TwoDigitYearExpansion
Strategy for expanding two-digit years into four-digit years.