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<Month>, 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.
Expand description

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)

This struct is marked as 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<Month>

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

Create a new instance of Parsed with no information known.

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

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

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.

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.

The type returned in the event of a conversion error.

Performs the conversion.

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

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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.