pub struct Parsed { /* private fields */ }
cookies
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.
Implementations
sourceimpl Parsed
impl Parsed
sourcepub fn parse_item(
&mut self,
input: &'a [u8],
item: &FormatItem<'_>
) -> Result<&'a [u8], ParseFromDescription>
pub fn parse_item(
&mut self,
input: &'a [u8],
item: &FormatItem<'_>
) -> Result<&'a [u8], ParseFromDescription>
Parse a single FormatItem
, mutating the struct. The remaining input is returned as the
Ok
value.
If a FormatItem::Optional
is passed, parsing will not fail; the input will be returned
as-is if the expected format is not present.
sourcepub fn parse_items(
&mut self,
input: &'a [u8],
items: &[FormatItem<'_>]
) -> Result<&'a [u8], ParseFromDescription>
pub fn parse_items(
&mut self,
input: &'a [u8],
items: &[FormatItem<'_>]
) -> Result<&'a [u8], ParseFromDescription>
Parse a sequence of FormatItem
s, mutating the struct. The remaining input is returned as
the Ok
value.
This method will fail if any of the contained FormatItem
s fail to parse. self
will not
be mutated in this instance.
sourceimpl Parsed
impl Parsed
Getter methods
sourcepub const fn year_last_two(&self) -> Option<u8>
pub const fn year_last_two(&self) -> Option<u8>
Obtain the named component.
sourcepub const fn iso_year_last_two(&self) -> Option<u8>
pub const fn iso_year_last_two(&self) -> Option<u8>
Obtain the named component.
sourcepub const fn sunday_week_number(&self) -> Option<u8>
pub const fn sunday_week_number(&self) -> Option<u8>
Obtain the named component.
sourcepub const fn monday_week_number(&self) -> Option<u8>
pub const fn monday_week_number(&self) -> Option<u8>
Obtain the named component.
sourcepub const fn iso_week_number(&self) -> Option<NonZeroU8>
pub const fn iso_week_number(&self) -> Option<NonZeroU8>
Obtain the named component.
sourcepub const fn ordinal(&self) -> Option<NonZeroU16>
pub const fn ordinal(&self) -> Option<NonZeroU16>
Obtain the named component.
sourcepub const fn hour_12_is_pm(&self) -> Option<bool>
pub const fn hour_12_is_pm(&self) -> Option<bool>
Obtain the named component.
sourcepub const fn offset_hour(&self) -> Option<i8>
pub const fn offset_hour(&self) -> Option<i8>
Obtain the named component.
sourcepub const fn offset_minute(&self) -> Option<u8>
pub const fn offset_minute(&self) -> Option<u8>
Obtain the named component.
sourcepub const fn offset_second(&self) -> Option<u8>
pub const fn offset_second(&self) -> Option<u8>
Obtain the named component.
sourceimpl Parsed
impl Parsed
Setter methods
All setters return Option<()>
, which is Some
if the value was set, and None
if not. The
setters may fail if the value is invalid, though behavior is not guaranteed.
sourcepub fn set_year_last_two(&mut self, value: u8) -> Option<()>
pub fn set_year_last_two(&mut self, value: u8) -> Option<()>
Set the named component.
sourcepub fn set_iso_year(&mut self, value: i32) -> Option<()>
pub fn set_iso_year(&mut self, value: i32) -> Option<()>
Set the named component.
sourcepub fn set_iso_year_last_two(&mut self, value: u8) -> Option<()>
pub fn set_iso_year_last_two(&mut self, value: u8) -> Option<()>
Set the named component.
sourcepub fn set_sunday_week_number(&mut self, value: u8) -> Option<()>
pub fn set_sunday_week_number(&mut self, value: u8) -> Option<()>
Set the named component.
sourcepub fn set_monday_week_number(&mut self, value: u8) -> Option<()>
pub fn set_monday_week_number(&mut self, value: u8) -> Option<()>
Set the named component.
sourcepub fn set_iso_week_number(&mut self, value: NonZeroU8) -> Option<()>
pub fn set_iso_week_number(&mut self, value: NonZeroU8) -> Option<()>
Set the named component.
sourcepub fn set_weekday(&mut self, value: Weekday) -> Option<()>
pub fn set_weekday(&mut self, value: Weekday) -> Option<()>
Set the named component.
sourcepub fn set_ordinal(&mut self, value: NonZeroU16) -> Option<()>
pub fn set_ordinal(&mut self, value: NonZeroU16) -> Option<()>
Set the named component.
sourcepub fn set_hour_24(&mut self, value: u8) -> Option<()>
pub fn set_hour_24(&mut self, value: u8) -> Option<()>
Set the named component.
sourcepub fn set_hour_12(&mut self, value: NonZeroU8) -> Option<()>
pub fn set_hour_12(&mut self, value: NonZeroU8) -> Option<()>
Set the named component.
sourcepub fn set_hour_12_is_pm(&mut self, value: bool) -> Option<()>
pub fn set_hour_12_is_pm(&mut self, value: bool) -> Option<()>
Set the named component.
sourcepub fn set_minute(&mut self, value: u8) -> Option<()>
pub fn set_minute(&mut self, value: u8) -> Option<()>
Set the named component.
sourcepub fn set_second(&mut self, value: u8) -> Option<()>
pub fn set_second(&mut self, value: u8) -> Option<()>
Set the named component.
sourcepub fn set_subsecond(&mut self, value: u32) -> Option<()>
pub fn set_subsecond(&mut self, value: u32) -> Option<()>
Set the named component.
sourcepub fn set_offset_hour(&mut self, value: i8) -> Option<()>
pub fn set_offset_hour(&mut self, value: i8) -> Option<()>
Set the named component.
sourcepub fn set_offset_minute(&mut self, value: u8) -> Option<()>
pub fn set_offset_minute(&mut self, value: u8) -> Option<()>
Set the named component.
sourcepub fn set_offset_second(&mut self, value: u8) -> Option<()>
pub fn set_offset_second(&mut self, value: u8) -> Option<()>
Set the named component.
sourceimpl Parsed
impl Parsed
Builder methods
All builder methods return Option<Self>
, which is Some
if the value was set, and None
if
not. The builder methods may fail if the value is invalid, though behavior is not guaranteed.
sourcepub const fn with_year(self, value: i32) -> Option<Parsed>
pub const fn with_year(self, value: i32) -> Option<Parsed>
Set the named component and return self
.
sourcepub const fn with_year_last_two(self, value: u8) -> Option<Parsed>
pub const fn with_year_last_two(self, value: u8) -> Option<Parsed>
Set the named component and return self
.
sourcepub const fn with_iso_year(self, value: i32) -> Option<Parsed>
pub const fn with_iso_year(self, value: i32) -> Option<Parsed>
Set the named component and return self
.
sourcepub const fn with_iso_year_last_two(self, value: u8) -> Option<Parsed>
pub const fn with_iso_year_last_two(self, value: u8) -> Option<Parsed>
Set the named component and return self
.
sourcepub const fn with_month(self, value: Month) -> Option<Parsed>
pub const fn with_month(self, value: Month) -> Option<Parsed>
Set the named component and return self
.
sourcepub const fn with_sunday_week_number(self, value: u8) -> Option<Parsed>
pub const fn with_sunday_week_number(self, value: u8) -> Option<Parsed>
Set the named component and return self
.
sourcepub const fn with_monday_week_number(self, value: u8) -> Option<Parsed>
pub const fn with_monday_week_number(self, value: u8) -> Option<Parsed>
Set the named component and return self
.
sourcepub const fn with_iso_week_number(self, value: NonZeroU8) -> Option<Parsed>
pub const fn with_iso_week_number(self, value: NonZeroU8) -> Option<Parsed>
Set the named component and return self
.
sourcepub const fn with_weekday(self, value: Weekday) -> Option<Parsed>
pub const fn with_weekday(self, value: Weekday) -> Option<Parsed>
Set the named component and return self
.
sourcepub const fn with_ordinal(self, value: NonZeroU16) -> Option<Parsed>
pub const fn with_ordinal(self, value: NonZeroU16) -> Option<Parsed>
Set the named component and return self
.
sourcepub const fn with_day(self, value: NonZeroU8) -> Option<Parsed>
pub const fn with_day(self, value: NonZeroU8) -> Option<Parsed>
Set the named component and return self
.
sourcepub const fn with_hour_24(self, value: u8) -> Option<Parsed>
pub const fn with_hour_24(self, value: u8) -> Option<Parsed>
Set the named component and return self
.
sourcepub const fn with_hour_12(self, value: NonZeroU8) -> Option<Parsed>
pub const fn with_hour_12(self, value: NonZeroU8) -> Option<Parsed>
Set the named component and return self
.
sourcepub const fn with_hour_12_is_pm(self, value: bool) -> Option<Parsed>
pub const fn with_hour_12_is_pm(self, value: bool) -> Option<Parsed>
Set the named component and return self
.
sourcepub const fn with_minute(self, value: u8) -> Option<Parsed>
pub const fn with_minute(self, value: u8) -> Option<Parsed>
Set the named component and return self
.
sourcepub const fn with_second(self, value: u8) -> Option<Parsed>
pub const fn with_second(self, value: u8) -> Option<Parsed>
Set the named component and return self
.
sourcepub const fn with_subsecond(self, value: u32) -> Option<Parsed>
pub const fn with_subsecond(self, value: u32) -> Option<Parsed>
Set the named component and return self
.
sourcepub const fn with_offset_hour(self, value: i8) -> Option<Parsed>
pub const fn with_offset_hour(self, value: i8) -> Option<Parsed>
Set the named component and return self
.
sourcepub const fn with_offset_minute(self, value: u8) -> Option<Parsed>
pub const fn with_offset_minute(self, value: u8) -> Option<Parsed>
Set the named component and return self
.
sourcepub const fn with_offset_second(self, value: u8) -> Option<Parsed>
pub const fn with_offset_second(self, value: u8) -> Option<Parsed>
Set the named component and return self
.
Trait Implementations
sourceimpl TryFrom<Parsed> for OffsetDateTime
impl TryFrom<Parsed> for OffsetDateTime
type Error = TryFromParsed
type Error = TryFromParsed
The type returned in the event of a conversion error.
sourcepub fn try_from(
parsed: Parsed
) -> Result<OffsetDateTime, <OffsetDateTime as TryFrom<Parsed>>::Error>
pub fn try_from(
parsed: Parsed
) -> Result<OffsetDateTime, <OffsetDateTime as TryFrom<Parsed>>::Error>
Performs the conversion.
sourceimpl TryFrom<Parsed> for PrimitiveDateTime
impl TryFrom<Parsed> for PrimitiveDateTime
type Error = TryFromParsed
type Error = TryFromParsed
The type returned in the event of a conversion error.
sourcepub fn try_from(
parsed: Parsed
) -> Result<PrimitiveDateTime, <PrimitiveDateTime as TryFrom<Parsed>>::Error>
pub fn try_from(
parsed: Parsed
) -> Result<PrimitiveDateTime, <PrimitiveDateTime as TryFrom<Parsed>>::Error>
Performs the conversion.
impl Copy for Parsed
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
pub fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more