Struct ParsedDateTime

Source
pub(super) struct ParsedDateTime<'i> {
    input: Bytes<'i>,
    date: ParsedDate<'i>,
    time: Option<ParsedTime<'i>>,
    offset: Option<ParsedOffset>,
    annotations: ParsedAnnotations<'i>,
}
Expand description

The datetime components parsed from a string.

Fields§

§input: Bytes<'i>

The original input that the datetime was parsed from.

§date: ParsedDate<'i>

A required civil date.

§time: Option<ParsedTime<'i>>

An optional civil time.

§offset: Option<ParsedOffset>

An optional UTC offset.

§annotations: ParsedAnnotations<'i>

An optional RFC 9557 annotations parsed.

An empty ParsedAnnotations is valid and possible, so this bakes optionality into the type and doesn’t need to be an Option itself.

Implementations§

Source§

impl<'i> ParsedDateTime<'i>

Source

pub(super) fn to_pieces(&self) -> Result<Pieces<'i>, Error>

Source

pub(super) fn to_zoned( &self, db: &TimeZoneDatabase, offset_conflict: OffsetConflict, disambiguation: Disambiguation, ) -> Result<Zoned, Error>

Source

pub(super) fn to_ambiguous_zoned( &self, db: &TimeZoneDatabase, offset_conflict: OffsetConflict, ) -> Result<AmbiguousZoned, Error>

Source

pub(super) fn to_timestamp(&self) -> Result<Timestamp, Error>

Source

pub(super) fn to_datetime(&self) -> Result<DateTime, Error>

Source

pub(super) fn to_date(&self) -> Result<Date, Error>

Source

fn time(&self) -> Time

Trait Implementations§

Source§

impl<'i> Debug for ParsedDateTime<'i>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'i> Display for ParsedDateTime<'i>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'i> Freeze for ParsedDateTime<'i>

§

impl<'i> RefUnwindSafe for ParsedDateTime<'i>

§

impl<'i> Send for ParsedDateTime<'i>

§

impl<'i> Sync for ParsedDateTime<'i>

§

impl<'i> Unpin for ParsedDateTime<'i>

§

impl<'i> UnwindSafe for ParsedDateTime<'i>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.