Struct MaybeNamedTimeZone
pub struct MaybeNamedTimeZone { pub name: Option<TimeZoneId>, pub tz: TimeZone }
A representation of a possibly named time zone backed by TZif data.
It is useful to represent a named time zone as distinct from the time zone itself because a name is not inherently part of the TZif data. Indeed, there are a couple reasons why it's important to separate the name:
- It's possible that no meaningful name exists. For example, a
/etc/localtimefile with no obvious mapping to a name. (e.g., No symlink and no discoverable Time Zone Database.) - Some IANA time zone identifiers correspond to different regions, but share the same TZif data.
Fields
name: Option<TimeZoneId>The name of this TZif time zone. e.g.,
America/New_York.tz: TimeZoneThe time zone itself.
Implementations
impl MaybeNamedTimeZone
fn name(&self) -> Option<&str>Returns the underlying time zone name as a string.
fn tz(&self) -> &TimeZoneReturns a reference to the underlying time zone definition.
Trait Implementations
impl Clone for MaybeNamedTimeZone
fn clone(&self) -> Self
impl Debug for MaybeNamedTimeZone
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl PartialEq for MaybeNamedTimeZone
fn eq(&self, other: &Self) -> bool