#[non_exhaustive]pub enum DateTimeError {
FieldValueOutOfRange,
TimeZoneDisplacementOutOfRange,
DateOutOfRange,
TimestampOutOfRange,
TimestampCannotBeNaN,
OutsideJiffRange,
NeedsTimeZone,
TimeZoneNotRecognized,
InvalidInputSyntax(PgType),
NeedsDateOrder,
NeedsCurrentTime,
}Expand description
Why PostgreSQL refuses a date or time, one variant per message it raises, or why this crate cannot answer for it without more session state or within jiff’s years.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
FieldValueOutOfRange
A year, month, day, hour, minute or second no calendar or clock has.
TimeZoneDisplacementOutOfRange
An offset of 16 hours or more, or with minutes or seconds of 60 or more.
DateOutOfRange
A date before 4714-11-24 BC or from 5874898-01-01.
TimestampOutOfRange
A timestamp before 4714-11-24 BC or from 294277-01-01.
TimestampCannotBeNaN
NaN given as a timestamp.
OutsideJiffRange
A value outside jiff’s years -9999 to 9999, an infinity included, where jiff’s types are needed.
NeedsTimeZone
A literal without an offset read as a timestamptz with no time zone in the
InputContext.
TimeZoneNotRecognized
A zone name, or an abbreviation whose set names a zone, that does not exist.
InvalidInputSyntax(PgType)
Text the type’s input function cannot read.
NeedsDateOrder
A date whose reading the DateStyle field order decides, read with no order in the
InputContext.
NeedsCurrentTime
now, today, tomorrow or yesterday read with no current time in the
InputContext.
Trait Implementations§
Source§impl Clone for DateTimeError
impl Clone for DateTimeError
impl Copy for DateTimeError
Source§impl Debug for DateTimeError
impl Debug for DateTimeError
Source§impl Display for DateTimeError
impl Display for DateTimeError
impl Eq for DateTimeError
Source§impl Error for DateTimeError
impl Error for DateTimeError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()