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>,
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)
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]
&mut self,
input: &'a [u8],
component: Component
) -> Result<&'a [u8], ParseFromDescription>
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.
fn try_from(parsed: Parsed) -> Result<Self, Self::Error>
[src]
impl TryFrom<Parsed> for Time
[src]
type Error = TryFromParsed
The type returned in the event of a conversion error.
fn try_from(parsed: Parsed) -> Result<Self, Self::Error>
[src]
impl TryFrom<Parsed> for UtcOffset
[src]
type Error = TryFromParsed
The type returned in the event of a conversion error.
fn try_from(parsed: Parsed) -> Result<Self, Self::Error>
[src]
impl TryFrom<Parsed> for PrimitiveDateTime
[src]
type Error = TryFromParsed
The type returned in the event of a conversion error.
fn try_from(parsed: Parsed) -> Result<Self, Self::Error>
[src]
impl TryFrom<Parsed> for OffsetDateTime
[src]
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,