use displaydoc::Display; use icu_provider::DataError; use tinystr::{tinystr, TinyStr16, TinyStr4}; use writeable::Writeable;
#[cfg(feature = "std")] impl std::error::Error for CalendarError {}
/// A list of error outcomes for various operations in this module. /// /// Re-exported as [`Error`](crate::Error). #[derive(Display, Debug, Copy, Clone, PartialEq)] #[non_exhaustive] pubenum CalendarError { /// An input could not be parsed. #[displaydoc("Could not parse as integer")]
Parse, /// An input overflowed its range. #[displaydoc("{field} must be between 0-{max}")]
Overflow { /// The name of the field
field: &'static str, /// The maximum value
max: usize,
}, #[displaydoc("{field} must be between {min}-0")] /// An input underflowed its range.
Underflow { /// The name of the field
field: &'static str, /// The minimum value
min: isize,
}, /// Out of range // TODO(Manishearth) turn this into a proper variant
OutOfRange, /// Unknown era #[displaydoc("No era named {0} for calendar {1}")]
UnknownEra(TinyStr16, &'static str), /// Unknown month code for a given calendar #[displaydoc("No month code named {0} for calendar {1}")]
UnknownMonthCode(TinyStr4, &'static str), /// Missing required input field for formatting #[displaydoc("No value for {0}")]
MissingInput(&'static str), /// No support for a given calendar in AnyCalendar #[displaydoc("AnyCalendar does not support calendar {0}")]
UnknownAnyCalendarKind(TinyStr16), /// An operation required a calendar but a calendar was not provided. #[displaydoc("An operation required a calendar but a calendar was not provided")]
MissingCalendar, /// An error originating inside of the [data provider](icu_provider). #[displaydoc("{0}")]
Data(DataError),
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.