#[non_exhaustive]pub struct Plan<'p> {
pub date: Date,
pub time: Time,
pub offset: Option<i32>,
pub zone: ZoneOption<'p>,
pub options: &'p DateTimeOptions<'p>,
}Expand description
What a backend formats: backend-independent, everything MF2 decided.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.date: DateThe date to show: the wall date in Plan::zone.
time: TimeThe time to show: the wall time in Plan::zone, to the millisecond.
offset: Option<i32>The zone’s UTC offset at that instant, in seconds east; None: not
known — a floating value placed in a named zone the host has no data
for.
zone: ZoneOption<'p>The zone the value is shown in: ZoneOption::Utc, an offset or a
named zone, never ZoneOption::Input. What timeZoneStyle
names.
options: &'p DateTimeOptions<'p>The resolved options: date (fields and length) for :datetime and
:date, time (precision) for :datetime and :time,
time_zone_style, hour12, calendar. Their time_zone is the
option (the inheritance record): a backend shows Plan::zone.
Implementations§
Source§impl<'p> Plan<'p>
impl<'p> Plan<'p>
Sourcepub fn new(cx: &FnContext<'p>, value: &'p DateTime<'p>) -> Plan<'p>
pub fn new(cx: &FnContext<'p>, value: &'p DateTime<'p>) -> Plan<'p>
The plan of value, which a date/time function resolved in the
context cx (so it is in the zone its options.time_zone names,
the context’s when None).
Sourcepub fn epoch_ms(&self) -> Option<i64>
pub fn epoch_ms(&self) -> Option<i64>
The instant, in milliseconds since the epoch; None when the offset
is not known.
Sourcepub fn request(&self) -> DateTimeRequest<'p>
pub fn request(&self) -> DateTimeRequest<'p>
The request for a host’s date formatter (Host::format_date_time,
datetime-intl): the instant in Plan::zone; without a known
offset, the wall time read as UTC, shown in UTC (the same wall
time, but the zone is lost).
Trait Implementations§
impl<'p> Copy for Plan<'p>
impl<'p> Eq for Plan<'p>
impl<'p> StructuralPartialEq for Plan<'p>
Auto Trait Implementations§
impl<'p> Freeze for Plan<'p>
impl<'p> RefUnwindSafe for Plan<'p>
impl<'p> Send for Plan<'p>
impl<'p> Sync for Plan<'p>
impl<'p> Unpin for Plan<'p>
impl<'p> UnsafeUnpin for Plan<'p>
impl<'p> UnwindSafe for Plan<'p>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more