mod formatter;
mod names;
#[allow(clippy::module_inception)] mod pattern;
use crate::error::ErrorField;
pub use formatter::DateTimePatternFormatter;
pub use formatter::FormattedDateTimePattern;
use icu_pattern::SinglePlaceholderPattern;
pub use names::DateTimeNames;
pub use names::DayPeriodNameLength;
pub use names::FixedCalendarDateTimeNames;
pub use names::MonthNameLength;
pub(crate) use names::RawDateTimeNames;
pub(crate) use names::RawDateTimeNamesBorrowed;
pub(crate) use names::TimeZoneDataPayloadsBorrowed;
pub use names::WeekdayNameLength;
pub use names::YearNameLength;
pub use pattern::DateTimePattern;
pub(crate) enum GetNameForMonthError {
InvalidMonthCode,
InvalidFieldLength,
NotLoaded,
}
pub(crate) enum GetNameForWeekdayError {
InvalidFieldLength,
NotLoaded,
}
pub(crate) enum GetNameForEraError {
InvalidEraCode,
InvalidFieldLength,
NotLoaded,
}
pub(crate) enum GetNameForCyclicYearError {
InvalidYearNumber { max: usize },
InvalidFieldLength,
NotLoaded,
}
pub(crate) enum GetNameForDayPeriodError {
InvalidFieldLength,
NotLoaded,
}
pub(crate) enum MonthPlaceholderValue<'a> {
PlainString(&'a str),
Numeric,
NumericPattern(&'a SinglePlaceholderPattern),
}
#[derive(Debug, Clone, Copy, PartialEq, displaydoc::Display)]
#[non_exhaustive]
pub enum PatternLoadError {
#[displaydoc("A field {0:?} conflicts with a previous field.")]
ConflictingField(ErrorField),
#[displaydoc("The field {0:?} symbol is not supported in that length.")]
UnsupportedLength(ErrorField),
#[displaydoc("The specific type does not support the field {0:?}.")]
TypeTooSpecific(ErrorField),
#[displaydoc("Problem loading data for field {1:?}: {0}")]
Data(icu_provider::DataError, ErrorField),
}
impl core::error::Error for PatternLoadError {}