Struct time::parsing::Parsed[][src]

#[non_exhaustive]
pub struct Parsed {
Show fields pub year: Option<i32>, pub year_last_two: Option<u8>, pub iso_year: Option<i32>, pub iso_year_last_two: Option<u8>, pub month: Option<NonZeroU8>, pub sunday_week_number: Option<u8>, pub monday_week_number: Option<u8>, pub iso_week_number: Option<NonZeroU8>, pub weekday: Option<Weekday>, pub ordinal: Option<NonZeroU16>, pub day: Option<NonZeroU8>, pub hour_24: Option<u8>, pub hour_12: Option<NonZeroU8>, pub hour_12_is_pm: Option<bool>, pub minute: Option<u8>, pub second: Option<u8>, pub subsecond: Option<u32>, pub offset_hour: Option<i8>, pub offset_minute: Option<u8>, pub offset_second: Option<u8>,
}
This is supported on crate feature parsing only.

All information parsed.

This information is directly used to construct the final values.

Most users will not need think about this struct in any way. It is public to allow for manual control over values, in the instance that the default parser is insufficient.

Fields (Non-exhaustive)

Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct {{ .. }} syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
year: Option<i32>

Calendar year.

year_last_two: Option<u8>

The last two digits of the calendar year.

iso_year: Option<i32>

Year of the ISO week date.

iso_year_last_two: Option<u8>

The last two digits of the ISO week year.

month: Option<NonZeroU8>

Month of the year.

sunday_week_number: Option<u8>

Week of the year, where week one begins on the first Sunday of the calendar year.

monday_week_number: Option<u8>

Week of the year, where week one begins on the first Monday of the calendar year.

iso_week_number: Option<NonZeroU8>

Week of the year, where week one is the Monday-to-Sunday period containing January 4.

weekday: Option<Weekday>

Day of the week.

ordinal: Option<NonZeroU16>

Day of the year.

day: Option<NonZeroU8>

Day of the month.

hour_24: Option<u8>

Hour within the day.

hour_12: Option<NonZeroU8>

Hour within the 12-hour period (midnight to noon or vice versa). This is typically used in conjunction with AM/PM, which is indicated by the hour_12_is_pm field.

hour_12_is_pm: Option<bool>

Whether the hour_12 field indicates a time that “PM”.

minute: Option<u8>

Minute within the hour.

second: Option<u8>

Second within the minute.

subsecond: Option<u32>

Nanosecond within the second.

offset_hour: Option<i8>

Whole hours of the UTC offset.

offset_minute: Option<u8>

Minutes within the hour of the UTC offset.

offset_second: Option<u8>

Seconds within the minute of the UTC offset.

Implementations

impl Parsed[src]

pub const fn new() -> Self[src]

Create a new instance of Parsed with no information known.

pub fn parse_component<'a>(
    &mut self,
    input: &'a [u8],
    component: Component
) -> Result<&'a [u8], ParseFromDescription>
[src]

Parse a single component, mutating the struct. The remaining input is returned as the Ok value.

Trait Implementations

impl Clone for Parsed[src]

impl Copy for Parsed[src]

impl Debug for Parsed[src]

impl TryFrom<Parsed> for Date[src]

type Error = TryFromParsed

The type returned in the event of a conversion error.

impl TryFrom<Parsed> for Time[src]

type Error = TryFromParsed

The type returned in the event of a conversion error.

impl TryFrom<Parsed> for UtcOffset[src]

type Error = TryFromParsed

The type returned in the event of a conversion error.

impl TryFrom<Parsed> for PrimitiveDateTime[src]

type Error = TryFromParsed

The type returned in the event of a conversion error.

impl TryFrom<Parsed> for OffsetDateTime[src]

type Error = TryFromParsed

The type returned in the event of a conversion error.

Auto Trait Implementations

impl RefUnwindSafe for Parsed

impl Send for Parsed

impl Sync for Parsed

impl Unpin for Parsed

impl UnwindSafe for Parsed

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.