pub struct ParsedDateTime {
    pub millennium: Option<DateTimeFieldValue>,
    pub century: Option<DateTimeFieldValue>,
    pub decade: Option<DateTimeFieldValue>,
    pub year: Option<DateTimeFieldValue>,
    pub month: Option<DateTimeFieldValue>,
    pub day: Option<DateTimeFieldValue>,
    pub hour: Option<DateTimeFieldValue>,
    pub minute: Option<DateTimeFieldValue>,
    pub second: Option<DateTimeFieldValue>,
    pub millisecond: Option<DateTimeFieldValue>,
    pub microsecond: Option<DateTimeFieldValue>,
    pub timezone_offset_second: Option<Timezone>,
}
Expand description

All of the fields that can appear in a literal DATE, TIME, TIMESTAMP or INTERVAL string.

Fields

millennium: Option<DateTimeFieldValue>century: Option<DateTimeFieldValue>decade: Option<DateTimeFieldValue>year: Option<DateTimeFieldValue>month: Option<DateTimeFieldValue>day: Option<DateTimeFieldValue>hour: Option<DateTimeFieldValue>minute: Option<DateTimeFieldValue>second: Option<DateTimeFieldValue>millisecond: Option<DateTimeFieldValue>microsecond: Option<DateTimeFieldValue>timezone_offset_second: Option<Timezone>

Implementations

Compute an Interval from an ParsedDateTime.

Errors
  • If any component overflows a parameter (i.e. i64).

Compute a chrono::NaiveDate from an ParsedDateTime.

Errors

Note: Postgres does not recognize Year 0, but in order to make arithmetic work as expected, the Year 1 BC in a ParsedDateTime is mapped to the Year 0 in a NaiveDate, and vice-versa.

Compute a chrono::NaiveDate from an ParsedDateTime.

Errors
  • If hour, minute, or second (both unit and fraction) overflow u32.

Builds a ParsedDateTime from an interval string (value).

Arguments
  • value is a PostgreSQL-compatible interval string, e.g INTERVAL 'value'.
  • leading_time_precision optionally identifies the leading time component HOUR | MINUTE to disambiguate {}:{} formatted intervals
  • ambiguous_resolver identifies the DateTimeField of the final part if it’s ambiguous, e.g. in INTERVAL '1' MONTH ‘1’ is ambiguous as its DateTimeField, but MONTH resolves the ambiguity.

Builds a ParsedDateTime from a TIMESTAMP string (value).

Arguments
  • value is a SQL-formatted TIMESTAMP string.

Builds a ParsedDateTime from a TIME string (value).

Arguments
  • value is a SQL-formatted TIME string.

Write to the specified field of a ParsedDateTime iff it is currently set to None; otherwise generate an error to propagate to the user.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
Feeds this value into the given Hasher. Read more
Feeds a slice of this type into the given Hasher. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Compare self to key and return true if they are equal.

Returns the argument unchanged.

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
Attaches the current Context to this type, returning a WithContext wrapper. Read more
The type of the output value.
A well-distributed integer derived from the data.
Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Wrap the input message T in a tonic::Request
Upcasts this ProgressEventTimestamp to Any. Read more
Returns the name of the concrete type of this object. Read more
Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more